import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const SelectedSetRules = reactive({ code: [required], available: [required], concurrencyStamp: [required] }) export const SelectedSet = useCrudSchemas(reactive([ { label: 'id', field: 'id', sort: 'custom', isForm: false }, { label: '编码', field: 'code', sort: 'custom', isSearch: true }, { label: '描述', field: 'describe', sort: 'custom', isSearch: true }, { label: '分类', field: 'classification', sort: 'custom', isSearch: true }, { label: '是否可用', field: 'available', 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: 'deletionTime', 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: '删除者ID', field: 'deleterId', sort: 'custom', isSearch: true }, { label: '扩展属性', field: 'extraProperties', sort: 'custom', isSearch: true }, { label: '并发乐观锁', field: 'concurrencyStamp', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '地点ID', field: 'siteId', sort: 'custom', isSearch: true }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))