P-40/refactoring safety
This commit is contained in:
1 parent
505fdd279c
commit
ba33bfb69a
4 files changed
+66
-125
No files matched your search
@@ -11,9 +11,9 @@
|
||||
<v-window-item class="gap h-100" value="document">
|
||||
<documentation-safety :docSections = "safetyData" />
|
||||
</v-window-item>
|
||||
<v-window-item class="gap h-100" value="testings">
|
||||
<!-- <v-window-item class="gap h-100" value="testings">
|
||||
<TestSafety></TestSafety>
|
||||
</v-window-item>
|
||||
</v-window-item> -->
|
||||
</template>
|
||||
</pattern-tabs>
|
||||
</template>
|
||||
@@ -49,8 +49,6 @@ export default {
|
||||
.then((result) => {
|
||||
safetyData.value = result.data;
|
||||
loading.value = true;
|
||||
// pdfSource.value = burl + safetyData.value.categories[0].files[0].url
|
||||
console.log(safetyData.value, "-------------------------------");
|
||||
});
|
||||
};
|
||||
getSafety()
|
||||
@@ -63,7 +61,7 @@ export default {
|
||||
tabs_items: [
|
||||
{ title: "Основная информация", value: "mainInfo" },
|
||||
{ title: "Документация", value: "document" },
|
||||
{ title: "Тестирование", value: "testings" },
|
||||
// { title: "Тестирование", value: "testings" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
@@ -3,65 +3,9 @@
|
||||
<v-col class="d-flex">
|
||||
<v-row no-gutters class="flex-column gap">
|
||||
<v-col lg="6" class="w100 d-flex flex-column">
|
||||
<v-card class="h-100 w-100 d-flex flex-column pb-1 rounded-0">
|
||||
<v-card-title>
|
||||
<span class="text-h4 text-wrap"> Комиссии </span>
|
||||
</v-card-title>
|
||||
|
||||
<v-row no-gutters class="h-0 overflow-auto flex-column flex-nowrap">
|
||||
<v-col
|
||||
class="flex-grow-0"
|
||||
v-for="(comm, key) in docSections.type_comm"
|
||||
:key="key"
|
||||
>
|
||||
<v-card-subtitle class="text-wrap">
|
||||
<span class="text-subtitle-1 text-wrap">
|
||||
{{ comm.comm.name }}
|
||||
</span>
|
||||
</v-card-subtitle>
|
||||
|
||||
<v-list :lines="false" density="compact" nav>
|
||||
<v-row
|
||||
no-gutters
|
||||
v-for="file in comm.comm.comitee_files"
|
||||
:key="file.id"
|
||||
>
|
||||
<v-col>
|
||||
<v-list-item
|
||||
:active="filId == file.id"
|
||||
color="primary"
|
||||
density="compact"
|
||||
@click="
|
||||
openPDF(file)
|
||||
"
|
||||
>
|
||||
<span class="text-body-2 text-wrap">
|
||||
{{
|
||||
get_name(
|
||||
decodeURI(file.file_name.replace(/\.[^/.]+$/, ""))
|
||||
)
|
||||
}}
|
||||
</span>
|
||||
</v-list-item></v-col
|
||||
>
|
||||
<v-col class="flex-grow-0 align-self-center">
|
||||
<v-icon
|
||||
icon="mdi-file-download-outline"
|
||||
@click="
|
||||
downloadItem(file)
|
||||
"
|
||||
/></v-col>
|
||||
</v-row>
|
||||
</v-list>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
</v-col>
|
||||
|
||||
<v-col class="w100 d-flex flex-column">
|
||||
<v-card class="h-100 w-100 d-flex flex-column rounded-0">
|
||||
<v-card-title>
|
||||
<span class="text-h4 text-wrap"> Ответсвенности </span>
|
||||
<span class="text-h6 text-wrap"> Ответственность </span>
|
||||
</v-card-title>
|
||||
|
||||
<v-row no-gutters class="h-0 overflow-auto flex-column flex-nowrap">
|
||||
@@ -87,25 +31,62 @@
|
||||
:active="filId == file.id"
|
||||
color="primary"
|
||||
density="compact"
|
||||
@click="
|
||||
openPDF(file)
|
||||
"
|
||||
@click="openPDF(file)">
|
||||
<span class="text-body-2 text-wrap">
|
||||
{{ get_name(decodeURI(file.file_name.replace(/\.[^/.]+$/, ""))) }}
|
||||
</span>
|
||||
</v-list-item>
|
||||
</v-col>
|
||||
<v-col class="flex-grow-0 align-self-center">
|
||||
<v-icon
|
||||
icon="mdi-file-download-outline"
|
||||
@click="downloadItem(file)"
|
||||
/></v-col>
|
||||
</v-row>
|
||||
</v-list>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
</v-col>
|
||||
|
||||
<v-col class="w100 d-flex flex-column">
|
||||
<v-card class="h-100 w-100 d-flex flex-column pb-1 rounded-0">
|
||||
<v-card-title>
|
||||
<span class="text-h6 text-wrap"> Комиссии </span>
|
||||
</v-card-title>
|
||||
|
||||
<v-row no-gutters class="h-0 overflow-auto flex-column flex-nowrap">
|
||||
<v-col
|
||||
class="flex-grow-0"
|
||||
v-for="(comm, key) in docSections.type_comm"
|
||||
:key="key">
|
||||
<v-card-subtitle class="text-wrap">
|
||||
<span class="text-subtitle-1 text-wrap">
|
||||
{{ comm.comm.name }}
|
||||
</span>
|
||||
</v-card-subtitle>
|
||||
|
||||
<v-list :lines="false" density="compact" nav>
|
||||
<v-row
|
||||
no-gutters
|
||||
v-for="file in comm.comm.comitee_files"
|
||||
:key="file.id">
|
||||
<v-col>
|
||||
<v-list-item
|
||||
:active="filId == file.id"
|
||||
color="primary"
|
||||
density="compact"
|
||||
@click="openPDF(file)"
|
||||
>
|
||||
<span class="text-body-2 text-wrap">
|
||||
{{
|
||||
get_name(
|
||||
decodeURI(file.file_name.replace(/\.[^/.]+$/, ""))
|
||||
)
|
||||
}}
|
||||
{{ get_name(decodeURI(file.file_name.replace(/\.[^/.]+$/, ""))) }}
|
||||
</span>
|
||||
</v-list-item></v-col
|
||||
>
|
||||
<v-col class="flex-grow-0 align-self-center">
|
||||
<v-icon
|
||||
icon="mdi-file-download-outline"
|
||||
@click="
|
||||
downloadItem(file)
|
||||
"
|
||||
@click="downloadItem(file)"
|
||||
/></v-col>
|
||||
</v-row>
|
||||
</v-list>
|
||||
@@ -117,29 +98,22 @@
|
||||
</v-col>
|
||||
|
||||
<v-col class="d-flex flex-column">
|
||||
|
||||
<v-card class="flex-column h-100 d-flex rounded-0">
|
||||
<v-row no-gutters class="h-0 overflow-auto">
|
||||
<v-col class="d-flex flex-column "
|
||||
:class="!loading?'align-center align-self-center':''">
|
||||
|
||||
<v-container v-if="loading">
|
||||
<v-progress-linear :rounded="5" indeterminate color="teal" />
|
||||
</v-container>
|
||||
|
||||
|
||||
<VuePdfEmbed
|
||||
|
||||
<VuePdfEmbed
|
||||
v-show="showFile"
|
||||
:source="pdfSource"
|
||||
width="720"
|
||||
@rendered="loading = false"
|
||||
@loading-failed="handlePdfError"
|
||||
/>
|
||||
@loading-failed="handlePdfError"/>
|
||||
<v-card-text v-show="!showFile" >
|
||||
<span class="text-h5 text-grey"
|
||||
>
|
||||
{{ err }}
|
||||
<span class="text-h5 text-grey">
|
||||
{{ err }}
|
||||
</span>
|
||||
</v-card-text>
|
||||
|
||||
@@ -160,7 +134,6 @@ import { ref, computed } from "vue";
|
||||
import { axiosApiInstance, baseURL, spravURLBase } from "@/utils/axios-api";
|
||||
import { saveAs } from "file-saver";
|
||||
import VuePdfEmbed from "vue-pdf-embed";
|
||||
import { triggerRef } from "vue";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -194,20 +167,14 @@ export default {
|
||||
});
|
||||
};
|
||||
|
||||
const openPDF = (file) => {
|
||||
console.log(file, "fil");
|
||||
|
||||
|
||||
const openPDF = (file) => {
|
||||
let source =development.value ? burl + file.file_name : spravURLBase + `files/${file.typeoffile == 'comm' ? 'committee1_docs' : 'order_responsibility_docs'}/${file.parent}/${get_name(file.file_name)}`
|
||||
if(source!=pdfSource.value){
|
||||
loading.value = true
|
||||
pdfSource.value = source
|
||||
}
|
||||
|
||||
|
||||
showFile.value = true;
|
||||
filId.value = file.id;
|
||||
|
||||
};
|
||||
|
||||
const development = computed({
|
||||
@@ -215,7 +182,6 @@ export default {
|
||||
return process.env.NODE_ENV == "development" ? true : false;
|
||||
}
|
||||
})
|
||||
// process.env.NODE_ENV == "development" ? true : false;
|
||||
|
||||
const get_name = (namestr) => {
|
||||
let arr = namestr.split("/");
|
||||
@@ -232,37 +198,21 @@ export default {
|
||||
showFile.value=false
|
||||
err.value = "Файл не найден";
|
||||
loading.value = false;
|
||||
|
||||
// if (error.status === 404) {
|
||||
// console.error('PDF file not found');
|
||||
// // Дополнительная логика или обработка ошибки 404 здесь
|
||||
// } else {
|
||||
// console.error('An error occurred while loading the PDF:', error);
|
||||
// }
|
||||
};
|
||||
|
||||
const firstFile = () => {
|
||||
|
||||
let files = []
|
||||
props.docSections.type_comm.forEach(el => {
|
||||
// console.log(el);
|
||||
files.push(...el.comm.comitee_files)
|
||||
});
|
||||
|
||||
props.docSections.type_resp.forEach(el => {
|
||||
files.push(...el.resp.get_resp_files)
|
||||
});
|
||||
|
||||
|
||||
|
||||
pdfSource.value =development.value ? burl + files[0].file_name : spravURLBase + `files/${files[0].typeoffile == 'comm' ? 'committee1_docs' : 'order_responsibility_docs'}/${files[0].parent}/${get_name(files[0].file_name)}`
|
||||
|
||||
// = source
|
||||
|
||||
// pdfSource.value =
|
||||
// burl + files[0].file_name;
|
||||
pdfSource.value =
|
||||
development.value ? burl + files[0].file_name : spravURLBase + `files/${files[0].typeoffile == 'comm' ? 'committee1_docs' : 'order_responsibility_docs'}/${files[0].parent}/${get_name(files[0].file_name)}`
|
||||
filId.value = files[0].id;
|
||||
console.log(pdfSource.value, "-------------------------------");
|
||||
};
|
||||
|
||||
firstFile();
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
<v-row no-gutters class="h-0 overflow-auto">
|
||||
<v-col>
|
||||
<v-col class="v-col-auto ">
|
||||
<div class="text-h6 d-flex justify-center">Ответственные</div>
|
||||
<div class="text-h6 d-flex justify-center">Ответственность</div>
|
||||
</v-col>
|
||||
<v-col class="v-col-auto">
|
||||
<div v-if="responsibility != undefined && responsibility.length > 0" >
|
||||
<v-expansion-panels>
|
||||
<v-expansion-panels variant="accordion">
|
||||
<v-expansion-panel v-for="item in responsibility">
|
||||
<v-expansion-panel-title class="font-weight-medium">
|
||||
<v-expansion-panel-title >
|
||||
{{ item.resp.sphere_of_responsibility }}
|
||||
</v-expansion-panel-title>
|
||||
<v-expansion-panel-text>
|
||||
@@ -56,9 +56,9 @@
|
||||
</v-col>
|
||||
<v-col class="v-col-auto">
|
||||
<div v-if="commitee != undefined && commitee.length > 0" >
|
||||
<v-expansion-panels >
|
||||
<v-expansion-panels variant="accordion">
|
||||
<v-expansion-panel v-for="item in commitee">
|
||||
<v-expansion-panel-title class="font-weight-medium">
|
||||
<v-expansion-panel-title>
|
||||
{{ item.comm.name }}
|
||||
</v-expansion-panel-title>
|
||||
<v-expansion-panel-text>
|
||||
@@ -73,17 +73,10 @@
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="text-caption text-grey d-flex justify-center">Данные по комиссиям отсутствуют</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</v-col>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<!-- <div class=" overflow-y-auto h-100 bg-orange">
|
||||
|
||||
|
||||
</div> -->
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
Reference in new issue
Block a user