From e9f6aae01ea2e46f65bebb803959de15a1e7b170 Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Mon, 4 Jan 2021 18:56:38 +0800 Subject: [PATCH] =?UTF-8?q?'admin-21.01.04:=E7=BC=96=E5=86=99=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E9=85=8D=E7=BD=AE=E8=8F=9C=E5=8D=95/=E9=A1=B6?= =?UTF-8?q?=E6=A0=8F=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=BA=8B=E4=BB=B6=E6=80=BB?= =?UTF-8?q?=E7=BA=BFmitt=E7=AD=89'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue-admin-wonderful-next/package.json | 3 +- vue-admin-wonderful-next/src/main.ts | 5 +- vue-admin-wonderful-next/src/theme/app.scss | 3 + .../src/theme/element.scss | 11 ++- vue-admin-wonderful-next/src/utils/theme.ts | 6 +- .../src/views/layout/component/aside.vue | 2 +- .../layout/navBars/breadcrumb/breadcrumb.vue | 5 +- .../views/layout/navBars/breadcrumb/index.vue | 2 +- .../layout/navBars/breadcrumb/setings.vue | 99 ++++++++++++++++--- .../views/layout/navBars/breadcrumb/user.vue | 2 +- .../src/views/layout/navMenu/vertical.vue | 15 ++- .../src/views/login/index.vue | 2 +- 12 files changed, 129 insertions(+), 26 deletions(-) diff --git a/vue-admin-wonderful-next/package.json b/vue-admin-wonderful-next/package.json index bed7864..0e5b3db 100644 --- a/vue-admin-wonderful-next/package.json +++ b/vue-admin-wonderful-next/package.json @@ -7,6 +7,7 @@ }, "dependencies": { "element-plus": "^v1.0.1-beta.19", + "mitt": "^2.1.0", "sortablejs": "^1.10.2", "vue": "^3.0.5", "vue-router": "^4.0.2" @@ -19,4 +20,4 @@ "typescript": "^4.1.2", "vite": "^1.0.0-rc.13" } -} \ No newline at end of file +} diff --git a/vue-admin-wonderful-next/src/main.ts b/vue-admin-wonderful-next/src/main.ts index e340a98..25e9c42 100644 --- a/vue-admin-wonderful-next/src/main.ts +++ b/vue-admin-wonderful-next/src/main.ts @@ -6,5 +6,8 @@ import ElementPlus from 'element-plus' import 'element-plus/lib/theme-chalk/index.css' import '/@/theme/index.scss' import lang from 'element-plus/lib/locale/lang/zh-cn' +import mitt from "mitt" -createApp(App).use(router).use(ElementPlus, { locale: lang }).mount('#app') \ No newline at end of file +const app = createApp(App) +app.use(router).use(ElementPlus, { locale: lang }).mount('#app') +app.config.globalProperties.mittBus = mitt() diff --git a/vue-admin-wonderful-next/src/theme/app.scss b/vue-admin-wonderful-next/src/theme/app.scss index 25c1cb1..bf765ab 100644 --- a/vue-admin-wonderful-next/src/theme/app.scss +++ b/vue-admin-wonderful-next/src/theme/app.scss @@ -46,6 +46,9 @@ body, .el-scrollbar { width: 100%; } + .layout-aside-width { + width: 240px !important; + } .layout-scrollbar { @extend .el-scrollbar; padding: 15px; diff --git a/vue-admin-wonderful-next/src/theme/element.scss b/vue-admin-wonderful-next/src/theme/element.scss index c48f45d..9f64499 100644 --- a/vue-admin-wonderful-next/src/theme/element.scss +++ b/vue-admin-wonderful-next/src/theme/element.scss @@ -675,6 +675,7 @@ height: 50px !important; line-height: 50px !important; color: var(--bg-menuBarColor); + transition: none !important; } // horizontal 水平方向时 .el-menu--horizontal > .el-menu-item.is-active, @@ -698,7 +699,6 @@ color: inherit; text-decoration: none; } - // 默认 hover 时 .el-menu-item:hover, .el-submenu__title:hover { @@ -710,12 +710,21 @@ } // 高亮时 .el-menu-item.is-active { + color: set-color(primary); +} +.el-active-extend { color: #ffffff !important; background-color: set-color(primary) !important; i { color: #ffffff !important; } } +.add-is-active { + @extend .el-active-extend; + &:hover { + @extend .el-active-extend; + } +} /* Tabs 标签页 ------------------------------- */ diff --git a/vue-admin-wonderful-next/src/utils/theme.ts b/vue-admin-wonderful-next/src/utils/theme.ts index 24a4b22..b0dd218 100644 --- a/vue-admin-wonderful-next/src/utils/theme.ts +++ b/vue-admin-wonderful-next/src/utils/theme.ts @@ -3,7 +3,7 @@ import { ElMessage } from 'element-plus' // hex颜色转rgb颜色 export function hexToRgb(str: any) { let hexs: any = '' - let reg = /^\#?[0-9A-F]{6}$/ + let reg = /^\#?[0-9A-Fa-f]{6}$/ if (!reg.test(str)) return ElMessage({ type: 'warning', message: "输入错误的hex" }) str = str.replace("#", "") hexs = str.match(/../g) @@ -22,7 +22,7 @@ export function rgbToHex(r: any, g: any, b: any) { // 加深颜色值,level为加深的程度,限0-1之间 export function getDarkColor(color: any, level: number) { - let reg = /^\#?[0-9A-F]{6}$/ + let reg = /^\#?[0-9A-Fa-f]{6}$/ if (!reg.test(color)) return ElMessage({ type: 'warning', message: "输入错误的hex颜色值" }) let rgb = hexToRgb(color) for (let i = 0; i < 3; i++) rgb[i] = Math.floor(rgb[i] * (1 - level)) @@ -31,7 +31,7 @@ export function getDarkColor(color: any, level: number) { // 变浅颜色值,level为加深的程度,限0-1之间 export function getLightColor(color: any, level: number) { - let reg = /^\#?[0-9A-F]{6}$/ + let reg = /^\#?[0-9A-Fa-f]{6}$/ if (!reg.test(color)) return ElMessage({ type: 'warning', message: "输入错误的hex颜色值" }) let rgb = hexToRgb(color) for (let i = 0; i < 3; i++) rgb[i] = Math.floor((255 - rgb[i]) * level + rgb[i]) diff --git a/vue-admin-wonderful-next/src/views/layout/component/aside.vue b/vue-admin-wonderful-next/src/views/layout/component/aside.vue index 67bf855..a167973 100644 --- a/vue-admin-wonderful-next/src/views/layout/component/aside.vue +++ b/vue-admin-wonderful-next/src/views/layout/component/aside.vue @@ -1,5 +1,5 @@