系統監控getData帶入buildingStore.selectedBuilding
This commit is contained in:
parent
eee56c4273
commit
3460130e7e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user