import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const EquipmentShutdownRules = reactive({ equipmentCode: [required], operationDate: [required], concurrencyStamp: [required] }) export const EquipmentShutdown = useCrudSchemas(reactive([ { label: '设备编码', field: 'equipmentCode', sort: 'custom', isSearch: true }, { label: '操作日期', field: 'operationDate', 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: 'operationer', sort: 'custom', isSearch: true }, // { // label: '所属厂区编号', // field: 'factoryAreaCode', // sort: 'custom', // isSearch: true // }, { label: '车间编号', field: 'workshopCode', sort: 'custom', isSearch: true }, { label: '工段编号', field: 'workshopSectionCode', sort: 'custom', isSearch: false }, { label: '是否停机', field: 'status', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: false, form: { component: 'Radio' } }, { label: '设备停机原因', field: 'shutdownCause', sort: 'custom', isSearch: false }, { label: '备注', field: 'remark', sort: 'custom', isSearch: false }, // { // 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' } } ]))