import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const EquipmentMaintenanceRecordDetailRules = reactive({ number: [required], masterId: [required], name: [required], equipmentParts: [required], concurrencyStamp: [required] }) export const EquipmentMaintenanceRecordDetail = useCrudSchemas(reactive([ { label: '保养工单号', field: 'number', sort: 'custom', isSearch: true }, { label: '主表', field: 'masterId', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '人数', field: 'peoples', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '预计分钟', field: 'estimatedMinutes', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '实际分钟', field: 'actualMinutes', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '责任人多选', field: 'chargePeoples', sort: 'custom', isSearch: true }, { label: '完成时间', field: 'completionTime', sort: 'custom', formatter: dateFormatter, isSearch: true, search: { component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'daterange', defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } } }, { label: '未完成原因', field: 'uncompletedCause', sort: 'custom', isSearch: true }, { label: '结果枚举', field: 'result', sort: 'custom', dictType: DICT_TYPE.IS_COMPLETED, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, form: { component: 'SelectV2' } }, { label: '保养名称', field: 'name', sort: 'custom', isSearch: true }, { label: '保养要求', field: 'content', sort: 'custom', isSearch: true, form: { component: 'Editor', componentProps: { valueHtml: '', height: 200 } } }, { label: '保养部位', field: 'equipmentParts', sort: 'custom', isSearch: true }, { label: '备注', field: 'remark', sort: 'custom', isSearch: true }, { label: '是否可用', field: 'available', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } } }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))