history exec scenario page
This commit is contained in:
36
src/stores/ScenarioExecutionStore.js
Normal file
36
src/stores/ScenarioExecutionStore.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { computed, ref } from 'vue';
|
||||
import { ScenarioService } from '../service/ScenarioService';
|
||||
import { LoadingStore } from './LoadingStore';
|
||||
|
||||
|
||||
export const ScenarioExecutionStore = defineStore('scenario_execution_store', () => {
|
||||
|
||||
const lstScenarioExecution = ref([])
|
||||
const selectedExecScenario = ref(null)
|
||||
const loadingStore = LoadingStore()
|
||||
|
||||
|
||||
async function fetchScenariosExecution() {
|
||||
loadingStore.scenario_loading = true;
|
||||
await ScenarioService.getExecScenariosByUser().then(resp => {
|
||||
lstScenarioExecution.value = resp.data;
|
||||
loadingStore.scenario_loading = false;
|
||||
});
|
||||
|
||||
}
|
||||
const scenariosExecution = computed(() => {
|
||||
return lstScenarioExecution.value
|
||||
})
|
||||
|
||||
const getSelectedExecScenario = computed(() => {
|
||||
return selectedExecScenario.value
|
||||
})
|
||||
|
||||
async function setSelectedExecScenario(execScenario){
|
||||
selectedExecScenario.value = execScenario
|
||||
console.log("selectedExecScenario", selectedExecScenario.value);
|
||||
}
|
||||
|
||||
return { fetchScenariosExecution, selectedExecScenario, lstScenarioExecution, scenariosExecution, getSelectedExecScenario, setSelectedExecScenario}
|
||||
})
|
||||
Reference in New Issue
Block a user