fix(styles): 统一全站 el-table 表头文字颜色,修复 project-apply 表头色差问题

- 解决 project-apply 页面表头颜色在不同电脑显示不一致的问题
- 在 element-ui.scss 中新增高优先级规则,统一 el-table 表头文字颜色为 #374151
- 清理 project-apply.vue 中与全局样式冲突且无效的局部表头样式,保留字体加粗样式
- 修改选择器为 :deep(.el-table__header th .cell),确保样式生效且不影响背景色
This commit is contained in:
2026-08-26 17:53:44 +08:00
parent c3f05a342e
commit ae45e88df9
3 changed files with 32 additions and 6 deletions
+25
View File
@@ -95,3 +95,28 @@ customer-archive.vue:4980(按钮 min-width)、cargo-type.vue:604(选择器拼错
**保留未动**: 所有 `__search` 搜索栏的 8px、risk-disposal 的 28px 特殊分组、transportCapacity
vehicle/driver/ship 与 customer-archive 等本就是 14px(含 !important)。
## project-apply 表头颜色在不同电脑不一致
**问题**: 客户反馈 `business/project-apply/form?mode=add` 页面中「客户信息」等表格表头颜色
在用户电脑是 `#374151`,客户电脑是 `#909399`
**根因**:
- `src/styles/theme/go.scss``.theme-go .el-table tr th .cell { color: #374151 }` 把表头文字写死为 `#374151`
- 客户电脑未使用 `theme-go`,表头文字走 Element Plus 默认 CSS 变量
`--el-table-header-text-color: #909399`
- `src/views/business/project-apply.vue` 里的 `:deep(.el-table__header th) { color: #303133 }`
只作用在 `th` 上,颜色靠继承,优先级敌不过直接写在 `.cell` 上的规则和 Element Plus 默认值,
所以实际没生效。
**修复**:
- `src/styles/element-ui.scss` 在「统一全站 el-table 表头背景色」之后追加规则:
```scss
.el-table .el-table__header-wrapper th.el-table__cell .cell {
color: #374151;
}
```
直接作用于 `.cell`,特异性高于 `theme-go` 和 Element Plus 默认,全站统一为 `#374151`。
- `src/views/business/project-apply.vue` 清理两处与全局冲突且不生效的局部表头样式:
删除 `background: #f5f7fa; color: #303133;`,保留 `font-weight: 600`
选择器改为 `:deep(.el-table__header th .cell)`。