From 6ede47d0b95e1c6b60517056f2fbd72d1c2a8481 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Mon, 21 Sep 2026 11:42:48 +0800 Subject: [PATCH] fix: user manage --- ui/src/api/types/system-user.ts | 1 + ui/src/components/COMPONENT_README.md | 9 +++-- .../workspace-relation-tags/index.vue | 37 ++++++++++++------- ui/src/components/mk-edit-avatar/index.vue | 2 +- ui/src/styles/element-plus.scss | 2 + .../components/ButtonEditPortal.vue | 4 +- .../system/identity/groups/GroupsListView.vue | 14 +++++-- .../system/identity/users/UserListView.vue | 15 ++++++-- 8 files changed, 56 insertions(+), 28 deletions(-) diff --git a/ui/src/api/types/system-user.ts b/ui/src/api/types/system-user.ts index c71ff6bb153..293116d5ee6 100644 --- a/ui/src/api/types/system-user.ts +++ b/ui/src/api/types/system-user.ts @@ -52,6 +52,7 @@ export interface SystemUser { role_workspace?: Record role_setting?: SystemUserRoleAssignment[] user_group_names?: string[] + user_group_workspace?: { workspace: string; user_group_names: string[] }[] user_group_ids?: string[] create_time: string update_time?: string diff --git a/ui/src/components/COMPONENT_README.md b/ui/src/components/COMPONENT_README.md index 7bb21a14f0d..5b324766df5 100644 --- a/ui/src/components/COMPONENT_README.md +++ b/ui/src/components/COMPONENT_README.md @@ -660,9 +660,12 @@ Skills 场景传入 `[TOOL_TYPE.SKILL]`,并通过 `title` 指定标题。两 ### WorkspaceRelationTags 用于展示标签组,并在悬浮表格中展示每个标签关联的工作空间。 -`tags` 控制表格单元格中的折叠标签;`tagWorkspace` 使用标签名称作为键、工作空间 -名称数组作为值;`tableRenderParams.property` 和 `tableRenderParams.value` 分别设置 -悬浮表格的标签列与工作空间列标题。 +`tags` 控制表格单元格中的折叠标签;`data` 接收关联记录数组,`columns` 按顺序配置 +`prop`(字段名)和 `label`(列名),列宽由表格自动分配。组件不转换接口数据结构, +旧对象映射由调用页面转换为行数组。用户组直接传入 `user_group_workspace` 数组, +使用 `workspace`、`user_group_names` 两列;角色映射由用户列表页面转换。 +数组单元格以“、”连接,空数组、空字符串、null 和 undefined 显示 `-`,长文本使用溢出提示。 +`data` 为空时禁用关联浮层,保留标签展示;内部 `MkTagGroup` 的标签浮层保持禁用。 ### ResourceAuthorizationDrawer diff --git a/ui/src/components/business/workspace-relation-tags/index.vue b/ui/src/components/business/workspace-relation-tags/index.vue index bfb7976103a..8313021c4d7 100644 --- a/ui/src/components/business/workspace-relation-tags/index.vue +++ b/ui/src/components/business/workspace-relation-tags/index.vue @@ -1,27 +1,36 @@ - + diff --git a/ui/src/views/system/identity/users/UserListView.vue b/ui/src/views/system/identity/users/UserListView.vue index 30c2f1d2d98..7aaa55594fa 100644 --- a/ui/src/views/system/identity/users/UserListView.vue +++ b/ui/src/views/system/identity/users/UserListView.vue @@ -27,6 +27,7 @@ const userTableRef = useTemplateRef('userTableRef') const systemUsersLoading = ref(false) const paginationConfig = ref({ currentPage: 1, pageSize: 20, total: 0 }) const systemUsersData = ref([]) + const searchFields: OptionItem[] = [ { label: '用户名', value: 'username' }, { label: '姓名', value: 'nick_name' }, @@ -168,9 +169,12 @@ onMounted(() => loadSystemUsers()) @@ -180,9 +184,12 @@ onMounted(() => loadSystemUsers()) -