From 182c447ef83adf6ec182e2d8af221f3f536dd361 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 28 Mar 2023 22:43:10 +0800 Subject: [PATCH 1/6] fix: dept leaderUserId #I6R4NH --- src/views/system/dept/dept.data.ts | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/views/system/dept/dept.data.ts b/src/views/system/dept/dept.data.ts index 177433a4..3f38722f 100644 --- a/src/views/system/dept/dept.data.ts +++ b/src/views/system/dept/dept.data.ts @@ -3,6 +3,15 @@ import { getListSimpleUsers } from '@/api/system/user' import { BasicColumn, FormSchema, useRender } from '@/components/Table' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' +let userOptions: any[] = [] + +async function getUserList() { + const res = await getListSimpleUsers() + userOptions = res +} + +await getUserList() + export const columns: BasicColumn[] = [ { title: '部门名称', @@ -12,8 +21,19 @@ export const columns: BasicColumn[] = [ }, { title: '负责人', - dataIndex: 'leader', - width: 120 + dataIndex: 'leaderUserId', + width: 120, + customRender: ({ text }) => { + if (!text) { + return '未设置' + } + for (const user of userOptions) { + if (text === user.id) { + return user.nickname + } + } + return '未知【' + text + '】' + } }, { title: '排序', @@ -94,7 +114,7 @@ export const formSchema: FormSchema[] = [ field: 'leaderUserId', component: 'ApiSelect', componentProps: { - api: () => getListSimpleUsers(), + options: () => getListSimpleUsers(), labelField: 'nickname', valueField: 'id' } From 9d7298598a9808794bea87efbd1ce4c89da54a9f Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 28 Mar 2023 22:49:14 +0800 Subject: [PATCH 2/6] fix: tenant #I6R4NN --- src/views/system/tenant/tenant.data.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/system/tenant/tenant.data.ts b/src/views/system/tenant/tenant.data.ts index c5a37456..8b9d091b 100644 --- a/src/views/system/tenant/tenant.data.ts +++ b/src/views/system/tenant/tenant.data.ts @@ -147,13 +147,13 @@ export const formSchema: FormSchema[] = [ label: '用户名称', field: 'username', component: 'Input', - ifShow: ({ values }) => values.id !== undefined + ifShow: ({ values }) => !!!values.id }, { label: '用户密码', field: 'password', component: 'InputPassword', - ifShow: ({ values }) => values.id === undefined + ifShow: ({ values }) => !!!values.id }, { label: '账号额度', From 0c5e6e9e2ce36754ca964e77a36c3133e55b5183 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 28 Mar 2023 22:52:07 +0800 Subject: [PATCH 3/6] fix: codegen pre #I6R4O4 --- src/views/infra/codegen/components/PreviewModal.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/infra/codegen/components/PreviewModal.vue b/src/views/infra/codegen/components/PreviewModal.vue index 1bdf1ddb..05f2e90d 100644 --- a/src/views/infra/codegen/components/PreviewModal.vue +++ b/src/views/infra/codegen/components/PreviewModal.vue @@ -1,7 +1,7 @@