diff --git a/frontend/src/api/modules/project-management/usergroup.ts b/frontend/src/api/modules/project-management/usergroup.ts new file mode 100644 index 0000000000..018b0bd7d2 --- /dev/null +++ b/frontend/src/api/modules/project-management/usergroup.ts @@ -0,0 +1,61 @@ +import MSR from '@/api/http/index'; +import * as ugUrl from '@/api/requrls/project-management/usergroup'; +import { TableQueryParams, CommonList } from '@/models/common'; +import { + UserGroupItem, + SystemUserGroupParams, + UserGroupAuthSetting, + SaveGlobalUSettingData, + UserTableItem, +} from '@/models/setting/usergroup'; + +// 项目-创建或修改用户组 +export function updateOrAddUserGroup(data: SystemUserGroupParams) { + return MSR.post({ + url: data.id ? ugUrl.updateUrl : ugUrl.addUrl, + data, + }); +} + +// 项目-获取用户组列表 +export function postUserGroupList(data: TableQueryParams) { + return MSR.post>({ url: ugUrl.listUserGroupUrl, data }); +} + +// 项目-删除用户组 +export function deleteUserGroup(id: string) { + return MSR.get({ url: `${ugUrl.deleteUrl}${id}` }); +} + +// 项目-获取需要关联的用户选项 +export function getUserGroupOption(organizationId: string, roleId: string, keyword: string) { + return MSR.get({ + url: `${ugUrl.getMemberOptionsUrl}${organizationId}/${roleId}`, + params: { keyword }, + }); +} + +// 项目-编辑用户组对应的权限配置 +export function saveUSetting(data: SaveGlobalUSettingData) { + return MSR.post({ url: ugUrl.updatePermissionUrl, data }); +} + +// 项目-获取用户组对应的权限 +export function postAuthByUserGroup(data: TableQueryParams) { + return MSR.post>({ url: ugUrl.listPermissionUrl, data }); +} + +// 项目-获取用户组对应的用户列表 +export function postUserByUserGroup(data: TableQueryParams) { + return MSR.post>({ url: ugUrl.listMemberUrl, data }); +} + +// 项目-删除用户组对应的用户 +export function deleteUserFromUserGroup(data: { userRoleId: string; userIds: string[]; organizationId: string }) { + return MSR.post>({ url: ugUrl.removeMemberUrl, data }); +} + +// 项目-添加用户到用户组 +export function addUserToUserGroup(data: { userRoleId: string; userIds: string[]; organizationId: string }) { + return MSR.post({ url: ugUrl.addMemberUrl, data }); +} diff --git a/frontend/src/api/requrls/project-management/usergroup.ts b/frontend/src/api/requrls/project-management/usergroup.ts new file mode 100644 index 0000000000..cc21a909a4 --- /dev/null +++ b/frontend/src/api/requrls/project-management/usergroup.ts @@ -0,0 +1,10 @@ +export const updateUrl = '/user/role/project/update'; +export const addUrl = '/user/role/project/add'; +export const removeMemberUrl = '/user/role/project/remove-member'; +export const updatePermissionUrl = '/user/role/project/permission/update'; +export const listMemberUrl = '/user/role/project/list-member'; +export const addMemberUrl = '/user/role/project/add-member'; +export const listPermissionUrl = '/user/role/project/permission/setting/'; +export const listUserGroupUrl = '/user/role/project/list/'; +export const getMemberOptionsUrl = '/api/project-management/usergroup/getMemberOptions'; +export const deleteUrl = '/api/project-management/usergroup/delete'; diff --git a/frontend/src/components/business/ms-user-group-comp/userTable.vue b/frontend/src/components/business/ms-user-group-comp/userTable.vue index 0bc4e4ec12..c7b84a9a0b 100644 --- a/frontend/src/components/business/ms-user-group-comp/userTable.vue +++ b/frontend/src/components/business/ms-user-group-comp/userTable.vue @@ -57,6 +57,7 @@ { title: 'system.userGroup.operation', slotName: 'action', + dataIndex: 'operation', fixed: 'right', width: 200, }, diff --git a/frontend/src/components/pure/ms-table/base-table.vue b/frontend/src/components/pure/ms-table/base-table.vue index 0511d14f3c..ae16b8ddcd 100644 --- a/frontend/src/components/pure/ms-table/base-table.vue +++ b/frontend/src/components/pure/ms-table/base-table.vue @@ -103,7 +103,12 @@
( }); watchEffect(() => { + // TODO 等UI出图,表格设置里加入分页配置等操作 const { heightUsed } = propsRes.value; - propsRes.value.scroll = { ...propsRes.value.scroll, y: appStore.innerHeight - (heightUsed || 294) }; + const currentY = appStore.innerHeight - (heightUsed || 294); + propsRes.value.scroll = { ...propsRes.value.scroll, y: currentY }; }); return { diff --git a/frontend/src/enums/tableEnum.ts b/frontend/src/enums/tableEnum.ts index 1be478be16..4477c6df82 100644 --- a/frontend/src/enums/tableEnum.ts +++ b/frontend/src/enums/tableEnum.ts @@ -15,6 +15,7 @@ export enum TableKeyEnum { SYSTEM_PROJECT = 'systemProject', SYSTEM_LOG = 'systemLog', PROJECT_MEMBER = 'projectMember', + PROJECT_USER_GROUP = 'projectUserGroup', ORGANIZATION_MEMBER = 'organizationMember', ORGANIZATION_PROJECT = 'organizationProject', ORGANIZATION_PROJECT_USER_DRAWER = 'organizationProjectUserDrawer', diff --git a/frontend/src/locale/en-US/common.ts b/frontend/src/locale/en-US/common.ts index 23367a60e0..34ede6c2da 100644 --- a/frontend/src/locale/en-US/common.ts +++ b/frontend/src/locale/en-US/common.ts @@ -48,4 +48,6 @@ export default { 'common.leave': 'Leave', 'common.rename': 'Rename', 'common.noData': 'No data', + 'common.internal': 'Internal', + 'common.custom': 'Custom', }; diff --git a/frontend/src/locale/zh-CN/common.ts b/frontend/src/locale/zh-CN/common.ts index edac886b25..9597e7a81f 100644 --- a/frontend/src/locale/zh-CN/common.ts +++ b/frontend/src/locale/zh-CN/common.ts @@ -50,4 +50,6 @@ export default { 'common.leave': '离开', 'common.rename': '重命名', 'common.noData': '暂无数据', + 'common.internal': '内部', + 'common.custom': '自定义', }; diff --git a/frontend/src/views/project-management/projectAndPermission/userGroup/addUserModal.vue b/frontend/src/views/project-management/projectAndPermission/userGroup/addUserModal.vue new file mode 100644 index 0000000000..04b1a05f2f --- /dev/null +++ b/frontend/src/views/project-management/projectAndPermission/userGroup/addUserModal.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/frontend/src/views/project-management/projectAndPermission/userGroup/locale/en-US.ts b/frontend/src/views/project-management/projectAndPermission/userGroup/locale/en-US.ts new file mode 100644 index 0000000000..c8e15010c4 --- /dev/null +++ b/frontend/src/views/project-management/projectAndPermission/userGroup/locale/en-US.ts @@ -0,0 +1,7 @@ +export default { + 'project.usergroup.add': 'Add User Group', + 'project.usergroup.searchUser': 'Search User', + 'project.usergroup.name': 'User Group Name', + 'project.usergroup.memberCount': 'Member Count', + 'project.userGroup.viewAuth': 'View Auth', +}; diff --git a/frontend/src/views/project-management/projectAndPermission/userGroup/locale/zh-CN.ts b/frontend/src/views/project-management/projectAndPermission/userGroup/locale/zh-CN.ts new file mode 100644 index 0000000000..5abbc0986b --- /dev/null +++ b/frontend/src/views/project-management/projectAndPermission/userGroup/locale/zh-CN.ts @@ -0,0 +1,7 @@ +export default { + 'project.userGroup.add': '添加用户组', + 'project.userGroup.searchUser': '通过名称搜索', + 'project.userGroup.name': '用户组名称', + 'project.userGroup.memberCount': '成员数', + 'project.userGroup.viewAuth': '查看权限', +}; diff --git a/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue b/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue index e528ee6238..d8c301b118 100644 --- a/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue +++ b/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue @@ -1,9 +1,157 @@ diff --git a/frontend/src/views/project-management/projectAndPermission/userGroup/userDrawer.vue b/frontend/src/views/project-management/projectAndPermission/userGroup/userDrawer.vue new file mode 100644 index 0000000000..9c0a71678d --- /dev/null +++ b/frontend/src/views/project-management/projectAndPermission/userGroup/userDrawer.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/frontend/src/views/setting/organization/project/orgProject.vue b/frontend/src/views/setting/organization/project/orgProject.vue index 27fc228b3a..5b90ac1253 100644 --- a/frontend/src/views/setting/organization/project/orgProject.vue +++ b/frontend/src/views/setting/organization/project/orgProject.vue @@ -25,7 +25,9 @@