fix
This commit is contained in:
1 parent
5b6b271c44
commit
df9a32223c
10 files changed
+122
-305
No files matched your search
@@ -30,6 +30,7 @@ class MyTokenObtainPairSerializer(TokenObtainPairSerializer):
|
|||||||
token['user']=model_to_dict(user.userinfo)
|
token['user']=model_to_dict(user.userinfo)
|
||||||
token['user']['is_active']=user.is_active
|
token['user']['is_active']=user.is_active
|
||||||
token['user']['is_staff']=user.is_staff
|
token['user']['is_staff']=user.is_staff
|
||||||
|
token['user']['is_superuser']=user.is_superuser
|
||||||
# !ТУТ СДЕЛАТь ФОТО НАВЕРНОЕ
|
# !ТУТ СДЕЛАТь ФОТО НАВЕРНОЕ
|
||||||
# token['user']['last_login']= user.last_login
|
# token['user']['last_login']= user.last_login
|
||||||
# print(token)
|
# print(token)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class Settings():
|
|||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'NAME': 'accounting',
|
'NAME': 'accounting',
|
||||||
'USER': 'root',
|
'USER': 'root',
|
||||||
'PASSWORD': 'admin',
|
'PASSWORD': 'ADMIN',
|
||||||
'HOST': '127.0.0.1',
|
'HOST': '127.0.0.1',
|
||||||
'PORT': '3306',
|
'PORT': '3306',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
width="600"
|
width="600"
|
||||||
class="mx-auto"
|
class="mx-auto"
|
||||||
>
|
>
|
||||||
<v-card height="480">
|
<v-card height="500">
|
||||||
<v-card-title class="pl-6">
|
<v-card-title class="pl-6">
|
||||||
Информация
|
Информация
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-divider/>
|
<v-divider/>
|
||||||
<v-card-actions class="align-self-end pt-0">
|
<v-card-actions class="align-self-end py-0">
|
||||||
<v-btn
|
<v-btn
|
||||||
color="modal_btn"
|
color="modal_btn"
|
||||||
variant="text"
|
variant="text"
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="h-100">
|
||||||
|
<v-list-item
|
||||||
<v-list-item v-if="from_which=='dialog-search'" class="pl-4 h-100 text-left pa-2" @click="open=true">
|
v-if="from_which == 'dialog-search'"
|
||||||
|
class="pl-4 h-100 text-left pa-2"
|
||||||
|
@click="open = true"
|
||||||
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<v-avatar
|
<v-avatar
|
||||||
color="grey-darken-3"
|
color="grey-darken-3"
|
||||||
@@ -16,10 +19,14 @@
|
|||||||
</v-list-item-subtitle>
|
</v-list-item-subtitle>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
<v-list-item v-if="from_which=='top-user'" class="h-100 text-left pa-0 pl-0 " @click="open=true">
|
<v-list-item
|
||||||
|
v-if="from_which == 'top-user'"
|
||||||
|
class="h-100 text-left pa-0 pl-0"
|
||||||
|
@click="open = true"
|
||||||
|
>
|
||||||
<v-chip
|
<v-chip
|
||||||
class="cursor-pointer pa-0"
|
class="cursor-pointer pa-0"
|
||||||
variant='text'
|
variant="text"
|
||||||
label
|
label
|
||||||
color="grey-darken-3"
|
color="grey-darken-3"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -31,14 +38,10 @@
|
|||||||
/>
|
/>
|
||||||
<span class="font-weight-medium text-grey-darken-3 myleft text-caption">
|
<span class="font-weight-medium text-grey-darken-3 myleft text-caption">
|
||||||
{{ splitname(author) }}
|
{{ splitname(author) }}
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</v-chip>
|
</v-chip>
|
||||||
|
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<v-img
|
<v-img
|
||||||
v-if="from_which == 'top_comment'"
|
v-if="from_which == 'top_comment'"
|
||||||
@click="open = true"
|
@click="open = true"
|
||||||
@@ -47,58 +50,47 @@
|
|||||||
:src="checkremote(`${spravURL}${author.login}.jpg`)"
|
:src="checkremote(`${spravURL}${author.login}.jpg`)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<info-user-card
|
<info-user-card
|
||||||
:author="author"
|
:author="author"
|
||||||
:opendialog = open
|
:opendialog="open"
|
||||||
@update:opendialog="open = $event"
|
@update:opendialog="open = $event"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref } from 'vue'
|
import { ref } from "vue";
|
||||||
import {checkremote} from '@/utils/universal_functions'
|
import { checkremote } from "@/utils/universal_functions";
|
||||||
import { spravURL } from '@/utils/axios-api'
|
import { spravURL } from "@/utils/axios-api";
|
||||||
import {splitname} from '@/utils/universal_functions'
|
import { splitname } from "@/utils/universal_functions";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "list-user",
|
name: "list-user",
|
||||||
props: {
|
props: {
|
||||||
author: {
|
author: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {}
|
default: {},
|
||||||
},
|
},
|
||||||
|
|
||||||
from_which: {
|
from_which: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "dialog-search"
|
default: "dialog-search",
|
||||||
}
|
},
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
|
const open = ref(false);
|
||||||
const open = ref(false)
|
|
||||||
|
|
||||||
|
|
||||||
const style_item_title = () => {
|
const style_item_title = () => {
|
||||||
if (props.from_which == "top-user") {
|
if (props.from_which == "top-user") {
|
||||||
return "text-body-1 font-weight-medium"
|
return "text-body-1 font-weight-medium";
|
||||||
}
|
} else return "text-body-1 font-weight-medium pt-2";
|
||||||
else
|
};
|
||||||
return "text-body-1 font-weight-medium pt-2"
|
|
||||||
}
|
|
||||||
|
|
||||||
const style_item_subtitle = () => {
|
const style_item_subtitle = () => {
|
||||||
if (props.from_which == "top-user") {
|
if (props.from_which == "top-user") {
|
||||||
return "text-caption"
|
return "text-caption";
|
||||||
}
|
} else return "pb-2";
|
||||||
else
|
};
|
||||||
return "pb-2"
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
open,
|
open,
|
||||||
@@ -106,12 +98,10 @@ export default {
|
|||||||
spravURL,
|
spravURL,
|
||||||
style_item_title,
|
style_item_title,
|
||||||
style_item_subtitle,
|
style_item_subtitle,
|
||||||
splitname
|
splitname,
|
||||||
}
|
};
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -44,7 +44,6 @@
|
|||||||
<v-card-text class="text-center text-body-2">
|
<v-card-text class="text-center text-body-2">
|
||||||
<p>
|
<p>
|
||||||
Государственный советник Российской Федерации 2 класса
|
Государственный советник Российской Федерации 2 класса
|
||||||
{{userlinks}}
|
|
||||||
</p>
|
</p>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|||||||
@@ -33,18 +33,21 @@
|
|||||||
class="d-flex py-3 justify-center align-center font-weight-medium text-uppercase"
|
class="d-flex py-3 justify-center align-center font-weight-medium text-uppercase"
|
||||||
>
|
>
|
||||||
{{ structure.post }}
|
{{ structure.post }}
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-row no-gutters>
|
<v-row no-gutters>
|
||||||
<v-col lg="4" class="pa-1 heightfoto">
|
<v-col lg="4" class="pa-1 heightfoto">
|
||||||
<v-img
|
|
||||||
|
<list-user :author="structure" :from_which="'top_comment'" />
|
||||||
|
<!-- <v-img
|
||||||
class="h-100"
|
class="h-100"
|
||||||
:src="
|
:src="
|
||||||
checkremote(`${spravURL}${structure.login}.jpg`)
|
checkremote(`${spravURL}${structure.login}.jpg`)
|
||||||
"
|
"
|
||||||
cover
|
cover
|
||||||
/>
|
/> -->
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col
|
<v-col
|
||||||
class="text-center align-self-center font-weight-medium"
|
class="text-center align-self-center font-weight-medium"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<template v-if="accountStore.cod2user">
|
<template v-if="accountStore.cod2user">
|
||||||
<vcard-user :author="accountStore.user" />
|
<vcard-user :author="accountStore.user" />
|
||||||
|
<my-helper :pretext="accountStore.user"></my-helper>
|
||||||
<v-tooltip location="bottom">
|
<v-tooltip location="bottom">
|
||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }">
|
||||||
<v-btn
|
<v-btn
|
||||||
@@ -126,8 +126,13 @@
|
|||||||
><v-col>
|
><v-col>
|
||||||
<v-list nav density="compact">
|
<v-list nav density="compact">
|
||||||
<template v-for="(x, key) in navigations">
|
<template v-for="(x, key) in navigations">
|
||||||
|
<!-- v-if="!('submenu' in x) || (x.path== '/portal' && accountStore.user.is_staff)" -->
|
||||||
<v-list-item
|
<v-list-item
|
||||||
v-if="!('submenu' in x)"
|
v-if="
|
||||||
|
(x.path == '/portal'
|
||||||
|
? accountStore.user.is_staff
|
||||||
|
: true) && !('submenu' in x)
|
||||||
|
"
|
||||||
:key="x.key"
|
:key="x.key"
|
||||||
:title="x.name"
|
:title="x.name"
|
||||||
:value="x.name"
|
:value="x.name"
|
||||||
@@ -137,6 +142,7 @@
|
|||||||
:target="x.link ? '_blank' : ''"
|
:target="x.link ? '_blank' : ''"
|
||||||
color="navigation"
|
color="navigation"
|
||||||
>
|
>
|
||||||
|
|
||||||
<!-- Чтобы сделать неактивным раздел безопасность, не забыть прописать путь до него в disabled для показа -->
|
<!-- Чтобы сделать неактивным раздел безопасность, не забыть прописать путь до него в disabled для показа -->
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<v-icon :icon="x.ico" />
|
<v-icon :icon="x.ico" />
|
||||||
@@ -147,7 +153,7 @@
|
|||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
<v-list-group
|
<v-list-group
|
||||||
v-else
|
v-if="x.path != '/portal' && 'submenu' in x"
|
||||||
:class="rail ? 'railmenu' : ''"
|
:class="rail ? 'railmenu' : ''"
|
||||||
:key="key"
|
:key="key"
|
||||||
:value="x.name"
|
:value="x.name"
|
||||||
@@ -266,7 +272,6 @@
|
|||||||
permanent
|
permanent
|
||||||
location="right"
|
location="right"
|
||||||
@click="rail = false"
|
@click="rail = false"
|
||||||
|
|
||||||
>
|
>
|
||||||
<Online-users />
|
<Online-users />
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
@@ -453,7 +458,7 @@ export default {
|
|||||||
if (!item.path.startsWith("/")) {
|
if (!item.path.startsWith("/")) {
|
||||||
item.path = "/" + item.path;
|
item.path = "/" + item.path;
|
||||||
}
|
}
|
||||||
item.path="/safety"+item.path
|
item.path = "/safety" + item.path;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.data.length > 0) {
|
if (response.data.length > 0) {
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
// Composables
|
// Composables
|
||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
|
// import { useAccountStore } from "@/store/AccountStore";
|
||||||
|
|
||||||
|
|
||||||
|
// const accountStore = useAccountStore()
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
@@ -97,7 +100,8 @@ const routes = [
|
|||||||
component: () => import('@/views/AboutPortalPage.vue'),
|
component: () => import('@/views/AboutPortalPage.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"О портале",
|
title:"О портале",
|
||||||
ico: "mdi-information-variant"
|
ico: "mdi-information-variant",
|
||||||
|
requiresAuth: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -145,9 +149,32 @@ const router = createRouter({
|
|||||||
history: createWebHistory(process.env.BASE_URL),
|
history: createWebHistory(process.env.BASE_URL),
|
||||||
routes,
|
routes,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// const accountStore = useAccountStore();
|
||||||
|
|
||||||
|
function isSuperuser() {
|
||||||
|
let a= false
|
||||||
|
if (a=== true) {
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
router.beforeEach((to,from, next)=>{
|
router.beforeEach((to,from, next)=>{
|
||||||
|
console.log(to,from, '-----sdsd----------------------------------------------------f')
|
||||||
|
if (to.meta.requiresAuth && isSuperuser()) {
|
||||||
document.title = to.meta.title;
|
document.title = to.meta.title;
|
||||||
next()
|
next()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log('22222222222222');
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
@@ -1,230 +0,0 @@
|
|||||||
<template>
|
|
||||||
<v-row no-gutters class="flex-column h-100 gap pa-1">
|
|
||||||
<v-col class="w100 h-100 flex-grow-0">
|
|
||||||
<v-card>
|
|
||||||
<v-tabs
|
|
||||||
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="document">Документация</v-tab>
|
|
||||||
<v-tab 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
|
|
||||||
:formainpage="safetyData.mainpage_file"
|
|
||||||
></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 overflow-auto pb-1">
|
|
||||||
<v-card
|
|
||||||
class="overflow-y-auto flex-grow-1 flex-shrink-1 h-100"
|
|
||||||
>
|
|
||||||
<v-card-title>{{ safetyData.name }}</v-card-title>
|
|
||||||
<v-expansion-panels multiple 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">{{
|
|
||||||
category.category__name
|
|
||||||
}}</v-expansion-panel-title>
|
|
||||||
<v-expansion-panel-text>
|
|
||||||
<div
|
|
||||||
v-for="file in category.files"
|
|
||||||
:key="file.id"
|
|
||||||
class="overflow-y-auto d-flex justify-space-between"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cursor-pointer"
|
|
||||||
@click="openPDF(file.url), (loading = true)"
|
|
||||||
>
|
|
||||||
{{ file.name }}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<v-btn
|
|
||||||
variant="text"
|
|
||||||
icon="mdi-file-pdf-box"
|
|
||||||
color="red"
|
|
||||||
@click="openPDF(file.url), (loading = true)"
|
|
||||||
></v-btn>
|
|
||||||
<v-btn
|
|
||||||
variant="text"
|
|
||||||
icon="mdi-file-download-outline"
|
|
||||||
color="green"
|
|
||||||
@click="
|
|
||||||
downloadItem(burl + file.url, file.name)
|
|
||||||
"
|
|
||||||
></v-btn>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</v-expansion-panel-text>
|
|
||||||
</v-expansion-panel>
|
|
||||||
</v-expansion-panels>
|
|
||||||
</v-card>
|
|
||||||
</v-row>
|
|
||||||
<v-row class="ma-0 overflow-auto bg-yellow">
|
|
||||||
<v-card class="overflow-y-auto flex-grow-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
|
|
||||||
class="cursor-pointer"
|
|
||||||
@click="
|
|
||||||
openPDF(checkNameFiles(file)), (loading = true)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{
|
|
||||||
get_name(
|
|
||||||
decodeURI(file.file_name.replace(/\.[^/.]+$/, ""))
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
</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-download-outline"
|
|
||||||
color="green"
|
|
||||||
@click="
|
|
||||||
downloadItem(
|
|
||||||
burl + checkNameFiles(file),
|
|
||||||
get_name(decodeURI(file.file_name))
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
</v-btn>
|
|
||||||
</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-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">
|
|
||||||
<v-progress-linear
|
|
||||||
:rounded="5"
|
|
||||||
indeterminate
|
|
||||||
color="teal"
|
|
||||||
>
|
|
||||||
</v-progress-linear>
|
|
||||||
</v-container>
|
|
||||||
<VuePdfEmbed
|
|
||||||
:source="pdfSource"
|
|
||||||
width="720"
|
|
||||||
@rendered="loading = false"
|
|
||||||
/>
|
|
||||||
</v-card>
|
|
||||||
</v-row>
|
|
||||||
<v-card-actions v-show="showFile">
|
|
||||||
<v-btn position="sticky" block @click="showFile = false"
|
|
||||||
>Закрыть</v-btn
|
|
||||||
>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-window-item>
|
|
||||||
<v-window-item value="testings" no-gutters class="gap h-100">
|
|
||||||
</v-window-item>
|
|
||||||
</v-window>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, onBeforeMount } 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";
|
|
||||||
|
|
||||||
pagecounter();
|
|
||||||
|
|
||||||
const safetyData = ref({});
|
|
||||||
const responsibilityData = ref();
|
|
||||||
const showMore = ref(false);
|
|
||||||
const showFile = ref(true);
|
|
||||||
let pdfSource = ref("");
|
|
||||||
const loading = ref(false);
|
|
||||||
const tab = ref("");
|
|
||||||
const burl = baseURL.slice(0, -1);
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
// Вынес запрос в отдельную функцию, чтобы избежать дублирования одного и того же запроса на сервер.
|
|
||||||
function getSafety() {
|
|
||||||
axiosApiInstance
|
|
||||||
.get(`api/safety/?chapter=${route.params.chapter}`)
|
|
||||||
.then((result) => {
|
|
||||||
safetyData.value = result.data;
|
|
||||||
loading.value = true;
|
|
||||||
// pdfSource.value = burl + safetyData.value.categories[0].files[0].url
|
|
||||||
console.log(safetyData.value);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onBeforeMount(() => getSafety());
|
|
||||||
|
|
||||||
const downloadItem = (url, fileName) => {
|
|
||||||
axiosApiInstance.get(url, { responseType: "blob" }).then((response) => {
|
|
||||||
saveAs(response.data, fileName);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
function openPDF(url) {
|
|
||||||
pdfSource.value = burl + url;
|
|
||||||
showFile.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_name(namestr) {
|
|
||||||
let arr = namestr.split("/");
|
|
||||||
return arr[arr.length - 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
// function checkNameFiles(obj) {
|
|
||||||
// if (obj.file_name.includes('/media/comitee_files/')) {
|
|
||||||
// return obj.file_name
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// return spravURLBase + `files/committee1_docs/${obj.id_committee1}/${get_name(obj.file_name)}`
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.isActiveTab {
|
|
||||||
background-color: #e0f2f1;
|
|
||||||
color: #004d40;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row no-gutters class="h-100">
|
<v-row no-gutters class="h-100">
|
||||||
<v-col cols="9" class="flex-column">
|
<v-col cols="8" class="flex-column">
|
||||||
<v-row no-gutters class="h-100 justify-center">
|
<v-row no-gutters class="h-100 justify-center">
|
||||||
<v-col
|
<v-col
|
||||||
lg="6"
|
lg="6"
|
||||||
@@ -24,14 +24,16 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="3" class="d-flex flex-column h-100">
|
<v-col class="d-flex flex-column h-100">
|
||||||
<v-row no-gutters class="h-0 overflow-auto">
|
<v-row no-gutters class="h-0 overflow-auto">
|
||||||
<v-col>
|
<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">
|
<v-col class="v-col-auto">
|
||||||
<div v-if="responsibility != undefined && responsibility.length > 0" >
|
<div
|
||||||
|
v-if="responsibility != undefined && responsibility.length > 0"
|
||||||
|
>
|
||||||
<v-expansion-panels variant="accordion">
|
<v-expansion-panels variant="accordion">
|
||||||
<v-expansion-panel v-for="item in responsibility">
|
<v-expansion-panel v-for="item in responsibility">
|
||||||
<v-expansion-panel-title>
|
<v-expansion-panel-title>
|
||||||
@@ -40,39 +42,51 @@
|
|||||||
<v-expansion-panel-text>
|
<v-expansion-panel-text>
|
||||||
<list-user
|
<list-user
|
||||||
v-for="user in item.resp.employee"
|
v-for="user in item.resp.employee"
|
||||||
:key=user
|
:key="user"
|
||||||
:author="user">
|
:author="user"
|
||||||
|
>
|
||||||
</list-user>
|
</list-user>
|
||||||
</v-expansion-panel-text>
|
</v-expansion-panel-text>
|
||||||
</v-expansion-panel>
|
</v-expansion-panel>
|
||||||
</v-expansion-panels>
|
</v-expansion-panels>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="text-caption text-grey d-flex justify-center">Данные по ответственным отсутствуют</div>
|
<div class="text-caption text-grey d-flex justify-center">
|
||||||
|
Данные по ответственным отсутствуют
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</v-col>
|
</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">
|
<v-col class="v-col-auto">
|
||||||
<div v-if="commitee != undefined && commitee.length > 0">
|
<div v-if="commitee != undefined && commitee.length > 0">
|
||||||
<v-expansion-panels variant="accordion">
|
<v-expansion-panels variant="accordion">
|
||||||
<v-expansion-panel v-for="item in commitee">
|
<v-expansion-panel v-for="item in commitee" :key="item">
|
||||||
<v-expansion-panel-title>
|
<v-expansion-panel-title>
|
||||||
{{ item.comm.name }}
|
{{ item.comm.name }}
|
||||||
</v-expansion-panel-title>
|
</v-expansion-panel-title>
|
||||||
<v-expansion-panel-text>
|
<v-expansion-panel-text class="d-block">
|
||||||
|
<div v-if="item.comm.com_members.length > 0">
|
||||||
<list-user
|
<list-user
|
||||||
|
class="text-subtitle-1"
|
||||||
v-for="user in item.comm.com_members"
|
v-for="user in item.comm.com_members"
|
||||||
:key=user
|
:key="user"
|
||||||
:author="user">
|
:author="user"
|
||||||
|
>
|
||||||
</list-user>
|
</list-user>
|
||||||
|
</div>
|
||||||
|
<v-card-subtitle class="text-center" v-else
|
||||||
|
>Участников нет
|
||||||
|
</v-card-subtitle>
|
||||||
</v-expansion-panel-text>
|
</v-expansion-panel-text>
|
||||||
</v-expansion-panel>
|
</v-expansion-panel>
|
||||||
</v-expansion-panels>
|
</v-expansion-panels>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="text-caption text-grey d-flex justify-center">Данные по комиссиям отсутствуют</div>
|
<div class="text-caption text-grey d-flex justify-center">
|
||||||
|
Данные по комиссиям отсутствуют
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -88,24 +102,32 @@
|
|||||||
density="compact"
|
density="compact"
|
||||||
variant="text"
|
variant="text"
|
||||||
icon="mdi-close"
|
icon="mdi-close"
|
||||||
@click="openFirstPlan = false">
|
@click="openFirstPlan = false"
|
||||||
|
>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn class="d-flex align-center" icon='mdi-file-download-outline' color="green"
|
<v-btn
|
||||||
@click="downloadFile(urlschema)">
|
class="d-flex align-center"
|
||||||
|
icon="mdi-file-download-outline"
|
||||||
|
color="green"
|
||||||
|
@click="downloadFile(urlschema)"
|
||||||
|
>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
|
|
||||||
<VuePdfEmbed v-if="urlschema.endsWith('.pdf')"
|
<VuePdfEmbed
|
||||||
|
v-if="urlschema.endsWith('.pdf')"
|
||||||
:source="urlschema"
|
:source="urlschema"
|
||||||
width="500"
|
width="500"
|
||||||
@click="openFirstPlan = false"/>
|
@click="openFirstPlan = false"
|
||||||
|
/>
|
||||||
<v-img
|
<v-img
|
||||||
v-else
|
v-else
|
||||||
:src="urlschema"
|
:src="urlschema"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
height="100%"
|
height="100%"
|
||||||
width="100%"
|
width="100%"
|
||||||
@click="openFirstPlan = false">
|
@click="openFirstPlan = false"
|
||||||
|
>
|
||||||
</v-img>
|
</v-img>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|||||||
Reference in new issue
Block a user