import type {FormSchemaGetter} from '#/adapter/form'; import type {VxeGridProps} from '#/adapter/vxe-table'; import {renderDict} from "#/utils/render"; import {getDictOptions} from "#/utils/dict"; import {z} from "#/adapter/form"; import {$t} from "@vben/locales"; export const querySchema: FormSchemaGetter = () => [ { component: 'Input', fieldName: 'depotName', label: '仓库名称', }, { component: 'Select', fieldName: 'modelType', label: '仓库类型', componentProps: { options: getDictOptions('wy_cclx'), }, }, { component: 'Select', fieldName: 'state', label: '状态', componentProps: { options: getDictOptions('wy_state'), }, }, ]; export const columns: VxeGridProps['columns'] = [ {type: 'checkbox', width: 60}, { title: '仓库名称', field: 'depotName', width:200 }, { title: '仓库类型', field: 'modelType', slots: { default: ({row}) => { return renderDict(row.modelType, 'wy_cclx') } }, width:180 }, { title: '状态', field: 'state', slots: {default: 'state'}, width:120 }, { title: '创建时间', field: 'createTime', }, { title: '描述信息', field: 'msg', minWidth:180, }, { field: 'action', fixed: 'right', slots: {default: 'action'}, title: '操作', width: 180, }, ]; export const modalSchema: FormSchemaGetter = () => [ { label: '主键', fieldName: 'id', component: 'Input', dependencies: { show: () => false, triggerFields: [''], }, }, { label: '仓库名称', fieldName: 'depotName', component: 'Input', rules: z.string().min(1,'请输入仓库名称').max(30, { message: '仓库名称过长' }), }, { label: '仓库类型', fieldName: 'modelType', component: 'Select', componentProps: { options: getDictOptions('wy_cclx'), }, rules:'selectRequired' }, { label: '描述信息', fieldName: 'msg', component: 'Textarea', formItemClass:'col-span-2' }, ];