5.1日 暂定 水电表管理
This commit is contained in:
@@ -23,7 +23,7 @@ export const useHouseStore = defineStore(
|
||||
// 当前小区信息
|
||||
const currentVilageInfo = ref<communitylist_rows_type>();
|
||||
// 住宅类型
|
||||
const buildingtype = ref<number>(0);
|
||||
const buildingtype = ref<string>('0');
|
||||
// 住宅列表
|
||||
const buildingtypelist = ref([]);
|
||||
// 房屋树状结构
|
||||
@@ -51,6 +51,9 @@ export const useHouseStore = defineStore(
|
||||
|
||||
// 当前楼栋 所有楼层数据
|
||||
const currentFloorInfoList = computed(() => {
|
||||
if (floorslist.value.size === 0) {
|
||||
return [];
|
||||
}
|
||||
return [...floorslist.value].sort(sortNumberStr);
|
||||
});
|
||||
// 楼层列表 set
|
||||
@@ -70,10 +73,10 @@ export const useHouseStore = defineStore(
|
||||
};
|
||||
|
||||
// 初始化
|
||||
const initHouse = async (currentbuildingtype: number) => {
|
||||
const initHouse = async (currentbuildingtype: string) => {
|
||||
currentBuildingInfoList.value = [];
|
||||
// 获取当前小区 所有楼栋信息
|
||||
const res2 = await getBuildinglistAPI(currentVilageInfo.value.villageId, currentbuildingtype);
|
||||
const res2 = await getBuildinglistAPI(currentbuildingtype);
|
||||
currentBuildingInfoList.value = res2.data;
|
||||
|
||||
// 获取当前小区 第一个楼栋信息
|
||||
@@ -111,11 +114,11 @@ export const useHouseStore = defineStore(
|
||||
};
|
||||
|
||||
// 切换住宅类型
|
||||
const switchHouseType = async (housetype: number) => {
|
||||
const switchHouseType = async (housetype: string) => {
|
||||
// 清空
|
||||
currentBuildingInfoList.value = [];
|
||||
// 获取当前小区 所有楼栋信息
|
||||
const res2 = await getBuildinglistAPI(currentVilageInfo.value.villageId, housetype);
|
||||
const res2 = await getBuildinglistAPI(housetype);
|
||||
currentBuildingInfoList.value = res2.data;
|
||||
// 获取当前小区 第一个楼栋信息
|
||||
if ((currentBuildingInfo.value && currentBuildingInfo.value.id === null) || buildingtype.value !== housetype) {
|
||||
@@ -143,7 +146,6 @@ export const useHouseStore = defineStore(
|
||||
floorslist.value = new Set();
|
||||
}
|
||||
buildingtype.value = housetype;
|
||||
console.log(housetype);
|
||||
ElMessage.success('切换成功');
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user