import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const QadCostcentreRules = reactive({ code: [required], usageDescription: [required], available: [required], concurrencyStamp: [required], }) export const QadCostcentre = useCrudSchemas(reactive([ { label: 'id', field: 'id', sort: 'custom', isForm: false, isTable:false, }, { label: '成本中心ID', field: 'costcentreId', sort: 'custom', isSearch: false, }, { label: '成本中心代码', field: 'costcentreCode', sort: 'custom', isSearch: true, }, { label: '成本中心描述', field: 'costcentreDescription', sort: 'custom', isSearch: false, form: { component: 'Editor', componentProps: { valueHtml: '', height: 200 } }, }, { label: '启用', field: 'costcentreActive', sort: 'custom', isSearch: false, }, { label: '成本中心类型', field: 'costcentreType', sort: 'custom', isSearch: false, form: { component: 'SelectV2' }, }, { label: '是否可用', field: 'available', sort: 'custom', isSearch: false, dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isTable: true, table: { width: 120 }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '备注', field: 'remark', sort: 'custom', isSearch: false, }, { label: '创建时间', field: 'createTime', 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')] } }, isForm: false, }, { label: '创建者', field: 'creator', table: { width: 130 }, isForm: false, isTable: true }, { label: '最后更新时间', field: 'updateTime', sort: 'custom', isDetail: true, isForm: false, isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 180 }, form: { component: 'DatePicker', componentProps: { style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } } }, { label: '最后更新者', field: 'updater', isDetail: true, isForm: false, isTable: true, table: { width: 150 } }, { label: '删除时间', field: 'deletionTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isTable: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: '删除者ID', field: 'deleterId', sort: 'custom', isSearch: false, isTable:false, }, { label: '扩展属性', field: 'extraProperties', sort: 'custom', isSearch: false, isTable:false, }, { label: '并发乐观锁', field: 'concurrencyStamp', sort: 'custom', isSearch: false, isTable:false, form: { component: 'InputNumber', value: 0 }, }, { label: '地点ID', field: 'siteId', sort: 'custom', isSearch: false, isTable:false, }, { label: '操作', field: 'action', isForm: false, isTable:false, table: { width: 150, fixed: 'right' } } ]))