P-13 Переверстка

This commit is contained in:
iriska-gri committed 2024-05-07 17:01:24 +03:00
1 parent b10128405a
commit 8690522018
6 files changed
+650 -308

No files matched your search

@@ -0,0 +1,51 @@
<template>
<v-row no-gutters class="flex-column gap pa-1">
<v-col class="bg-green flex-grow-0">
<v-card>
<v-tabs
v-model="tab"
bg-color="teal-darken-1"
slider-color="teal-lighten-3"
selected-class="active-tab"
:grow="true"
>
<v-tab
v-for="(tabitem, key) in tabs"
:value="tabitem.value"
:key="key"
>
{{ tabitem.title }}
</v-tab>
</v-tabs>
</v-card>
</v-col>
<v-col class="flex-column">
<v-window v-model="tab" class="h-100">
<slot name="item" />
</v-window>
</v-col>
</v-row>
</template>
<script>
import { ref } from "vue";
export default {
props: {
tabs: {
type: Object,
default: () => {},
},
},
setup() {
return {
tab: ref(null),
};
},
};
</script>
<style></style>
@@ -1,5 +1,5 @@
<template>
<v-row class="ma-1">
<!-- <v-row class="ma-1">
<v-col lg="6" class="d-flex justify-center align-start">
<v-card :elevation="5">
<div style="width:915px;height:832px; ">
@@ -69,6 +69,11 @@
</v-col>
</v-row> -->
<v-row>
<v-col class="bg-red">
1
</v-col>
</v-row>
</template>
<script>
@@ -0,0 +1,208 @@
<template>
<v-row no-gutters class="flex-column h-100 gap">
<v-col>
<v-row no-gutters class="flex-column h-100 gap">
<v-col class="w100 flex-grow-0">
<v-card class="text-center">
<v-card-text class="font-weight-medium text-lg-h6">
Межрегиональная инспекция Федеральной налоговой службы по
централизованной обработке данных №2
<p class="font-weight-medium text-lg-subtitle-1 text-sm-caption">
создана 01.02.2018 года в соответствии с приказом ФНС России от
27.12.2017 №ММВ-7-4/1102
</p>
<p class="mt-3">
<a class="text-decoration-none" :href="caCuratorLink"
>Работа МИ ФНС России по ЦОД №2 координируется заместителем
руководителя ФНС России Будариным Андреем Владимировичем</a
>
</p>
</v-card-text>
</v-card>
</v-col>
<v-col class="d-flex">
<v-row no-gutters class="gap">
<v-col lg="3" class="flex-column">
<v-row no-gutters class="gap flex-column h-100">
<v-col class="w100 ">
<v-card class="h-100">
<v-card-title class="text-h6 text-uppercase text-center">
Начальник инспекции</v-card-title
>
<v-divider class="mb-3" />
<v-img
:src="checkremote(`${spravURL}${userlinks.login}.jpg`)"
height="200"
/>
<v-card-title class="text-h6 text-center">{{
userlinks.fio
}}</v-card-title>
<v-card-text class="text-center text-body-2">
<p>
Государственный советник Российской Федерации 2 класса
</p>
</v-card-text>
</v-card>
</v-col>
<v-col class="w100 flex-column d-flex">
<v-card class="flex-grow-1">
<v-card-title class="text-h6 text-center text-uppercase">
Штатная численность
</v-card-title>
<v-card-text class="text-h2 text-center">
<vue3-autocounter
ref="counter"
:startAmount="0"
:endAmount="getstatesize.statesize"
:duration="2"
/>
</v-card-text>
<v-card-subtitle class="text-center"
>по состоянию на
{{
new Date(getstatesize.date_created).toLocaleDateString(
"ru-RU"
)
}}
</v-card-subtitle>
</v-card>
<!-- <v-divider></v-divider> -->
<v-card class="flex-grow-1 mt-1">
<v-card-title class="text-h6 text-center text-uppercase">
Фактическая численность
</v-card-title>
<v-card-text class="text-h2 text-center">
<vue3-autocounter
ref="counter"
:startAmount="0"
:endAmount="getfactsize.factsize"
:duration="2"
/>
</v-card-text>
<v-card-subtitle class="text-center"
>по состоянию на
{{
new Date(getfactsize.date_created).toLocaleDateString(
"ru-RU"
)
}}
</v-card-subtitle>
</v-card>
</v-col>
</v-row>
</v-col>
<v-col class="bg-yellow">
<v-card class="h-100 flex-column d-flex">
<v-card-title class="text-h6 text-uppercase text-center ">
Основные направления деятельности инспекции
</v-card-title>
<v-divider class="pb-3"/>
<v-row no-gutters class=" gap justify-center ">
<!-- v-for="direction in directionworks" -->
<v-col
v-for="direction in 10"
:key="direction.id"
lg="12"
class="px-3"
>
<v-card class="d-flex" :elevation="3">
<v-col class="d-flex align-center justify-center">
<v-avatar
class="elevation-10 text-teal-darken-4"
color="teal-lighten-5"
>
<v-icon :icon="direction.icon_name"></v-icon>
</v-avatar>
</v-col>
<v-col
lg="11"
class="d-flex align-center justify-start text-h6"
>
{{ direction.direction_title }}
</v-col>
</v-card>
</v-col>
</v-row>
</v-card>
</v-col>
</v-row>
</v-col>
</v-row></v-col
>
</v-row>
</template>
<script>
import { ref } from "vue";
import { axiosApiInstance } from "@/utils/axios-api";
import { checkremote } from "@/utils/universal_functions";
import { spravURL, baseURL } from "@/utils/axios-api";
export default {
setup() {
const userlinks = ref([]);
const getfactsize = ref({ factsize: 0, date_created: new Date() });
const getstatesize = ref({ statesize: 0, date_created: new Date() });
const directionworks = ref([]);
const infouser = () => {
axiosApiInstance
.get("api/accounts/getuser/?userlogin=9966-00-001")
.then((res) => {
userlinks.value = res.data;
});
};
const getFactSize = () => {
axiosApiInstance.get("api/about_inspection/getfactsize/").then((res) => {
getfactsize.value = res.data;
});
};
const getStateSize = () => {
axiosApiInstance.get("api/about_inspection/getstatesize/").then((res) => {
getstatesize.value = res.data;
});
};
const getInspectionDirections = () => {
axiosApiInstance
.get("api/about_inspection/getinspectiondirections/")
.then((res) => {
directionworks.value = res.data;
console.log(directionworks.value);
});
};
getInspectionDirections();
getStateSize();
getFactSize();
infouser();
return {
userlinks,
checkremote,
directionworks,
getstatesize,
getfactsize,
spravURL,
baseURL,
date_now: new Date().toLocaleDateString("ru-RU"),
caCuratorLink: ref(
"https://www.nalog.gov.ru/rn77/about_fts/fts/structure_fts/ca_fns/9515034/"
),
};
},
};
</script>
<style></style>
@@ -84,7 +84,7 @@
</template>
<span> Сменить тему</span>
</v-tooltip>
<v-card class="text-lg-h6 text-md-h3 text-sm-caption text-red-lighten-2" width="50">1</v-card>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
+215 -193
View File
@@ -1,221 +1,243 @@
<template>
<v-row no-gutters class="flex-column">
<v-card>
<v-tabs v-model="tab" bg-color="teal-darken-1" slider-color="teal-lighten-3" selected-class="active-tab"
:grow="true">
<v-tab v-for="tabitem in tabs_items" :value="tabitem.value">{{ tabitem.title }}</v-tab>
</v-tabs>
</v-card>
<v-col>
<v-window v-model="tab">
<v-window-item class="gap h-100" value="mainInfo">
<v-row class="ma-1">
<v-row no-gutters>
<v-col class="d-flex flex-column gap">
<v-card>
<v-card-text class="text-h6 text-center">
<p>
Межрегиональная инспекция Федеральной налоговой службы по централизованной
обработке
данных №2
</p>
<p>
создана 01.02.2018 года в соответствии с приказом ФНС России от 27.12.2017
№ММВ-7-4/1102
</p>
</v-card-text>
<pattern-tabs :tabs="tabs_items">
<template v-slot:item>
<v-window-item class="gap h-100" value="mainInfo">
<general-information />
</v-window-item>
<v-window-item class="gap h-100" value="structureInspection">
<structure-inspection />
</v-window-item>
<v-window-item class="gap h-100" value="openVacancies">
<h1>Открытые вакансии</h1>
</v-window-item>
<v-window-item class="gap h-100" value="contactInfo">
<contact-info />
</v-window-item>
</template>
</pattern-tabs>
<!-- -->
<!-- <v-row no-gutters class="flex-column h-100 gap">
<v-col class="w100 bg-green flex-grow-0">
<v-card-text class="text-h6 text-center">
<a class=" text-decoration-none" :href="caCuratorLink">Работа МИ ФНС
России
по ЦОД №2
координируется заместителем
руководителя ФНС
России
Будариным Андреем Владимировичем</a>
</v-card-text>
</v-card>
</v-col>
</v-row>
<v-row>
<v-col lg="3" class="d-flex flex-column gap">
<v-card>
<v-card-title class="text-h6 text-uppercase text-center"> Начальник
инспекции</v-card-title>
<v-divider></v-divider>
<div class="w-100 d-flex justify-center">
<v-avatar rounded="0" size="200">
<v-img :src="checkremote(`${spravURL}${userlinks.login}.jpg`)"></v-img>
</v-avatar>
</div>
<v-card-title class="text-h6 text-center">{{ userlinks.fio }}</v-card-title>
<v-card-text class="text-center">
<p>{{ bossRank }}</p>
</v-card-text>
</v-card>
<v-card>
<v-card-title class="text-h6 text-center text-uppercase">
Штатная численность
</v-card-title>
<v-card-text class="text-h2 text-center ma-7">
<vue3-autocounter ref='counter' :startAmount='0' :endAmount='getstatesize.statesize'
:duration='2' />
</v-card-text>
<v-card>
<v-tabs
v-model="tab"
bg-color="teal-darken-1"
slider-color="teal-lighten-3"
selected-class="active-tab"
:grow="true"
>
<v-tab
v-for="tabitem in tabs_items"
:value="tabitem.value"
>
{{tabitem.title}}
</v-tab>
</v-tabs>
</v-card>
</v-col>
<v-col>
<v-window v-model="tab" class="h-100">
<v-window-item class="gap h-100" value="mainInfo">
<v-row>
<v-col class="bg-red">
1
</v-col>
</v-row> -->
<!-- <v-row class="ma-1">
<v-row no-gutters>
<v-col class="d-flex flex-column gap">
<v-card>
<v-card-text class="text-h6 text-center">
<p>
Межрегиональная инспекция Федеральной налоговой службы по
централизованной обработке данных №2
</p>
<p>
создана 01.02.2018 года в соответствии с приказом ФНС
России от 27.12.2017 №ММВ-7-4/1102
</p>
</v-card-text>
<v-card-subtitle class="text-center">по состоянию на
{{ new Date(getstatesize.date_created).toLocaleDateString("ru-RU") }}
</v-card-subtitle>
<v-card-text class="text-h6 text-center">
<a class="text-decoration-none" :href="caCuratorLink"
>Работа МИ ФНС России по ЦОД №2 координируется
заместителем руководителя ФНС России Будариным Андреем
Владимировичем</a
>
</v-card-text>
</v-card>
</v-col>
</v-row>
<v-row>
<v-col lg="3" class="d-flex flex-column gap">
<v-card>
<v-card-title class="text-h6 text-uppercase text-center">
Начальник инспекции</v-card-title
>
<v-divider></v-divider>
<div class="w-100 d-flex justify-center">
<v-avatar rounded="0" size="200">
<v-img
:src="checkremote(`${spravURL}${userlinks.login}.jpg`)"
></v-img>
</v-avatar>
</div>
<v-card-title class="text-h6 text-center">{{
userlinks.fio
}}</v-card-title>
<v-card-text class="text-center">
<p>{{ bossRank }}</p>
</v-card-text>
</v-card>
<v-card>
<v-card-title class="text-h6 text-center text-uppercase">
Штатная численность
</v-card-title>
<v-card-text class="text-h2 text-center ma-7">
<vue3-autocounter
ref="counter"
:startAmount="0"
:endAmount="getstatesize.statesize"
:duration="2"
/>
</v-card-text>
<v-divider></v-divider>
<v-card-subtitle class="text-center"
>по состоянию на
{{
new Date(getstatesize.date_created).toLocaleDateString(
"ru-RU"
)
}}
</v-card-subtitle>
<v-card-title class="text-h6 text-center text-uppercase">
Фактическая численность
</v-card-title>
<v-divider></v-divider>
<v-card-text class="text-h2 text-center ma-8">
<vue3-autocounter ref='counter' :startAmount='0' :endAmount='getfactsize.factsize'
:duration='2' />
</v-card-text>
<v-card-title class="text-h6 text-center text-uppercase">
Фактическая численность
</v-card-title>
<v-card-subtitle class="text-center">по состоянию на
{{ new Date(getfactsize.date_created).toLocaleDateString("ru-RU") }}
</v-card-subtitle>
</v-card>
</v-col>
<v-card-text class="text-h2 text-center ma-8">
<vue3-autocounter
ref="counter"
:startAmount="0"
:endAmount="getfactsize.factsize"
:duration="2"
/>
</v-card-text>
<v-col lg="9">
<v-card>
<v-card-title class=" text-h6 text-uppercase text-center">
Основные направления деятельности инспекции
</v-card-title>
<v-divider></v-divider>
<v-row no-gutters class="d-flex justify-center">
<v-col v-for="direction in directionworks" :key="direction.id" lg="12">
<v-card class="ma-3 d-flex" :elevation="3" :height="104">
<v-col class="d-flex align-center justify-center">
<v-avatar class="elevation-10 text-teal-darken-4"
color="teal-lighten-5">
<v-icon :icon="direction.icon_name"></v-icon>
</v-avatar>
</v-col>
<v-col lg="11" class="d-flex align-center justify-start text-h6">
{{ direction.direction_title }}
</v-col>
</v-card>
</v-col>
</v-row>
</v-card>
</v-col>
</v-row>
</v-row>
</v-window-item>
<v-window-item class="gap h-100" value="structureInspection">
<structure-inspection />
</v-window-item>
<v-window-item class="gap h-100" value="openVacancies">
<h1>Открытые вакансии</h1>
</v-window-item>
<v-window-item class="gap h-100" value="contactInfo">
<contact-info />
</v-window-item>
</v-window>
</v-col>
</v-row>
<v-card-subtitle class="text-center"
>по состоянию на
{{
new Date(getfactsize.date_created).toLocaleDateString(
"ru-RU"
)
}}
</v-card-subtitle>
</v-card>
</v-col>
<v-col lg="9">
<v-card>
<v-card-title class="text-h6 text-uppercase text-center">
Основные направления деятельности инспекции
</v-card-title>
<v-divider></v-divider>
<v-row no-gutters class="d-flex justify-center">
<v-col
v-for="direction in directionworks"
:key="direction.id"
lg="12"
>
<v-card class="ma-3 d-flex" :elevation="3" :height="104">
<v-col class="d-flex align-center justify-center">
<v-avatar
class="elevation-10 text-teal-darken-4"
color="teal-lighten-5"
>
<v-icon :icon="direction.icon_name"></v-icon>
</v-avatar>
</v-col>
<v-col
lg="11"
class="d-flex align-center justify-start text-h6"
>
{{ direction.direction_title }}
</v-col>
</v-card>
</v-col>
</v-row>
</v-card>
</v-col>
</v-row>
</v-row> -->
<!-- </v-window-item>
<v-window-item class="gap h-100" value="structureInspection">
<structure-inspection />
</v-window-item>
<v-window-item class="gap h-100" value="openVacancies">
<h1>Открытые вакансии</h1>
</v-window-item>
<v-window-item class="gap h-100" value="contactInfo">
<contact-info />
</v-window-item>
</v-window>
</v-col>
</v-row> -->
</template>
<script>
import { ref } from 'vue'
import { axiosApiInstance } from '@/utils/axios-api'
import { checkremote } from '@/utils/universal_functions'
import { spravURL, baseURL } from '@/utils/axios-api'
import StructureInspection from '@/components/about_inspection/structure/StructureInspection.vue';
import ContactInfo from '@/components/about_inspection/contacts/ContactInfo.vue';
import { pagecounter } from '@/utils/universal_functions'
import { ref } from "vue";
import { axiosApiInstance } from "@/utils/axios-api";
import { spravURL, baseURL } from "@/utils/axios-api";
import StructureInspection from "@/components/about_inspection/structure/StructureInspection.vue";
import ContactInfo from "@/components/about_inspection/contacts/ContactInfo.vue";
import { pagecounter } from "@/utils/universal_functions";
import PatternTabs from "@/components/UI/PatternTabs.vue";
import GeneralInformation from '@/components/about_inspection/пeneral_information/GeneralInformation.vue';
export default {
components: {
StructureInspection,
ContactInfo,
},
components: {
StructureInspection,
ContactInfo,
PatternTabs,
GeneralInformation,
},
setup() {
const userlinks = ref([])
const getfactsize = ref({ 'factsize': 0, 'date_created': new Date() })
const getstatesize = ref({ 'statesize': 0, 'date_created': new Date() })
const directionworks = ref([])
const caCuratorLink = ref('https://www.nalog.gov.ru/rn77/about_fts/fts/structure_fts/ca_fns/9515034/')
const infouser = () => {
axiosApiInstance.get('api/accounts/getuser/?userlogin=9966-00-001').then(res => {
userlinks.value = res.data
})
}
const getFactSize = () => {
axiosApiInstance.get('api/about_inspection/getfactsize/').then(res => {
getfactsize.value = res.data
})
}
const getStateSize = () => {
axiosApiInstance.get('api/about_inspection/getstatesize/').then(res => {
getstatesize.value = res.data
})
}
setup() {
const getInspectionDirections = () => {
axiosApiInstance.get('api/about_inspection/getinspectiondirections/').then(res => {
directionworks.value = res.data
console.log(directionworks.value)
})
}
getInspectionDirections()
getStateSize()
getFactSize()
infouser()
pagecounter()
return {
caCuratorLink,
directionworks,
getstatesize,
getfactsize,
spravURL,
baseURL,
checkremote,
caCuratorLink,
userlinks,
tab: ref(null),
date_now: new Date().toLocaleDateString("ru-RU"),
bossRank: "Государственный советник Российской Федерации 2 класса",
tabs_items: [{ "title": "Общая информация", "value": "mainInfo" },
{ "title": "Структура инспекции", "value": "structureInspection" },
{ "title": "Открытые вакансии", "value": "openVacancies" },
{ "title": "Контактная информация", "value": "contactInfo" }],
}
}
}
pagecounter();
return {
tabs_items: [
{ title: "Общая информация", value: "mainInfo" },
{ title: "Структура инспекции", value: "structureInspection" },
{ title: "Открытые вакансии", value: "openVacancies" },
{ title: "Контактная информация", value: "contactInfo" },
],
};
},
};
</script>
<style>
.active-tab {
background-color: #E0F2F1;
color: #004D40;
background-color: #e0f2f1;
color: #004d40;
}
a {
color: inherit;
color: inherit;
}
</style>
</style>
+169 -113
View File
@@ -1,84 +1,140 @@
<template>
<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 lg="1" class="w100 h-100">
<v-card>
<v-tabs
v-model="tab"
bg-color="teal-darken-1"
slider-color="teal-darken-2"
:grow="true">
<v-tab selected-class="isActiveTab" value="mainInfo">Основная информация</v-tab>
<v-tab selected-class="isActiveTab" value="document">Документация</v-tab>
<v-tab selected-class="isActiveTab" value="testings">Тестирование</v-tab>
</v-tabs>
</v-card>
<v-card>
<v-tabs
v-model="tab"
bg-color="teal-darken-1"
slider-color="teal-darken-2"
:grow="true"
>
<v-tab selected-class="isActiveTab" value="mainInfo"
>Основная информация</v-tab
>
<v-tab selected-class="isActiveTab" value="document"
>Документация</v-tab
>
<v-tab selected-class="isActiveTab" value="testings"
>Тестирование</v-tab
>
</v-tabs>
</v-card>
</v-col>
<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>
</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">
<v-card-title>{{ item.name }}</v-card-title>
<v-container
v-for="category in item.categories"
:key="item.id + category.id"
:fluid="true"
class="py-0">
<v-card-actions v-if="category.id != 'evacuation_plan'">
<v-btn
@click="showMore[item.id + category.id] = !showMore[item.id + category.id]"
variant="text">
{{ category.name }}
</v-btn>
<v-btn
:icon="showMore[item.id + category.id] ? 'mdi-chevron-up' : 'mdi-chevron-down'"
@click="showMore[item.id + category.id] = !showMore[item.id + category.id]">
</v-btn>
</v-card-actions>
<v-expand-transition>
<div v-show="showMore[item.id + category.id]">
<v-card-actions v-for="file in category.files" :key="file.id" class="overflow-y-auto">
<v-card-text
class="cursor-pointer"
:ref_="openPDF(burl + file.url)"
@click="openPDF(burl + file.url), loading=true">
{{ file.name }}
</v-card-text>
<v-btn icon="mdi-file-pdf-box" color="red" @click="openPDF(burl + 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-container>
</v-card>
</v-row>
<v-row class="ma-0 overflow-auto h-0">
<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.replace(/\.[^/.]+$/, "") }}</v-card-text>
<v-btn icon="mdi-file-pdf-box" color="red" @click="openPDF(burl + file.url), loading=true"></v-btn>
<v-btn icon='mdi-file-download-outline' color="green" @click="downloadItem(burl + file.file_name, file.file_name)"></v-btn>
<!-- @click="downloadItem(burl + file.file_name, file.file_name)" -->
</v-card-actions>
</v-container>
</v-card>
</v-row>
</v-card>
<v-window v-model="tab" class="h-100">
<v-window-item no-gutters class="gap h-100" value="mainInfo">
<MainInfoSafety></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"
>
<v-card-title>{{ item.name }}</v-card-title>
<v-container
v-for="category in item.categories"
:key="item.id + category.id"
:fluid="true"
class="py-0"
>
<v-card-actions v-if="category.id != 'evacuation_plan'">
<v-btn
@click="
showMore[item.id + category.id] =
!showMore[item.id + category.id]
"
variant="text"
>
{{ category.name }}
</v-btn>
<v-btn
:icon="
showMore[item.id + category.id]
? 'mdi-chevron-up'
: 'mdi-chevron-down'
"
@click="
showMore[item.id + category.id] =
!showMore[item.id + category.id]
"
>
</v-btn>
</v-card-actions>
<v-expand-transition>
<div v-show="showMore[item.id + category.id]">
<v-card-actions
v-for="file in category.files"
:key="file.id"
class="overflow-y-auto"
>
<v-card-text
class="cursor-pointer"
:ref_="openPDF(burl + file.url)"
@click="
openPDF(burl + file.url), (loading = true)
"
>
{{ file.name }}
</v-card-text>
<v-btn
icon="mdi-file-pdf-box"
color="red"
@click="
openPDF(burl + 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-container>
</v-card>
</v-row>
<v-row class="ma-0 overflow-auto h-0">
<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.replace(/\.[^/.]+$/, "")
}}</v-card-text>
<v-btn
icon="mdi-file-pdf-box"
color="red"
@click="openPDF(burl + file.url), (loading = true)"
></v-btn>
<v-btn
icon="mdi-file-download-outline"
color="green"
@click="
downloadItem(burl + file.file_name, file.file_name)
"
></v-btn>
<!-- @click="downloadItem(burl + file.file_name, file.file_name)" -->
</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">
@@ -99,27 +155,26 @@
</v-card-actions>
</v-card> -->
</v-col>
</v-row>
</v-window-item>
<v-window-item value="testings" no-gutters class="gap h-100 ">
<TestSafety></TestSafety>
</v-row>
</v-window-item>
</v-window>
<v-window-item value="testings" no-gutters class="gap h-100">
<TestSafety></TestSafety>
</v-window-item>
</v-window>
</v-col>
</v-row>
</v-row>
</template>
<script setup>
import { ref, onBeforeMount, onUpdated } from 'vue';
import { pagecounter } from '@/utils/universal_functions';
import { axiosApiInstance, baseURL } from '@/utils/axios-api';
import { saveAs } from 'file-saver';
import { useRoute } from 'vue-router'
import { ref, onBeforeMount, onUpdated } from "vue";
import { pagecounter } from "@/utils/universal_functions";
import { axiosApiInstance, baseURL } from "@/utils/axios-api";
import { saveAs } from "file-saver";
import { useRoute } from "vue-router";
import VuePdfEmbed from 'vue-pdf-embed';
import TestSafety from './TestSafety.vue';
import MainInfoSafety from './MainInfoSafety.vue';
import VuePdfEmbed from "vue-pdf-embed";
import TestSafety from "./TestSafety.vue";
import MainInfoSafety from "./MainInfoSafety.vue";
pagecounter();
@@ -127,26 +182,28 @@ const safetyData = ref([]);
const responsibilityData = ref();
const showMore = ref(false);
const showFile = ref(false);
let pdfSource = '';
let pdfSource = "";
const loading = ref(false);
const tab = ref('');
const burl = baseURL.slice(0,-1);
const tab = ref("");
const burl = baseURL.slice(0, -1);
const route = useRoute();
// Вынес запрос в отдельную функцию, чтобы избежать дублирования одного и того же запроса на сервер.
function getSafety() {
axiosApiInstance.get(`api/safety/files/?chapter_id=${route.params.chapter_id}`).then(result => {
safetyData.value = result.data
})
axiosApiInstance
.get(`api/safety/files/?chapter_id=${route.params.chapter_id}`)
.then((result) => {
safetyData.value = result.data;
});
}
function getResponsibility() {
axiosApiInstance.get(`api/safety/committee_files/`).then(result => {
responsibilityData.value = result.data
})
axiosApiInstance.get(`api/safety/committee_files/`).then((result) => {
responsibilityData.value = result.data;
});
}
getResponsibility()
getResponsibility();
onBeforeMount(() => getSafety());
// Хук обновления реализует возможность динамической подгрузки данных при переключении между вкладками раздела безопасность
@@ -154,27 +211,26 @@ onUpdated(() => getSafety());
// Проверяем по ID на какой категории срабатывает клик на раскрытии/скрытии, чтобы избежать срабатывания у всех категорий одновременно
showMore.value = safetyData.value.reduce((acc, value) => {
acc[value.id] = false
return acc
acc[value.id] = false;
return acc;
}, {});
const downloadItem = (url, fileName) => {
axiosApiInstance.get(url, {responseType: 'blob'})
.then(response => {
saveAs(response.data, fileName)
})
axiosApiInstance.get(url, { responseType: "blob" }).then((response) => {
saveAs(response.data, fileName);
});
};
function openPDF(url) {
showFile.value = true
if (showFile) {
return pdfSource = url
}
};
showFile.value = true;
if (showFile) {
return (pdfSource = url);
}
}
</script>
<style>
.isActiveTab {
background-color: #68c3ff70;
background-color: #68c3ff70;
}
</style>
</style>