import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const TableDataExtendedAttributeRules = reactive({ tableName: [required], dataId: [required], fieldName: [required], concurrencyStamp: [required] }) export const TableDataExtendedAttribute = useCrudSchemas(reactive([ { label: 'id', field: 'id', sort: 'custom', isForm: false }, { label: '表名称', field: 'tableName', sort: 'custom', isSearch: true }, { label: '数据', field: 'dataId', sort: 'custom', isSearch: true }, { label: '字段名称', field: 'fieldName', sort: 'custom', isSearch: true }, { label: '字段值', field: 'fieldVal', 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: 'siteId', sort: 'custom', isSearch: true }, { label: '是否可用', field: 'available', sort: 'custom', isSearch: true }, { label: '部门', field: 'departmentCode', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '备注', field: 'remark', 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' } } ]))