Conformance: layout done.(not time range)
This commit is contained in:
@@ -1,17 +1,53 @@
|
||||
import { defineStore } from "pinia";
|
||||
import loadingStore from "./loading";
|
||||
import pinia from '@/stores/main.js';
|
||||
import {useToast} from 'vue-toast-notification';
|
||||
import 'vue-toast-notification/dist/theme-sugar.css';
|
||||
|
||||
const loading = loadingStore(pinia);
|
||||
const $toast = useToast();
|
||||
// Delay loading and toast 待模組化
|
||||
let delay = (s = 0) => new Promise((resolve, reject) => setTimeout(resolve, s));
|
||||
|
||||
export default defineStore('conformanceStore', {
|
||||
state: () => ({
|
||||
selectedRuleType: 'Have activity',
|
||||
selectedActivitySequence: 'Start & End',
|
||||
selectedMode: 'Directly follows',
|
||||
selectedProcessScope: 'End to end',
|
||||
selectedActSeqMore: 'All',
|
||||
logId: null,
|
||||
filterId: null,
|
||||
allConformanceTask: [],
|
||||
selectedRuleType: 'Have activity', // radio
|
||||
selectedActivitySequence: 'Start & End', // radio
|
||||
selectedMode: 'Directly follows', // radio
|
||||
selectedProcessScope: 'End to end', // radio
|
||||
selectedActSeqMore: 'All', // radio
|
||||
selectedActSeqFromTo: 'From', // radio
|
||||
}),
|
||||
getters: {},
|
||||
actions: {},
|
||||
getters: {
|
||||
conformanceTask: state => {
|
||||
return state.allConformanceTask;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* fetch Log Conformance Parameters api for Rule Settings.
|
||||
*/
|
||||
async getLogConformanceParams() {
|
||||
let logId = this.logId;
|
||||
const api = `/api/log-checkers/params?log_id=${logId}`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
console.log(response);
|
||||
this.allConformanceTask = response.data.tasks;
|
||||
|
||||
} catch(error) {
|
||||
console.log(error);
|
||||
await delay();
|
||||
loading.isLoading = true;
|
||||
await delay(1000);
|
||||
loading.isLoading = false;
|
||||
await delay(500);
|
||||
$toast.default('Failed to load the Conformance Parameters.',{position: 'bottom'});
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user