feat: 新增租户切换组件和css目录优化

This commit is contained in:
Ray.Hao
2025-12-15 08:04:05 +08:00
parent 6e0597437e
commit 62e0af68a6
23 changed files with 193 additions and 166 deletions

View File

@@ -1,7 +0,0 @@
/* 暗黑模式通过 CSS 自定义变量官方链接https://element-plus.org/zh-CN/guide/dark-mode.html#%E9%80%9A%E8%BF%87-css */
html.dark {
.el-table {
/* 自定义表格选中高亮时当前行的背景颜色 */
--el-table-current-row-bg-color: var(--el-fill-color-light);
}
}

View File

@@ -0,0 +1,30 @@
/**
* Element Plus 变量覆盖
*
* 此文件用于覆盖 Element Plus 的默认主题变量
* 需要在 element-plus.scss 中导入,而不是在 variables.scss 中
*/
@forward "element-plus/theme-chalk/src/common/var.scss" with (
$colors: (
"primary": (
// 默认主题色 - 修改此值时需同步修改 src/settings.ts 中的 themeColor
"base": #4080ff,
),
"success": (
"base": #23c343,
),
"warning": (
"base": #ff9a2e,
),
"danger": (
"base": #f76560,
),
"info": (
"base": #a9aeb8,
),
),
$bg-color: (
"page": #f5f8fd,
)
);

View File

@@ -1,3 +1,6 @@
// Element Plus 变量覆盖(必须在最前面)
@use "./element-plus-vars";
$border: 1px solid var(--el-border-color-light);
/* el-dialog */

View File

@@ -1,12 +1,12 @@
// 基础变量与主题色
@use "./variables";
// 基础重置与组件细化样式
// 1. 基础重置(补充 UnoCSS 预设未覆盖的全局样式)
@use "./reset";
@use "./element-plus";
// Vxe Table 主题覆写CSS 变量 + 自定义样式
// 2. 项目自定义主题变量CSS 变量 / SCSS 变量 / JS 导出
@use "./variables" as *;
// 3. UI 框架适配Element Plus & Vxe Table
@use "./element-plus";
@use "./vxe-table";
// 业务通用样式
// 4. 业务通用样式
@use "./common";

View File

@@ -1,3 +1,5 @@
// 全局基础重置:补充 UnoCSS 预设未覆盖的项目级样式
#app {
width: 100%;
height: 100%;
@@ -36,11 +38,6 @@ body {
text-rendering: optimizelegibility;
}
a {
color: inherit;
text-decoration: inherit;
}
img,
svg {
display: inline-block;

View File

@@ -0,0 +1,16 @@
/* stylelint-disable property-no-unknown */
// 通过 SCSS 变量导出给 JS/TS 使用的模块文件
// 注意:依赖 src/styles/variables.scss 中定义的 SCSS 变量
:export {
sidebar-width: $sidebar-width;
navbar-height: $navbar-height;
tags-view-height: $tags-view-height;
menu-background: $menu-background;
menu-text: $menu-text;
menu-active-text: $menu-active-text;
menu-hover: $menu-hover;
}
/* stylelint-enable property-no-unknown */

View File

@@ -1,29 +1,9 @@
@forward "element-plus/theme-chalk/src/common/var.scss" with (
$colors: (
"primary": (
// 默认主题色 - 修改此值时需同步修改 src/settings.ts 中的 themeColor
"base": #4080ff,
),
"success": (
"base": #23c343,
),
"warning": (
"base": #ff9a2e,
),
"danger": (
"base": #f76560,
),
"info": (
"base": #a9aeb8,
),
),
$bg-color: (
"page": #f5f8fd,
)
);
/** 全局SCSS变量 */
/**
* 项目自定义主题变量CSS 变量 / SCSS 变量 / JS 导出)
* 与 Element Plus 主题变量覆盖element-plus-vars.scss职责分离
*
* 注意:此文件以下划线开头,是 Sass partial不会被单独编译只能被其他文件导入
*/
:root {
--menu-background: #fff; // 菜单背景色
@@ -56,6 +36,11 @@ html.dark {
--sidebar-logo-background: rgb(0 0 0 / 20%);
--sidebar-logo-text-color: #fff;
.el-table {
/* 自定义表格选中高亮时当前行的背景颜色(暗黑模式) */
--el-table-current-row-bg-color: var(--el-fill-color-light);
}
/** WangEditor Dark */
/* Textarea - css vars */
--w-e-textarea-bg-color: var(--el-bg-color); /* 深色背景 */
@@ -92,7 +77,7 @@ $sidebar-width-collapsed: 54px; // 侧边栏收缩宽度
$navbar-height: 50px; // 导航栏高度
$tags-view-height: 34px; // TagsView 高度
/* 供 JS/TS 侧按需读取的变量导出(保持与原 module 一致) */
/* 供 JS/TS 侧按需读取的变量导出 */
/* stylelint-disable property-no-unknown */
:export {
sidebar-width: $sidebar-width;