From 70874bab313b82e96eff315b26e766e01dc993df Mon Sep 17 00:00:00 2001 From: RubyLiu Date: Mon, 19 Jun 2023 19:00:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BB=84=E7=AE=A1=E7=90=86=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/api-test/index.ts | 8 +- frontend/src/api/modules/system/usergroup.ts | 30 +++++ frontend/src/api/requrls/usergroup.ts | 21 +++ .../usergroup/deleteUserGroupModal.vue | 58 ++++++++ .../components/bussiness/usergroup/index.vue | 126 +++++++++++++----- .../bussiness/usergroup/popconfirm.vue | 69 +++++++--- .../components/bussiness/usergroup/type.ts | 23 +++- .../components/pure/ms-table/base-table.vue | 33 ++--- .../components/pure/ms-table/batchAction.vue | 51 +++---- frontend/src/components/pure/ms-table/type.ts | 11 ++ frontend/src/models/api-test.ts | 9 +- frontend/src/models/common.ts | 3 +- frontend/src/store/modules/system/types.ts | 1 + .../src/store/modules/system/usergroup.ts | 1 + frontend/src/views/api-test/index.vue | 62 ++++++++- frontend/src/views/system/locale/en-US.ts | 8 ++ frontend/src/views/system/locale/zh-CN.ts | 7 + frontend/src/views/system/usergroup/index.vue | 6 +- 18 files changed, 407 insertions(+), 120 deletions(-) create mode 100644 frontend/src/api/modules/system/usergroup.ts create mode 100644 frontend/src/api/requrls/usergroup.ts create mode 100644 frontend/src/components/bussiness/usergroup/deleteUserGroupModal.vue diff --git a/frontend/src/api/modules/api-test/index.ts b/frontend/src/api/modules/api-test/index.ts index 0dd28e3ace..f468c35c50 100644 --- a/frontend/src/api/modules/api-test/index.ts +++ b/frontend/src/api/modules/api-test/index.ts @@ -1,16 +1,16 @@ import MSR from '@/api/http/index'; import { GetApiTestList, GetApiTestListUrl } from '@/api/requrls/api-test'; -import { TableQueryParams } from '@/models/common'; -import { CommonList } from '@/models/api-test'; +import { TableQueryParams, CommonList } from '@/models/common'; +import { APIListItemI } from '@/models/api-test'; export function getTableList(params: TableQueryParams) { const { current, pageSize, sort, filter, keyword } = params; - return MSR.post({ + return MSR.post>({ url: GetApiTestList, data: { current, pageSize, sort, filter, keyword, projectId: 'test-project-id' }, }); } export function getlist() { - return MSR.get({ url: GetApiTestListUrl }); + return MSR.get>({ url: GetApiTestListUrl }); } diff --git a/frontend/src/api/modules/system/usergroup.ts b/frontend/src/api/modules/system/usergroup.ts new file mode 100644 index 0000000000..f3179f7b51 --- /dev/null +++ b/frontend/src/api/modules/system/usergroup.ts @@ -0,0 +1,30 @@ +import MSR from '@/api/http/index'; +import { updateUserGroupU, getUserGroupU, addUserGroupU, deleteUserGroupU } from '@/api/requrls/usergroup'; +// import { QueryParams, CommonList } from '@/models/common'; +import { UserGroupItem } from '@/components/bussiness/usergroup/type'; + +export function updateOrAddUserGroup(data: Partial) { + return MSR.post({ + url: data.id ? updateUserGroupU : addUserGroupU, + data, + }); +} + +export function updateSocpe(data: Partial) { + return MSR.post({ + url: updateUserGroupU, + data, + }); +} + +export function getUserGroupList() { + return MSR.get({ url: getUserGroupU }); +} + +export function deleteUserGroup(id: string) { + return MSR.get({ url: `${deleteUserGroupU}${id}` }); +} + +export function getUsergroupInfo(id: string) { + return MSR.get({ url: `${getUserGroupU}${id}` }); +} diff --git a/frontend/src/api/requrls/usergroup.ts b/frontend/src/api/requrls/usergroup.ts new file mode 100644 index 0000000000..20fef3266d --- /dev/null +++ b/frontend/src/api/requrls/usergroup.ts @@ -0,0 +1,21 @@ +/** 修改用户组 */ +export const updateUserGroupU = `/user/role/global/update`; +/** 编辑用户组对应的权限配置 */ +export const editGlobalUSetting = `/user/role/global/permission/update`; +/** 添加用户组 */ +export const addUserGroupU = `/user/role/global/add`; +/** 获取用户组对应的权限配置 */ +export const getGlobalUSetting = `/user/role/global/permission/list`; +/** 获取用户组 */ +export const getUserGroupU = `/user/role/global/list`; +/** 获取单个用户组信息 */ +export const getUsergroupInfoU = `/user/role/global/get/`; +/** 删除用户组 */ +export const deleteUserGroupU = `/user/role/global/delete/`; + +/** 根据用户组获取用户列表 */ +export const getUserByUserGroupU = `/user/role/relation/global/list/`; +/** 创建用户组添加用户 */ +export const addUserToUserGroupU = `/user/role/relation/global/add/`; +/** 删除用户组用户 */ +export const deleteUserFromUserGroupU = `/user/role/relation/global/delete/`; diff --git a/frontend/src/components/bussiness/usergroup/deleteUserGroupModal.vue b/frontend/src/components/bussiness/usergroup/deleteUserGroupModal.vue new file mode 100644 index 0000000000..b7e5c27a05 --- /dev/null +++ b/frontend/src/components/bussiness/usergroup/deleteUserGroupModal.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/frontend/src/components/bussiness/usergroup/index.vue b/frontend/src/components/bussiness/usergroup/index.vue index 590a0c8539..86b2ca8fe5 100644 --- a/frontend/src/components/bussiness/usergroup/index.vue +++ b/frontend/src/components/bussiness/usergroup/index.vue @@ -13,7 +13,7 @@
{{ element.name }} - {{ `(${element.title})` }} + ({{ t(`system.userGroup.${element.type}`) }})
@@ -47,43 +49,38 @@
+