Переверстка фронта в разделе Основная информация
This commit is contained in:
1 parent
d2143a8400
commit
81568e4300
4 files changed
+97
-73
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<v-row no-gutters class="flex-column h-100 gap pa-1">
|
||||
<v-col lg="1" class="w100 h-100">
|
||||
<v-col class="w100 h-100 flex-grow-0">
|
||||
<v-card>
|
||||
<v-tabs
|
||||
v-model="tab"
|
||||
@@ -17,12 +17,11 @@
|
||||
<v-col class="w100 h-100">
|
||||
<v-window v-model="tab" class="h-100">
|
||||
<v-window-item no-gutters class="gap h-100" value="mainInfo">
|
||||
<MainInfoSafety></MainInfoSafety>
|
||||
<MainInfoSafety :formainpage="formainpage"></MainInfoSafety>
|
||||
</v-window-item>
|
||||
<v-window-item value="document" class="h-100">
|
||||
<v-row no-gutters class="gap h-100 ">
|
||||
<v-col lg="6">
|
||||
<!---->
|
||||
<v-card class="h-100 flex-column d-flex gap">
|
||||
<v-row class="ma-0 my-3 overflow-auto h-0 pb-1">
|
||||
<v-card v-for="item in safetyData" :key="item.id" class="overflow-y-auto flex-grow-1 flex-shrink-1 h-100">
|
||||
@@ -111,7 +110,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onBeforeMount, onUpdated } from 'vue';
|
||||
import { ref, onBeforeMount, computed } from 'vue';
|
||||
import { pagecounter } from '@/utils/universal_functions';
|
||||
import { axiosApiInstance, baseURL, spravURLBase } from '@/utils/axios-api';
|
||||
import { saveAs } from 'file-saver';
|
||||
@@ -136,9 +135,25 @@ const route = useRoute();
|
||||
// Вынес запрос в отдельную функцию, чтобы избежать дублирования одного и того же запроса на сервер.
|
||||
function getSafety() {
|
||||
axiosApiInstance.get(`api/safety/files/?chapter_id=${route.params.chapter_id}`).then(result => {
|
||||
safetyData.value = result.data
|
||||
safetyData.value = result.data
|
||||
|
||||
})
|
||||
}
|
||||
const formainpage = computed({
|
||||
get(){
|
||||
let arr=[]
|
||||
if(safetyData.value.length>0){
|
||||
safetyData.value[0].categories.forEach(element => {
|
||||
element.files.forEach((e)=>{
|
||||
if(e.formainpage==true){arr.push(e)}})
|
||||
})
|
||||
}
|
||||
|
||||
return arr
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function getResponsibility() {
|
||||
axiosApiInstance.get(`api/safety/committee_files/`).then(result => {
|
||||
@@ -149,8 +164,6 @@ function getResponsibility() {
|
||||
getResponsibility()
|
||||
|
||||
onBeforeMount(() => getSafety());
|
||||
// Хук обновления реализует возможность динамической подгрузки данных при переключении между вкладками раздела безопасность
|
||||
onUpdated(() => getSafety());
|
||||
|
||||
// Проверяем по ID на какой категории срабатывает клик на раскрытии/скрытии, чтобы избежать срабатывания у всех категорий одновременно
|
||||
showMore.value = safetyData.value.reduce((acc, value) => {
|
||||
|
||||
@@ -1,71 +1,44 @@
|
||||
<template>
|
||||
<v-card class="h-100 black_and_white">
|
||||
<v-row no-gutters class="h-100">
|
||||
<v-col cols="9">
|
||||
<v-card class="h-100 d-flex flex-column black_and_white">
|
||||
|
||||
<v-row no-gutters class="gap h-100 ">
|
||||
<v-col class="bg-red flex-column" >
|
||||
<v-row no-gutters class="h-100 justify-center">
|
||||
<v-col lg="6" class="bg-yellow meheight " v-for="x in formainpage" :key="key">
|
||||
<v-img
|
||||
class="cursor-pointer"
|
||||
:src="burl + x.url"
|
||||
@click="openFirstPlan_opener(schema)">
|
||||
</v-img>
|
||||
</v-col>
|
||||
<!-- <v-col lg="6" class="bg-green">2</v-col>
|
||||
<v-col lg="6" class="bg-pink">2</v-col> -->
|
||||
</v-row>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
<!-- <v-card class="h-100 black_and_white">
|
||||
<my-helper :pretext=" formainpage" /> -->
|
||||
<!-- <v-row no-gutters class="h-100">
|
||||
<v-col cols="9">
|
||||
<v-card class="h-100 d-flex flex-column black_and_white">
|
||||
<v-row class="ma-0 overflow-auto h-0">
|
||||
<v-col
|
||||
<v-col v-for="(schema,index) in formainpage" :key="index"
|
||||
cols="6"
|
||||
class="h-100 gap">
|
||||
|
||||
<v-card class="h-100">
|
||||
<v-img
|
||||
<VuePdfEmbed v-if="schema.url.endsWith('.pdf')" :source="burl + schema.url" width="500" />
|
||||
<v-img v-else
|
||||
class="cursor-pointer"
|
||||
:src="`${burl}/media/safety/schemas/Схема1.jpg`"
|
||||
:src="burl + schema.url"
|
||||
height="100%"
|
||||
@click="openFirstPlan = true">
|
||||
@click="openFirstPlan_opener(schema)">
|
||||
</v-img>
|
||||
|
||||
</v-card>
|
||||
<v-dialog v-model="openFirstPlan" :width="900" height="100%">
|
||||
<v-row class="ma-0 overflow-auto h-0">
|
||||
<v-card class="h-100 w-100 pa-0 flex-grow-0">
|
||||
<v-btn
|
||||
density="compact"
|
||||
variant="text"
|
||||
icon="mdi-close"
|
||||
@click="openFirstPlan = false">
|
||||
</v-btn>
|
||||
<v-img
|
||||
:src="`${burl}/media/safety/schemas/Схема1.jpg`"
|
||||
class="cursor-pointer"
|
||||
height="100%"
|
||||
width="100%"
|
||||
@click="openFirstPlan = false">
|
||||
</v-img>
|
||||
</v-card>
|
||||
</v-row>
|
||||
</v-dialog>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="6"
|
||||
class="h-100 gap">
|
||||
<v-card class="h-100">
|
||||
<v-img
|
||||
:src="`${burl}/media/safety/schemas/Схема2.jpg`"
|
||||
class="cursor-pointer"
|
||||
height="100%"
|
||||
@click="openSecondPlan = true">
|
||||
</v-img>
|
||||
<v-dialog v-model="openSecondPlan" :width="900" height="100%">
|
||||
<v-row class="ma-0 overflow-auto h-0">
|
||||
<v-card class="h-100 w-100 pa-0 flex-grow-0">
|
||||
<v-btn
|
||||
density="compact"
|
||||
variant="text"
|
||||
icon="mdi-close"
|
||||
@click="openSecondPlan = false">
|
||||
</v-btn>
|
||||
<v-img
|
||||
:src="`${burl}/media/safety/schemas/Схема2.jpg`"
|
||||
class="cursor-pointer"
|
||||
height="100%"
|
||||
width="100%"
|
||||
@click="openSecondPlan = false">
|
||||
</v-img>
|
||||
</v-card>
|
||||
</v-row>
|
||||
</v-dialog>
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
<v-row class="ma-0 overflow-auto h-0">
|
||||
<v-col class="h-100 gap">
|
||||
@@ -99,6 +72,26 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
<v-dialog v-model="openFirstPlan" :width="900" height="100%">
|
||||
<v-row class="ma-0 overflow-auto h-0">
|
||||
<v-card class="h-100 w-100 pa-0 flex-grow-0">
|
||||
{{ index }}
|
||||
<v-btn
|
||||
density="compact"
|
||||
variant="text"
|
||||
icon="mdi-close"
|
||||
@click="openFirstPlan = false">
|
||||
</v-btn>
|
||||
<v-img
|
||||
:src="urlschema"
|
||||
class="cursor-pointer"
|
||||
height="100%"
|
||||
width="100%"
|
||||
@click="openFirstPlan = false">
|
||||
</v-img>
|
||||
</v-card>
|
||||
</v-row>
|
||||
</v-dialog>
|
||||
</v-col>
|
||||
<v-col cols="3" class="w100">
|
||||
<v-card class="h-100 d-flex flex-column">
|
||||
@@ -114,21 +107,32 @@
|
||||
</v-row>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
</v-row> -->
|
||||
<!-- </v-card> -->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import { baseURL, axiosApiInstance } from '@/utils/axios-api'
|
||||
import { ref } from 'vue';
|
||||
|
||||
import VuePdfEmbed from 'vue-pdf-embed';
|
||||
defineProps(
|
||||
{
|
||||
formainpage: Object,
|
||||
require:true
|
||||
},
|
||||
)
|
||||
const urlschema=ref(null)
|
||||
const burl = baseURL.slice(0,-1)
|
||||
const openImg = ref(false)
|
||||
const openFirstPlan = ref(false)
|
||||
const openSecondPlan = ref(false)
|
||||
const responsibility = ref([])
|
||||
|
||||
function openFirstPlan_opener(schema){
|
||||
urlschema.value = burl + schema.url
|
||||
openFirstPlan.value = true
|
||||
}
|
||||
|
||||
function getResponsibility() {
|
||||
axiosApiInstance.get(`api/safety/responsibility/`).then(result => {
|
||||
responsibility.value = result.data.users
|
||||
@@ -138,4 +142,10 @@ function getResponsibility() {
|
||||
getResponsibility()
|
||||
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.meheight {
|
||||
max-height: 44vh;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user