134 lines
2.3 KiB
TypeScript
134 lines
2.3 KiB
TypeScript
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||
|
|
||
|
|
||
|
export const querySchema: FormSchemaGetter = () => [
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'meetId',
|
||
|
label: '会议室id',
|
||
|
},
|
||
|
{
|
||
|
component: 'Textarea',
|
||
|
fieldName: 'projectName',
|
||
|
label: '产品名称',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'price',
|
||
|
label: '单价',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'unit',
|
||
|
label: '单位',
|
||
|
},
|
||
|
{
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
},
|
||
|
fieldName: 'type',
|
||
|
label: '类型',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'state',
|
||
|
label: '状态',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
||
|
export const columns: VxeGridProps['columns'] = [
|
||
|
{ type: 'checkbox', width: 60 },
|
||
|
{
|
||
|
title: '主键',
|
||
|
field: 'id',
|
||
|
},
|
||
|
{
|
||
|
title: '会议室id',
|
||
|
field: 'meetId',
|
||
|
},
|
||
|
{
|
||
|
title: '产品名称',
|
||
|
field: 'projectName',
|
||
|
},
|
||
|
{
|
||
|
title: '单价',
|
||
|
field: 'price',
|
||
|
},
|
||
|
{
|
||
|
title: '单位',
|
||
|
field: 'unit',
|
||
|
},
|
||
|
{
|
||
|
title: '类型',
|
||
|
field: 'type',
|
||
|
},
|
||
|
{
|
||
|
title: '状态',
|
||
|
field: 'state',
|
||
|
},
|
||
|
{
|
||
|
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: '会议室id',
|
||
|
fieldName: 'meetId',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '产品名称',
|
||
|
fieldName: 'projectName',
|
||
|
component: 'Textarea',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '单价',
|
||
|
fieldName: 'price',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '单位',
|
||
|
fieldName: 'unit',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '类型',
|
||
|
fieldName: 'type',
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
},
|
||
|
rules: 'selectRequired',
|
||
|
},
|
||
|
{
|
||
|
label: '状态',
|
||
|
fieldName: 'state',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
];
|