修正ts类型
This commit is contained in:
@@ -163,6 +163,21 @@ export const useHouseStore = defineStore(
|
||||
});
|
||||
});
|
||||
};
|
||||
// 根据房屋号,查询房屋
|
||||
async function getHouseBybuildingNo(houseName: string) {
|
||||
currentHouseInfoList.value = null;
|
||||
// 获取当前 楼栋的所有信息
|
||||
const res3 = await getHouselistAPI(currentBuildingInfo.value.id, houseName);
|
||||
currentHouseInfoList.value = res3.data;
|
||||
floorslist.value = null;
|
||||
floorslist.value = new Set();
|
||||
// 得到所有的有房屋的 楼层 数组
|
||||
currentHouseInfoList.value.units.forEach((item) => {
|
||||
item.floors.forEach((floor) => {
|
||||
floorslist.value.add(floor.floorNo);
|
||||
});
|
||||
});
|
||||
}
|
||||
// 切换楼栋
|
||||
const switchBuilding = (buildingId: string) => {
|
||||
if (!buildingId) return;
|
||||
@@ -218,9 +233,10 @@ export const useHouseStore = defineStore(
|
||||
|
||||
// 房屋 树状结构类型
|
||||
const getCurrentVilageTreeHouse = async () => {
|
||||
const villageid = localStorage.getItem('villageid');
|
||||
try {
|
||||
treedata.value = [];
|
||||
const res = await getVillageTree(currentVilageInfo.value.villageId);
|
||||
const res = await getVillageTree(villageid);
|
||||
treedata.value = convertBuildingToTree(res.data.buildings || []);
|
||||
return treedata.value;
|
||||
} catch (err) {
|
||||
@@ -239,6 +255,7 @@ export const useHouseStore = defineStore(
|
||||
buildingtype,
|
||||
buildingtypelist,
|
||||
treedata,
|
||||
getHouseBybuildingNo,
|
||||
updateVilageinfo,
|
||||
updateCureentBuilding,
|
||||
getviliageinfo,
|
||||
|
||||
Reference in New Issue
Block a user