This commit is contained in:
Zy
2026-04-08 14:30:29 +08:00
parent dc3080db32
commit cd292d5bf4
21 changed files with 188 additions and 62 deletions

View File

@@ -73,6 +73,12 @@ export const useHouseStore = defineStore('house', () => {
currentFloorInfoList.value = (Array.from(floorslist.value) as string[]).sort(sortNumberStr);
};
// 选中房屋
const checkoutHouses = ref<string[]>([]);
const checkoutHousesFun = (data: string[]) => {
checkoutHouses.value = data;
};
// 切换住宅类型
const switchHouseType = (housetype: 0 | 1 | 2 | 3) => {
getBuildinglistAPI(currentVilageInfo.value.villageId, housetype)
@@ -85,14 +91,26 @@ export const useHouseStore = defineStore('house', () => {
getHouselistAPI(buildingId).then(() => ElMessage.success('切换成功'));
};
const deleteHouseFun = (houseId: string | string[]) => {
console.log('删除房屋');
if (typeof houseId === 'string') {
console.log('单条删除');
} else if (Array.isArray(houseId)) {
console.log('批量删除');
}
};
return {
currentVilageInfo,
currentBuildingInfoList,
currentBuildingInfo,
currentHouseInfoList,
currentFloorInfoList,
checkoutHouses,
checkoutHousesFun,
initHouse,
switchHouseType,
switchBuilding
switchBuilding,
deleteHouseFun
};
});