系統監控getData帶入buildingStore.selectedBuilding

This commit is contained in:
koko 2024-11-08 14:36:27 +08:00
parent eee56c4273
commit 3460130e7e

View File

@ -118,21 +118,30 @@ const updateDataByGas = (gas) => {
}
watch(
[() => buildingStore.selectedBuilding, () => route.params.sub_system_id],
([newBuilding, newRoute], [oldBuilding, oldRoute]) => {
if (newBuilding && newRoute && newRoute !== oldRoute) {
() => buildingStore.selectedBuilding,
(newBuilding) => {
if (Boolean(newBuilding)) {
getData();
}
},
{
immediate: true,
deep: true,
}
);
watch(
() => route.params.sub_system_id,
(newRoute, oldRoute) => {
if (buildingStore.selectedBuilding && newRoute !== oldRoute) {
getData();
}
}
);
onMounted(() => {
getFloors();
getCompany();
getData();
});
const currentFloor = ref(null);