Merge remote-tracking branch 'origin/52_fire' into develop
This commit is contained in:
commit
3efc8fdfcd
14 files changed
+347
-394
No files matched your search
@@ -66,5 +66,5 @@ urlpatterns = [
|
|||||||
path('api/general_vacation/', include('general_vacation.urls')),
|
path('api/general_vacation/', include('general_vacation.urls')),
|
||||||
path('api/about_inspection/', include('about_inspection.urls')),
|
path('api/about_inspection/', include('about_inspection.urls')),
|
||||||
path('api/calendar_of_events/', include('calendar_of_events.urls')),
|
path('api/calendar_of_events/', include('calendar_of_events.urls')),
|
||||||
|
path('api/safety/', include('safety.urls'))
|
||||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
@@ -1,13 +1,16 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from .models import SafetyFile
|
from .models import SafetyFile, SafetyType, SafetyDocumentCategory
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
|
||||||
|
|
||||||
class SafetyFileAdmin(admin.ModelAdmin):
|
class SafetyFileAdmin(admin.ModelAdmin):
|
||||||
list_display = ('name', 'chapter_id', 'category_id', 'sign_date')
|
|
||||||
list_editable = ('sign_date', 'category_id')
|
list_display = ('name', 'chapter', 'category', 'sign_date', 'formainpage')
|
||||||
list_filter = ('name', 'sign_date', 'category_id',)
|
list_editable = ('sign_date', 'category', 'formainpage')
|
||||||
fields = ('name', 'url', 'chapter_id', 'category_id', 'sign_date')
|
list_filter = ('name', 'sign_date', 'category',)
|
||||||
|
fields = ('name', 'url', 'chapter', 'category', 'sign_date', 'formainpage')
|
||||||
admin.site.register(SafetyFile, SafetyFileAdmin)
|
|
||||||
|
admin.site.register(SafetyType)
|
||||||
|
admin.site.register(SafetyDocumentCategory)
|
||||||
|
admin.site.register(SafetyFile, SafetyFileAdmin)
|
||||||
+13
-28
@@ -1,42 +1,27 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from enum import Enum
|
|
||||||
|
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
|
|
||||||
class EnumChoice(Enum):
|
class SafetyDocumentCategory(models.Model):
|
||||||
@classmethod
|
name = models.CharField(max_length=255)
|
||||||
def get_choices(cls):
|
|
||||||
return [(enum_.name, enum_.value) for enum_ in cls]
|
|
||||||
|
|
||||||
class SafetyChapter(EnumChoice):
|
def __str__(self):
|
||||||
fire_safety = "Пожарная безопасность"
|
return str(self.name)
|
||||||
information_safety = "Информационная безопасность"
|
|
||||||
occupational_safety = "Охрана труда"
|
|
||||||
access_mode = "Пропускной и внутриобъектовый режим"
|
|
||||||
civil_defense = "Гражданская оборона"
|
|
||||||
state_secrets = "Защита гостайны"
|
|
||||||
military_registration = "Мобилизационная подготовка и воинский учет"
|
|
||||||
|
|
||||||
class SafetyDocumentCategory(EnumChoice):
|
class SafetyType(models.Model):
|
||||||
regulations = "Нормативные документы"
|
name = models.CharField(max_length=255)
|
||||||
instructions = "Инструкции"
|
path = models.CharField(max_length=255, null=True)
|
||||||
orders = "Приказы"
|
|
||||||
provisions = "Положения"
|
def __str__(self):
|
||||||
educational_materials = "Учебные материалы"
|
return str(self.name)
|
||||||
laws = "Законы"
|
|
||||||
decrees = "Указы"
|
|
||||||
resolutions = "Постановления"
|
|
||||||
thematic_materials = "Тематические материалы"
|
|
||||||
methodological_materials = "Методологические материалы"
|
|
||||||
evacuation_plan = 'План эвакуации'
|
|
||||||
|
|
||||||
|
|
||||||
# Общая модель для раздела "Безопасность"
|
# Общая модель для раздела "Безопасность"
|
||||||
class SafetyFile(models.Model):
|
class SafetyFile(models.Model):
|
||||||
name = models.CharField(verbose_name='Имя документа', max_length=255)
|
name = models.CharField(verbose_name='Имя документа', max_length=255)
|
||||||
url = models.FileField(verbose_name='Путь до файла',upload_to='safety')
|
url = models.FileField(verbose_name='Путь до файла',upload_to='safety')
|
||||||
chapter_id = models.CharField(verbose_name='Раздел', max_length=255, blank=False, db_index=True, choices=SafetyChapter.get_choices())
|
chapter = models.ForeignKey('SafetyType', models.DO_NOTHING, null=True, verbose_name='Раздел', related_name="type_file")
|
||||||
category_id = models.CharField(verbose_name='Категория документа', max_length=255, blank=False, db_index=True, choices=SafetyDocumentCategory.get_choices())
|
category = models.ForeignKey('SafetyDocumentCategory', models.DO_NOTHING, null=True, verbose_name='Категория документа')
|
||||||
|
formainpage = models.BooleanField(default=False, verbose_name="Основная информация")
|
||||||
sign_date = models.DateField(verbose_name='Дата документа')
|
sign_date = models.DateField(verbose_name='Дата документа')
|
||||||
created_at = models.DateTimeField(verbose_name='Дата загрузки файла', auto_now_add=True)
|
created_at = models.DateTimeField(verbose_name='Дата загрузки файла', auto_now_add=True)
|
||||||
update_at = models.DateTimeField(verbose_name='Дата обновления файла', auto_now=True)
|
update_at = models.DateTimeField(verbose_name='Дата обновления файла', auto_now=True)
|
||||||
|
|||||||
@@ -1,10 +1,43 @@
|
|||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from .models import *
|
from .models import *
|
||||||
|
from django.db.models import Count
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class OneFileSerializer(serializers.ModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = SafetyFile
|
||||||
|
fields = '__all__'
|
||||||
|
|
||||||
|
|
||||||
|
class SafetyTypeSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = SafetyType
|
||||||
|
fields = '__all__'
|
||||||
|
|
||||||
|
|
||||||
class SafetyFileSerializer(serializers.ModelSerializer):
|
class SafetyFileSerializer(serializers.ModelSerializer):
|
||||||
chapter_name = serializers.CharField(source='get_chapter_id_display')
|
# chapter_name = serializers.CharField(source='get_chapter_id_display')
|
||||||
category_name = serializers.CharField(source='get_category_id_display')
|
# category_name = serializers.CharField(source='get_category_id_display')
|
||||||
|
categories = serializers.SerializerMethodField('get_categories')
|
||||||
class Meta:
|
class Meta:
|
||||||
model = SafetyFile
|
model = SafetyType
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
def get_categories(self, obj):
|
||||||
|
|
||||||
|
files = obj.type_file.all().order_by('category__name')
|
||||||
|
categories = files.values("category","category__name").distinct()
|
||||||
|
for x in files:
|
||||||
|
for y in categories:
|
||||||
|
if 'files' not in y.keys():
|
||||||
|
y['files'] = []
|
||||||
|
if x.category.id == y['category']:
|
||||||
|
y['files'].append(OneFileSerializer(x).data)
|
||||||
|
|
||||||
|
return categories
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -4,6 +4,7 @@ from rest_framework.routers import DefaultRouter
|
|||||||
from .views import *
|
from .views import *
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path('gettypes/', SafetyTypeAPIView.as_view(), name="SafetyTypeAPIView"),
|
||||||
path('files/', SafetyFileAPIView.as_view(), name='safety_files'),
|
path('files/', SafetyFileAPIView.as_view(), name='safety_files'),
|
||||||
path('responsibility/', SafetyResponsebilityAPIView.as_view(), name='responsibility'),
|
path('responsibility/', SafetyResponsebilityAPIView.as_view(), name='responsibility'),
|
||||||
path('committee_files/', CommitteeFilesAPIView.as_view(), name='committee_files')
|
path('committee_files/', CommitteeFilesAPIView.as_view(), name='committee_files')
|
||||||
|
|||||||
+10
-22
@@ -1,5 +1,6 @@
|
|||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
|
from django.db.models import Count
|
||||||
|
from rest_framework.generics import ListAPIView
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
@@ -9,30 +10,17 @@ from userauth.serializers import *
|
|||||||
from userauth.models import *
|
from userauth.models import *
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
|
||||||
|
class SafetyTypeAPIView(ListAPIView):
|
||||||
|
def get(self, request):
|
||||||
|
chapters = SafetyType.objects.annotate(Count("type_file")).filter(type_file__count__gt=0)
|
||||||
|
return Response(SafetyTypeSerializer(chapters, many=True).data)
|
||||||
|
|
||||||
class SafetyFileAPIView(APIView):
|
class SafetyFileAPIView(APIView):
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
|
||||||
chapters = self.request.query_params.get('chapter_id', 1)
|
chapters = self.request.query_params.get('chapter', "fire_safety")
|
||||||
all_file = SafetyFile.objects.filter(chapter_id=chapters).order_by('chapter_id', 'category_id').all()
|
safety_group = SafetyType.objects.get(path=chapters)
|
||||||
serializer_for_file = SafetyFileSerializer(instance=all_file, many=True)
|
return Response(SafetyFileSerializer(safety_group).data)
|
||||||
|
|
||||||
data = []
|
|
||||||
|
|
||||||
for (chapter_id, chapter_name), row in groupby(serializer_for_file.data, lambda x: (x['chapter_id'], x['chapter_name'])):
|
|
||||||
chapter = {
|
|
||||||
'id': chapter_id,
|
|
||||||
'name': chapter_name,
|
|
||||||
'categories': []
|
|
||||||
}
|
|
||||||
data.append(chapter)
|
|
||||||
for (category_id, category_name), files in groupby(row, lambda x: (x['category_id'], x['category_name'])):
|
|
||||||
chapter['categories'].append({
|
|
||||||
'id': category_id,
|
|
||||||
'name': category_name,
|
|
||||||
'files': [file for file in files]
|
|
||||||
})
|
|
||||||
|
|
||||||
return Response(data)
|
|
||||||
|
|
||||||
class SafetyResponsebilityAPIView(APIView):
|
class SafetyResponsebilityAPIView(APIView):
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,21 @@ class DictDepartmentAdmin(admin.ModelAdmin):
|
|||||||
qs = super().get_queryset(request)
|
qs = super().get_queryset(request)
|
||||||
qs = qs.filter(deleted=0)
|
qs = qs.filter(deleted=0)
|
||||||
return qs
|
return qs
|
||||||
|
# class DictEmployeeAdmin(admin.ModelAdmin):
|
||||||
|
class IlineComitteeFiles(admin.StackedInline):
|
||||||
|
# readonly_fields = ['file_name']
|
||||||
|
model = Committee1Files
|
||||||
|
extra = 0
|
||||||
|
|
||||||
|
class InlineComiteePeople(admin.StackedInline):
|
||||||
|
model = Committee2
|
||||||
|
extra = 0
|
||||||
|
|
||||||
|
class Committee1Admin(admin.ModelAdmin):
|
||||||
|
# list_display = ('name', 'num_start', 'date_start', 'num_finish', 'date_finish')
|
||||||
|
inlines = [IlineComitteeFiles, InlineComiteePeople]
|
||||||
|
|
||||||
|
|
||||||
|
admin.site.register(Committee1, Committee1Admin)
|
||||||
admin.site.register(DictEmployee,DictEmployeeAdmin)
|
admin.site.register(DictEmployee,DictEmployeeAdmin)
|
||||||
admin.site.register(DictDepartment, DictDepartmentAdmin )
|
admin.site.register(DictDepartment, DictDepartmentAdmin )
|
||||||
@@ -23,16 +23,26 @@ class Committee1(models.Model):
|
|||||||
db_table = 'committee1'
|
db_table = 'committee1'
|
||||||
db_table_comment = '╤яшёюъ ъюьшёёшщ'
|
db_table_comment = '╤яшёюъ ъюьшёёшщ'
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.name)
|
||||||
|
|
||||||
|
|
||||||
class Committee1Files(models.Model):
|
class Committee1Files(models.Model):
|
||||||
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╚─ ъюьшёёшш')
|
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╚─ ъюьшёёшш')
|
||||||
file_name = models.CharField(max_length=1024, db_comment='╚ь Їрщыр')
|
file_name = models.FileField(null=True, blank=True, upload_to='comitee_files')
|
||||||
|
# file_name = models.CharField(max_length=1024, db_comment='╚ь Їрщыр')
|
||||||
is_actual = models.IntegerField(db_comment='╧Ёшчэръ ръЄєры№эюёЄш Їрщыр')
|
is_actual = models.IntegerField(db_comment='╧Ёшчэръ ръЄєры№эюёЄш Їрщыр')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
managed = False
|
managed = False
|
||||||
db_table = 'committee1_files'
|
db_table = 'committee1_files'
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.file_name)
|
||||||
|
def save(self, *args, **kwargs):
|
||||||
|
|
||||||
|
super().save(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class Committee2(models.Model):
|
class Committee2(models.Model):
|
||||||
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╙эшъры№э√щ эюьхЁ ъюьшёёшш')
|
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╙эшъры№э√щ эюьхЁ ъюьшёёшш')
|
||||||
@@ -45,6 +55,9 @@ class Committee2(models.Model):
|
|||||||
db_table = 'committee2'
|
db_table = 'committee2'
|
||||||
db_table_comment = '╤юёЄрт ъюьшёёшщ'
|
db_table_comment = '╤юёЄрт ъюьшёёшщ'
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.id_dict_committee_position.name)
|
||||||
|
|
||||||
|
|
||||||
class DictCommitteeExpert(models.Model):
|
class DictCommitteeExpert(models.Model):
|
||||||
fio = models.CharField(max_length=250, blank=True, null=True, db_comment='╘╚╬ ¤ъёяхЁЄр')
|
fio = models.CharField(max_length=250, blank=True, null=True, db_comment='╘╚╬ ¤ъёяхЁЄр')
|
||||||
@@ -54,6 +67,9 @@ class DictCommitteeExpert(models.Model):
|
|||||||
managed = False
|
managed = False
|
||||||
db_table = 'dict_committee_expert'
|
db_table = 'dict_committee_expert'
|
||||||
db_table_comment = '╤яЁртюўэшъ эхчртшёшь√ї ¤ъёяхЁЄют'
|
db_table_comment = '╤яЁртюўэшъ эхчртшёшь√ї ¤ъёяхЁЄют'
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.fio)
|
||||||
|
|
||||||
|
|
||||||
class DictCommitteeOrderAddon(models.Model):
|
class DictCommitteeOrderAddon(models.Model):
|
||||||
@@ -79,6 +95,9 @@ class DictCommitteePosition(models.Model):
|
|||||||
db_table = 'dict_committee_position'
|
db_table = 'dict_committee_position'
|
||||||
db_table_comment = '╤яЁртюўэшъ фюыцэюёЄхщ ъюьшёёшщ'
|
db_table_comment = '╤яЁртюўэшъ фюыцэюёЄхщ ъюьшёёшщ'
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.name_short)
|
||||||
|
|
||||||
|
|
||||||
class DictCommitteeType(models.Model):
|
class DictCommitteeType(models.Model):
|
||||||
name = models.CharField(max_length=100, blank=True, null=True, db_comment='═ршьхэютрэшх тшфр ъюьшёёшш')
|
name = models.CharField(max_length=100, blank=True, null=True, db_comment='═ршьхэютрэшх тшфр ъюьшёёшш')
|
||||||
@@ -88,6 +107,9 @@ class DictCommitteeType(models.Model):
|
|||||||
db_table = 'dict_committee_type'
|
db_table = 'dict_committee_type'
|
||||||
db_table_comment = '╤яЁртюўэшъ тшфют ъюьшёёшщ'
|
db_table_comment = '╤яЁртюўэшъ тшфют ъюьшёёшщ'
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.name)
|
||||||
|
|
||||||
|
|
||||||
class DictCompetences(models.Model):
|
class DictCompetences(models.Model):
|
||||||
id_dict_competences_type = models.ForeignKey('DictCompetencesType', models.DO_NOTHING, db_column='id_dict_competences_type', db_comment='шфхэЄшЇшърЄюЁ уЁєяя√ ъюьяхЄхэЎшш')
|
id_dict_competences_type = models.ForeignKey('DictCompetencesType', models.DO_NOTHING, db_column='id_dict_competences_type', db_comment='шфхэЄшЇшърЄюЁ уЁєяя√ ъюьяхЄхэЎшш')
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class OrderResponsibilitySerializer(serializers.ModelSerializer):
|
|||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
def respons_users(self,obj):
|
def respons_users(self,obj):
|
||||||
data = OrderResponsibilityEmployee.objects.filter(id_order_responsibility=obj.id)
|
data = OrderResponsibilityEmployee.objects.filter(id_order_responsibility=obj.id).order_by("id_dict_employee_id__id_dict_position__order_position","id_dict_employee_id__familyname")
|
||||||
return ResponsibilityUsersSerializer(data,many=True).data
|
return ResponsibilityUsersSerializer(data,many=True).data
|
||||||
|
|
||||||
class Committee1FilesSerializer(serializers.ModelSerializer):
|
class Committee1FilesSerializer(serializers.ModelSerializer):
|
||||||
@@ -40,7 +40,7 @@ class Committee1FilesSerializer(serializers.ModelSerializer):
|
|||||||
"""
|
"""
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Committee1Files
|
model = Committee1Files
|
||||||
exclude=['id_committee1']
|
fields = '__all__'
|
||||||
|
|
||||||
class Committee1Serializer(serializers.ModelSerializer):
|
class Committee1Serializer(serializers.ModelSerializer):
|
||||||
""" Забирает всю информацию по комиссиям с типом
|
""" Забирает всю информацию по комиссиям с типом
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ import { useTheme } from "vuetify";
|
|||||||
import AuthForm from '@/components/UI/Auth-form.vue'
|
import AuthForm from '@/components/UI/Auth-form.vue'
|
||||||
import OnlineUsers from '@/components/UI/fiousercard/onlineUsers.vue'
|
import OnlineUsers from '@/components/UI/fiousercard/onlineUsers.vue'
|
||||||
import CardLike from '@/components/cardLike.vue'
|
import CardLike from '@/components/cardLike.vue'
|
||||||
import { clearAxios } from '@/utils/axios-api'
|
import { axiosApiInstance, clearAxios } from '@/utils/axios-api'
|
||||||
|
|
||||||
import { baseURL } from '@/utils/axios-api'
|
import { baseURL } from '@/utils/axios-api'
|
||||||
import VcardUser from '@/components/UI/fiousercard/vcardUser.vue'
|
import VcardUser from '@/components/UI/fiousercard/vcardUser.vue'
|
||||||
@@ -381,7 +381,7 @@ export default {
|
|||||||
|
|
||||||
// ]
|
// ]
|
||||||
|
|
||||||
const navigations = [
|
const navigations = ref([
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'Структура',
|
name: 'Структура',
|
||||||
@@ -424,16 +424,6 @@ export default {
|
|||||||
ico: 'mdi-newspaper',
|
ico: 'mdi-newspaper',
|
||||||
path: "/news"
|
path: "/news"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'Безопасность',
|
|
||||||
ico: 'mdi-security',
|
|
||||||
submenu: [
|
|
||||||
{
|
|
||||||
name: 'Пожарная безопасность',
|
|
||||||
path: "/fire_safety"
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'О портале',
|
name: 'О портале',
|
||||||
ico: 'mdi-information-variant',
|
ico: 'mdi-information-variant',
|
||||||
@@ -456,8 +446,8 @@ export default {
|
|||||||
// ico: 'mdi-cake-variant',
|
// ico: 'mdi-cake-variant',
|
||||||
// path: "/fnshol"
|
// path: "/fnshol"
|
||||||
// }
|
// }
|
||||||
]
|
])
|
||||||
|
|
||||||
const imageSrc = computed(() => {
|
const imageSrc = computed(() => {
|
||||||
return new URL(`@/assets/FNS-logo-xs.png`, import.meta.url).href;
|
return new URL(`@/assets/FNS-logo-xs.png`, import.meta.url).href;
|
||||||
})
|
})
|
||||||
@@ -467,7 +457,26 @@ export default {
|
|||||||
// feedalert.value=true
|
// feedalert.value=true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getSafetyChapter = () => {
|
||||||
|
axiosApiInstance.get('api/safety/gettypes/').then(response => {
|
||||||
|
response.data.forEach(item => {
|
||||||
|
if(!item.path.startsWith('/')) {
|
||||||
|
item.path = '/' + item.path
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.data.length > 0) {
|
||||||
|
let safetyMenu = {
|
||||||
|
name: 'Безопасность',
|
||||||
|
ico: 'mdi-security',
|
||||||
|
submenu: response.data
|
||||||
|
}
|
||||||
|
navigations.value.splice(5, 0, safetyMenu)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getSafetyChapter()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
theme,
|
theme,
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ const routes = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/:chapter_id',
|
path: '/:chapter',
|
||||||
component: () => import('@/views/safety/ChaptersSafety.vue'),
|
component: () => import('@/views/safety/ChaptersSafety.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: "Разделы безопасности",
|
title: "Разделы безопасности",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {useAccountStore} from '@/store/AccountStore'
|
import {useAccountStore} from '@/store/AccountStore'
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
const spravURL = 'http://10.252.44.33/accounting6/images/photo/'
|
const spravURL = 'http://10.252.44.33/accounting6/images/photo/'
|
||||||
|
const spravURLBase = 'http://10.252.44.33/accounting6/'
|
||||||
const baseURL = process.env.NODE_ENV == 'development'? 'http://127.0.0.1:8000/': `http://${window.location.host}/`;
|
const baseURL = process.env.NODE_ENV == 'development'? 'http://127.0.0.1:8000/': `http://${window.location.host}/`;
|
||||||
const baseWS = process.env.NODE_ENV == 'development'? 'ws://127.0.0.1:8000/': `ws://${window.location.host}/`;
|
const baseWS = process.env.NODE_ENV == 'development'? 'ws://127.0.0.1:8000/': `ws://${window.location.host}/`;
|
||||||
// const baseURL = process.env.NODE_ENV == 'development'? 'http://127.0.0.1:8000/': `http://10.252.44.60:9965/`;
|
// const baseURL = process.env.NODE_ENV == 'development'? 'http://127.0.0.1:8000/': `http://10.252.44.60:9965/`;
|
||||||
@@ -89,4 +89,4 @@ async error => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
export { axiosApiInstance, clearAxios, baseURL,spravURL,baseWS }
|
export { axiosApiInstance, clearAxios, baseURL,spravURL, spravURLBase, baseWS }
|
||||||
@@ -1,236 +1,188 @@
|
|||||||
<template>
|
<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-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"
|
<v-tab value="mainInfo">Основная информация</v-tab>
|
||||||
bg-color="teal-darken-1"
|
<v-tab value="document">Документация</v-tab>
|
||||||
slider-color="teal-darken-2"
|
<v-tab value="testings">Тестирование</v-tab>
|
||||||
:grow="true"
|
</v-tabs>
|
||||||
>
|
</v-card>
|
||||||
<v-tab selected-class="isActiveTab" value="mainInfo"
|
</v-col>
|
||||||
>Основная информация</v-tab
|
<v-col class="w100 h-100">
|
||||||
>
|
<v-window v-model="tab" class="h-100">
|
||||||
<v-tab selected-class="isActiveTab" value="document"
|
<v-window-item no-gutters class="gap h-100" value="mainInfo">
|
||||||
>Документация</v-tab
|
<MainInfoSafety :formainpage="formainpage"></MainInfoSafety>
|
||||||
>
|
</v-window-item>
|
||||||
<v-tab selected-class="isActiveTab" value="testings"
|
<v-window-item value="document" class="h-100">
|
||||||
>Тестирование</v-tab
|
<v-row no-gutters class="gap h-100 ">
|
||||||
>
|
<v-col lg="6">
|
||||||
</v-tabs>
|
<v-card class="h-100 flex-column d-flex gap ">
|
||||||
</v-card>
|
<v-row class="ma-0 overflow-auto pb-1 ">
|
||||||
</v-col>
|
<v-card class="overflow-y-auto flex-grow-1 flex-shrink-1 h-100">
|
||||||
<v-col class="w100 h-100">
|
<v-card-title>{{ safetyData.name }}</v-card-title>
|
||||||
<v-window v-model="tab" class="h-100">
|
<v-expansion-panels
|
||||||
<v-window-item no-gutters class="gap h-100" value="mainInfo">
|
multiple
|
||||||
<MainInfoSafety></MainInfoSafety>
|
flat>
|
||||||
</v-window-item>
|
<v-expansion-panel elevation=0 v-for="category in safetyData.categories"
|
||||||
<v-window-item value="document" class="h-100">
|
:key="category.id" class="py-0">
|
||||||
<v-row no-gutters class="gap h-100">
|
<v-expansion-panel-title class="font-weight-medium">{{
|
||||||
<v-col lg="6">
|
category.category__name }}</v-expansion-panel-title>
|
||||||
<!---->
|
<v-expansion-panel-text>
|
||||||
<v-card class="h-100 flex-column d-flex gap">
|
<div v-for="file in category.files" :key="file.id"
|
||||||
<v-row class="ma-0 my-3 overflow-auto h-0 pb-1">
|
class="overflow-y-auto d-flex justify-space-between">
|
||||||
<v-card
|
<div class="cursor-pointer"
|
||||||
v-for="item in safetyData"
|
@click="openPDF(file.url), loading = true">
|
||||||
:key="item.id"
|
{{ file.name }}
|
||||||
class="overflow-y-auto flex-grow-1 flex-shrink-1 h-100"
|
</div>
|
||||||
>
|
<div>
|
||||||
<v-card-title>{{ item.name }}</v-card-title>
|
<v-btn variant="text" icon="mdi-file-pdf-box"
|
||||||
<v-container
|
color="red"
|
||||||
v-for="category in item.categories"
|
@click="openPDF(file.url), loading = true"></v-btn>
|
||||||
:key="item.id + category.id"
|
<v-btn variant="text"
|
||||||
:fluid="true"
|
icon='mdi-file-download-outline' color="green"
|
||||||
class="py-0"
|
@click="downloadItem(burl + file.url, file.name)"></v-btn>
|
||||||
>
|
</div>
|
||||||
<v-card-actions v-if="category.id != 'evacuation_plan'">
|
</div>
|
||||||
<v-btn
|
</v-expansion-panel-text>
|
||||||
@click="
|
</v-expansion-panel>
|
||||||
showMore[item.id + category.id] =
|
</v-expansion-panels>
|
||||||
!showMore[item.id + category.id]
|
</v-card>
|
||||||
"
|
</v-row>
|
||||||
variant="text"
|
<v-row class="ma-0 overflow-auto bg-yellow ">
|
||||||
>
|
<v-card class="overflow-y-auto flex-grow-1 h-100">
|
||||||
{{ category.name }}
|
<v-card-title>{{ responsibilityData.name }}</v-card-title>
|
||||||
</v-btn>
|
<v-container v-for="file in responsibilityData.files" :fluid="true" class="py-0">
|
||||||
<v-btn
|
<v-card-actions :key="file.id">
|
||||||
:icon="
|
<v-card-text class="cursor-pointer"
|
||||||
showMore[item.id + category.id]
|
@click="openPDF(checkNameFiles(file)), loading = true">
|
||||||
? 'mdi-chevron-up'
|
{{ get_name(decodeURI(file.file_name.replace(/\.[^/.]+$/, ""))) }}
|
||||||
: 'mdi-chevron-down'
|
</v-card-text>
|
||||||
"
|
<v-btn icon="mdi-file-pdf-box" color="red"
|
||||||
@click="
|
@click="openPDF(checkNameFiles(file)), loading = true"></v-btn>
|
||||||
showMore[item.id + category.id] =
|
<v-btn icon='mdi-file-download-outline' color="green"
|
||||||
!showMore[item.id + category.id]
|
@click="downloadItem(burl + checkNameFiles(file), get_name(decodeURI(file.file_name)))"></v-btn>
|
||||||
"
|
</v-card-actions>
|
||||||
>
|
</v-container>
|
||||||
</v-btn>
|
</v-card>
|
||||||
</v-card-actions>
|
</v-row>
|
||||||
<v-expand-transition>
|
</v-card>
|
||||||
<div v-show="showMore[item.id + category.id]">
|
</v-col>
|
||||||
<v-card-actions
|
<v-col>
|
||||||
v-for="file in category.files"
|
<v-card class="h-100 flex-column d-flex gap">
|
||||||
:key="file.id"
|
<v-row class="ma-0 overflow-auto h-0">
|
||||||
class="overflow-y-auto"
|
<v-card v-show="showFile"
|
||||||
>
|
class="mr-2 flex-grow-1 flex-shrink-1 h-100 pa-2 overflow-auto">
|
||||||
<v-card-text
|
<v-container v-if="loading">
|
||||||
class="cursor-pointer"
|
<v-progress-linear :rounded="5" indeterminate color="teal">
|
||||||
:ref_="openPDF(burl + file.url)"
|
</v-progress-linear>
|
||||||
@click="
|
</v-container>
|
||||||
openPDF(burl + file.url), (loading = true)
|
<VuePdfEmbed :source="pdfSource" width="720" @rendered="loading = false" />
|
||||||
"
|
</v-card>
|
||||||
>
|
</v-row>
|
||||||
{{ file.name }}
|
<v-card-actions v-show="showFile">
|
||||||
</v-card-text>
|
<v-btn position="sticky" block @click="showFile = false">Закрыть</v-btn>
|
||||||
<v-btn
|
</v-card-actions>
|
||||||
icon="mdi-file-pdf-box"
|
</v-card>
|
||||||
color="red"
|
</v-col>
|
||||||
@click="
|
</v-row>
|
||||||
openPDF(burl + file.url), (loading = true)
|
</v-window-item>
|
||||||
"
|
<v-window-item value="testings" no-gutters class="gap h-100 ">
|
||||||
></v-btn>
|
<TestSafety></TestSafety>
|
||||||
<v-btn
|
</v-window-item>
|
||||||
icon="mdi-file-download-outline"
|
</v-window>
|
||||||
color="green"
|
</v-col>
|
||||||
@click="downloadItem(burl + file.url, file.name)"
|
</v-row>
|
||||||
></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-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">
|
|
||||||
<TestSafety></TestSafety>
|
|
||||||
</v-window-item>
|
|
||||||
</v-window>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onBeforeMount, onUpdated } from "vue";
|
import { ref, onBeforeMount, computed } from 'vue';
|
||||||
import { pagecounter } from "@/utils/universal_functions";
|
import { pagecounter } from '@/utils/universal_functions';
|
||||||
import { axiosApiInstance, baseURL } from "@/utils/axios-api";
|
import { axiosApiInstance, baseURL, spravURLBase } from '@/utils/axios-api';
|
||||||
import { saveAs } from "file-saver";
|
import { saveAs } from 'file-saver';
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
import VuePdfEmbed from "vue-pdf-embed";
|
import VuePdfEmbed from 'vue-pdf-embed';
|
||||||
import TestSafety from "./TestSafety.vue";
|
import TestSafety from './TestSafety.vue';
|
||||||
import MainInfoSafety from "./MainInfoSafety.vue";
|
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(false);
|
const showFile = ref(true);
|
||||||
let pdfSource = "";
|
let pdfSource = ref("");
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const tab = ref("");
|
const tab = ref('');
|
||||||
const burl = baseURL.slice(0, -1);
|
const burl = baseURL.slice(0, -1);
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
// Вынес запрос в отдельную функцию, чтобы избежать дублирования одного и того же запроса на сервер.
|
// Вынес запрос в отдельную функцию, чтобы избежать дублирования одного и того же запроса на сервер.
|
||||||
function getSafety() {
|
function getSafety() {
|
||||||
axiosApiInstance
|
axiosApiInstance.get(`api/safety/files/?chapter=${route.params.chapter}`).then(result => {
|
||||||
.get(`api/safety/files/?chapter_id=${route.params.chapter_id}`)
|
safetyData.value = result.data
|
||||||
.then((result) => {
|
// console.log(safetyData.value);
|
||||||
safetyData.value = result.data;
|
loading.value = true
|
||||||
});
|
pdfSource.value = burl + safetyData.value.categories[0].files[0].url
|
||||||
|
// console.log(safetyData.value);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formainpage = computed({
|
||||||
|
get() {
|
||||||
|
let arr = []
|
||||||
|
safetyData.value.categories.forEach(element => {
|
||||||
|
element.files.forEach((e) => {
|
||||||
|
if (e.formainpage == true) {
|
||||||
|
arr.push(e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
function getResponsibility() {
|
function getResponsibility() {
|
||||||
axiosApiInstance.get(`api/safety/committee_files/`).then((result) => {
|
axiosApiInstance.get(`api/safety/committee_files/`).then(result => {
|
||||||
responsibilityData.value = result.data;
|
responsibilityData.value = result.data
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
getResponsibility();
|
getResponsibility()
|
||||||
|
|
||||||
onBeforeMount(() => getSafety());
|
onBeforeMount(() => getSafety());
|
||||||
// Хук обновления реализует возможность динамической подгрузки данных при переключении между вкладками раздела безопасность
|
|
||||||
onUpdated(() => getSafety());
|
|
||||||
|
|
||||||
// Проверяем по ID на какой категории срабатывает клик на раскрытии/скрытии, чтобы избежать срабатывания у всех категорий одновременно
|
|
||||||
showMore.value = safetyData.value.reduce((acc, value) => {
|
|
||||||
acc[value.id] = false;
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
const downloadItem = (url, fileName) => {
|
const downloadItem = (url, fileName) => {
|
||||||
axiosApiInstance.get(url, { responseType: "blob" }).then((response) => {
|
axiosApiInstance.get(url, { responseType: 'blob' })
|
||||||
saveAs(response.data, fileName);
|
.then(response => {
|
||||||
});
|
saveAs(response.data, fileName)
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
function openPDF(url) {
|
function openPDF(url) {
|
||||||
showFile.value = true;
|
pdfSource.value = burl + url
|
||||||
if (showFile) {
|
showFile.value = true
|
||||||
return (pdfSource = url);
|
};
|
||||||
}
|
|
||||||
|
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>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.isActiveTab {
|
.isActiveTab {
|
||||||
background-color: #68c3ff70;
|
background-color: #E0F2F1;
|
||||||
|
color: #004D40;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,106 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-card class="h-100">
|
|
||||||
<v-row no-gutters class="h-100">
|
<v-row no-gutters class="gap h-100 ">
|
||||||
<v-col cols="9">
|
<v-col cols="9" class="flex-column" >
|
||||||
<v-card class="h-100 d-flex flex-column">
|
<v-row no-gutters class="h-100 justify-center">
|
||||||
<v-row class="ma-0 overflow-auto h-0">
|
<v-col lg="6" class="meheight" v-for="schema in formainpage" :key="schema.id">
|
||||||
<v-col
|
<VuePdfEmbed v-if="schema.url.endsWith('.pdf')" :source="burl + schema.url" width="500" />
|
||||||
cols="6"
|
<v-img v-else
|
||||||
class="h-100 gap">
|
class="cursor-pointer"
|
||||||
<v-card class="h-100">
|
:src="burl + schema.url"
|
||||||
<v-img
|
@click="openFirstPlan_opener(schema)">
|
||||||
class="cursor-pointer"
|
</v-img>
|
||||||
:src="`${burl}/media/safety/schemas/Схема1.jpg`"
|
</v-col>
|
||||||
height="100%"
|
</v-row>
|
||||||
@click="openFirstPlan = true">
|
|
||||||
</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">
|
|
||||||
<v-card class="h-100">
|
|
||||||
<v-img
|
|
||||||
:src="`${burl}/media/safety/schemas/План.jpg`" @click="openImg = true"
|
|
||||||
class="cursor-pointer"
|
|
||||||
height="100%"
|
|
||||||
width="100%">
|
|
||||||
</v-img>
|
|
||||||
<v-dialog v-model="openImg" :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="openImg = false">
|
|
||||||
</v-btn>
|
|
||||||
<v-img
|
|
||||||
:src="`${burl}/media/safety/schemas/План.jpg`"
|
|
||||||
class="cursor-pointer"
|
|
||||||
height="100%"
|
|
||||||
width="100%"
|
|
||||||
@click="openImg = false">
|
|
||||||
</v-img>
|
|
||||||
</v-card>
|
|
||||||
</v-row>
|
|
||||||
</v-dialog>
|
|
||||||
</v-card>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card>
|
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="3" class="w100">
|
<v-col class="w100">
|
||||||
<v-card class="h-100 d-flex flex-column">
|
<v-card class="h-100 d-flex flex-column">
|
||||||
<v-card-title class="text-wrap">Ответственные за противопожарную безопасность</v-card-title>
|
<v-card-title class="text-wrap">Ответственные за противопожарную безопасность</v-card-title>
|
||||||
<v-row class="ma-0 overflow-auto h-0">
|
<v-row class="ma-0 overflow-auto h-0">
|
||||||
@@ -112,23 +25,52 @@
|
|||||||
</list-user>
|
</list-user>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card>
|
</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="urlschema"
|
||||||
|
class="cursor-pointer"
|
||||||
|
height="100%"
|
||||||
|
width="100%"
|
||||||
|
@click="openFirstPlan = false">
|
||||||
|
</v-img>
|
||||||
|
</v-card>
|
||||||
|
</v-row>
|
||||||
|
</v-dialog>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
import { baseURL, axiosApiInstance } from '@/utils/axios-api'
|
import { baseURL, axiosApiInstance } from '@/utils/axios-api'
|
||||||
import { ref } from 'vue';
|
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 burl = baseURL.slice(0,-1)
|
||||||
const openImg = ref(false)
|
|
||||||
const openFirstPlan = ref(false)
|
const openFirstPlan = ref(false)
|
||||||
const openSecondPlan = ref(false)
|
|
||||||
const responsibility = ref([])
|
const responsibility = ref([])
|
||||||
|
function openFirstPlan_opener(schema){
|
||||||
|
urlschema.value = burl + schema.url
|
||||||
|
openFirstPlan.value = true
|
||||||
|
}
|
||||||
|
|
||||||
function getResponsibility() {
|
function getResponsibility() {
|
||||||
axiosApiInstance.get(`api/safety/responsibility/`).then(result => {
|
axiosApiInstance.get(`api/safety/responsibility/`).then(result => {
|
||||||
responsibility.value = result.data.users
|
responsibility.value = result.data.users
|
||||||
@@ -137,5 +79,10 @@ function getResponsibility() {
|
|||||||
|
|
||||||
getResponsibility()
|
getResponsibility()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
</script>
|
<style>
|
||||||
|
.meheight {
|
||||||
|
max-height: 44vh;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in new issue
Block a user