Files
admin-vben5/apps/web-antd/src/views/property/assetManage/application/data.ts

168 lines
3.5 KiB
TypeScript
Raw Normal View History

2025-06-23 09:27:28 +08:00
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
2025-06-25 11:37:28 +08:00
import { renderDict } from "#/utils/render";
import { DictEnum } from '@vben/constants';
2025-08-04 17:27:37 +08:00
import {getDictOptions} from "#/utils/dict";
2025-06-25 11:37:28 +08:00
2025-06-23 09:27:28 +08:00
export const querySchema: FormSchemaGetter = () => [
2025-08-04 17:27:37 +08:00
// {
// component: 'Input',
// fieldName: 'assetId',
// label: '资产id',
// },
// {
// component: 'Input',
// fieldName: 'userId',
// label: '领用人id',
// },
// {
// component: 'Input',
// fieldName: 'number',
// label: '数量',
// },
2025-06-23 09:27:28 +08:00
{
2025-08-04 17:27:37 +08:00
component: 'Select',
componentProps:{
options:getDictOptions(DictEnum.WY_ZCSHZT)
2025-06-23 09:27:28 +08:00
},
2025-08-04 17:27:37 +08:00
fieldName: 'state',
2025-08-06 13:57:40 +08:00
label: '审核状态',
2025-06-23 09:27:28 +08:00
},
2025-08-04 17:27:37 +08:00
// {
// component: 'Input',
// fieldName: 'acceptanceUserId',
// label: '审批人id',
// },
// {
// component: 'DatePicker',
// componentProps: {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// },
// fieldName: 'acceptanceTime',
// label: '审批时间',
// },
// {
// component: 'DatePicker',
// componentProps: {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// },
// fieldName: 'applicationTime',
// label: '申请时间',
// },
2025-06-23 09:27:28 +08:00
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
2025-06-25 11:37:28 +08:00
title: '资产',
field: 'assetName',
2025-06-23 09:27:28 +08:00
},
{
2025-06-25 11:37:28 +08:00
title: '领用人',
field: 'userName',
2025-06-23 09:27:28 +08:00
},
{
title: '数量',
field: 'number',
},
{
2025-08-04 17:27:37 +08:00
title: '申请时间',
field: 'applicationTime',
},
{
2025-08-06 13:57:40 +08:00
title: '审核状态',
2025-06-23 09:27:28 +08:00
field: 'state',
2025-06-25 11:37:28 +08:00
slots: {
default: ({ row }) => {
return renderDict(row.state, DictEnum.WY_ZCSHZT);
},
},
2025-06-23 09:27:28 +08:00
},
{
2025-06-25 11:37:28 +08:00
title: '审批人',
field: 'acceptanceUserName',
2025-06-23 09:27:28 +08:00
},
{
title: '审批时间',
field: 'acceptanceTime',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
2025-08-04 17:27:37 +08:00
label: '资产',
2025-06-23 09:27:28 +08:00
fieldName: 'assetId',
2025-06-25 09:27:33 +08:00
component: 'Select',
2025-08-04 17:27:37 +08:00
rules:'selectRequired'
2025-06-23 09:27:28 +08:00
},
{
2025-08-04 17:27:37 +08:00
label: '领用人',
2025-06-23 09:27:28 +08:00
fieldName: 'userId',
2025-06-25 09:27:33 +08:00
component: 'Select',
2025-08-04 17:27:37 +08:00
rules:'selectRequired'
2025-06-23 09:27:28 +08:00
},
{
label: '数量',
fieldName: 'number',
2025-08-04 17:27:37 +08:00
component: 'InputNumber',
componentProps:{
min:1,
},
rules:'required'
2025-06-23 09:27:28 +08:00
},
2025-06-25 09:27:33 +08:00
// {
// label: '状态',
// fieldName: 'state',
// component: 'Input',
// },
// {
// label: '审批人id',
// fieldName: 'acceptanceUserId',
// component: 'Input',
// },
// {
// label: '审批时间',
// fieldName: 'acceptanceTime',
// component: 'DatePicker',
// componentProps: {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// },
// },
// {
// label: '申请时间',
// fieldName: 'applicationTime',
// component: 'DatePicker',
// componentProps: {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// },
// },
2025-06-23 09:27:28 +08:00
];