From c77d8f4ec2a0a69a2d8a8811b213a3db4a5b19f4 Mon Sep 17 00:00:00 2001 From: fangyunong Date: Sat, 19 Jul 2025 23:03:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto-imports.d.ts | 1 + src/api/roleApi.ts | 25 +++++++++++++---- src/components/Ls-UI/LsRoleBase.vue | 43 +++++++++++++++++++++++------ src/views/role/pages/Auth.vue | 3 +- 4 files changed, 58 insertions(+), 14 deletions(-) diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 6bcb7af..443f0c7 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -21,6 +21,7 @@ declare global { const deleteChildDict: typeof import('./src/api/dictApi')['deleteChildDict'] const deleteMenu: typeof import('./src/api/menu')['deleteMenu'] const deleteParentDict: typeof import('./src/api/dictApi')['deleteParentDict'] + const deleteRole: typeof import('./src/api/roleApi')['deleteRole'] const deleteUser: typeof import('./src/api/roleApi')['deleteUser'] const editParentMenu: typeof import('./src/api/menu')['editParentMenu'] const effectScope: typeof import('vue')['effectScope'] diff --git a/src/api/roleApi.ts b/src/api/roleApi.ts index e5808d6..9f278d9 100644 --- a/src/api/roleApi.ts +++ b/src/api/roleApi.ts @@ -35,6 +35,7 @@ export interface RoleListReturn { id: string; name: string; normalizedName: string; + ChineseName:string } export function getRoleList(): Promise { return http({ @@ -48,24 +49,27 @@ interface EnableRoleQuery { userId: string; roleName: string; } -export function enableRole(data: EnableRoleQuery) { +export function enableRole(params: EnableRoleQuery) { return http({ - url: "/api/v1/AdminRoleControllers/role", + url: "/api/v1/AdminRoleControllers/role/endow", method: "POST", - data, + params, }); } // 添加新角色 interface NewRoleReq{ rolename:string - normalizedname:string + ChineseName:string } export function addNewRole(params:NewRoleReq){ return http({ url:'/api/v1/AdminRoleControllers/role', method:'POST', - params + params:{ + ...params, + normalizedname:'suibiantiande' + } }) } @@ -82,3 +86,14 @@ export function assignMenu(data:MenuRequest) { data, }); } + +// 删除指定角色 +export function deleteRole(id:string){ + return http({ + url:'/api/v1/AdminRoleControllers/role', + method:'DELETE', + params:{ + id + } + }) +} \ No newline at end of file diff --git a/src/components/Ls-UI/LsRoleBase.vue b/src/components/Ls-UI/LsRoleBase.vue index 40a978a..513c775 100644 --- a/src/components/Ls-UI/LsRoleBase.vue +++ b/src/components/Ls-UI/LsRoleBase.vue @@ -12,9 +12,11 @@ {{ item.name }} - {{ item.normalizedName }} + {{ item.chineseName }} - 选择 + 选择 + 删除 @@ -22,10 +24,10 @@ - - 新增 + 新增 @@ -43,7 +45,7 @@