Discover: fetch discover api && set element(nodes, edges) done
This commit is contained in:
29
src/stores/allMapData.js
Normal file
29
src/stores/allMapData.js
Normal 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);
|
||||
};
|
||||
},
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user