import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const WorkstationRules = reactive({ code: [required], name: [required] }) export const Workstation = useCrudSchemas(reactive([ { label: '代码', field: 'code', sort: 'custom', isSearch: true }, { label: '名称', field: 'name', sort: 'custom', isSearch: true }, { label: '车间代码', field: 'workshopCode', sort: 'custom', isSearch: true, isForm: false }, { label: '生产线代码', field: 'productionLineCode', sort: 'custom', isSearch: true, isForm: false }, { label: '班组代码', field: 'teamCode', sort: 'custom', isSearch: true, isForm: false }, { 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: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))