import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; export const querySchema: FormSchemaGetter = () => [ { component: 'Input', fieldName: 'meterName', label: '水表名称', }, { component: 'Input', fieldName: 'meterCode', label: '设备编码', }, { component: 'Input', fieldName: 'factoryNo', label: '设备厂商', }, { component: 'Select', componentProps: { }, fieldName: 'meterType', label: '设备类型(1-电表,2-水表,3-气表)', }, { component: 'Input', fieldName: 'meterPurpose', label: '表用途(1-分表,2-总表,3-公摊表)', }, { component: 'Select', componentProps: { }, fieldName: 'shareType', label: '分摊类型', }, { component: 'Select', componentProps: { }, fieldName: 'payType', label: '付费类型(1-先付费,2-后付费)', }, { component: 'Input', fieldName: 'display', label: '当前表显示读数', }, { component: 'Input', fieldName: 'maxDisplay', label: '最大表显读数(超过归0)', }, { component: 'Input', fieldName: 'billingRate', label: '计费倍率', }, { component: 'Input', fieldName: 'surplus', label: '剩余量', }, { component: 'Input', fieldName: 'communicationState', label: '通信状态', }, { component: 'Input', fieldName: 'runningState', label: '运行状态', }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { title: '主键id', field: 'id', }, { title: '水表名称', field: 'meterName', }, { title: '设备编码', field: 'meterCode', }, { title: '设备厂商', field: 'factoryNo', }, { title: '设备类型(1-电表,2-水表,3-气表)', field: 'meterType', }, { title: '表用途(1-分表,2-总表,3-公摊表)', field: 'meterPurpose', }, { title: '分摊类型', field: 'shareType', }, { title: '付费类型(1-先付费,2-后付费)', field: 'payType', }, { title: '当前表显示读数', field: 'display', }, { title: '最大表显读数(超过归0)', field: 'maxDisplay', }, { title: '计费倍率', field: 'billingRate', }, { title: '剩余量', field: 'surplus', }, { title: '通信状态', field: 'communicationState', }, { title: '运行状态', field: 'runningState', }, { title: '备注', field: 'remark', }, { field: 'action', fixed: 'right', slots: { default: 'action' }, title: '操作', width: 180, }, ]; export const modalSchema: FormSchemaGetter = () => [ { label: '主键id', fieldName: 'id', component: 'Input', dependencies: { show: () => false, triggerFields: [''], }, }, { label: '水表名称', fieldName: 'meterName', component: 'Input', }, { label: '设备编码', fieldName: 'meterCode', component: 'Input', }, { label: '设备厂商', fieldName: 'factoryNo', component: 'Input', }, { label: '设备类型(1-电表,2-水表,3-气表)', fieldName: 'meterType', component: 'Select', componentProps: { }, }, { label: '表用途(1-分表,2-总表,3-公摊表)', fieldName: 'meterPurpose', component: 'Input', }, { label: '分摊类型', fieldName: 'shareType', component: 'Select', componentProps: { }, }, { label: '付费类型(1-先付费,2-后付费)', fieldName: 'payType', component: 'Select', componentProps: { }, }, { label: '当前表显示读数', fieldName: 'display', component: 'Input', }, { label: '最大表显读数(超过归0)', fieldName: 'maxDisplay', component: 'Input', }, { label: '计费倍率', fieldName: 'billingRate', component: 'Input', }, { label: '剩余量', fieldName: 'surplus', component: 'Input', }, { label: '通信状态', fieldName: 'communicationState', component: 'Input', }, { label: '运行状态', fieldName: 'runningState', component: 'Input', }, { label: '备注', fieldName: 'remark', component: 'Textarea', }, ];