profiling + research + download
This commit is contained in:
38
src/stores/KsDocumentStore.js
Normal file
38
src/stores/KsDocumentStore.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { computed, ref } from 'vue';
|
||||
import { KsDocumentService } from '../service/KsDocumentService';
|
||||
import { LoadingStore } from './LoadingStore';
|
||||
|
||||
|
||||
export const KsDocumentStore = defineStore('ksdocument_store', () => {
|
||||
|
||||
const lstKsDocument = ref([])
|
||||
const selectedKsDocument = ref(null)
|
||||
const loadingStore = LoadingStore()
|
||||
|
||||
|
||||
async function fetchKsDocument() {
|
||||
console.log("i'm in");
|
||||
loadingStore.scenario_loading = true;
|
||||
await KsDocumentService.getKsDocuments().then(resp => {
|
||||
lstKsDocument.value = resp.data;
|
||||
console.log("lstKsDocument", lstKsDocument.value);
|
||||
loadingStore.scenario_loading = false;
|
||||
});
|
||||
|
||||
}
|
||||
const ksDocument = computed(() => {
|
||||
return lstKsDocument.value
|
||||
})
|
||||
|
||||
const getSelectedKsDocument = computed(() => {
|
||||
return selectedKsDocument.value
|
||||
})
|
||||
|
||||
async function setSelectedKsDocument(ksDoc){
|
||||
selectedKsDocument.value = ksDoc
|
||||
console.log("selectedExecScenario", selectedKsDocument.value);
|
||||
}
|
||||
|
||||
return { fetchKsDocument, selectedKsDocument, lstKsDocument, ksDocument, getSelectedKsDocument, setSelectedKsDocument}
|
||||
})
|
||||
Reference in New Issue
Block a user