feat: 首页调整

This commit is contained in:
caiyuchao
2025-07-15 19:47:39 +08:00
parent a2e42c62ad
commit d938a59d2b
3 changed files with 107 additions and 401 deletions

View File

@@ -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<ProjectApi.Project>();
/** 新增/修改的表单 */
@@ -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',