Merge branch 'Alex' into razrab

This commit is contained in:
iriska-gri committed 2024-02-29 14:33:08 +03:00
commit 4bb29d7f2b
9 files changed
+90 -42

No files matched your search

+26 -9
View File
@@ -60,15 +60,22 @@
</v-card>
</v-row>
<v-row class="ma-0 overflow-auto h-0">
<v-card
title="Здесь отображаем файлы по пожарной комиссии"
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>{{ responsibilityData.name }}</v-card-title>
<v-container
v-for="file in responsibilityData.files"
:fluid="true"
class="py-0">
<v-card-actions :key="file.id">
<v-card-text>{{ file.file_name }}</v-card-text>
</v-card-actions>
</v-container>
</v-card>
</v-row>
</v-card>
</v-col>
<v-col>
<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 h-0">
<v-card v-show="showFile" class="mr-2 flex-grow-1 flex-shrink-1 h-100 pa-2 overflow-auto">
<v-container v-if="loading">
@@ -87,7 +94,7 @@
block
@click="showFile = false">Закрыть</v-btn>
</v-card-actions>
</v-card>
</v-card> -->
</v-col>
</v-row>
</v-window-item>
@@ -114,13 +121,14 @@ import MainInfoSafety from './MainInfoSafety.vue';
pagecounter();
const safetyData = ref([]);
const responsibilityData = ref();
const showMore = ref(false);
const showFile = ref(false);
let pdfSource = '';
const loading = ref(false);
const tab = ref('')
const burl = baseURL.slice(0,-1)
const route = useRoute()
const tab = ref('');
const burl = baseURL.slice(0,-1);
const route = useRoute();
// Вынес запрос в отдельную функцию, чтобы избежать дублирования одного и того же запроса на сервер.
function getSafety() {
@@ -129,9 +137,18 @@ function getSafety() {
})
}
function getResponsibility() {
axiosApiInstance.get(`api/safety/committee_files/`).then(result => {
responsibilityData.value = result.data
console.log(responsibilityData.value);
})
}
getResponsibility()
onBeforeMount(() => getSafety());
// Хук обновления реализует возможность динамической подгрузки данных при переключении между вкладками раздела безопасность
onUpdated(() => getSafety())
onUpdated(() => getSafety());
// Проверяем по ID на какой категории срабатывает клик на раскрытии/скрытии, чтобы избежать срабатывания у всех категорий одновременно
showMore.value = safetyData.value.reduce((acc, value) => {
+36 -28
View File
@@ -1,24 +1,16 @@
<template>
<v-card class="h-100">
<my-helper :pretext = getSchemas />
<v-row no-gutters class="h-100">
<v-col cols="3" class="w100">
<v-card class="h-100 d-flex flex-column">
<v-card-title class="text-wrap">Ответственные за противопожарную безопасность</v-card-title>
<v-row class="ma-0 overflow-auto h-0">
<v-card class="pa-1 overflow-y-auto flex-grow-1 flex-shrink-1 h-100">
</v-card>
</v-row>
</v-card>
</v-col>
<v-col cols="9">
<v-card class="h-100 d-flex flex-column bg-red">
<v-card class="h-100 d-flex flex-column">
<v-row class="ma-0 overflow-auto h-0">
<v-col cols="6">
<v-col
cols="6"
class="h-100 gap">
<v-card class="h-100">
<v-img
class="cursor-pointer"
:src="`${burl}/media/newsimage/2024/02/01/wallpaperflare.com_wallpaper_2.jpg`"
:src="`${burl}/media/safety/schemas/Схема1.jpg`"
height="100%"
@click="openFirstPlan = true">
</v-img>
@@ -33,7 +25,7 @@
@click="openFirstPlan = false">
</v-btn>
<v-img
:src="`${burl}/media/newsimage/2024/02/01/wallpaperflare.com_wallpaper_2.jpg`"
:src="`${burl}/media/safety/schemas/Схема1.jpg`"
class="cursor-pointer"
height="100%"
width="100%"
@@ -43,10 +35,12 @@
</v-row>
</v-dialog>
</v-col>
<v-col cols="6">
<v-col
cols="6"
class="h-100 gap">
<v-card class="h-100">
<v-img
:src="`${burl}/media/newsimage/2024/02/01/wallpaperflare.com_wallpaper_2.jpg`"
:src="`${burl}/media/safety/schemas/Схема2.jpg`"
class="cursor-pointer"
height="100%"
@click="openSecondPlan = true">
@@ -61,7 +55,7 @@
@click="openSecondPlan = false">
</v-btn>
<v-img
:src="`${burl}/media/newsimage/2024/02/01/wallpaperflare.com_wallpaper_2.jpg`"
:src="`${burl}/media/safety/schemas/Схема2.jpg`"
class="cursor-pointer"
height="100%"
width="100%"
@@ -74,13 +68,13 @@
</v-col>
</v-row>
<v-row class="ma-0 overflow-auto h-0">
<v-col >
<v-col class="h-100 gap">
<v-card class="h-100">
<v-img
:src="`${burl}/media/newsimage/2024/02/01/wallpaperflare.com_wallpaper_1.jpg`" @click="openImg = true"
:src="`${burl}/media/safety/schemas/План.jpg`" @click="openImg = true"
class="cursor-pointer"
height="380"
cover>
height="100%"
width="100%">
</v-img>
<v-dialog v-model="openImg" :width="900" height="100%">
<v-row class="ma-0 overflow-auto h-0">
@@ -92,7 +86,7 @@
@click="openImg = false">
</v-btn>
<v-img
:src="`${burl}/media/newsimage/2024/02/01/wallpaperflare.com_wallpaper_1.jpg`"
:src="`${burl}/media/safety/schemas/План.jpg`"
class="cursor-pointer"
height="100%"
width="100%"
@@ -106,11 +100,25 @@
</v-row>
</v-card>
</v-col>
<v-col cols="3" class="w100">
<v-card class="h-100 d-flex flex-column">
<v-card-title class="text-wrap">Ответственные за противопожарную безопасность</v-card-title>
<v-row class="ma-0 overflow-auto h-0">
<v-card class="pa-1 overflow-y-auto flex-grow-1 flex-shrink-1 h-100">
<list-user
v-for="item in responsibility"
:author="item">
</list-user>
</v-card>
</v-row>
</v-card>
</v-col>
</v-row>
</v-card>
</template>
<script setup>
import listUser from '@/components/UI/fiousercard/listUser.vue';
import { baseURL, axiosApiInstance } from '@/utils/axios-api'
import { ref } from 'vue';
@@ -118,15 +126,15 @@ const burl = baseURL.slice(0,-1)
const openImg = ref(false)
const openFirstPlan = ref(false)
const openSecondPlan = ref(false)
const responsibility = ref([])
const getSchemas = ref([])
function getData() {
axiosApiInstance.get(`api/safety/files/?chapter_id=fire_safety`).then(result => {
getSchemas.value = result.data
function getResponsibility() {
axiosApiInstance.get(`api/safety/responsibility/`).then(result => {
responsibility.value = result.data.users
})
}
getData()
getResponsibility()
</script>