fix:建筑管理、楼层管理
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
2025-07-30 15:27:32 +08:00
parent 48f0011e78
commit 8f6dc2ba11
6 changed files with 47 additions and 31 deletions

View File

@@ -29,7 +29,7 @@ export interface BuildingVO {
/**
* 建筑类型('1住宅','2商业','3:混合')
*/
buildType: number;
buildType: string;
/**
* 电梯数量

View File

@@ -59,6 +59,7 @@ const [BasicModal, modalApi] = useVbenModal({
if (isUpdate.value && id) {
const record = await buildingInfo(id);
record.buildType = record.buildType.toString();
await formApi.setValues(record);
}
await markInitialized();

View File

@@ -105,12 +105,20 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '总层数',
fieldName: 'floorCount',
component: 'Input',
component: 'InputNumber',
componentProps: {
min:1,
precision:0,
},
},
{
label: '单元数',
fieldName: 'unitCount',
component: 'Input',
component: 'InputNumber',
componentProps: {
min:1,
precision:0,
},
},
{
label: '建筑类型',
@@ -124,14 +132,17 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '电梯数量',
fieldName: 'elevatorCount',
component: 'Input',
component: 'InputNumber',
componentProps: {
min:0,
precision:0,
},
},
{
label: '竣工日期',
fieldName: 'completionDate',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
},

View File

@@ -54,7 +54,7 @@ export const modalSchema: FormSchemaGetter = () => [
},
{
component: 'TreeSelect',
fieldName: 'unitId',
fieldName: 'buildingId',
defaultValue: undefined,
label: '社区建筑',
rules: 'selectRequired',
@@ -80,11 +80,19 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '房间数量',
fieldName: 'roomCount',
component: 'Input',
component: 'InputNumber',
componentProps: {
min:0,
precision:0,
},
},
{
label: '层高',
fieldName: 'floorHeight',
component: 'Input',
component: 'InputNumber',
componentProps: {
min:0,
precision:0,
},
},
];

View File

@@ -90,12 +90,12 @@ async function handleConfirm() {
* 初始化城市
*/
async function setupCommunitySelect() {
const areaList = await communityTree(3);
const areaList = await communityTree(2);//楼层关联建筑
// 选中后显示在输入框的值 即父节点 / 子节点
// addFullName(areaList, 'areaName', ' / ');
const splitStr = '/';
handleNode(areaList, 'label', splitStr, function (node: any) {
if (node.level != 3) {
if (node.level != 2) {
node.disabled = true;
}
});
@@ -120,7 +120,7 @@ async function setupCommunitySelect() {
// 选中后显示在输入框的值
treeNodeLabelProp: 'fullName',
}),
fieldName: 'unitId',
fieldName: 'buildingId',
},
]);
}

View File

@@ -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,