import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import { string } from 'vue-types' const trueFalse = [{ label: '是', value: true }, { label: '否', value: false }] // 表单校验 export const DynamicRuleRules = reactive({ description: [ required, { max: 1024, message: '不得超过1024个字符', trigger: 'blur' }, ] }) export const DynamicRule = useCrudSchemas(reactive([ { label: '编码', field: 'code', sort: 'custom', isSearch: true, isForm: false, fixed: 'left' }, { label: '描述', field: 'description', sort: 'custom', isSearch: true }, { label: '是否可用', field: 'available', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, table: { width: 110 } }, { label: '操作', field: 'action', isDetail: false, isForm: false, table: { width: 330, fixed: 'right' }, } ]))