From c5911ea34ba6ba98fbc3c1d1044a28a4b55bfee9 Mon Sep 17 00:00:00 2001 From: dk <1260500659@qq.com> Date: Wed, 22 Apr 2026 14:34:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(user):=20=E7=94=A8=E6=88=B7=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=90=9C=E7=B4=A2=E5=8C=BA=E6=96=B0=E5=A2=9E=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=98=B5=E7=A7=B0=E6=90=9C=E7=B4=A2=E6=A1=86=20-=20?= =?UTF-8?q?=E5=9C=A8=E7=94=A8=E6=88=B7=E7=BB=84=E4=BB=B6=E4=B8=AD=E5=B0=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=E6=90=9C=E7=B4=A2=E6=A1=86=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E7=94=A8=E6=88=B7=E6=98=B5=E7=A7=B0=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A1=86=E3=80=82=20-=20=E7=BB=99=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9C=80=E5=B0=8F=E5=AE=BD=E5=BA=A6=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=86=85=E5=AE=B9=E7=BC=A9=E8=B5=B7=E6=9D=A5?= =?UTF-8?q?=E3=80=82=20fix(user-management-relation):=20=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=93=BE=E8=B7=AF=E6=A0=91=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20-=20=E5=BD=93=E7=BB=84=E7=BB=87=E7=B1=BB=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E4=B8=BA=E5=85=AC=E5=8F=B8=E6=97=B6=EF=BC=88=E4=B8=BA=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E3=80=81=E6=96=B9=E5=90=91=E3=80=81=E5=9B=A2=E9=98=9F?= =?UTF-8?q?=EF=BC=89=EF=BC=8C=E4=B8=BA=E9=98=B2=E6=AD=A2=E6=A0=B9=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=8F=98=E6=9B=B4=E5=AF=BC=E8=87=B4=E4=B8=8B=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E5=AD=90=E8=8A=82=E7=82=B9=E5=87=BA=E7=8E=B0=E7=B4=8A?= =?UTF-8?q?=E4=B9=B1=EF=BC=8C=E6=AD=A4=E6=97=B6=E9=9A=90=E8=97=8F=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=8C=89=E9=92=AE=E3=80=82=20-=20=E6=8A=8A=E7=94=A8ma?= =?UTF-8?q?rgin=E6=89=A9=E5=85=85=E5=AE=BD=E5=BA=A6=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E7=94=A8min-width=E3=80=82=20fix(role):=20=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E6=9F=90=E8=A7=92=E8=89=B2=E5=90=8E=E7=9A=84=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=88=97=E7=9A=84=E9=80=8F=E6=98=8E=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20-=20=E9=80=89=E4=B8=AD=E6=9F=90=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=BD=93=E9=A1=B5=E9=9D=A2=E5=88=86=E8=BE=A8?= =?UTF-8?q?=E7=8E=87=E4=B8=8D=E5=A4=9F=E6=97=B6=EF=BC=88=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=EF=BC=89=EF=BC=8C=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=AD=89=E5=AD=97=E6=AE=B5=E7=9A=84=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=BC=9A=E9=80=8F=E8=BF=87=E6=93=8D=E4=BD=9C=E5=88=97?= =?UTF-8?q?=20fix(post):=20=E5=B2=97=E4=BD=8D=E7=9A=84=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E3=80=81=E7=BC=96=E7=A0=81=E5=AD=97=E6=AE=B5=E7=9A=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20-=20=E7=BB=99=E8=BF=99=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E5=AD=97=E6=AE=B5=E8=AE=BE=E7=BD=AE=E6=9C=80=E5=B0=8F?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=AE=83=E4=BB=AC?= =?UTF-8?q?=E7=BC=A9=E8=B5=B7=E6=9D=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/langs/zh-cn.ts | 4 +-- src/service/api/dict.ts | 2 +- src/typings/api/system-manage.d.ts | 1 + src/views/system/post/index.vue | 4 +-- src/views/system/role/index.vue | 16 +++++++++ .../system/user-management-relation/index.vue | 33 +++++++++++++++---- src/views/system/user/index.vue | 6 ++-- src/views/system/user/modules/user-search.vue | 6 ++-- 8 files changed, 55 insertions(+), 17 deletions(-) diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 067fcf2..d432c55 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -404,7 +404,7 @@ const local: App.I18n.Schema = { emptyLeader: '暂无负责人', userName: '用户名', userGender: '性别', - nickName: '昵称', + nickName: '用户昵称', deptName: '所属组织', positionName: '岗位', userPhone: '手机号', @@ -422,7 +422,7 @@ const local: App.I18n.Schema = { form: { userName: '请输入用户名', userGender: '请选择性别', - nickName: '请输入昵称', + nickName: '请输入用户昵称', orgName: '请输入组织名称', orgCode: '请输入组织编码', orgTypeLabel: '请选择组织类型', diff --git a/src/service/api/dict.ts b/src/service/api/dict.ts index 09822ec..3daf039 100644 --- a/src/service/api/dict.ts +++ b/src/service/api/dict.ts @@ -104,7 +104,7 @@ export function fetchBatchDeleteDictData(ids: number[]) { } /** 通过岗位编码获取该字典的所有字典数据 */ -export function fetchGetDictDataByCode(code: String) { +export function fetchGetDictDataByCode(code: string) { return request>({ url: `${DICT_DATA_PREFIX}/code?code=${code}`, method: 'get' diff --git a/src/typings/api/system-manage.d.ts b/src/typings/api/system-manage.d.ts index 2ef8ec2..e9e3145 100644 --- a/src/typings/api/system-manage.d.ts +++ b/src/typings/api/system-manage.d.ts @@ -146,6 +146,7 @@ declare namespace Api { Pick & Pick & { username?: string; + nickname?: string; mobile?: string; deptId?: number; roleId?: number; diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index 9ec9af5..5cf7450 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -89,8 +89,8 @@ const { columns, columnChecks, data, loading, getData, getDataByPage, mobilePagi columns: () => [ { prop: 'selection', type: 'selection', width: 48 }, { prop: 'index', type: 'index', label: '序号', width: 64 }, - { prop: 'name', label: '岗位名称', minWidth: 160, showOverflowTooltip: true }, - { prop: 'code', label: '岗位编码', minWidth: 180, showOverflowTooltip: true }, + { prop: 'name', label: '岗位名称', minWidth: 200, showOverflowTooltip: true }, + { prop: 'code', label: '岗位编码', minWidth: 330, showOverflowTooltip: true }, { prop: 'postType', label: '岗位类型', diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 02f9a3f..e1ae59e 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -106,6 +106,7 @@ const { columns, columnChecks, data, loading, getData, getDataByPage, mobilePagi width: 196, align: 'center', fixed: 'right', + className: 'role-operate-column', formatter: row => ( (); +const { fromUserIndex = false, deptId = 100, orgType = 'company' } = defineProps(); + +/** + * 判断节点是否为母节点(根节点) + * + * 母节点是指树形数据中的第一层节点 + * + * @param data 节点数据 + */ +function isRootNode(data: Api.SystemManage.UserManagementRelationTreeRespVO): boolean { + return treeData.value.some(node => node.userId === data.userId); +} + +/** + * 判断母节点的编辑按钮是否应该隐藏 + * + * 当组织类型为部门、方向或团队时,隐藏母节点的编辑按钮 + */ +const shouldHideRootEdit = computed(() => { + return fromUserIndex && orgType !== 'company'; +}); /** * 初始化搜索参数 @@ -379,7 +402,6 @@ onMounted(async () => { :data="treeData" :props="treeProps" node-key="userId" - default-expand-all :expand-on-click-node="false" @check="handleNodeCheck" > @@ -389,14 +411,14 @@ onMounted(async () => { {{ node.label }} -
+
新增 - + @@ -416,7 +438,6 @@ onMounted(async () => { -
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index f94ba38..0b1b3f6 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -38,7 +38,7 @@ function getInitSearchParams(): Api.SystemManage.UserSearchParams { return { pageNo: 1, pageSize: 10, - username: undefined, + nickname: undefined, mobile: undefined, status: undefined, deptId: undefined, @@ -211,7 +211,7 @@ const {columns, columnChecks, data, loading, getDataByPage, mobilePagination} = { prop: 'positionName', label: $t('page.system.user.positionName'), - minWidth: 140, + minWidth: 200, showOverflowTooltip: true, formatter: row => getNullableLabel(row.positionName) }, @@ -772,7 +772,7 @@ onMounted(async () => { :show-footer="false" max-body-height="70vh" > - + diff --git a/src/views/system/user/modules/user-search.vue b/src/views/system/user/modules/user-search.vue index 29da050..b3e36ed 100644 --- a/src/views/system/user/modules/user-search.vue +++ b/src/views/system/user/modules/user-search.vue @@ -37,12 +37,12 @@ const model = defineModel('model', { required @search="$emit('search')" > - +