From 391e1d701be2687c8fd262772013d6a6f7e113ca Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Tue, 22 Jul 2025 16:08:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=90=9C=E7=B4=A2=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/locales/langs/en-US/project.json | 1 + .../src/locales/langs/zh-CN/project.json | 1 + .../src/views/license/license/data.ts | 136 ++++++++++-------- .../src/views/license/project/data.ts | 112 ++++++++------- 4 files changed, 136 insertions(+), 114 deletions(-) diff --git a/apps/web-antd/src/locales/langs/en-US/project.json b/apps/web-antd/src/locales/langs/en-US/project.json index d0ae157..166d038 100644 --- a/apps/web-antd/src/locales/langs/en-US/project.json +++ b/apps/web-antd/src/locales/langs/en-US/project.json @@ -10,6 +10,7 @@ "technicalOwnerC": "Technical Owner 3", "technicalOwnerB": "Technical Owner 2", "technicalOwnerA": "Technical Owner 1", + "technicalOwner": "Technical Owner", "customerOwner": "Customer Contact", "businessOwner": "Business Owner", "businessStatus": "Business Status", diff --git a/apps/web-antd/src/locales/langs/zh-CN/project.json b/apps/web-antd/src/locales/langs/zh-CN/project.json index 2116b79..31a2bbe 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/project.json +++ b/apps/web-antd/src/locales/langs/zh-CN/project.json @@ -10,6 +10,7 @@ "technicalOwnerC": "技术负责人3", "technicalOwnerB": "技术负责人2", "technicalOwnerA": "技术负责人1", + "technicalOwner": "技术负责人", "customerOwner": "客户对接人", "businessOwner": "业务负责人", "businessStatus": "商务状态", diff --git a/apps/web-antd/src/views/license/license/data.ts b/apps/web-antd/src/views/license/license/data.ts index 58999fd..a99d906 100644 --- a/apps/web-antd/src/views/license/license/data.ts +++ b/apps/web-antd/src/views/license/license/data.ts @@ -47,10 +47,11 @@ export function useFormSchema(): VbenFormSchema[] { customerList.value = await getCustomerList(); return customerList.value; }, + allowClear: true, fieldNames: { label: 'name', value: 'id' }, showSearch: true, filterOption: (input: string, option: any) => - option.label.toLowerCase().includes(input.toLowerCase()), + option.name.toLowerCase().includes(input.toLowerCase()), }, }, { @@ -60,10 +61,11 @@ export function useFormSchema(): VbenFormSchema[] { component: 'Select', componentProps: { options: projectList, + allowClear: true, fieldNames: { label: 'name', value: 'id' }, showSearch: true, filterOption: (input: string, option: any) => - option.label.toLowerCase().includes(input.toLowerCase()), + option.name.toLowerCase().includes(input.toLowerCase()), }, dependencies: { componentProps: async (values) => { @@ -214,22 +216,6 @@ export function useFormSchema(): VbenFormSchema[] { /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { return [ - { - fieldName: 'customerId', - label: $t('license.customer'), - component: 'Input', - componentProps: { - allowClear: true, - }, - }, - { - fieldName: 'projectId', - label: $t('license.project'), - component: 'Input', - componentProps: { - allowClear: true, - }, - }, { fieldName: 'serialNo', label: 'SN', @@ -238,6 +224,75 @@ export function useGridFormSchema(): VbenFormSchema[] { allowClear: true, }, }, + { + fieldName: 'customerId', + label: $t('license.customer'), + component: 'ApiSelect', + componentProps: { + api: async () => { + customerList.value = await getCustomerList(); + return customerList.value; + }, + allowClear: true, + fieldNames: { label: 'name', value: 'id' }, + showSearch: true, + filterOption: (input: string, option: any) => + option.name.toLowerCase().includes(input.toLowerCase()), + }, + }, + { + fieldName: 'applicant', + label: $t('license.applicant'), + component: 'ApiSelect', + componentProps: { + allowClear: true, + api: async () => { + const data = await getSimpleUserList(); + return data.map((item) => ({ + label: item.nickname, + value: item.id, + })); + }, + showSearch: true, + filterOption: (input: string, option: any) => + option.label.toLowerCase().includes(input.toLowerCase()), + }, + }, + { + fieldName: 'approver', + label: $t('license.approver'), + component: 'ApiSelect', + componentProps: { + allowClear: true, + api: async () => { + const data = await getLicenseAdminList(); + return data.map((item) => ({ + label: item.nickname, + value: item.id, + })); + }, + showSearch: true, + filterOption: (input: string, option: any) => + option.label.toLowerCase().includes(input.toLowerCase()), + }, + }, + // { + // fieldName: 'projectId', + // label: $t('license.project'), + // component: 'Input', + // componentProps: { + // allowClear: true, + // }, + // }, + { + fieldName: 'status', + label: $t('license.status'), + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.LIC_LICENSE_STATUS, 'number'), + }, + }, { fieldName: 'expiryDate', label: $t('license.expiryDate'), @@ -292,24 +347,6 @@ export function useGridFormSchema(): VbenFormSchema[] { // allowClear: true, // }, // }, - { - fieldName: 'applicant', - label: $t('license.applicant'), - component: 'ApiSelect', - componentProps: { - allowClear: true, - api: async () => { - const data = await getSimpleUserList(); - return data.map((item) => ({ - label: item.nickname, - value: item.id, - })); - }, - showSearch: true, - filterOption: (input: string, option: any) => - option.label.toLowerCase().includes(input.toLowerCase()), - }, - }, { fieldName: 'applicationTime', label: $t('license.applicationTime'), @@ -319,33 +356,6 @@ export function useGridFormSchema(): VbenFormSchema[] { allowClear: true, }, }, - { - fieldName: 'approver', - label: $t('license.approver'), - component: 'ApiSelect', - componentProps: { - allowClear: true, - api: async () => { - const data = await getLicenseAdminList(); - return data.map((item) => ({ - label: item.nickname, - value: item.id, - })); - }, - showSearch: true, - filterOption: (input: string, option: any) => - option.label.toLowerCase().includes(input.toLowerCase()), - }, - }, - { - fieldName: 'status', - label: $t('license.status'), - component: 'Select', - componentProps: { - allowClear: true, - options: getDictOptions(DICT_TYPE.LIC_LICENSE_STATUS, 'number'), - }, - }, // { // fieldName: 'remark', // label: $t('license.remark'), diff --git a/apps/web-antd/src/views/license/project/data.ts b/apps/web-antd/src/views/license/project/data.ts index 633d4ae..3d4364d 100644 --- a/apps/web-antd/src/views/license/project/data.ts +++ b/apps/web-antd/src/views/license/project/data.ts @@ -192,6 +192,58 @@ export function useFormSchema(): VbenFormSchema[] { /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { return [ + { + fieldName: 'serialNo', + label: 'SN', + component: 'Input', + componentProps: { + allowClear: true, + }, + }, + { + fieldName: 'customerId', + label: $t('project.belongCustomer'), + component: 'ApiSelect', + componentProps: { + api: async () => { + const data = await getCustomerList(); + return data.map((item) => ({ + // label: `${item.name}(${item.code})`, + label: item.name, + value: item.id, + })); + }, + showSearch: true, + filterOption: (input: string, option: any) => + option.label.toLowerCase().includes(input.toLowerCase()), + }, + }, + { + fieldName: 'status', + label: $t('project.status'), + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.LIC_PROJECT_STATUS, 'number'), + }, + }, + { + fieldName: 'technicalOwner', + label: $t('project.technicalOwner'), + component: 'Input', + componentProps: { + allowClear: true, + }, + }, + { + fieldName: 'businessStatus', + label: $t('project.businessStatus'), + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.LIC_BUSINESS_STATUS, 'number'), + }, + }, { fieldName: 'name', label: $t('project.name'), @@ -216,15 +268,6 @@ export function useGridFormSchema(): VbenFormSchema[] { allowClear: true, }, }, - { - fieldName: 'businessStatus', - label: $t('project.businessStatus'), - component: 'Select', - componentProps: { - allowClear: true, - options: getDictOptions(DICT_TYPE.LIC_BUSINESS_STATUS, 'number'), - }, - }, { fieldName: 'businessOwner', label: $t('project.businessOwner'), @@ -241,30 +284,6 @@ export function useGridFormSchema(): VbenFormSchema[] { allowClear: true, }, }, - { - fieldName: 'technicalOwnerA', - label: $t('project.technicalOwnerA'), - component: 'Input', - componentProps: { - allowClear: true, - }, - }, - { - fieldName: 'technicalOwnerB', - label: $t('project.technicalOwnerB'), - component: 'Input', - componentProps: { - allowClear: true, - }, - }, - { - fieldName: 'technicalOwnerC', - label: $t('project.technicalOwnerC'), - component: 'Input', - componentProps: { - allowClear: true, - }, - }, // { // fieldName: 'startTime', // label: $t('project.startTime'), @@ -283,23 +302,14 @@ export function useGridFormSchema(): VbenFormSchema[] { // allowClear: true, // }, // }, - { - fieldName: 'status', - label: $t('project.status'), - component: 'Select', - componentProps: { - allowClear: true, - options: getDictOptions(DICT_TYPE.LIC_PROJECT_STATUS, 'number'), - }, - }, - { - fieldName: 'envInfo', - label: $t('project.envInfo'), - component: 'Input', - componentProps: { - allowClear: true, - }, - }, + // { + // fieldName: 'envInfo', + // label: $t('project.envInfo'), + // component: 'Input', + // componentProps: { + // allowClear: true, + // }, + // }, { fieldName: 'createTime', label: $t('project.creationTime'), @@ -345,7 +355,7 @@ export function useGridColumns( minWidth: 120, }, { - field: 'sn', + field: 'serialNo', title: 'SN', minWidth: 120, },