import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; export const querySchema: FormSchemaGetter = () => [ { component: 'Input', fieldName: 'name', label: '劳务名称', }, { component: 'Input', fieldName: 'method', label: '计算方式', }, { component: 'Select', fieldName: 'stater', label: '状态', componentProps: { options: [ { label: '下架', value: 0 }, { label: '上架', value: 1 }, ], placeholder: '请选择类型', }, }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ { title: '序号', field: 'id', width: '60', slots: { default: ({ rowIndex }) => { return (rowIndex + 1).toString(); }, }, }, { title: '劳务名称', field: 'name', minWidth: '120', }, { title: '计量单位', field: 'measure', width: '120', }, { title: '计算方式', field: 'method', width: '120', }, { title: '申报单价含税(元)', field: 'peices', width: 'auto', }, { title: '保洁频率', field: 'frequency', width: '120', }, // { // title: '保洁内容', // field: 'standard', // }, { title: '保洁标准', field: 'standard', width: '200', }, { title: '备注', field: 'remark', width: '200', }, { title: '状态', field: 'stater', width: '120', slots: { default: ({ row }) => (row.stater === 1 ? '上架' : '下架'), }, }, // { // title: '创建时间', // field: 'stater', // }, { field: 'action', fixed: 'right', slots: { default: 'action' }, title: '操作', width: '230', }, ]; export const modalSchema: FormSchemaGetter = () => [ { label: '主键id', fieldName: 'id', component: 'Input', dependencies: { show: () => false, triggerFields: [''], }, }, { label: '劳务名称', fieldName: 'name', component: 'Input', rules: 'required', }, { label: '计量单位', fieldName: 'measure', component: 'Input', rules: 'required', }, { label: '计算方式', fieldName: 'method', component: 'Input', rules: 'required', }, { label: '申报单价含税(元)', fieldName: 'peices', component: 'Input', rules: 'required', width: 300, }, { label: '保洁频率', fieldName: 'frequency', component: 'Input', rules: 'required', }, // { // label: '保洁内容', // fieldName: 'standard', // component: 'Input', // rules: 'required', // }, { label: '保洁标准', fieldName: 'standard', component: 'Input', rules: 'required', }, // { // label: '开始时间', // fieldName: 'starTime', // component: 'DatePicker', // componentProps: { // showTime: true, // format: 'YYYY-MM-DD HH:mm:ss', // placeholder: '请选择开始时间' // }, // rules: 'required', // }, // { // label: '结束时间', // fieldName: 'endTime', // component: 'DatePicker', // componentProps: { // showTime: true, // format: 'YYYY-MM-DD HH:mm:ss', // placeholder: '请选择结束时间' // }, // rules: 'required', // }, { label: '保洁内容', fieldName: 'cleanContent', component: 'Textarea', rules: 'required', formItemClass: 'col-span-2', }, { label: '状态', fieldName: 'stater', component: 'Select', componentProps: { options: [ { label: '下架', value: 0 }, { label: '上架', value: 1 }, ], placeholder: '请选择类型', }, rules: 'required', }, { label: '备注', fieldName: 'remark', component: 'Textarea', }, ];