Create videos frontend
This commit is contained in:
40
src/stores/KsVideoGroupStore.js
Normal file
40
src/stores/KsVideoGroupStore.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { computed, ref } from 'vue';
|
||||
import { KsVideoGroupService } from '../service/KsVideoGroupService';
|
||||
|
||||
export const KsVideoGroupStore = defineStore('ksvideogroup_store', () => {
|
||||
const lstKsVideoGroup = ref([]);
|
||||
const selectedKsVideoGroup = ref(null);
|
||||
|
||||
async function fetchKsVideoGroup(projectId) {
|
||||
try {
|
||||
const response = await KsVideoGroupService.getKsVideoGroups(projectId);
|
||||
lstKsVideoGroup.value = response.data;
|
||||
} catch (error) {
|
||||
console.error('Error fetching video groups:', error);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
const ksVideoGroup = computed(() => {
|
||||
return lstKsVideoGroup.value;
|
||||
});
|
||||
|
||||
const getSelectedKsVideoGroup = computed(() => {
|
||||
return selectedKsVideoGroup.value;
|
||||
});
|
||||
|
||||
async function setSelectedKsVideoGroup(group) {
|
||||
selectedKsVideoGroup.value = group;
|
||||
console.log('selectedVideoGroup', selectedKsVideoGroup.value);
|
||||
}
|
||||
|
||||
return {
|
||||
fetchKsVideoGroup,
|
||||
selectedKsVideoGroup,
|
||||
lstKsVideoGroup,
|
||||
ksVideoGroup,
|
||||
getSelectedKsVideoGroup,
|
||||
setSelectedKsVideoGroup
|
||||
};
|
||||
});
|
||||
42
src/stores/KsVideoStore.js
Normal file
42
src/stores/KsVideoStore.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { computed, ref } from 'vue';
|
||||
import { KsVideoService } from '../service/KsVideoService';
|
||||
import { LoadingStore } from './LoadingStore';
|
||||
|
||||
export const KsVideoStore = defineStore('ksvideo_store', () => {
|
||||
|
||||
const lstKsVideo = ref([])
|
||||
const selectedKsVideo = ref(null)
|
||||
const loadingStore = LoadingStore()
|
||||
|
||||
|
||||
async function fetchKsVideoByGroupId(groupId) {
|
||||
try {
|
||||
const response = await KsVideoService.getKsVideosByGroupId(groupId);
|
||||
lstKsVideo.value = response.data;
|
||||
} catch (error) {
|
||||
console.error('Error fetching videos by group:', error);
|
||||
lstKsVideo.value = [];
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
const ksVideo = computed(() => {
|
||||
return lstKsVideo.value;
|
||||
});
|
||||
|
||||
const getKsVideoByGroupId = computed(() => {
|
||||
return lstKsVideo.value;
|
||||
});
|
||||
|
||||
const getSelectedKsVideo = computed(() => {
|
||||
return selectedKsVideo.value;
|
||||
});
|
||||
|
||||
async function setSelectedKsVideo(ksVideo) {
|
||||
selectedKsVideo.value = ksVideo;
|
||||
console.log('selectedExecScenario', selectedKsVideo.value);
|
||||
}
|
||||
|
||||
return {fetchKsVideoByGroupId, selectedKsVideo, lstKsVideo, ksVideo, getKsVideoByGroupId, getSelectedKsVideo, setSelectedKsVideo };
|
||||
});
|
||||
Reference in New Issue
Block a user