import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; export const querySchema: FormSchemaGetter = () => [ { component: 'Input', fieldName: 'communityName', label: '社区', }, { component: 'Select', componentProps: {}, fieldName: 'communityType', label: '社区类型', }, { component: 'Input', fieldName: 'propertyCompany', label: '物业公司', }, { component: 'Input', fieldName: 'contactPhone', label: '联系电话', }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { title: '社区名称', field: 'communityName', }, { title: '社区类型', field: 'communityType', }, { title: '省', field: 'province', }, { title: '市', field: 'city', }, { title: '区', field: 'district', }, { title: '地址', field: 'addr', }, { title: '经度', field: 'lon', }, { title: '维度', field: 'lat', }, { title: '占地面积(平方米)', field: 'area', }, { title: '', field: 'builtYear', }, { title: '物业公司', field: 'propertyCompany', }, { title: '联系电话', field: 'contactPhone', }, { title: '社区描述', field: 'description', }, { title: '小图图片', field: 'img', }, { 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: 'communityName', component: 'Input', rules: 'required', }, { label: '社区类型', fieldName: 'communityType', component: 'Select', componentProps: {}, rules: 'selectRequired', }, { label: '省', fieldName: 'province', component: 'Input', rules: 'required', }, { label: '市', fieldName: 'city', component: 'Input', rules: 'required', }, { label: '区', fieldName: 'district', component: 'Input', rules: 'required', }, { label: '地址', fieldName: 'addr', component: 'Input', rules: 'required', }, { label: '经度', fieldName: 'lon', component: 'Input', rules: 'required', }, { label: '维度', fieldName: 'lat', component: 'Input', rules: 'required', }, { label: '占地面积(平方米)', fieldName: 'area', component: 'Input', }, { label: '', fieldName: 'builtYear', component: 'DatePicker', componentProps: { showTime: true, format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss', }, }, { label: '物业公司', fieldName: 'propertyCompany', component: 'Input', }, { label: '联系电话', fieldName: 'contactPhone', component: 'Input', }, { label: '社区描述', fieldName: 'description', component: 'Textarea', }, { label: '小图图片', fieldName: 'img', component: 'Input', }, ];