import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const EquipmentSpotCheckRecordDetailRules = reactive({ number: [required], masterId: [required], name: [required], concurrencyStamp: [required] }) export const EquipmentSpotCheckRecordDetail = useCrudSchemas(reactive([ { label: '点检工单号', field: 'number', sort: 'custom', isSearch: true }, // { // label: '主表', // field: 'masterId', // sort: 'custom', // isSearch: false, // form: { // component: 'InputNumber', // value: 0 // } // }, { label: '完成时间', field: 'completionTime', sort: 'custom', formatter: dateFormatter, isSearch: false, 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: false }, { label: '结果枚举', field: 'result', sort: 'custom', dictType: DICT_TYPE.IS_COMPLETED, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: false }, { label: '名称', field: 'name', sort: 'custom', isSearch: false }, { label: '点检内容', field: 'content', sort: 'custom', isSearch: false, form: { component: 'Editor', componentProps: { valueHtml: '', height: 200 } } }, { label: '点检部位', field: 'equipmentParts', sort: 'custom', isSearch: true }, { label: '点检方法', field: 'methods', sort: 'custom', isSearch: false }, { 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' } } ]))