From a31d0fa349b12afcd291e544dae1f19c6028b1b9 Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Mon, 25 Aug 2025 18:36:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E9=A1=B9=E7=9B=AE=EF=BC=9B=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8D=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/license/customer/index.ts | 7 ++++ .../web-antd/src/api/license/project/index.ts | 10 +++++ .../src/locales/langs/en-US/license.json | 2 + .../src/locales/langs/en-US/project.json | 4 +- .../src/locales/langs/zh-CN/license.json | 4 +- .../src/locales/langs/zh-CN/project.json | 4 +- .../src/views/license/license/data.ts | 23 ++++++---- .../src/views/license/project/data.ts | 42 +++++++++---------- 8 files changed, 61 insertions(+), 35 deletions(-) diff --git a/apps/web-antd/src/api/license/customer/index.ts b/apps/web-antd/src/api/license/customer/index.ts index f4a2975..f664ab4 100644 --- a/apps/web-antd/src/api/license/customer/index.ts +++ b/apps/web-antd/src/api/license/customer/index.ts @@ -47,6 +47,13 @@ export function getCustomerList() { return requestClient.get('/license/customer/list'); } +/** 查询可选择的客户列表 */ +export function getLicenseCustomerList() { + return requestClient.get( + '/license/customer/license-list', + ); +} + /** 查询客户详情 */ export function getCustomer(id: number) { return requestClient.get( diff --git a/apps/web-antd/src/api/license/project/index.ts b/apps/web-antd/src/api/license/project/index.ts index 830b841..0a2b165 100644 --- a/apps/web-antd/src/api/license/project/index.ts +++ b/apps/web-antd/src/api/license/project/index.ts @@ -43,6 +43,16 @@ export function getProjectList(params: any) { }); } +/** 查询可选择的项目列表 */ +export function getLicenseProjectList(params: any) { + return requestClient.get( + '/license/project/license-list', + { + params, + }, + ); +} + /** 查询项目详情 */ export function getProject(id: number) { return requestClient.get(`/license/project/get?id=${id}`); diff --git a/apps/web-antd/src/locales/langs/en-US/license.json b/apps/web-antd/src/locales/langs/en-US/license.json index c7201bf..c764dac 100644 --- a/apps/web-antd/src/locales/langs/en-US/license.json +++ b/apps/web-antd/src/locales/langs/en-US/license.json @@ -9,6 +9,8 @@ "licenseContent": "License Content", "applicant": "Applicant", "approver": "License Administrator", + "approverName": "Approver", + "approveTime": "Approval Time", "status": "Status", "remark": "Remark", "creationTime": "Creation Time", 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 debb9d3..3627b65 100644 --- a/apps/web-antd/src/locales/langs/en-US/project.json +++ b/apps/web-antd/src/locales/langs/en-US/project.json @@ -23,6 +23,6 @@ "progress": "Comment", "updateTime": "Last Modified Time", "commentNum": "Comment Count", - "softwareVersion": "Operating System Platform", - "operatingSystem": "Software Version" + "softwareVersion": "Software Version", + "operatingSystem": "Operating System Platform" } diff --git a/apps/web-antd/src/locales/langs/zh-CN/license.json b/apps/web-antd/src/locales/langs/zh-CN/license.json index 19f2d19..2fffbd7 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/license.json +++ b/apps/web-antd/src/locales/langs/zh-CN/license.json @@ -9,6 +9,8 @@ "licenseContent": "License内容", "applicant": "申请人", "approver": "License管理员", + "approverName": "审批人", + "approveTime": "审批时间", "status": "状态", "remark": "说明", "creationTime": "创建时间", @@ -35,5 +37,5 @@ "reapply": "重新申请", "reapplyAction": "重新申请{0}", "history": "历史", - "applyCount": "申请次数" + "applyCount": "license申请次数" } 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 f58cff6..e8d50a1 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/project.json +++ b/apps/web-antd/src/locales/langs/zh-CN/project.json @@ -23,6 +23,6 @@ "progress": "评论", "updateTime": "最后修改时间", "commentNum": "评论数", - "softwareVersion": "操作系统平台", - "operatingSystem": "软件版本" + "softwareVersion": "软件版本", + "operatingSystem": "操作系统平台" } diff --git a/apps/web-antd/src/views/license/license/data.ts b/apps/web-antd/src/views/license/license/data.ts index c5cb6be..3a26021 100644 --- a/apps/web-antd/src/views/license/license/data.ts +++ b/apps/web-antd/src/views/license/license/data.ts @@ -12,9 +12,9 @@ import { formatDate, formatDateTime } from '@vben/utils'; import dayjs, { Dayjs } from 'dayjs'; import { z } from '#/adapter/form'; -import { getCustomerList } from '#/api/license/customer'; +import { getLicenseCustomerList } from '#/api/license/customer'; import { isLicenseSnUnique } from '#/api/license/license'; -import { getProjectList } from '#/api/license/project'; +import { getLicenseProjectList } from '#/api/license/project'; import { getLicenseAdminList, getSimpleUserList } from '#/api/system/user'; import { DictTag } from '#/components/dict-tag'; import { $t } from '#/locales'; @@ -46,7 +46,7 @@ export function useFormSchema(): VbenFormSchema[] { }, componentProps: { api: async () => { - customerList.value = await getCustomerList(); + customerList.value = await getLicenseCustomerList(); return customerList.value; }, allowClear: true, @@ -71,7 +71,7 @@ export function useFormSchema(): VbenFormSchema[] { }, dependencies: { componentProps: async (values) => { - projectList.value = await getProjectList({ + projectList.value = await getLicenseProjectList({ customerId: values.customerId, }); const hasProject = projectList.value.find((project) => { @@ -304,12 +304,12 @@ export function useGridColumns(): VxeTableGridOptions['colum return [ { field: 'customerName', - title: $t('license.customer'), + title: $t('customer.customerName'), minWidth: 120, }, { field: 'projectName', - title: $t('license.project'), + title: $t('project.name'), minWidth: 120, }, { @@ -367,7 +367,7 @@ export function useGridColumns(): VxeTableGridOptions['colum { field: 'applyCount', title: $t('license.applyCount'), - minWidth: 70, + minWidth: 120, }, { field: 'operation', @@ -384,11 +384,11 @@ export function useDetailSchema(): DescriptionItemSchema[] { return [ { field: 'customerName', - label: $t('license.customer'), + label: $t('customer.customerName'), }, { field: 'projectName', - label: $t('license.project'), + label: $t('project.name'), }, { field: 'serialNo', @@ -465,6 +465,11 @@ export function useDetailSchema(): DescriptionItemSchema[] { return formatDateTime(data?.applicationTime) as string; }, }, + { + field: 'approverName', + label: $t('license.approverName'), + hidden: (data) => data.status !== 3, + }, { field: 'status', label: $t('license.status'), diff --git a/apps/web-antd/src/views/license/project/data.ts b/apps/web-antd/src/views/license/project/data.ts index 90cda5e..a53d220 100644 --- a/apps/web-antd/src/views/license/project/data.ts +++ b/apps/web-antd/src/views/license/project/data.ts @@ -225,15 +225,6 @@ export function useFormSchema(): VbenFormSchema[] { options: getDictOptions(DICT_TYPE.LIC_ENV_INFO, 'number'), }, }, - { - fieldName: 'softwareVersion', - label: $t('project.softwareVersion'), - rules: 'required', - component: 'Select', - componentProps: { - options: getDictOptions(DICT_TYPE.LIC_SOFTWARE_VERSION, 'number'), - }, - }, { fieldName: 'operatingSystem', label: $t('project.operatingSystem'), @@ -243,6 +234,15 @@ export function useFormSchema(): VbenFormSchema[] { options: getDictOptions(DICT_TYPE.LIC_OPERATING_SYSTEM, 'number'), }, }, + { + fieldName: 'softwareVersion', + label: $t('project.softwareVersion'), + rules: 'required', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.LIC_SOFTWARE_VERSION, 'number'), + }, + }, ]; } @@ -409,7 +409,7 @@ export function useGridColumns( }, { field: 'customerName', - title: $t('project.belongCustomer'), + title: $t('customer.customerName'), minWidth: 120, }, { @@ -490,16 +490,6 @@ export function useGridColumns( props: { type: DICT_TYPE.LIC_ENV_INFO }, }, }, - { - field: 'softwareVersion', - title: $t('project.softwareVersion'), - visible: false, - minWidth: 120, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.LIC_SOFTWARE_VERSION }, - }, - }, { field: 'operatingSystem', title: $t('project.operatingSystem'), @@ -510,6 +500,16 @@ export function useGridColumns( props: { type: DICT_TYPE.LIC_OPERATING_SYSTEM }, }, }, + { + field: 'softwareVersion', + title: $t('project.softwareVersion'), + visible: false, + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.LIC_SOFTWARE_VERSION }, + }, + }, // { // field: 'remark', // title: $t('project.remarks'), @@ -524,7 +524,7 @@ export function useGridColumns( { field: 'applyCount', title: $t('license.applyCount'), - minWidth: 70, + minWidth: 120, }, { field: 'updateTime',