import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter2 } from '@/utils/formatTime' import { validateHanset, validateEmail } from '@/utils/validator' import { dateFormatter } from '@/utils/formatTime' import { validateTwoNum } from '@/utils/validator' const { t } = useI18n() // 国际化 /** * @returns {Array}质量通知主表 */ export const QualityNoticeMain = useCrudSchemas(reactive([ { label: '编码', field: 'number', sort: 'custom', isSearch: true, isForm: false, table: { width: 150, fixed: 'left' } }, { label: '类型', field: 'type', dictType: DICT_TYPE.QUALITY_NOTIFICATION_TYPE, sort: 'custom', isSearch: true, isForm: false, table: { width: 150 } }, { label: '描述', field: 'description', sort: 'custom', isSearch: false, isForm: false, table: { width: 150 } }, { label: '详情', field: 'detail', sort: 'custom', isSearch: false, isForm: false, table: { width: 150 } }, { label: '优先级', field: 'priority', sort: 'custom', isSearch: false, isForm: false, table: { width: 150 }, form: { componentProps: { disabled: true } }, }, { label: '状态', field: 'status', sort: 'custom', isSearch: false, isForm: false, table: { width: 150 }, form: { componentProps: { disabled: true } }, }, { label: '报告人', field: 'reporter', sort: 'custom', isSearch: false, isForm: false, table: { width: 150 }, form: { componentProps: { disabled: true } }, }, { label: '报告时间', field: 'reportTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isForm: 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' } }, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 150 } }, { label: '要求开始时间', field: 'requestStartTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isForm: 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' } }, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 150 } }, { label: '要求结束时间', field: 'requestEndTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isForm: 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' } }, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 150 } }, { label: '是否造成停机', field: 'whetherCausesMachineHalt', dictType: DICT_TYPE.FALSE_OR_TRUE, sort: 'custom', isSearch: false, isForm: false, table: { width: 150 } }, { label: '停机开始时间', field: 'machineHaltStartTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isForm: 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' } }, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 150 } }, { label: '停机结束时间', field: 'machineHaltEndTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isForm: 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' } }, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 150 } }, { label: '协调人', field: 'coordinator', sort: 'custom', isSearch: false, isForm: false, table: { width: 150 } }, { label: '任务模板编号', field: 'taskTemplateCode', sort: 'custom', isSearch: false, isForm: false, table: { width: 150 } }, { label: '完成时间', field: 'finishTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isForm: 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' } }, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 150 } }, { // reference_certificate_row label: '参考通知编号', field: 'referenceNoticeCode', sort: 'custom', isSearch: false, isForm: false, form: { component: 'InputNumber', value: 0 }, table: { width: 150 } }, { label: '操作', field: 'action', isDetail: false, isForm: false, table: { width: 200, fixed: 'right' } } ])) //表单校验 export const QualityNoticeMainRules = reactive({ useDecision: [required], })