Conformance: layout done.(not time range)

This commit is contained in:
chiayin
2023-07-12 09:56:23 +08:00
parent 466c6ea867
commit 9db7b73d2c
17 changed files with 805 additions and 65 deletions

View File

@@ -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'});
}
}
},
})