Discover: fetch discover api && set element(nodes, edges) done

This commit is contained in:
chiayin
2023-02-22 16:10:40 +08:00
parent 8228f9791c
commit 78e18663aa
11 changed files with 361 additions and 74 deletions

29
src/stores/allMapData.js Normal file
View File

@@ -0,0 +1,29 @@
import { defineStore } from "pinia";
export default defineStore('allMapDataStore', {
state: () => ({
logId: null,
processMap: {},
bpmn: {},
}),
getters: {
},
actions: {
/**
* fetch discover api, include '/process-map, /bpmn, /stats, /insights'.
*/
async getAllMapData() {
let logId = this.logId
const api = `/api/logs/${logId}/discover`;
try {
const response = await this.$axios.get(api);
// console.log(response);
this.processMap = response.data.process_map;
this.bpmn = response.data.bpmn;
} catch(error) {
// console.dir(error);
};
},
}
})