Рефакторинг всего раздела
This commit is contained in:
1 parent
a375c1e47f
commit
241966bb89
8 files changed
+79
-42
No files matched your search
@@ -8,24 +8,24 @@
|
||||
<!-- Безопасность -->
|
||||
<!-- {{ 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-col>
|
||||
<v-card class="bg-orange" v-for="item in safetyData" :key="item.id">
|
||||
<v-card-title>{{ item.name }}</v-card-title>
|
||||
<v-card-actions v-for="category in item.categories" :key="category.id">
|
||||
<v-btn>{{ category.name }}</v-btn>
|
||||
<v-btn :icon="showMore[category.id] ? 'mdi-chevron-up' : 'mdi-chevron-down'" @click="showMore[category.id] = !showMore[category.id]"></v-btn>
|
||||
<v-expand-transition>
|
||||
<div v-show="showMore[category.id]">
|
||||
<!-- <v-divider></v-divider> -->
|
||||
<v-card-actions v-for="file in category.files" :key="file.id">
|
||||
<v-card-text>{{ file.name }}</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-actions>
|
||||
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -36,23 +36,25 @@ import { ref, onBeforeMount } from 'vue';
|
||||
import { pagecounter } from '@/utils/universal_functions'
|
||||
import { axiosApiInstance } from '@/utils/axios-api';
|
||||
|
||||
pagecounter()
|
||||
pagecounter();
|
||||
|
||||
const safetyData = ref([])
|
||||
const showMore = ref(true)
|
||||
const safetyData = ref([]);
|
||||
const showMore = ref(false);
|
||||
|
||||
onBeforeMount(() => {
|
||||
axiosApiInstance.get(`api/safety/files/`).then(result => {
|
||||
safetyData.value = result.data
|
||||
})
|
||||
})
|
||||
|
||||
console.log(safetyData.value);
|
||||
});
|
||||
|
||||
|
||||
showMore.value = safetyData.value.reduce((acc, value) => {
|
||||
acc[value.id] = false
|
||||
return acc
|
||||
}, {});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
Reference in new issue
Block a user