profiling + research + download

This commit is contained in:
Florinda
2024-11-27 09:33:08 +01:00
parent 818ed15ca0
commit ddd06350cd
15 changed files with 578 additions and 34 deletions

View 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}
})