From d938a59d2b8c7dca8055f36b0d88e00ea2759407 Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Tue, 15 Jul 2025 19:47:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A6=96=E9=A1=B5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/license/customer/index.ts | 14 + apps/web-antd/src/views/dashboard/index.vue | 332 +++--------------- .../src/views/license/project/data.ts | 162 +++------ 3 files changed, 107 insertions(+), 401 deletions(-) diff --git a/apps/web-antd/src/api/license/customer/index.ts b/apps/web-antd/src/api/license/customer/index.ts index dc11683..f79ae36 100644 --- a/apps/web-antd/src/api/license/customer/index.ts +++ b/apps/web-antd/src/api/license/customer/index.ts @@ -16,6 +16,20 @@ export namespace CustomerApi { email: string; // 邮箱 remark: string; // 备注 } + + export interface Dashboard { + customerCount: number; + projectCount: number; + licenseCount: number; + userCount: number; + } +} + +/** 查询首页详情 */ +export function dashboard() { + return requestClient.get( + `/license/customer/dashboard`, + ); } /** 查询客户分页 */ diff --git a/apps/web-antd/src/views/dashboard/index.vue b/apps/web-antd/src/views/dashboard/index.vue index 9691035..170f0aa 100644 --- a/apps/web-antd/src/views/dashboard/index.vue +++ b/apps/web-antd/src/views/dashboard/index.vue @@ -1,309 +1,71 @@ diff --git a/apps/web-antd/src/views/license/project/data.ts b/apps/web-antd/src/views/license/project/data.ts index 6827c47..89dd0aa 100644 --- a/apps/web-antd/src/views/license/project/data.ts +++ b/apps/web-antd/src/views/license/project/data.ts @@ -12,13 +12,13 @@ import { isProjectCodeUnique, isProjectNameUnique, } from '#/api/license/project'; -import { getSimpleUserList } from '#/api/system/user'; +// import { getSimpleUserList } from '#/api/system/user'; import { $t } from '#/locales'; import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; const { hasAccessByCodes } = useAccess(); -const userList = await getSimpleUserList(); +// const userList = await getSimpleUserList(); export const formData = ref(); /** 新增/修改的表单 */ @@ -126,82 +126,37 @@ export function useFormSchema(): VbenFormSchema[] { fieldName: 'businessOwner', label: $t('project.businessOwner'), rules: 'required', - component: 'Select', - componentProps: { - options: userList, - allowClear: true, - showSearch: true, - fieldNames: { label: 'nickname', value: 'id' }, - filterOption: (input: string, option: any) => { - return option.nickname.toLowerCase().includes(input.toLowerCase()); - }, - }, + component: 'Input', }, { fieldName: 'customerOwner', label: $t('project.customerOwner'), rules: 'required', - component: 'Select', - componentProps: { - options: userList, - allowClear: true, - showSearch: true, - fieldNames: { label: 'nickname', value: 'id' }, - filterOption: (input: string, option: any) => { - return option.nickname.toLowerCase().includes(input.toLowerCase()); - }, - }, + component: 'Input', }, { fieldName: 'technicalOwnerA', label: $t('project.technicalOwnerA'), rules: 'required', - component: 'Select', - componentProps: { - options: userList, - allowClear: true, - showSearch: true, - fieldNames: { label: 'nickname', value: 'id' }, - filterOption: (input: string, option: any) => { - return option.nickname.toLowerCase().includes(input.toLowerCase()); - }, - }, + component: 'Input', }, { fieldName: 'technicalOwnerB', label: $t('project.technicalOwnerB'), - component: 'Select', - componentProps: { - options: userList, - allowClear: true, - showSearch: true, - fieldNames: { label: 'nickname', value: 'id' }, - filterOption: (input: string, option: any) => { - return option.nickname.toLowerCase().includes(input.toLowerCase()); - }, - }, + component: 'Input', }, { fieldName: 'technicalOwnerC', label: $t('project.technicalOwnerC'), - component: 'Select', - componentProps: { - options: userList, - allowClear: true, - showSearch: true, - fieldNames: { label: 'nickname', value: 'id' }, - filterOption: (input: string, option: any) => { - return option.nickname.toLowerCase().includes(input.toLowerCase()); - }, - }, + component: 'Input', }, { fieldName: 'startTime', label: $t('project.startTime'), component: 'DatePicker', + rules: 'required', componentProps: { - showTime: true, - format: 'YYYY-MM-DD HH:mm:ss', + format: 'YYYY-MM-DD', valueFormat: 'x', }, }, @@ -210,14 +165,14 @@ export function useFormSchema(): VbenFormSchema[] { label: $t('project.endTime'), component: 'DatePicker', componentProps: { - showTime: true, - format: 'YYYY-MM-DD HH:mm:ss', + format: 'YYYY-MM-DD', valueFormat: 'x', }, }, { fieldName: 'envInfo', label: $t('project.envInfo'), + rules: 'required', component: 'Input', }, // { @@ -273,91 +228,61 @@ export function useGridFormSchema(): VbenFormSchema[] { { fieldName: 'businessOwner', label: $t('project.businessOwner'), - component: 'Select', + component: 'Input', componentProps: { - options: userList, allowClear: true, - showSearch: true, - fieldNames: { label: 'nickname', value: 'id' }, - filterOption: (input: string, option: any) => { - return option.nickname.toLowerCase().includes(input.toLowerCase()); - }, }, }, { fieldName: 'customerOwner', label: $t('project.customerOwner'), - component: 'Select', + component: 'Input', componentProps: { - options: userList, allowClear: true, - showSearch: true, - fieldNames: { label: 'nickname', value: 'id' }, - filterOption: (input: string, option: any) => { - return option.nickname.toLowerCase().includes(input.toLowerCase()); - }, }, }, { fieldName: 'technicalOwnerA', label: $t('project.technicalOwnerA'), - component: 'Select', + component: 'Input', componentProps: { - options: userList, allowClear: true, - showSearch: true, - fieldNames: { label: 'nickname', value: 'id' }, - filterOption: (input: string, option: any) => { - return option.nickname.toLowerCase().includes(input.toLowerCase()); - }, }, }, { fieldName: 'technicalOwnerB', label: $t('project.technicalOwnerB'), - component: 'Select', + component: 'Input', componentProps: { - options: userList, allowClear: true, - showSearch: true, - fieldNames: { label: 'nickname', value: 'id' }, - filterOption: (input: string, option: any) => { - return option.nickname.toLowerCase().includes(input.toLowerCase()); - }, }, }, { fieldName: 'technicalOwnerC', label: $t('project.technicalOwnerC'), - component: 'Select', + component: 'Input', componentProps: { - options: userList, - allowClear: true, - showSearch: true, - fieldNames: { label: 'nickname', value: 'id' }, - filterOption: (input: string, option: any) => { - return option.nickname.toLowerCase().includes(input.toLowerCase()); - }, - }, - }, - { - fieldName: 'startTime', - label: $t('project.startTime'), - component: 'RangePicker', - componentProps: { - ...getRangePickerDefaultProps(), - allowClear: true, - }, - }, - { - fieldName: 'endTime', - label: $t('project.endTime'), - component: 'RangePicker', - componentProps: { - ...getRangePickerDefaultProps(), allowClear: true, }, }, + // { + // fieldName: 'startTime', + // label: $t('project.startTime'), + // component: 'RangePicker', + // componentProps: { + // ...getRangePickerDefaultProps(), + // allowClear: true, + // }, + // }, + // { + // fieldName: 'endTime', + // label: $t('project.endTime'), + // component: 'RangePicker', + // componentProps: { + // ...getRangePickerDefaultProps(), + // allowClear: true, + // }, + // }, { fieldName: 'status', label: $t('project.status'), @@ -412,13 +337,18 @@ export function useGridColumns( field: 'startTime', title: $t('project.startTime'), minWidth: 120, - formatter: 'formatDateTime', + formatter: 'formatDate', }, { field: 'contractCode', title: $t('project.contractCode'), minWidth: 120, }, + { + field: 'sn', + title: 'SN', + minWidth: 120, + }, { field: 'businessStatus', title: $t('project.businessStatus'), @@ -439,28 +369,28 @@ export function useGridColumns( }, }, { - field: 'businessOwnerName', + field: 'businessOwner', title: $t('project.businessOwner'), minWidth: 120, }, { - field: 'customerOwnerName', + field: 'customerOwner', title: $t('project.customerOwner'), visible: false, minWidth: 120, }, { - field: 'technicalOwnerAName', + field: 'technicalOwnerA', title: $t('project.technicalOwnerA'), minWidth: 120, }, { - field: 'technicalOwnerBName', + field: 'technicalOwnerB', title: $t('project.technicalOwnerB'), minWidth: 120, }, { - field: 'technicalOwnerCName', + field: 'technicalOwnerC', title: $t('project.technicalOwnerC'), minWidth: 120, }, @@ -469,7 +399,7 @@ export function useGridColumns( title: $t('project.endTime'), visible: false, minWidth: 120, - formatter: 'formatDateTime', + formatter: 'formatDate', }, { field: 'envInfo',