1、入驻单位、人员优化
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -1,12 +1,45 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import {communityList} from "#/api/property/community";
|
||||
import {buildingList} from "#/api/property/building";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'communityCode',
|
||||
label: '所属区域',
|
||||
componentProps: (formModel, formActionType) => ({
|
||||
api: getCommunityList,
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
immediate: true,
|
||||
debounceTime: 500,
|
||||
allowClear: true,
|
||||
placeholder: '请选择区域',
|
||||
onChange: () => {
|
||||
// 清空建筑字段
|
||||
formModel.buildingCode = undefined;
|
||||
// 更新表单值
|
||||
formActionType.setFieldValue('buildingCode', undefined);
|
||||
},
|
||||
}),
|
||||
},
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'buildingCode',
|
||||
label: '建筑名称',
|
||||
label: '所属建筑',
|
||||
componentProps:{
|
||||
api: getBuildingList,
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
immediate: true,
|
||||
debounceTime: 500,
|
||||
allowClear: true,
|
||||
placeholder: '请选择建筑',
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
@@ -18,25 +51,9 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
fieldName: 'unitName',
|
||||
label: '单元名称',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'floorCount',
|
||||
label: '单元层数',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'householdCount',
|
||||
label: '单元户数',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'stairCount',
|
||||
label: '楼梯数量',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
@@ -83,9 +100,41 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '建筑名称',
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'communityCode',
|
||||
label: '所属区域',
|
||||
componentProps: (formModel, formActionType) => ({
|
||||
api: getCommunityList,
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
immediate: true,
|
||||
debounceTime: 500,
|
||||
allowClear: true,
|
||||
placeholder: '请选择区域',
|
||||
onChange: () => {
|
||||
// 清空建筑字段
|
||||
formModel.buildingCode = undefined;
|
||||
// 更新表单值
|
||||
formActionType.setFieldValue('buildingCode', undefined);
|
||||
},
|
||||
}),
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'buildingCode',
|
||||
component: 'Input',
|
||||
label: '所属建筑',
|
||||
componentProps: {
|
||||
api: getBuildingList,
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
immediate: true,
|
||||
debounceTime: 500,
|
||||
allowClear: true,
|
||||
placeholder: '请选择建筑',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
@@ -103,16 +152,69 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '单元层数',
|
||||
fieldName: 'floorCount',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
componentProps:{
|
||||
defaultValue:0,
|
||||
precision:0,
|
||||
min:0
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '单元户数',
|
||||
fieldName: 'householdCount',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
componentProps:{
|
||||
defaultValue:0,
|
||||
precision:0,
|
||||
min:0
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '楼梯数量',
|
||||
fieldName: 'stairCount',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
componentProps:{
|
||||
defaultValue:0,
|
||||
precision:0,
|
||||
min:0
|
||||
}
|
||||
},
|
||||
];
|
||||
//获取区域数据
|
||||
async function getCommunityList(): Promise<{ value: number; label: string }[]> {
|
||||
const queryParam = {
|
||||
pageNum: 1000,
|
||||
pageSize: 1,
|
||||
};
|
||||
const res = await communityList(queryParam);
|
||||
const data: { value: number; label: string }[] = [];
|
||||
res.rows.forEach((r: any) => {
|
||||
data.push({
|
||||
value: r.communityName,
|
||||
label: r.id,
|
||||
});
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
//获取建筑数据
|
||||
export async function getBuildingList(): Promise<{ value: number; label: string }[]> {
|
||||
const queryParam = {
|
||||
pageNum: 1000,
|
||||
pageSize: 1,
|
||||
};
|
||||
const res = await buildingList(queryParam);
|
||||
const data: { value: number; label: string }[] = [];
|
||||
|
||||
res.rows.forEach((r: any) => {
|
||||
data.push({
|
||||
value: r.buildingName,
|
||||
label: r.id,
|
||||
});
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@@ -1,13 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
@@ -35,15 +31,6 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||
// 不需要直接删除
|
||||
// fieldMappingTime: [
|
||||
// [
|
||||
// 'createTime',
|
||||
// ['params[beginTime]', 'params[endTime]'],
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
@@ -55,8 +42,6 @@ const gridOptions: VxeGridProps = {
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
|
Reference in New Issue
Block a user