Files
admin-vben5/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/data.ts

80 lines
1.6 KiB
TypeScript
Raw Normal View History

2025-08-04 17:06:09 +08:00
import {type FormSchemaGetter, z} from '#/adapter/form';
2025-07-10 17:33:46 +08:00
import type { VxeGridProps } from '#/adapter/vxe-table';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'routeName',
2025-07-11 17:07:29 +08:00
label: '巡检路线名称',
2025-07-10 17:33:46 +08:00
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
2025-07-11 17:07:29 +08:00
title: '巡检路线名称',
field: 'routeName',
2025-07-10 17:33:46 +08:00
},
{
2025-07-11 17:07:29 +08:00
title: '创建时间',
field: 'createTime',
},
{
title: '排序',
field: 'sort',
2025-07-10 17:33:46 +08:00
},
{
title: '备注',
field: 'remark',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
2025-07-11 17:07:29 +08:00
label: '巡检路线名称',
2025-07-10 17:33:46 +08:00
fieldName: 'routeName',
component: 'Input',
rules: 'required',
},
2025-07-11 17:07:29 +08:00
{
label: '排序',
fieldName: 'sort',
component: 'Input',
rules: 'required',
},
2025-08-04 17:06:09 +08:00
{
label: '巡检点',
fieldName: 'pointId',
component: 'ApiSelect',
componentProps:{
mode: 'multiple',
},
rules: z.array(z.string()).min(1, { message: '请选择' }),
formItemClass: 'col-span-2',
},
2025-07-10 17:33:46 +08:00
{
label: '备注',
fieldName: 'remark',
2025-07-11 17:07:29 +08:00
component: 'Textarea',
2025-07-10 17:33:46 +08:00
},
];