系統監控getData帶入buildingStore.selectedBuilding
This commit is contained in:
parent
eee56c4273
commit
3460130e7e
@ -118,21 +118,30 @@ const updateDataByGas = (gas) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
[() => buildingStore.selectedBuilding, () => route.params.sub_system_id],
|
() => buildingStore.selectedBuilding,
|
||||||
([newBuilding, newRoute], [oldBuilding, oldRoute]) => {
|
(newBuilding) => {
|
||||||
if (newBuilding && newRoute && newRoute !== oldRoute) {
|
if (Boolean(newBuilding)) {
|
||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
immediate: true,
|
||||||
deep: true,
|
deep: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => route.params.sub_system_id,
|
||||||
|
(newRoute, oldRoute) => {
|
||||||
|
if (buildingStore.selectedBuilding && newRoute !== oldRoute) {
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getFloors();
|
getFloors();
|
||||||
getCompany();
|
getCompany();
|
||||||
getData();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const currentFloor = ref(null);
|
const currentFloor = ref(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user