同步6/16

This commit is contained in:
Zy
2026-06-01 18:12:58 +08:00
parent 38274ab612
commit 50e7b14fd6
183 changed files with 8956 additions and 4803 deletions

View File

@@ -73,40 +73,14 @@ export const useHouseStore = defineStore(
// 初始化
const initHouse = async () => {
currentBuildingInfoList.value = [];
resertInit();
// 获取当前小区 所有楼栋信息
const res2 = await getBuildinglistAPI();
currentBuildingInfoList.value = res2.data;
// 得到小区 内 楼栋列表 -> 切换到第一个小区
// 得到小区 内 楼栋列表 -> 切换到第一个
if (res2.data.length > 0) {
switchBuilding(res2.data[0].id);
}
// 获取当前小区 第一个楼栋信息
// // ! 不同住宅类型
// if ((currentBuildingInfo.value && currentBuildingInfo.value.id === null) || buildingtype.value !== currentbuildingtype) {
// currentBuildingInfo.value = res2.data[0];
// // ! 相同住宅类型
// } else if (buildingtype.value === currentbuildingtype) {
// // 更新当前楼栋的 信息
// currentBuildingInfo.value = res2.data.find((item) => item.id === currentBuildingInfo.value.id);
// }
// if (currentBuildingInfo.value && currentBuildingInfo.value.id) {
// // 获取当前 第一个楼栋的所有信息
// const res3 = await getHouselistAPI(currentBuildingInfo.value.id);
// currentHouseInfoList.value = res3.data;
// floorslist.value = new Set();
// // 得到所有的有房屋的 楼层 数组
// currentHouseInfoList.value.units.forEach((item) => {
// item.floors.forEach((floor) => {
// floorslist.value.add(floor.floorNo);
// });
// });
// if (buildingtype.value !== currentbuildingtype) {
// buildingtype.value = currentbuildingtype;
// }
// }
};
// 选中的房屋
@@ -173,6 +147,9 @@ export const useHouseStore = defineStore(
// 获取当前 楼栋的所有信息
const res3 = await getHouselistAPI(currentBuildingInfo.value.id, houseName, houseUseTypeId);
currentHouseInfoList.value = res3.data;
console.log(res3.data);
floorslist.value = null;
floorslist.value = new Set();
// 得到所有的有房屋的 楼层 数组
@@ -216,6 +193,24 @@ export const useHouseStore = defineStore(
});
};
function resertInit() {
currentBuildingInfo.value = {
'id': null,
'villageId': null,
'villageName': '',
'buildingName': '',
'buildingUse': null,
'buildToward': '',
'buildTall': '',
'buildStructure': '',
'floorCount': null,
'remark': ''
};
currentBuildingInfoList.value = [];
currentHouseInfoList.value = null;
floorslist.value.clear();
}
// 更新数据
const updateHouse = () => {
initHouse();