feat: 优化大屏

This commit is contained in:
fyy
2025-08-05 17:07:10 +08:00
parent c847bd29e1
commit 2beb771185
24 changed files with 1671 additions and 1481 deletions

View File

@@ -4,146 +4,6 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'userId',
label: '用户ID关联用户表',
},
{
component: 'Input',
fieldName: 'username',
label: '申请人姓名',
},
{
component: 'Input',
fieldName: 'departmentId',
label: '部门ID关联部门表',
},
{
component: 'Input',
fieldName: 'departmentName',
label: '部门名称',
},
{
component: 'Select',
componentProps: {
},
fieldName: 'leaveType',
label: '请假类型',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'startTime',
label: '开始时间',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'endTime',
label: '结束时间',
},
{
component: 'Input',
fieldName: 'totalDuration',
label: '合计时间如3天5个小时',
},
{
component: 'Textarea',
fieldName: 'reason',
label: '请假事由',
},
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_SQZT 便于维护
options: getDictOptions('wy_sqzt'),
},
fieldName: 'status',
label: '申请状态',
},
{
component: 'Input',
fieldName: 'searchValue',
label: '搜索值',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '',
field: 'id',
},
{
title: '用户ID关联用户表',
field: 'userId',
},
{
title: '申请人姓名',
field: 'username',
},
{
title: '部门ID关联部门表',
field: 'departmentId',
},
{
title: '部门名称',
field: 'departmentName',
},
{
title: '请假类型',
field: 'leaveType',
},
{
title: '开始时间',
field: 'startTime',
},
{
title: '结束时间',
field: 'endTime',
},
{
title: '合计时间如3天5个小时',
field: 'totalDuration',
},
{
title: '请假事由',
field: 'reason',
},
{
title: '申请状态',
field: 'status',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_SQZT 便于维护
return renderDict(row.status, 'wy_sqzt');
},
},
},
{
title: '搜索值',
field: 'searchValue',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
@@ -156,24 +16,16 @@ export const modalSchema: FormSchemaGetter = () => [
},
},
{
label: '用户ID关联用户表',
fieldName: 'userId',
component: 'Input',
},
{
label: '申请人姓名',
label: '姓名',
fieldName: 'username',
component: 'Input',
rules:'required'
},
{
label: '部门ID关联部门表',
label: '部门',
fieldName: 'departmentId',
component: 'Input',
},
{
label: '部门名称',
fieldName: 'departmentName',
component: 'Input',
component: 'ApiSelect',
rules:'required'
},
{
label: '请假类型',
@@ -181,6 +33,7 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Select',
componentProps: {
},
rules:'required'
},
{
label: '开始时间',
@@ -191,6 +44,8 @@ export const modalSchema: FormSchemaGetter = () => [
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules:'required'
},
{
label: '结束时间',
@@ -201,29 +56,19 @@ export const modalSchema: FormSchemaGetter = () => [
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules:'required'
},
{
label: '合计时间如3天5个小时',
label: '合计时间',
fieldName: 'totalDuration',
component: 'Input',
disabled:true,
rules:'required'
},
{
label: '请假事由',
fieldName: 'reason',
component: 'Textarea',
},
{
label: '申请状态',
fieldName: 'status',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_SQZT 便于维护
options: getDictOptions('wy_sqzt'),
},
},
{
label: '搜索值',
fieldName: 'searchValue',
component: 'Input',
},
rules:'required'
}
];