fix: #310 keep loading animation bug is related to cytoscape undefined bug. And cytoscape node position remembering feature is not actually finished correctly yet before. Now remembering feature is done.
This commit is contained in:
@@ -53,14 +53,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onBeforeMount, } from 'vue';
|
||||
import { onBeforeMount, computed } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import axios from 'axios';
|
||||
import LoadingStore from '@/stores/loading.js';
|
||||
import AllMapDataStore from '@/stores/allMapData.js';
|
||||
import ConformanceStore from '@/stores/conformance.js';
|
||||
import cytoscapeMap from '@/module/cytoscapeMap.js';
|
||||
import CytoscapeStore from '@/stores/cytoscapeStore.js';
|
||||
import CytoscapeStore from '@/stores/cytoscapeStore.ts';
|
||||
import SidebarView from '@/components/Discover/Map/SidebarView.vue';
|
||||
import SidebarState from '@/components/Discover/Map/SidebarState.vue';
|
||||
import SidebarTraces from '@/components/Discover/Map/SidebarTraces.vue';
|
||||
@@ -71,6 +72,7 @@ export default {
|
||||
const loadingStore = LoadingStore();
|
||||
const allMapDataStore = AllMapDataStore();
|
||||
const { isLoading } = storeToRefs(loadingStore);
|
||||
const route = useRoute();
|
||||
const { processMap, bpmn, stats, insights, traceId, traces, baseTraces, baseTraceId,
|
||||
filterTasks, filterStartToEnd, filterEndToStart, filterTimeframe, filterTrace,
|
||||
temporaryData, isRuleData, ruleData, logId, baseLogId, createFilterId, cases,
|
||||
@@ -81,8 +83,25 @@ export default {
|
||||
|
||||
const { setCurrentGraphId } = cytoscapeStore;
|
||||
|
||||
const numberBeforeMapInRoute = computed(() => {
|
||||
// 取得當前路由的路徑
|
||||
const path = route.path;
|
||||
// 使用斜線分割路徑
|
||||
const segments = path.split('/');
|
||||
// 查找包含 'map' 的片段索引
|
||||
const mapIndex = segments.findIndex(segment => segment.includes('map'));
|
||||
if (mapIndex > 0) {
|
||||
// 定位到 'map' 片段的左邊片段
|
||||
const previousSegment = segments[mapIndex - 1];
|
||||
// 萃取左邊片段中的數字
|
||||
const match = previousSegment.match(/\d+/);
|
||||
return match ? match[0] : 'No number found';
|
||||
}
|
||||
return 'No map segment found';
|
||||
});
|
||||
|
||||
onBeforeMount(() => {
|
||||
setCurrentGraphId(logId);
|
||||
setCurrentGraphId(numberBeforeMapInRoute);
|
||||
});
|
||||
|
||||
return { isLoading, processMap, bpmn, stats, insights, traceId, traces, baseTraces,
|
||||
|
||||
Reference in New Issue
Block a user