Удалил лишние комментарии
This commit is contained in:
1 parent
18c0042729
commit
1c73326a88
1 file changed
+3
-49
@@ -19,23 +19,16 @@
|
|||||||
<v-col lg="6">
|
<v-col lg="6">
|
||||||
<v-card class="h-100 flex-column d-flex gap ">
|
<v-card class="h-100 flex-column d-flex gap ">
|
||||||
<v-row class="ma-0 overflow-auto pb-1 ">
|
<v-row class="ma-0 overflow-auto pb-1 ">
|
||||||
|
|
||||||
<v-card class="overflow-y-auto flex-grow-1 flex-shrink-1 h-100">
|
<v-card class="overflow-y-auto flex-grow-1 flex-shrink-1 h-100">
|
||||||
|
|
||||||
<v-card-title>{{ safetyData.name }}</v-card-title>
|
<v-card-title>{{ safetyData.name }}</v-card-title>
|
||||||
<v-expansion-panels
|
<v-expansion-panels
|
||||||
multiple
|
multiple
|
||||||
flat>
|
flat>
|
||||||
|
|
||||||
<v-expansion-panel elevation=0 v-for="category in safetyData.categories"
|
<v-expansion-panel elevation=0 v-for="category in safetyData.categories"
|
||||||
:key="category.id" class="py-0">
|
:key="category.id" class="py-0">
|
||||||
<v-expansion-panel-title class="font-weight-medium">{{
|
<v-expansion-panel-title class="font-weight-medium">{{
|
||||||
category.category__name }}</v-expansion-panel-title>
|
category.category__name }}</v-expansion-panel-title>
|
||||||
|
|
||||||
<v-expansion-panel-text>
|
<v-expansion-panel-text>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div v-for="file in category.files" :key="file.id"
|
<div v-for="file in category.files" :key="file.id"
|
||||||
class="overflow-y-auto d-flex justify-space-between">
|
class="overflow-y-auto d-flex justify-space-between">
|
||||||
<div class="cursor-pointer"
|
<div class="cursor-pointer"
|
||||||
@@ -43,46 +36,15 @@
|
|||||||
{{ file.name }}
|
{{ file.name }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<v-btn size="small" variant="text" icon="mdi-file-pdf-box"
|
<v-btn variant="text" icon="mdi-file-pdf-box"
|
||||||
color="red"
|
color="red"
|
||||||
@click="openPDF(file.url), loading = true"></v-btn>
|
@click="openPDF(file.url), loading = true"></v-btn>
|
||||||
<v-btn size="small" variant="text"
|
<v-btn variant="text"
|
||||||
icon='mdi-file-download-outline' color="green"
|
icon='mdi-file-download-outline' color="green"
|
||||||
@click="downloadItem(burl + file.url, file.name)"></v-btn>
|
@click="downloadItem(burl + file.url, file.name)"></v-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</v-expansion-panel-text>
|
</v-expansion-panel-text>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <v-card-actions v-if="category.id != 'evacuation_plan'">
|
|
||||||
<v-btn
|
|
||||||
@click="showMore[ category.id] = !showMore[category.id]"
|
|
||||||
variant="text">
|
|
||||||
{{ category.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-card-actions>-->
|
|
||||||
<!-- <v-expand-transition>
|
|
||||||
<div v-show="showMore[ category.id]">
|
|
||||||
<v-card-actions v-for="file in category.files" :key="file.id" class="overflow-y-auto">
|
|
||||||
<v-card-text
|
|
||||||
class="cursor-pointer"
|
|
||||||
@click="openPDF(file.url), loading=true">
|
|
||||||
{{ file.name }}
|
|
||||||
</v-card-text>
|
|
||||||
<v-btn icon="mdi-file-pdf-box" color="red" @click="openPDF(file.url), loading=true"></v-btn>
|
|
||||||
<v-btn icon='mdi-file-download-outline' color="green" @click="downloadItem(burl + file.url, file.name)"></v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</div>
|
|
||||||
</v-expand-transition> -->
|
|
||||||
</v-expansion-panel>
|
</v-expansion-panel>
|
||||||
</v-expansion-panels>
|
</v-expansion-panels>
|
||||||
</v-card>
|
</v-card>
|
||||||
@@ -169,8 +131,7 @@ function getSafety() {
|
|||||||
|
|
||||||
const formainpage = computed({
|
const formainpage = computed({
|
||||||
get() {
|
get() {
|
||||||
let arr = []
|
let arr = []
|
||||||
|
|
||||||
safetyData.value.categories.forEach(element => {
|
safetyData.value.categories.forEach(element => {
|
||||||
element.files.forEach((e) => {
|
element.files.forEach((e) => {
|
||||||
if (e.formainpage == true) {
|
if (e.formainpage == true) {
|
||||||
@@ -178,7 +139,6 @@ const formainpage = computed({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -193,12 +153,6 @@ getResponsibility()
|
|||||||
|
|
||||||
onBeforeMount(() => getSafety());
|
onBeforeMount(() => getSafety());
|
||||||
|
|
||||||
// Проверяем по ID на какой категории срабатывает клик на раскрытии/скрытии, чтобы избежать срабатывания у всех категорий одновременно
|
|
||||||
// showMore.value = safetyData.value.reduce((acc, value) => {
|
|
||||||
// acc[value.id] = false
|
|
||||||
// return acc
|
|
||||||
// }, {});
|
|
||||||
|
|
||||||
const downloadItem = (url, fileName) => {
|
const downloadItem = (url, fileName) => {
|
||||||
axiosApiInstance.get(url, { responseType: 'blob' })
|
axiosApiInstance.get(url, { responseType: 'blob' })
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|||||||
Reference in new issue
Block a user