From 71c08d6e9a84ae7555eadcbb2f55e15897a2190a Mon Sep 17 00:00:00 2001 From: chenxing Date: Fri, 18 Sep 2026 11:13:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(authz):=20=E6=9D=83=E9=99=90=E4=B8=80?= =?UTF-8?q?=E8=A7=88=E5=8A=A0=E3=80=8C=E5=85=A8=E9=83=A8=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E3=80=8D=E5=BC=80=E5=85=B3=E4=B8=8E=E5=8D=A1=E7=89=87=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=8A=A0=E5=9B=BA=EF=BC=9B=E4=B8=8B=E7=BA=BF=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=8E=A8=E9=80=81=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 权限一览:应用层默认折叠,新增「全部展开」开关(事件不冒泡到标题行),MyTree 透传 expand-all - 应用模块树卡片:分类名与数量让位(超大收缩系数 + min-width:0),「子组继承」加 tooltip 与弹性空隙, 「全部展开」加标签样式与竖线分隔,避免整组被挤出可视区或被读成同一个开关 - 下线测试推送:删除 /push-test 路由、菜单项与 PushTest.vue --- src/assets/config/menu.ts | 1 - src/router/routes.ts | 7 ---- src/views/GroupAuth.vue | 30 +++++++++++++--- src/views/PermissionView.vue | 39 +++++++++++++++++++-- src/views/role-authz/AppModuleCheckTree.vue | 16 +++++++-- 5 files changed, 77 insertions(+), 16 deletions(-) diff --git a/src/assets/config/menu.ts b/src/assets/config/menu.ts index 5b592e7..5bcfe48 100644 --- a/src/assets/config/menu.ts +++ b/src/assets/config/menu.ts @@ -62,7 +62,6 @@ export function getMenuList(userRole?: UserRoleEnum): Promise { { id: 53, modId: 1111, name: "操作日志", page: "/oplog", roles: [UserRoleEnum.SuperAdmin] }, { id: 56, modId: 1114, name: "开放接口日志", page: "/oapilog", roles: [UserRoleEnum.SuperAdmin] }, { id: 54, modId: 1112, name: "推送日志", page: "/push-log", roles: [UserRoleEnum.SuperAdmin] }, - { id: 55, modId: 1113, name: "测试推送", page: "/push-test", roles: [UserRoleEnum.SuperAdmin] }, ], }, ]; diff --git a/src/router/routes.ts b/src/router/routes.ts index 645e0cf..0d6a901 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -12,7 +12,6 @@ import PermissionView from "@/views/PermissionView.vue"; import OperationLogList from "@/views/oplog/OperationLogList.vue"; import OapiLogList from "@/views/oapilog/OapiLogList.vue"; import PushLog from "@/views/push/PushLog.vue"; -import PushTest from "@/views/push/PushTest.vue"; import NoAuth from "@/views/NoAuth.vue"; // 管理端四级访问控制:meta.roles 为空/未声明 = 登录即可访问 @@ -112,12 +111,6 @@ const routes: RouteRecordRaw[] = [ component: PushLog, meta: { title: "推送日志", icon: "icon-list", modId: 1112, keepAlive: true, roles: [UserRoleEnum.SuperAdmin] }, }, - { - path: "/push-test", - name: "PushTest", - component: PushTest, - meta: { title: "测试推送", icon: "icon-list", modId: 1113, roles: [UserRoleEnum.SuperAdmin] }, - }, // ===== 操作日志 ===== { path: "/oplog", diff --git a/src/views/GroupAuth.vue b/src/views/GroupAuth.vue index f099010..43ad0cd 100644 --- a/src/views/GroupAuth.vue +++ b/src/views/GroupAuth.vue @@ -39,10 +39,11 @@ :type="collapsedMap[String(item.cat.id)] ? 'ios-arrow-forward' : 'ios-arrow-down'" /> {{ item.cat.name }} {{ item.treeData.length }}个应用 - 子组继承 + + 子组继承 - 全部展开 + 全部展开: @@ -662,6 +663,10 @@ onMounted(async () => { font-size: 13px; color: #333; margin-left: 6px; + /* 卡片是 3 列布局,列宽有限:用超大的收缩系数让分类名先让位(省略号), + 保证右侧「子组继承 / 全部展开」整组不被挤出可视区 */ + flex: 0 999 auto; + min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; @@ -671,15 +676,28 @@ onMounted(async () => { color: #999; font-size: 12px; margin-left: 8px; - flex: 1; + /* 次优先收缩:空间实在不够时先截断数量文案,也不挤走开关 */ + flex: 0 10 auto; + min-width: 0; + overflow: hidden; white-space: nowrap; } +/* 弹性空隙:把右侧「子组继承 | 全部展开」整组推到卡片头右端,与分类名/数量拉开距离 */ +.cat-spacer { + flex: 1 1 0; + min-width: 0; +} + .inherit-cap { font-size: 12px; color: #999; flex-shrink: 0; - margin-right: 6px; + padding: 0 6px; + line-height: 18px; + background: #f0f2f5; + border-radius: 2px; + cursor: default; } .expand-all { @@ -687,6 +705,10 @@ onMounted(async () => { align-items: center; flex-shrink: 0; gap: 4px; + /* 与左侧「子组继承」提示以竖线分隔:否则两个标签相邻会被读成同一个开关的说明 */ + margin-left: 10px; + padding-left: 10px; + border-left: 1px solid #e8eaec; } .expand-all-label { diff --git a/src/views/PermissionView.vue b/src/views/PermissionView.vue index 2083cea..76d4b73 100644 --- a/src/views/PermissionView.vue +++ b/src/views/PermissionView.vue @@ -62,11 +62,19 @@
-
{{ permMainTitle }}
+
+ {{ permMainTitle }} + + + 全部展开: + + +
权限加载中...
{{ permEmptyTip }}
- +
@@ -156,6 +164,9 @@ const permScope = ref<{ type: "user" | "group" | "role"; id?: number; label: str label: "", }); +// 已授权应用面板的「全部展开」开关(默认关闭):应用层默认折叠,需按需展开模块 +const permExpandAll = ref(false); + const permMainTitle = computed(() => { if (permScope.value.type === "group") return `已授权应用(部门:${permScope.value.label})`; if (permScope.value.type === "role") return `已授权应用(角色:${permScope.value.label})`; @@ -571,6 +582,30 @@ function formatModules(modules: ModuleNode[]): any[] { font-size: 13px; background: #fafafa; border-bottom: 1px solid #f0f0f0; + display: flex; + align-items: center; +} + +.side-title-text { + flex: 1; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.expand-all { + display: flex; + align-items: center; + flex-shrink: 0; + gap: 4px; + font-weight: 400; +} + +.expand-all-label { + font-size: 12px; + color: #999; + white-space: nowrap; } .side-body { diff --git a/src/views/role-authz/AppModuleCheckTree.vue b/src/views/role-authz/AppModuleCheckTree.vue index 63e2528..5abcbb1 100644 --- a/src/views/role-authz/AppModuleCheckTree.vue +++ b/src/views/role-authz/AppModuleCheckTree.vue @@ -26,9 +26,10 @@ :type="collapsedMap[String(item.cat.id)] ? 'ios-arrow-forward' : 'ios-arrow-down'" /> {{ item.cat.name }} {{ item.treeData.length }}个应用 + - 全部展开 + 全部展开: @@ -393,6 +394,9 @@ watch( font-size: 13px; color: #333; margin-left: 6px; + /* 列宽有限:分类名优先让位(省略号),保证右侧「全部展开」不被挤出可视区 */ + flex: 0 999 auto; + min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; @@ -402,10 +406,18 @@ watch( color: #999; font-size: 12px; margin-left: 8px; - flex: 1; + flex: 0 10 auto; + min-width: 0; + overflow: hidden; white-space: nowrap; } +/* 弹性空隙:把「全部展开」整组推到卡片头右端 */ +.cat-spacer { + flex: 1 1 0; + min-width: 0; +} + .cat-card-body { padding: 6px 8px; }