From 16d49375f12199c0da29016cbbeb4b11fc01c432 Mon Sep 17 00:00:00 2001 From: chenxing Date: Wed, 21 Oct 2026 15:12:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(dept):=20=E6=92=A4=E6=8E=89=E6=A0=91?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E5=BC=80=E5=85=B3=E3=80=81=E4=BF=AE=E6=96=87?= =?UTF-8?q?=E6=A1=88=E8=AF=AF=E5=88=A4=EF=BC=9B=E9=83=A8=E9=97=A8=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=BF=81=E5=85=A5=E3=80=8C=E5=9F=BA=E7=A1=80=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E3=80=8D=E5=B9=B6=E6=94=B9=E8=B5=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 树恢复纯 zTree:去掉 MyTree.attachNodeControl 的调用与相关定位样式(绝对定位在节点行内会漂移、视觉突兀) - 修正卡片副文案误判:原来按 type!==7 判「学生组·非部门」,实际教师组下挂的是普通组(type=1), 改为只对 type===8 判学生组,其余都算部门(部门身份由「挂在教师组下」决定,不由自身 type 决定) - 菜单:部门管理从「权限管理」迁入新建的「基础设置」分组(menu modId 1115,routes meta.parentId 同步为 modId 而非 menu.id) - 「包含子组」改为读写学校节点的 includeChildren 字段(去掉 localStorage),切换即调 SetIncludeChildren - 布局:说明条移入面板内部并改主题浅绿(iView success 在本主题下是灰绿 #D3E0D8,不跟随); Card 面板 flex 撑满高度;树容器收掉外层滚动条,滚动统一交给 MyTree 内部 .ztree --- src/api/apiDefinitions.ts | 1 + src/api/globals.d.ts | 32 +++++ src/assets/config/menu.ts | 16 ++- src/router/routes.ts | 7 +- src/views/dept-manage/DeptCard.vue | 7 +- src/views/dept-manage/index.vue | 202 ++++++++++++----------------- 6 files changed, 139 insertions(+), 126 deletions(-) diff --git a/src/api/apiDefinitions.ts b/src/api/apiDefinitions.ts index c9bc2b6..3116ff5 100644 --- a/src/api/apiDefinitions.ts +++ b/src/api/apiDefinitions.ts @@ -32,6 +32,7 @@ export default { 'SysGroup.sysGroupRemove': ['POST', '/api/sysgroup/Delete/{id}'], 'SysGroup.disable': ['POST', '/api/sysgroup/Disable/{id}'], 'SysGroup.enable': ['POST', '/api/sysgroup/Enable/{id}'], + 'SysGroup.setIncludeChildren': ['POST', '/api/sysgroup/SetIncludeChildren/{id}'], 'SysGroup.batchAdd': ['POST', '/api/sysgroup/BatchAdd'], 'SysGroup.sysGroupAdd': ['POST', '/api/sysgroup/Add'], 'PushSubscription.test': ['POST', '/api/push/Test'], diff --git a/src/api/globals.d.ts b/src/api/globals.d.ts index 29334d6..0ea5a1a 100644 --- a/src/api/globals.d.ts +++ b/src/api/globals.d.ts @@ -148,6 +148,9 @@ export interface SysGroupRequest { type: number; sort?: number; } +export interface SysGroupIncludeChildrenRequest { + includeChildren: boolean; +} export interface PushTestRequest { appId?: number; interfacePath?: string; @@ -1584,6 +1587,35 @@ declare global { >( config: Config ): Alova2Method; + /** + * --- + * + * [POST] + * + * **path:** /api/sysgroup/SetIncludeChildren/{id} + * + * --- + * + * **RequestBody** + * ```ts + * type RequestBody = SysGroupIncludeChildrenRequest + * ``` + * + * **Response** + * ```ts + * type Response = null + * ``` + */ + setIncludeChildren< + Config extends Alova2MethodConfig & { + pathParams: { + id: number; + }; + data: SysGroupIncludeChildrenRequest; + } + >( + config: Config + ): Alova2Method; /** * --- * diff --git a/src/assets/config/menu.ts b/src/assets/config/menu.ts index 72045ef..349757e 100644 --- a/src/assets/config/menu.ts +++ b/src/assets/config/menu.ts @@ -13,6 +13,9 @@ import { UserRoleEnum } from "@/types"; * 2. 应用管理 —— S+C(局端不开放:局端的应用动作是「开通」,应用维护是平台级) * 3. 权限管理 —— 父目录:应用开通(S+B) / 组授权 / 角色授权 / 权限一览(S+B+C) * 4. 日志管理 —— 仅超管(父目录) + * 5. 基础设置 —— 非业务域的基础配置合集(当前:部门管理),后续字典/参数/模板等杂项归此 + * + * 菜单不渲染图标:本工程侧边栏只输出文字,节点无需 icon 字段。 * * 每个节点带唯一 id;子节点的 pid 由 layout.vue 的 flaten() 扁平化时 * 依据父节点 id 自动推导,用于「高亮自身 + 面包屑展示父级」联动。 @@ -48,7 +51,6 @@ export function getMenuList(userRole?: UserRoleEnum): Promise { { id: 42, modId: 1104, name: "组授权", page: "/group-auth", roles: [UserRoleEnum.SuperAdmin, UserRoleEnum.Bureau, UserRoleEnum.School] }, { id: 44, modId: 1110, name: "角色授权", page: "/role-authz/list", roles: [UserRoleEnum.SuperAdmin, UserRoleEnum.Bureau, UserRoleEnum.School] }, { id: 43, modId: 1105, name: "权限一览", page: "/permission-view", roles: [UserRoleEnum.SuperAdmin, UserRoleEnum.Bureau, UserRoleEnum.School] }, - { id: 45, modId: 1106, name: "部门管理", page: "/dept-manage", roles: [UserRoleEnum.SuperAdmin, UserRoleEnum.Bureau, UserRoleEnum.School] }, ], }, // 4. 日志管理(父目录) @@ -65,6 +67,18 @@ export function getMenuList(userRole?: UserRoleEnum): Promise { { id: 54, modId: 1112, name: "推送日志", page: "/push-log", roles: [UserRoleEnum.SuperAdmin] }, ], }, + // 5. 基础设置(父目录):非业务域的基础配置杂项合集,部门管理从「权限管理」迁入 + { + id: 6, + modId: 1115, + name: "基础设置", + page: "", + childState: true, + roles: [UserRoleEnum.SuperAdmin, UserRoleEnum.Bureau, UserRoleEnum.School], + children: [ + { id: 61, modId: 1106, name: "部门管理", page: "/dept-manage", roles: [UserRoleEnum.SuperAdmin, UserRoleEnum.Bureau, UserRoleEnum.School] }, + ], + }, ]; return Promise.resolve(filterMenuByRole(menu, userRole)); } diff --git a/src/router/routes.ts b/src/router/routes.ts index 5a2ccdd..1fc1e3b 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -106,13 +106,14 @@ const routes: RouteRecordRaw[] = [ component: PermissionView, meta: { title: "权限一览", icon: "icon-list", modId: 1105, roles: ALL_ADMIN }, }, - // ===== 部门管理(2026-10-20 部门线 P0 最小批:只读树 + 状态徽标 + 启停)===== - // 挂「权限管理」分组(菜单 id=45);无删除/成员/职务/新建入口——建部门=建组回「组,用户管理」 + // ===== 部门管理(2026-10-20 部门线 P0 最小批,2026-10-21 迁入「基础设置」分组)===== + // 原挂「权限管理」(modId 1108);部门属于组织基础配置而非权限,改挂「基础设置」(modId 1115) + // 无删除/成员/职务/新建入口——建部门=建组回「组,用户管理」 { path: "/dept-manage", name: "DeptManage", component: DeptManage, - meta: { title: "部门管理", icon: "icon-list", modId: 1106, parentId: 1108, roles: ALL_ADMIN }, + meta: { title: "部门管理", icon: "icon-list", modId: 1106, parentId: 1115, roles: ALL_ADMIN }, }, { path: "/push-log", diff --git a/src/views/dept-manage/DeptCard.vue b/src/views/dept-manage/DeptCard.vue index 2d4c9fa..613761f 100644 --- a/src/views/dept-manage/DeptCard.vue +++ b/src/views/dept-manage/DeptCard.vue @@ -18,8 +18,8 @@