Создан скелет шаблона для отображения данных в разделе

This commit is contained in:
Alex committed 2024-01-16 10:42:57 +03:00
1 parent 5e6be9a50f
commit a375c1e47f
6 files changed
+42 -14

No files matched your search

+30 -14
View File
@@ -1,23 +1,34 @@
<template> <template>
<v-row class="bg-red w-100"> <!-- <v-row class="bg-red w-100">
<v-col class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"> <v-col class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light">
<!-- Безопасность -->
</v-col>
</v-row> -->
<!-- Безопасность -->
<!-- {{ safetyData }} -->
<v-row class="bg-red">
<v-col cols="4" class="bg-orange" v-for="item in safetyData" :key="item.id">
<v-card
width="500"
:title="item.name_chapter">
<v-card-actions>
<v-btn>{{ item.document_category }}</v-btn>
<v-btn :icon="showMore[item.id] ? 'mdi-chevron-up' : 'mdi-chevron-down'" @click="showMore[item.id] = !showMore[item.id]"></v-btn>
</v-card-actions>
<v-expand-transition>
<div v-show="showMore[item.id]">
<v-divider></v-divider>
<v-card-actions>
<v-card-text>Название документа</v-card-text>
<v-btn icon="mdi-eye" color="grey"></v-btn>
<v-btn icon='mdi-cloud-download' color="grey"></v-btn>
</v-card-actions>
</div>
</v-expand-transition>
</v-card>
</v-col> </v-col>
</v-row> </v-row>
<v-container class="bg-green">
{{ safetyData }}
<!-- <ul>
<li v-for="item in safetyData">{{ item.id }}</li>
</ul> -->
<v-card v-for="safety in safetyData" :title="safety.name_chapter" max-width="470">
<v-list :key="safety.id">
<v-list-item :title="safety.document_category"></v-list-item>
</v-list>
</v-card>
</v-container>
</template> </template>
<script setup> <script setup>
@@ -28,6 +39,7 @@ import { axiosApiInstance } from '@/utils/axios-api';
pagecounter() pagecounter()
const safetyData = ref([]) const safetyData = ref([])
const showMore = ref(true)
onBeforeMount(() => { onBeforeMount(() => {
axiosApiInstance.get(`api/safety/files/`).then(result => { axiosApiInstance.get(`api/safety/files/`).then(result => {
@@ -35,6 +47,10 @@ onBeforeMount(() => {
}) })
}) })
showMore.value = safetyData.value.reduce((acc, value) => {
acc[value.id] = false
return acc
}, {});
</script> </script>
@@ -0,0 +1,3 @@
class="text-white text-center text-lg-h5 h-100"
align-content="center"
justify="center"
@@ -0,0 +1,3 @@
class="text-white text-center text-lg-h5 h-100"
align-content="center"
justify="center"
@@ -0,0 +1,3 @@
class="text-white text-center text-lg-h5 h-100"
align-content="center"
justify="center"
@@ -0,0 +1,3 @@
class="text-white text-center text-lg-h5 h-100"
align-content="center"
justify="center"