Files
frontend-elite-data-analysis/src/components/data-analysis/file-container/FileContainer.vue
T

45 lines
1.4 KiB
Vue
Raw Normal View History

<template>
2023-01-31 10:37:06 +08:00
<va-card>
2023-01-12 17:37:54 +08:00
<va-card-content>
<va-button @click="showModal">FILE</va-button>
2023-01-12 17:37:54 +08:00
<p>X: {{ channelStore.xAxisSelected.name }} Y: {{ channelStore.yAxisSelected.name }}</p>
<va-list class="py-2" fit>
<va-list-label> </va-list-label>
<template v-for="(file, i) in selectedFiles" :key="'item' + file.id">
<va-list-item>
<va-list-item-section>
<va-list-item-label>
{{ file.name }}
</va-list-item-label>
</va-list-item-section>
</va-list-item>
<va-list-separator v-if="i < selectedFiles.length - 1" :key="'separator' + i" class="my-1" fit />
</template>
</va-list>
<Suspense>
2023-02-01 11:19:57 +08:00
<FileSlide ref="file_modal_ref"></FileSlide>
</Suspense>
2023-01-12 17:37:54 +08:00
</va-card-content>
</va-card>
</template>
<script setup lang="ts">
2023-01-12 17:37:54 +08:00
import { ref, reactive } from 'vue'
import { useChannelStore } from '@/stores/data-analysis/channel'
import { useFileViewStore } from '@/stores/data-analysis/file-view'
2023-02-01 11:19:57 +08:00
import FileSlide from './FileSlider.vue'
2023-01-12 17:37:54 +08:00
const channelStore = useChannelStore()
const fileViewStore = useFileViewStore()
const selectedFiles = reactive(fileViewStore.selectedFiles)
/* File Modal Handling */
2023-03-07 16:48:30 +08:00
const file_modal_ref = ref<InstanceType<typeof FileSlide> | null>(null)
const showModal = function () {
file_modal_ref.value?.showModal()
}
defineExpose({ file_modal_ref, showModal })
</script>