From ed0509b1e7228c748fa4e271835f3c39162d3183 Mon Sep 17 00:00:00 2001 From: wkc <978997012@qq.com> Date: Fri, 27 Feb 2026 11:03:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Material=20Design?= =?UTF-8?q?=20=E6=A0=B7=E5=BC=8F=E6=9C=AA=E7=94=9F=E6=95=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 el-table 的 border 属性 - 增强 CSS 选择器优先级 - 添加 !important 覆盖 Element UI 默认样式 - 移除所有单元格边框 - 添加 overflow: hidden 确保圆角效果 --- .../ccdiProject/components/ProjectTable.vue | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/ruoyi-ui/src/views/ccdiProject/components/ProjectTable.vue b/ruoyi-ui/src/views/ccdiProject/components/ProjectTable.vue index ee22a7d..dbd167d 100644 --- a/ruoyi-ui/src/views/ccdiProject/components/ProjectTable.vue +++ b/ruoyi-ui/src/views/ccdiProject/components/ProjectTable.vue @@ -3,7 +3,6 @@ @@ -245,9 +244,10 @@ export default { // 表格整体样式 - Material Design 卡片式 :deep(.el-table) { // 移除边框,使用阴影 - border: none; + border: none !important; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + overflow: hidden; // 悬停时卡片阴影加深 transition: box-shadow 0.3s ease; @@ -257,8 +257,8 @@ export default { } // 表头样式 - 扁平化,无背景色 - th { - background-color: transparent; + th.el-table__cell { + background-color: transparent !important; color: #333; font-weight: 600; font-size: 14px; @@ -266,16 +266,18 @@ export default { padding: 16px 12px; // 只保留底部一条分隔线 - border-bottom: 2px solid #e0e0e0; + border-bottom: 2px solid #e0e0e0 !important; + border-right: none !important; } // 数据行样式 - 增加留白,移除分隔线 - td { + td.el-table__cell { color: #333; font-size: 14px; height: 64px; padding: 20px 12px; - border-bottom: none; + border-bottom: none !important; + border-right: none !important; } // 移除列分隔线 @@ -289,7 +291,7 @@ export default { .el-table__row { transition: background-color 0.2s ease; - &:hover > td { + &:hover > td.el-table__cell { background-color: #fafafa !important; } } @@ -297,7 +299,12 @@ export default { // 移除额外边框 &::before, &::after { - display: none; + display: none !important; + } + + // 移除 inner border + .el-table__inner-wrapper::before { + display: none !important; } } }