import type {FormSchemaGetter} from '#/adapter/form'; import type {VxeGridProps} from '#/adapter/vxe-table'; import {getDictOptions} from "#/utils/dict"; export const querySchema: FormSchemaGetter = () => [ { component: 'Input', fieldName: 'name', label: '资产名称', }, { component: 'Select', fieldName: 'model', label: '资产类型', }, { component: 'Select', componentProps: { options: getDictOptions('wy_sf'), }, fieldName: 'type', label: '固定资产', }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ {type: 'checkbox', width: 60}, { title: '序号', field: 'id', slots: { default: ({ rowIndex }) => { return (rowIndex + 1).toString(); }, }, }, { title: '资产名称', field: 'name', }, { title: '资产类型', field: 'model', }, { title: '规格', field: 'specs', }, { title: '价格', field: 'price', }, { title: '库存', field: 'stock', }, { title: '计量单位', field: 'unit', }, { title: '仓库id', field: 'depotId', }, { title: '描述信息', field: 'msg', }, { title: '供应商id', field: 'suppliersId', }, { title: '入库时间', field: 'storageTime', }, { title: '固定资产', field: 'type', }, { title: '创建时间', field: 'createTime', }, { 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: 'name', component: 'Input', }, { label: '类型', fieldName: 'model', component: 'Textarea', }, { label: '规格', fieldName: 'specs', component: 'Textarea', }, { label: '价格', fieldName: 'price', component: 'Input', }, { label: '库存', fieldName: 'stock', component: 'Input', }, { label: '计量单位', fieldName: 'unit', component: 'Input', }, { label: '仓库id', fieldName: 'depotId', component: 'Input', }, { label: '描述信息', fieldName: 'msg', component: 'Textarea', }, { label: '供应商id', fieldName: 'suppliersId', component: 'Input', }, { label: '入库时间', fieldName: 'storageTime', component: 'DatePicker', componentProps: { showTime: true, format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss', }, }, { label: '固定资产类型', fieldName: 'type', component: 'Select', componentProps: {}, }, ];