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

107 lines
2.1 KiB
TypeScript
Raw Normal View History

2025-06-24 14:52:45 +08:00
import type {FormSchemaGetter} from '#/adapter/form';
import type {VxeGridProps} from '#/adapter/vxe-table';
import {renderDict} from "#/utils/render";
import {getDictOptions} from "#/utils/dict";
2025-08-12 13:41:46 +08:00
import {z} from "#/adapter/form";
import {$t} from "@vben/locales";
2025-06-24 14:52:45 +08:00
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'depotName',
label: '仓库名称',
},
{
component: 'Select',
fieldName: 'modelType',
label: '仓库类型',
componentProps: {
options: getDictOptions('wy_cclx'),
},
},
{
component: 'Select',
fieldName: 'state',
label: '状态',
componentProps: {
options: getDictOptions('wy_state'),
},
},
];
export const columns: VxeGridProps['columns'] = [
{type: 'checkbox', width: 60},
{
title: '仓库名称',
field: 'depotName',
2025-08-12 13:41:46 +08:00
width:200
2025-06-24 14:52:45 +08:00
},
{
title: '仓库类型',
field: 'modelType',
slots: {
default: ({row}) => {
return renderDict(row.modelType, 'wy_cclx')
}
2025-08-12 13:41:46 +08:00
},
width:180
2025-06-24 14:52:45 +08:00
},
{
title: '状态',
field: 'state',
2025-08-12 13:41:46 +08:00
slots: {default: 'state'},
width:120
2025-06-24 14:52:45 +08:00
},
{
title: '创建时间',
field: 'createTime',
},
2025-08-12 13:41:46 +08:00
{
title: '描述信息',
field: 'msg',
minWidth:180,
},
2025-06-24 14:52:45 +08:00
{
field: 'action',
fixed: 'right',
slots: {default: 'action'},
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '仓库名称',
fieldName: 'depotName',
component: 'Input',
2025-08-12 13:41:46 +08:00
rules: z.string().min(1,'请输入仓库名称').max(30, { message: '仓库名称过长' }),
2025-06-24 14:52:45 +08:00
},
{
label: '仓库类型',
fieldName: 'modelType',
component: 'Select',
componentProps: {
options: getDictOptions('wy_cclx'),
},
rules:'selectRequired'
},
{
label: '描述信息',
fieldName: 'msg',
component: 'Textarea',
formItemClass:'col-span-2'
},
];