import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; export const querySchema: FormSchemaGetter = () => [ { component: 'Input', fieldName: 'userId', label: '用户id', }, { component: 'Input', fieldName: 'userName', label: '用户名称', }, { component: 'Input', fieldName: 'phone', label: '联系电话', }, { component: 'Input', fieldName: 'gender', label: '性别', }, { component: 'Input', fieldName: 'img', label: '人脸图片', }, { component: 'Input', fieldName: 'unitId', label: '所属单位id', }, { component: 'Input', fieldName: 'unitName', label: '所属单位名称', }, { component: 'Input', fieldName: 'locathon', label: '入驻位置', }, { component: 'DatePicker', componentProps: { showTime: true, format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss', }, fieldName: 'time', label: '入驻时间', }, { component: 'Textarea', fieldName: 'carNumber', label: '车牌号码', }, { component: 'Input', fieldName: 'state', label: '状态', }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { title: '主键id', field: 'id', }, { title: '用户id', field: 'userId', }, { title: '用户名称', field: 'userName', }, { title: '联系电话', field: 'phone', }, { title: '性别', field: 'gender', }, { title: '人脸图片', field: 'img', }, { title: '所属单位id', field: 'unitId', }, { title: '所属单位名称', field: 'unitName', }, { title: '入驻位置', field: 'locathon', }, { title: '入驻时间', field: 'time', }, { title: '车牌号码', field: 'carNumber', }, { title: '状态', field: 'state', }, { 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: '用户id', fieldName: 'userId', component: 'Input', rules: 'required', }, { label: '用户名称', fieldName: 'userName', component: 'Input', rules: 'required', }, { label: '联系电话', fieldName: 'phone', component: 'Input', rules: 'required', }, { label: '性别', fieldName: 'gender', component: 'Input', rules: 'required', }, { label: '人脸图片', fieldName: 'img', component: 'Input', }, { label: '所属单位id', fieldName: 'unitId', component: 'Input', }, { label: '所属单位名称', fieldName: 'unitName', component: 'Input', }, { label: '入驻位置', fieldName: 'locathon', component: 'Input', }, { label: '入驻时间', fieldName: 'time', component: 'DatePicker', componentProps: { showTime: true, format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss', }, }, { label: '车牌号码', fieldName: 'carNumber', component: 'Textarea', }, { label: '状态', fieldName: 'state', component: 'Input', rules: 'required', }, { label: '备注', fieldName: 'remark', component: 'Textarea', }, ];