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

111 lines
2.0 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";
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: 'id',
slots: {
default: ({rowIndex}) => {
return (rowIndex + 1).toString();
}
}
},
{
title: '仓库名称',
field: 'depotName',
},
{
title: '仓库类型',
field: 'modelType',
slots: {
default: ({row}) => {
return renderDict(row.modelType, 'wy_cclx')
}
}
},
{
title: '状态',
field: 'state',
slots: {default: 'state'}
},
{
title: '描述信息',
field: 'msg',
},
{
title: '创建时间',
field: 'createTime',
},
{
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',
rules:'required'
},
{
label: '仓库类型',
fieldName: 'modelType',
component: 'Select',
componentProps: {
options: getDictOptions('wy_cclx'),
},
rules:'selectRequired'
},
{
label: '描述信息',
fieldName: 'msg',
component: 'Textarea',
formItemClass:'col-span-2'
},
];