import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const ApiMqErrorRules = reactive({ number: [required], type: [required], times: [required] }) export const ApiMqError = useCrudSchemas(reactive([ { label: '业务编号', field: 'number', sort: 'custom', isSearch: true }, { label: '类型', field: 'type', sort: 'custom', isSearch: true, form: { component: 'SelectV2' } }, { label: '内容', field: 'content', sort: 'custom', isSearch: true, form: { component: 'Editor', componentProps: { valueHtml: '', height: 200 } } }, { label: '执行次数', field: 'times', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '错误信息', field: 'errorMsg', sort: 'custom', isSearch: true, form: { component: 'Editor', componentProps: { valueHtml: '', height: 200 } } }, // { // 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: 'departmentCode', // sort: 'custom', // isSearch: true // }, { label: '创建时间', field: 'createTime', 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')] } }, isForm: false }, // // { // // label: '扩展属性', // // field: 'extraProperties', // // sort: 'custom', // // isSearch: true // // }, // // { // // label: '地点ID', // // field: 'siteId', // // sort: 'custom', // // isSearch: true // // }, // { // label: '乐观锁', // field: 'concurrencyStamp', // sort: 'custom', // isSearch: true, // form: { // component: 'InputNumber', // value: 0 // } // }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))