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: 'serverName', label: '服务名称', }, { component: 'Select', componentProps: { options: getDictOptions('wy_fwlx'), }, fieldName: 'serverType', label: '服务类型', }, { component: 'Input', fieldName: 'price', label: '价格', }, { component: 'Input', fieldName: 'sort', label: '排序', }, { component: 'Input', fieldName: 'state', label: '状态', }, { component: 'DatePicker', componentProps: { showTime: true, format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss', }, fieldName: 'createTime', label: '创建时间', }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { title: '主键', field: 'id', }, { title: '服务名称', field: 'serverName', }, { title: '服务类型', field: 'serverType', }, { title: '价格', field: 'price', }, { title: '排序', field: 'sort', }, { title: '状态', field: 'state', }, { 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: 'serverName', component: 'Input', }, { label: '服务类型', fieldName: 'serverType', component: 'Select', componentProps: { options: getDictOptions('wy_fwlx'), }, }, { label: '价格', fieldName: 'price', component: 'Input', }, { label: '排序', fieldName: 'sort', component: 'Input', }, ];