import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const ItemwarehouseRules = reactive({ itemCode: [required], warehouseCode: [required], manageMode: [required], packUnit: [required], available: [required], }) export const Itemwarehouse = useCrudSchemas(reactive([ { label: 'id', field: 'id', sort: 'custom', isForm: false, }, { label: '物品代码', field: 'itemCode', sort: 'custom', isSearch: true, }, { label: '区域代码', field: 'warehouseCode', sort: 'custom', isSearch: true, }, { label: '管理精度', field: 'manageMode', sort: 'custom', isSearch: true, }, { label: '入库包装规格', field: 'packUnit', sort: 'custom', }, { label: '是否可用', field: 'available', sort: 'custom', }, { label: '生效时间', field: 'activeTime', sort: 'custom', formatter: dateFormatter, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } }, }, { label: '失效时间', field: 'expireTime', sort: 'custom', formatter: dateFormatter, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } }, }, { label: '备注', field: 'remark', sort: 'custom', }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, isForm: false, }, { label: '删除时间', field: 'deletionTime', sort: 'custom', formatter: dateFormatter, isForm: false, }, { label: '删除者ID', field: 'deleterId', sort: 'custom', isForm: false, }, { label: '扩展属性', field: 'extraProperties', sort: 'custom', isForm: false, }, { label: '并发乐观锁', field: 'concurrencyStamp', sort: 'custom', isForm: false, }, { label: '地点ID', field: 'siteId', sort: 'custom', isForm: false, }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))