Replace async IIFE with onMounted for page initialization (S7785)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1458,8 +1458,7 @@ function getAvgProcessTimeHorizontalBarChart(
|
|||||||
return [primeVueSetData, primeVueSetOption];
|
return [primeVueSetData, primeVueSetOption];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Created logic
|
onMounted(async () => {
|
||||||
(async () => {
|
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
try {
|
try {
|
||||||
const routeParams = route.params;
|
const routeParams = route.params;
|
||||||
@@ -1548,12 +1547,9 @@ function getAvgProcessTimeHorizontalBarChart(
|
|||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to initialize compare dashboard:", error);
|
console.error("Failed to initialize compare dashboard:", error);
|
||||||
}
|
} finally {
|
||||||
})();
|
|
||||||
|
|
||||||
// Mounted
|
|
||||||
onMounted(() => {
|
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch, onBeforeMount, onBeforeUnmount } from "vue";
|
import { ref, computed, watch, onMounted, onBeforeMount, onBeforeUnmount } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { useLoadingStore } from "@/stores/loading";
|
import { useLoadingStore } from "@/stores/loading";
|
||||||
@@ -578,8 +578,7 @@ function setActivityBgImage(mapData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Created logic
|
onMounted(async () => {
|
||||||
(async () => {
|
|
||||||
try {
|
try {
|
||||||
const routeParams = route.params;
|
const routeParams = route.params;
|
||||||
const file = route.meta.file;
|
const file = route.meta.file;
|
||||||
@@ -635,7 +634,7 @@ function setActivityBgImage(mapData) {
|
|||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
})();
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
emitter.off("saveModal");
|
emitter.off("saveModal");
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ const {
|
|||||||
|
|
||||||
let loadingTimerId = null;
|
let loadingTimerId = null;
|
||||||
|
|
||||||
// Created logic
|
onMounted(async () => {
|
||||||
(async () => {
|
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
try {
|
try {
|
||||||
const params = route.params;
|
const params = route.params;
|
||||||
@@ -113,10 +112,6 @@ let loadingTimerId = null;
|
|||||||
} finally {
|
} finally {
|
||||||
loadingTimerId = setTimeout(() => (isLoading.value = false), 500);
|
loadingTimerId = setTimeout(() => (isLoading.value = false), 500);
|
||||||
}
|
}
|
||||||
})();
|
|
||||||
|
|
||||||
// Mounted
|
|
||||||
onMounted(() => {
|
|
||||||
selectedRuleType.value = "Have activity";
|
selectedRuleType.value = "Have activity";
|
||||||
selectedActivitySequence.value = "Start & End";
|
selectedActivitySequence.value = "Start & End";
|
||||||
selectedMode.value = "Directly follows";
|
selectedMode.value = "Directly follows";
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch, onBeforeMount, onBeforeUnmount } from "vue";
|
import { ref, computed, watch, onMounted, onBeforeMount, onBeforeUnmount } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { useLoadingStore } from "@/stores/loading";
|
import { useLoadingStore } from "@/stores/loading";
|
||||||
@@ -567,8 +567,7 @@ function setActivityBgImage(mapData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Created logic
|
onMounted(async () => {
|
||||||
(async () => {
|
|
||||||
try {
|
try {
|
||||||
const routeParams = route.params;
|
const routeParams = route.params;
|
||||||
const file = route.meta.file;
|
const file = route.meta.file;
|
||||||
@@ -624,7 +623,7 @@ function setActivityBgImage(mapData) {
|
|||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
})();
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
emitter.off("saveModal");
|
emitter.off("saveModal");
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
@@ -1049,8 +1049,7 @@ function getAvgWaitingTimeLineChart(chartData, content, yUnit) {
|
|||||||
return [primeVueSetData, primeVueSetOption];
|
return [primeVueSetData, primeVueSetOption];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Created logic
|
onMounted(async () => {
|
||||||
(async () => {
|
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
try {
|
try {
|
||||||
const routeParams = route.params;
|
const routeParams = route.params;
|
||||||
@@ -1138,7 +1137,7 @@ function getAvgWaitingTimeLineChart(chartData, content, yUnit) {
|
|||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
})();
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@reference "../../../assets/tailwind.css";
|
@reference "../../../assets/tailwind.css";
|
||||||
|
|||||||
Reference in New Issue
Block a user