From 0fabfdbdb4089c5c043df45b0e269f0e691229e3 Mon Sep 17 00:00:00 2001 From: bunny <1319900154@qq.com> Date: Fri, 2 May 2025 15:46:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9D=83=E9=99=90=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9;=E9=A1=B5=E9=9D=A2=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReadMe.md | 6 +- src/api/v1/system/power.ts | 9 +- src/store/system/power.ts | 8 +- .../components/account-management.vue | 1 - .../configuration/email-template/index.vue | 3 +- .../email-template/utils/hooks.tsx | 28 ++++- src/views/configuration/email-user/index.vue | 2 +- .../configuration/email-user/utils/hooks.tsx | 4 +- src/views/configuration/menu-icon/index.vue | 2 +- .../configuration/menu-icon/utils/hooks.tsx | 4 +- src/views/i18n/i18n-setting/index.vue | 11 +- src/views/i18n/i18n-setting/utils/hooks.tsx | 6 +- src/views/i18n/i18n-type-setting/index.vue | 2 +- .../i18n/i18n-type-setting/utils/hooks.tsx | 4 +- .../message-manger/message-type/index.vue | 2 +- .../message-type/utils/hooks.ts | 4 +- .../scheduler-execute-log/utils/hooks.ts | 2 +- .../monitor/user-login-log/utils/hooks.ts | 2 +- .../scheduler/schedulers-group/index.vue | 2 +- .../scheduler/schedulers-group/utils/hooks.ts | 4 +- src/views/scheduler/schedulers/index.vue | 5 +- src/views/scheduler/schedulers/utils/auth.ts | 1 + src/views/scheduler/schedulers/utils/hooks.ts | 4 +- src/views/system/admin-user/index.vue | 2 +- src/views/system/admin-user/utils/hooks.tsx | 42 +++++-- src/views/system/dept/index.vue | 2 +- src/views/system/dept/utils/hooks.ts | 25 +++- src/views/system/files/index.vue | 11 +- src/views/system/files/utils/hooks.tsx | 4 +- src/views/system/menu/index.vue | 2 +- src/views/system/menu/utils/modules/hooks.tsx | 2 +- ...-dialog.vue => permission-from-dialog.vue} | 2 +- .../components/permission-sort-dialog.vue | 114 ++++++++++++++++++ src/views/system/permission/index.vue | 60 ++++++--- src/views/system/permission/utils/hooks.tsx | 32 ++++- src/views/system/role/index.vue | 4 +- src/views/system/role/utils/hooks.tsx | 4 +- 37 files changed, 333 insertions(+), 89 deletions(-) rename src/views/system/permission/components/{power-dialog.vue => permission-from-dialog.vue} (98%) create mode 100644 src/views/system/permission/components/permission-sort-dialog.vue diff --git a/ReadMe.md b/ReadMe.md index a7b8378..8e07fe7 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -253,10 +253,10 @@ docker compose up -d ## 📈 后续规划 -- [ ] 权限级别拖拽 -- [ ] 权限树型结构动态添加、更新、删除 +- [x] 权限级别拖拽 +- [x] 权限树型结构动态添加、更新、删除 - [ ] 用户设置持久化存储到数据库 -- [ ] 权限弹窗页面优化 +- [x] 权限弹窗页面优化 - [x] 后端文档注释完善 - [x] 系统监控后端返回403停止请求 - [x] 优化用户配置权限逻辑,配置后热更新逻辑等 diff --git a/src/api/v1/system/power.ts b/src/api/v1/system/power.ts index f12cc77..b6f14ce 100644 --- a/src/api/v1/system/power.ts +++ b/src/api/v1/system/power.ts @@ -43,9 +43,14 @@ export const getSystemApiInfoList = () => { return http.request>('get', 'permission/private/getSystemApiInfoList'); }; -/** 权限---更新权限 */ +/** 权限---批量修改权限父级 */ export const updatePermissionListByParentId = (data: any) => { - return http.request>('put', 'permission/update/permissionListByParentId', { data }); + return http.request>('patch', 'permission/update/permissionListByParentId', { data }); +}; + +/** 权限---批量更新权限 */ +export const updatePermissionBatch = (data: any) => { + return http.request>('patch', 'permission/update/permissionBatch', { data }); }; /** 角色和权限---根据角色id获取权限内容 */ diff --git a/src/store/system/power.ts b/src/store/system/power.ts index 5441adf..0665622 100644 --- a/src/store/system/power.ts +++ b/src/store/system/power.ts @@ -8,6 +8,7 @@ import { getSystemApiInfoList, importPermission, updatePermission, + updatePermissionBatch, updatePermissionListByParentId, } from '@/api/v1/system/power'; import { pageSizes } from '@/enums/baseConstant'; @@ -57,7 +58,6 @@ export const usePermissionStore = defineStore('PermissionStore', { const data = { ...this.pagination, ...this.form }; delete data.pageSizes; delete data.total; - delete data.background; // 获取权限列表 const result = await getPermissionPage(data); @@ -117,5 +117,11 @@ export const usePermissionStore = defineStore('PermissionStore', { const result = await updatePermissionListByParentId(data); return storeMessage(result); }, + + /* 批量更新权限 */ + async updatePermissionBatch(data: any) { + const result = await updatePermissionBatch(data); + return storeMessage(result); + }, }, }); diff --git a/src/views/account-settings/components/account-management.vue b/src/views/account-settings/components/account-management.vue index 0fc2291..963a17e 100644 --- a/src/views/account-settings/components/account-management.vue +++ b/src/views/account-settings/components/account-management.vue @@ -23,7 +23,6 @@ function onResetPassword() { addDialog({ title: `修改密码`, - width: '30%', draggable: true, closeOnClickModal: false, fullscreenIcon: true, diff --git a/src/views/configuration/email-template/index.vue b/src/views/configuration/email-template/index.vue index 48f389a..f325f89 100644 --- a/src/views/configuration/email-template/index.vue +++ b/src/views/configuration/email-template/index.vue @@ -97,8 +97,9 @@ onMounted(() => { +