From 5da3670608192790dc73abc52c457cc1d8f1b61d Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Tue, 24 Nov 2026 18:33:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=97=AA=E5=B1=8F=E5=B9=B6=E6=8A=BD=E5=8F=96?= =?UTF-8?q?=E4=BE=A7=E6=A0=8F=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 字典弹窗挂到 body,避免页面入场动画导致首次打开闪屏 - 抽取侧栏搜索列表为公共 aside-list 样式 - 公共类按结构角色命名,移除业务字段与动作名 --- package.json | 2 +- src/styles/page.scss | 120 +++++++++++++++++++++++++++ src/views/system/dict/index.vue | 107 ++---------------------- src/views/system/role/index.vue | 142 +++----------------------------- 4 files changed, 141 insertions(+), 230 deletions(-) diff --git a/package.json b/package.json index 3e7570eb..4a7383b2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue3-element-admin", "description": "Vue3 + Vite + TypeScript + Element-Plus 的后台管理模板,vue-element-admin 的 Vue3 版本", - "version": "4.14.0", + "version": "4.14.1", "private": true, "type": "module", "scripts": { diff --git a/src/styles/page.scss b/src/styles/page.scss index 251fb6af..c45a30d1 100644 --- a/src/styles/page.scss +++ b/src/styles/page.scss @@ -419,6 +419,126 @@ } } +// 侧栏搜索列表:page-aside__inner 内的「搜索 + 滚动列表 + 分页」结构 +.aside-list { + display: flex; + flex-direction: column; + height: 100%; + min-height: 0; + padding: 16px; + + &__head { + display: flex; + gap: 8px; + align-items: center; + margin-bottom: 8px; + + .el-input { + flex: 1; + min-width: 0; + } + + .el-button { + flex-shrink: 0; + } + } + + &__scroll { + flex: 1 1 auto; + min-height: 0; + } + + &__item { + position: relative; + display: flex; + align-items: center; + justify-content: space-between; + padding: 8px 10px; + cursor: pointer; + border-radius: var(--radius-control); + transition: background-color 0.15s; + + &:hover { + background-color: var(--el-fill-color-light); + } + + &.is-active { + background-color: var(--el-color-primary-light-9); + } + + &.is-active::before { + position: absolute; + top: 6px; + bottom: 6px; + left: 0; + width: 2px; + content: ""; + background-color: var(--el-color-primary); + border-radius: 1px; + } + } + + &__info { + display: flex; + flex: 1 1 auto; + flex-direction: column; + min-width: 0; + line-height: 1.35; + } + + &__title { + display: flex; + gap: 6px; + align-items: center; + min-width: 0; + } + + &__meta { + display: flex; + gap: 6px; + align-items: center; + min-width: 0; + } + + &__label { + flex: 0 1 auto; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + font-size: 14px; + font-weight: 500; + color: var(--el-text-color-primary); + white-space: nowrap; + } + + &__sub { + overflow: hidden; + text-overflow: ellipsis; + font-size: 12px; + color: var(--el-text-color-secondary); + white-space: nowrap; + } + + &__tag { + flex-shrink: 0; + padding: 0 4px; + font-size: 11px; + line-height: 16px; + color: var(--el-color-warning); + background-color: var(--el-color-warning-light-9); + border-radius: 3px; + } + + &__item.is-active &__label { + font-weight: 600; + color: var(--el-color-primary); + } + + &__item.is-disabled:not(.is-active) &__label { + color: var(--el-text-color-secondary); + } +} + // 侧栏列表行内图标按钮:常驻可见但视觉安静,hover / 聚焦时提亮 .aside-actions { display: inline-flex; diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index f1017f7f..5a88dcb7 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -2,8 +2,8 @@