Переработка бэкэнда под задачи №99, 88

This commit is contained in:
Alex committed 2024-04-19 16:15:12 +03:00
1 parent fa8d49efef
commit b281b9d109
1 file changed
+34 -47
+34 -47
View File
@@ -2,12 +2,7 @@
<v-row no-gutters class="flex-column h-100 gap pa-1"> <v-row no-gutters class="flex-column h-100 gap pa-1">
<v-col class="w100 h-100 flex-grow-0"> <v-col class="w100 h-100 flex-grow-0">
<v-card> <v-card>
<v-tabs <v-tabs v-model="tab" bg-color="bg_tab" slider-color="slider_tab" selected-class="isActiveTab" :grow="true">
v-model="tab"
bg-color="bg_tab"
slider-color="slider_tab"
selected-class="isActiveTab"
:grow="true">
<v-tab value="mainInfo">Основная информация</v-tab> <v-tab value="mainInfo">Основная информация</v-tab>
<v-tab value="document">Документация</v-tab> <v-tab value="document">Документация</v-tab>
<v-tab value="testings">Тестирование</v-tab> <v-tab value="testings">Тестирование</v-tab>
@@ -23,38 +18,37 @@
<v-row no-gutters class="gap h-100 "> <v-row no-gutters class="gap h-100 ">
<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 my-3 overflow-auto h-0 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
flat>
flat <v-expansion-panel elevation=0 v-for="category in safetyData.categories"
> :key="category.id" class="py-0">
<v-expansion-panel-title class="font-weight-medium">{{
<v-expansion-panel category.category__name }}</v-expansion-panel-title>
elevation=0
v-for="category in safetyData.categories"
:key="category.id"
class="py-0">
<v-expansion-panel-title class="font-weight-medium">{{ 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" class="overflow-y-auto d-flex justify-space-between"> <div v-for="file in category.files" :key="file.id"
<div class="overflow-y-auto d-flex justify-space-between">
class="cursor-pointer" <div class="cursor-pointer"
@click="openPDF(file.url), loading = true"> @click="openPDF(file.url), loading = true">
{{ file.name }} {{ file.name }}
</div> </div>
<div> <div>
<v-btn size="small" variant="text" icon="mdi-file-pdf-box" color="red" @click="openPDF(file.url), loading=true"></v-btn> <v-btn size="small" variant="text" icon="mdi-file-pdf-box"
<v-btn size="small" variant="text" icon='mdi-file-download-outline' color="green" @click="downloadItem(burl + file.url, file.name)"></v-btn> color="red"
@click="openPDF(file.url), loading = true"></v-btn>
<v-btn size="small" variant="text"
icon='mdi-file-download-outline' color="green"
@click="downloadItem(burl + file.url, file.name)"></v-btn>
</div> </div>
</div> </div>
@@ -93,21 +87,19 @@
</v-expansion-panels> </v-expansion-panels>
</v-card> </v-card>
</v-row> </v-row>
<v-row class="ma-0 overflow-auto h-0"> <v-row class="ma-0 overflow-auto bg-yellow ">
<v-card class="overflow-y-auto flex-grow-1 h-100"> <v-card class="overflow-y-auto flex-grow-1 h-100">
<v-card-title>{{ responsibilityData.name }}</v-card-title> <v-card-title>{{ responsibilityData.name }}</v-card-title>
<v-container <v-container v-for="file in responsibilityData.files" :fluid="true" class="py-0">
v-for="file in responsibilityData.files"
:fluid="true"
class="py-0">
<v-card-actions :key="file.id"> <v-card-actions :key="file.id">
<v-card-text <v-card-text class="cursor-pointer"
class="cursor-pointer"
@click="openPDF(checkNameFiles(file)), loading = true"> @click="openPDF(checkNameFiles(file)), loading = true">
{{ get_name(decodeURI(file.file_name.replace(/\.[^/.]+$/, ""))) }} {{ get_name(decodeURI(file.file_name.replace(/\.[^/.]+$/, ""))) }}
</v-card-text> </v-card-text>
<v-btn icon="mdi-file-pdf-box" color="red" @click="openPDF(checkNameFiles(file)), loading=true"></v-btn> <v-btn icon="mdi-file-pdf-box" color="red"
<v-btn icon='mdi-file-download-outline' color="green" @click="downloadItem(burl + checkNameFiles(file), get_name(decodeURI(file.file_name)))"></v-btn> @click="openPDF(checkNameFiles(file)), loading = true"></v-btn>
<v-btn icon='mdi-file-download-outline' color="green"
@click="downloadItem(burl + checkNameFiles(file), get_name(decodeURI(file.file_name)))"></v-btn>
</v-card-actions> </v-card-actions>
</v-container> </v-container>
</v-card> </v-card>
@@ -117,22 +109,17 @@
<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-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-card v-show="showFile"
class="mr-2 flex-grow-1 flex-shrink-1 h-100 pa-2 overflow-auto">
<v-container v-if="loading"> <v-container v-if="loading">
<v-progress-linear <v-progress-linear :rounded="5" indeterminate color="teal">
:rounded="5"
indeterminate
color="teal">
</v-progress-linear> </v-progress-linear>
</v-container> </v-container>
<VuePdfEmbed :source="pdfSource" width="720" @rendered="loading = false" /> <VuePdfEmbed :source="pdfSource" width="720" @rendered="loading = false" />
</v-card> </v-card>
</v-row> </v-row>
<v-card-actions v-show="showFile"> <v-card-actions v-show="showFile">
<v-btn <v-btn position="sticky" block @click="showFile = false">Закрыть</v-btn>
position="sticky"
block
@click="showFile = false">Закрыть</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-col> </v-col>
@@ -144,7 +131,6 @@
</v-window> </v-window>
</v-col> </v-col>
</v-row> </v-row>
</template> </template>
<script setup> <script setup>
@@ -160,7 +146,7 @@ import MainInfoSafety from './MainInfoSafety.vue';
pagecounter(); pagecounter();
const safetyData = ref([]); const safetyData = ref({categories:[]});
const responsibilityData = ref(); const responsibilityData = ref();
const showMore = ref(false); const showMore = ref(false);
const showFile = ref(true); const showFile = ref(true);
@@ -184,14 +170,15 @@ function getSafety() {
const formainpage = computed({ const formainpage = computed({
get() { get() {
let arr = [] let arr = []
if(safetyData.value.length>0){
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) {
arr.push(e)} arr.push(e)
})
})
} }
})
})
return arr return arr
} }
}) })