完成访客搭建,完善之前审核界面

This commit is contained in:
Zy
2026-04-13 18:10:23 +08:00
parent d957d1a039
commit 7f152c45f5
34 changed files with 1732 additions and 1208 deletions

View File

@@ -1,7 +1,8 @@
import { getCommunitylistAPI } from '@/api/system/community';
import { communitylist_rows_type } from '@/api/system/community/type';
import { deleteHouseApi, getBuildinglistAPI, getHouselistAPI } from '@/api/system/house';
import { deleteHouseApi, getBuildinglistAPI, getHouselistAPI, getVillageTree } from '@/api/system/house';
import type { addBuildingType, BuildingUnit, BuildingVo } from '@/api/system/house/type';
import { convertBuildingToTree } from '@/utils/house';
import { defineStore } from 'pinia';
// 数字排序
function sortNumberStr(a: string, b: string) {
@@ -25,6 +26,8 @@ export const useHouseStore = defineStore(
const buildingtype = ref<number>(0);
// 住宅列表
const buildingtypelist = ref([]);
// 房屋树状结构
const treedata = ref([]);
// 当前小区 所有楼栋信息
const currentBuildingInfoList = ref<BuildingVo[]>([]);
@@ -154,6 +157,15 @@ export const useHouseStore = defineStore(
}
};
// 房屋 树状结构类型
const getCurrentVilageTreeHouse = async () => {
const res = await getCommunitylistAPI();
const currentVilage = res.rows.find((item) => item.choiceStatus === 0);
currentVilageInfo.value = currentVilage;
getVillageTree(currentVilageInfo.value.villageId).then((res) => {
treedata.value = convertBuildingToTree(res.data.buildings);
});
};
return {
currentVilageInfo,
currentBuildingInfoList,
@@ -163,12 +175,14 @@ export const useHouseStore = defineStore(
checkoutHouses,
buildingtype,
buildingtypelist,
treedata,
checkoutHousesFun,
initHouse,
switchHouseType,
switchBuilding,
updateHouse,
deleteBuildingFun
deleteBuildingFun,
getCurrentVilageTreeHouse
};
},
{