import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const SubjectAccountRules = reactive({ code: [required], usageDescription: [required], costecentreId: [required], costecentreCode: [required], costecentreType: [required], projectId: [required], projectCode: [required], available: [required], concurrencyStamp: [required], }) export const SubjectAccount = useCrudSchemas(reactive([ { label: 'id', field: 'id', sort: 'custom', isForm: false, isTable:false, }, { label: '代码', field: 'code', sort: 'custom', isSearch: true, }, { label: '领用描述', field: 'usageDescription', sort: 'custom', isSearch: true, form: { component: 'Editor', componentProps: { valueHtml: '', height: 200 } }, }, { label: '成本中心ID', field: 'costecentreId', sort: 'custom', isSearch: false, isTable:false, }, { label: '成本中心代码', field: 'costecentreCode', sort: 'custom', isSearch: false, }, { label: '成本中心类型', field: 'costecentreType', sort: 'custom', isSearch: false, form: { component: 'SelectV2' }, }, { label: '项目ID', field: 'projectId', sort: 'custom', isSearch: false, isTable:false, }, { label: '项目代码', field: 'projectCode', sort: 'custom', isSearch: false, }, { label: '科目', field: 'address', sort: 'custom', isSearch: false, }, { label: '是否可用', field: 'available', sort: 'custom', }, { label: '备注', field: 'remark', sort: 'custom', }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, 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: 'deletionTime', sort: 'custom', formatter: dateFormatter, 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, form: { component: 'InputNumber', value: 0 }, isTable:false, }, { label: '地点ID', field: 'siteId', sort: 'custom', isSearch: false, isTable:false }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))