import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; export const querySchema: FormSchemaGetter = () => [ { component: 'Input', fieldName: 'communityName', label: '社区', }, { component: 'Input', fieldName: 'buildingName', label: '建筑名称', }, { component: 'Input', fieldName: 'unitCount', label: '单元数', }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { title: '建筑名称', field: 'buildingName', }, { title: '省', field: 'province', }, { title: '市', field: 'city', }, { title: '区', field: 'district', }, { title: '总层数', field: 'floorCount', }, { title: '单元数', field: 'unitCount', }, { title: '建筑类型', field: 'buildType', }, { title: '电梯数量', field: 'elevatorCount', }, { title: '竣工日期', field: 'completionDate', }, { title: '地址', field: 'addr', }, { title: '经度', field: 'lon', }, { title: '维度', field: 'lat', }, { 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: 'communityId', component: 'Input', rules: 'required', }, { label: '建筑名称', fieldName: 'buildingName', component: 'Input', rules: 'required', }, { label: '省', fieldName: 'province', component: 'Input', rules: 'required', }, { label: '市', fieldName: 'city', component: 'Input', rules: 'required', }, { label: '区', fieldName: 'district', component: 'Input', rules: 'required', }, { label: '总层数', fieldName: 'floorCount', component: 'Input', }, { label: '单元数', fieldName: 'unitCount', component: 'Input', }, { label: '建筑类型', fieldName: 'buildType', component: 'Select', componentProps: {}, }, { label: '电梯数量', fieldName: 'elevatorCount', component: 'Input', }, { label: '竣工日期', fieldName: 'completionDate', component: 'DatePicker', componentProps: { showTime: true, format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss', }, }, { label: '地址', fieldName: 'addr', component: 'Input', rules: 'required', }, { label: '经度', fieldName: 'lon', component: 'Input', rules: 'required', }, { label: '维度', fieldName: 'lat', component: 'Input', rules: 'required', }, { label: '排序字段', fieldName: 'sort', component: 'Input', }, ];