import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; import { getDictOptions } from '#/utils/dict'; import { renderDict } from '#/utils/render'; export const querySchema: FormSchemaGetter = () => [ { component: 'Input', fieldName: 'communityName', label: '小区名称', }, { component: 'Input', fieldName: 'communityCode', label: '小区编码', }, { component: 'Select', componentProps: { options: getDictOptions('wy_sqlx'), }, fieldName: 'communityType', label: '小区类型', } ]; export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { title: '序号', field: 'id', slots: { default: ({ rowIndex }) => { return (rowIndex + 1).toString(); }, }, }, { title: '小区名称', field: 'communityName', }, { title: '小区编码', field: 'communityCode', }, { title: '小区类型', field: 'communityType', slots: { default: ({ row }) => { return renderDict(row.communityType, 'wy_sqlx'); }, }, }, { title: '省', field: 'province', }, { title: '市', field: 'city', }, { title: '区', field: 'district', }, { title: '地址', field: 'addr', }, { title: '经度', field: 'lon', }, { title: '维度', field: 'lat', }, { title: '小图图片', field: 'img', }, { title: '修改时间', field: 'modifyTime', }, { 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: 'communityCode', component: 'Input', rules: 'required', }, { label: '小区类型', fieldName: 'communityType', component: 'Select', componentProps: { options: getDictOptions('wy_sqlx'), }, 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: 'img', component: 'ImageUpload', componentProps: { }, } ];