Compare commits
22
Commits
dev-denzel
...
lexxik753
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03631ec134 | ||
|
|
2a88a3da58 | ||
|
|
fff189a514 | ||
|
|
31a2905dcf | ||
|
|
e519dc1c85 | ||
|
|
c7a6eb9b00 | ||
|
|
8226fb74e6 | ||
|
|
1dd6959f0b | ||
|
|
08b36bd65b | ||
|
|
049c4a1915 | ||
|
|
3b8e67c83b | ||
|
|
b4d19770b8 | ||
|
|
d72a30d368 | ||
|
|
225f4cbc8a | ||
|
|
10520599b6 | ||
|
|
a07891d67b | ||
|
|
fdfd00e04f | ||
|
|
a1ef02283b | ||
|
|
838f43a710 | ||
|
|
c4feb6aee7 | ||
|
|
02e7ed4ceb | ||
|
|
1051b69dd5 |
No files matched your search
@@ -0,0 +1,31 @@
|
|||||||
|
# Generated by Django 5.2.4 on 2025-07-18 09:24
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("commeteresp", "0001_initial"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name="OrderResponsibilityEmployee",
|
||||||
|
fields=[
|
||||||
|
(
|
||||||
|
"id",
|
||||||
|
models.PositiveIntegerField(
|
||||||
|
db_comment="╥рсхы№э√щ эюьхЁ", primary_key=True, serialize=False
|
||||||
|
),
|
||||||
|
|
||||||
|
),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
"verbose_name": "Ответственный сотрудник",
|
||||||
|
"verbose_name_plural": "Ответственные сотрудники",
|
||||||
|
"db_table": "order_responsibility_employee",
|
||||||
|
"managed": False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -70,4 +70,5 @@ urlpatterns = [
|
|||||||
path('api/safety/', include('safety.urls')),
|
path('api/safety/', include('safety.urls')),
|
||||||
path('api/tests/', include('tests.urls')),
|
path('api/tests/', include('tests.urls')),
|
||||||
path('api/vote/', include('vote.urls')),
|
path('api/vote/', include('vote.urls')),
|
||||||
|
path('api/userauth/', include('userauth.urls')),
|
||||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
@@ -132,6 +132,17 @@ class InfoUserCardSerializer(serializers.ModelSerializer):
|
|||||||
""" Собирает необходимую информацию о пользователе, содержит необходимые
|
""" Собирает необходимую информацию о пользователе, содержит необходимые
|
||||||
поля для отрисовки карточки информации о пользователе при клике на фамилию
|
поля для отрисовки карточки информации о пользователе при клике на фамилию
|
||||||
Необходим для компонента infoUserCard"""
|
Необходим для компонента infoUserCard"""
|
||||||
|
position = serializers.IntegerField(source='id_dict_position.order_position')
|
||||||
|
department = serializers.CharField(source='id_dict_department.name')
|
||||||
class Meta:
|
class Meta:
|
||||||
model = DictEmployee
|
model = DictEmployee
|
||||||
fields = ['department', 'fio', 'post', 'email', 'tel', 'room', 'login', 'familyname', 'name', 'parentname', 'id']
|
fields = ['department', 'fio', 'post', 'email', 'tel', 'room', 'login', 'familyname', 'name', 'parentname', 'id', 'deleted','position']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class DepartmentsSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
|
persons = InfoUserCardSerializer(source='dep_user', many=True)
|
||||||
|
class Meta:
|
||||||
|
model = DictDepartment
|
||||||
|
fields = ['id','name','persons']
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
from django.urls import path
|
||||||
|
from .views import *
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('getdepartments', GetDepartment.as_view(), name= "GetDepartment")
|
||||||
|
]
|
||||||
@@ -1,3 +1,16 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
from .models import DictDepartment
|
||||||
|
from .serializers import DepartmentsSerializer
|
||||||
|
from rest_framework.permissions import AllowAny, IsAuthenticated
|
||||||
|
from rest_framework.views import APIView
|
||||||
|
from rest_framework.response import Response
|
||||||
|
|
||||||
# Create your views here.
|
class GetDepartment(APIView):
|
||||||
|
permission_classes = (AllowAny,)
|
||||||
|
"""
|
||||||
|
Получаем отделы
|
||||||
|
"""
|
||||||
|
def get(self,request):
|
||||||
|
department = DictDepartment.objects.all()
|
||||||
|
|
||||||
|
return Response(DepartmentsSerializer(department, many=True).data)
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<template>
|
||||||
|
<div v-for="(sort, depart) in grouped" class="mt-2">
|
||||||
|
<h2 class="text-teal">{{ depart }}</h2>
|
||||||
|
<v-divider :thickness="4" color="teal"/>
|
||||||
|
<v-row class="mt-1">
|
||||||
|
<v-col v-for="person in sort.sort((a,b)=>a.position-b.position)" cols="4" :key="person.id" class="cursor-pointer">
|
||||||
|
<CardDictEmployee :person="person" v-model:moreInformation="moreInformation"/>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</div>
|
||||||
|
<v-dialog v-model="moreInformation" transition="dialog-top-transition">
|
||||||
|
<DialogEmployeeDirection />
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import DialogEmployeeDirection from "./DialogEmployeeDirection.vue";
|
||||||
|
import CardDictEmployee from "../UI/DictEmployee/CardDictEmployee.vue";
|
||||||
|
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
selectedDep: {
|
||||||
|
name: String,
|
||||||
|
},
|
||||||
|
isWork: Number,
|
||||||
|
search: String,
|
||||||
|
})
|
||||||
|
|
||||||
|
const moreInformation = ref(false)
|
||||||
|
|
||||||
|
const filteredPerson = computed(() => {
|
||||||
|
return props.selectedDep.persons.filter(item => item.deleted == props.isWork && item.fio.toLowerCase().includes(props.search.toLowerCase()))
|
||||||
|
})
|
||||||
|
|
||||||
|
const grouped = computed(() => {
|
||||||
|
let group = []
|
||||||
|
group = Object.groupBy(filteredPerson.value, (item) => item.department)
|
||||||
|
return group
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<template>
|
||||||
|
<v-card>
|
||||||
|
<v-row class="bg-red">
|
||||||
|
<v-col class="bg-blue">
|
||||||
|
Общие данные
|
||||||
|
<!-- <CardDictEmployee /> -->
|
||||||
|
</v-col>
|
||||||
|
<v-col class="bg-purple">Участия в комиссиях</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row class="bg-green">
|
||||||
|
<v-col class="bg-orange">Сферы ответственности</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import CardDictEmployee from '../UI/DictEmployee/CardDictEmployee.vue';
|
||||||
|
|
||||||
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
|
import { onMounted } from 'vue'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
fullListInfo: {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
async function getFullInfoList() {
|
||||||
|
try {
|
||||||
|
const response = await axiosApiInstance.get('api/userauth/getdepartments')
|
||||||
|
} catch (error) {
|
||||||
|
console.log('Ошибка получения полной информации из справоника', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getFullInfoList();
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<template>
|
||||||
|
<v-card class="pa-2">
|
||||||
|
<v-row align="center">
|
||||||
|
<v-col cols="6">
|
||||||
|
<v-select
|
||||||
|
return-object
|
||||||
|
item-title="name"
|
||||||
|
:items="props.department"
|
||||||
|
v-model="selectedDep"
|
||||||
|
variant="outlined"
|
||||||
|
density="compact"
|
||||||
|
hide-details bg-color="grey-lighten-5"
|
||||||
|
label="Список отделов">
|
||||||
|
</v-select>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="2">
|
||||||
|
<v-switch
|
||||||
|
v-model="isWork"
|
||||||
|
:false-value="0"
|
||||||
|
:true-value="1"
|
||||||
|
color="teal"
|
||||||
|
label="Уволенные"
|
||||||
|
hide-details>
|
||||||
|
</v-switch>
|
||||||
|
</v-col>
|
||||||
|
<v-col class="ml-auto" cols="2">
|
||||||
|
<v-text-field
|
||||||
|
v-model="search"
|
||||||
|
append-inner-icon="mdi-magnify"
|
||||||
|
label="Поиск сотрудников"
|
||||||
|
variant="outlined"
|
||||||
|
density="compact"
|
||||||
|
bg-color="grey-lighten-5"
|
||||||
|
hide-details
|
||||||
|
clearable
|
||||||
|
@click:clear="handleClear"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
department: Array,
|
||||||
|
})
|
||||||
|
|
||||||
|
const selectedDep = defineModel('selectedDep')
|
||||||
|
const isWork = defineModel('isWork')
|
||||||
|
const search = defineModel('search')
|
||||||
|
|
||||||
|
const handleClear = () => {
|
||||||
|
search.value = '';
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<template>
|
||||||
|
<!-- добавить проверку пользователи скрыты или нет (смена текста) от состояния -->
|
||||||
|
<v-tooltip v-for="itemMenu in navMenu" :text="itemMenu.text" location="bottom">
|
||||||
|
<template v-slot:activator="{ props }">
|
||||||
|
<v-btn :icon="itemMenu.icon" v-bind="props" @click="itemMenu.event" :color="itemMenu.color"/>
|
||||||
|
</template>
|
||||||
|
</v-tooltip>
|
||||||
|
<v-dialog v-model="isDialog" width="800">
|
||||||
|
<card-like :LikeDialog="isDialog" @menusClose="isDialog = false"/>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import router from '@/router';
|
||||||
|
import { useTheme } from "vuetify";
|
||||||
|
import { useAccountStore } from '@/store/AccountStore';
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
|
||||||
|
import CardLike from '@/components/cardLike.vue'
|
||||||
|
|
||||||
|
const userStore = useAccountStore()
|
||||||
|
const theme = useTheme()
|
||||||
|
const isDialog = ref(null)
|
||||||
|
const rightRail = ref(true)
|
||||||
|
|
||||||
|
const emit = defineEmits(['showUser'])
|
||||||
|
|
||||||
|
const navMenu = computed(() => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
text: 'F.A.Q.',
|
||||||
|
icon: 'mdi-comment-question-outline',
|
||||||
|
event: () => router.push('/faq'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Обратная связь',
|
||||||
|
icon: 'mdi-thumb-up-outline',
|
||||||
|
event: () => isDialog.value = true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Сменить тему',
|
||||||
|
icon: 'mdi-lightbulb-outline',
|
||||||
|
color: 'lampa',
|
||||||
|
event: () => theme.toggle(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: `${rightRail.value == true ? 'Скрыть ' : 'Показать '} пользователей`,
|
||||||
|
icon: 'mdi-account-multiple-outline',
|
||||||
|
event: () => {
|
||||||
|
rightRail.value = !rightRail.value
|
||||||
|
emit('showUser', rightRail.value)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Выход',
|
||||||
|
icon: 'mdi-logout',
|
||||||
|
event: () => userStore.logout(),
|
||||||
|
},
|
||||||
|
]})
|
||||||
|
</script>
|
||||||
@@ -109,6 +109,7 @@ import {useAppStore} from '@/store/app'
|
|||||||
import { useVuelidate } from '@vuelidate/core'
|
import { useVuelidate } from '@vuelidate/core'
|
||||||
import { required, helpers } from '@vuelidate/validators'
|
import { required, helpers } from '@vuelidate/validators'
|
||||||
import { ref, reactive, computed, onMounted } from 'vue'
|
import { ref, reactive, computed, onMounted } from 'vue'
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
const req= helpers.withMessage('Обязательное поле', required)
|
const req= helpers.withMessage('Обязательное поле', required)
|
||||||
|
|
||||||
@@ -122,7 +123,7 @@ export default {
|
|||||||
const err = ref('')
|
const err = ref('')
|
||||||
const alert = ref(false)
|
const alert = ref(false)
|
||||||
const eyeshow = ref(false)
|
const eyeshow = ref(false)
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
const anon=reactive({
|
const anon=reactive({
|
||||||
username:"9966-00-",
|
username:"9966-00-",
|
||||||
@@ -158,7 +159,9 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
finally {
|
||||||
|
router.push('/')
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<v-card v-model="moreInformation" @click="moreInformation = true">
|
||||||
|
<v-avatar :image="checkremote(`${spravURL}.jpg`)" rounded="0" size="100"></v-avatar>
|
||||||
|
<v-card-item>
|
||||||
|
<v-card-title>{{ props.person.familyname }} {{ props.person.name }} {{ props.person.parentname }}</v-card-title>
|
||||||
|
<v-card-title class="text-subtitle-1">{{ props.person.post }}</v-card-title>
|
||||||
|
<v-card-subtitle>{{ props.person.tel }}</v-card-subtitle>
|
||||||
|
</v-card-item>
|
||||||
|
</v-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { checkremote } from "@/utils/universal_functions";
|
||||||
|
import { spravURL } from "@/utils/axios-api";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
person: {
|
||||||
|
familyname: String,
|
||||||
|
name: String,
|
||||||
|
parentname: String,
|
||||||
|
tel: String,
|
||||||
|
post: String,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const moreInformation = defineModel('moreInformation')
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<template>
|
||||||
|
<v-app-bar density="compact" color="teal-darken-4" elevation="1">
|
||||||
|
<template v-slot:image>
|
||||||
|
<v-img gradient="to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)" />
|
||||||
|
</template>
|
||||||
|
<v-icon :icon="props.showSideBar ? 'mdi-chevron-right' : 'mdi-chevron-left'" rounded="0" @click="$emit('showSide')" class="pl-7" size="small"/>
|
||||||
|
<v-col cols="3" class="d-flex align-center ml-3 cursor-pointer" @click="router.push('/')">
|
||||||
|
<v-img :src="props.logo" max-height="45" max-width="45"/>
|
||||||
|
<v-app-bar-title class="pl-2 text-h6 font-weight-bold">Портал МИ ФНС России по ЦОД № 2</v-app-bar-title>
|
||||||
|
</v-col>
|
||||||
|
<v-col class="d-flex justify-end align-center">
|
||||||
|
<vcard-user :author="accountStore.user"/>
|
||||||
|
<AppNavigation @showUser="showUser"/>
|
||||||
|
</v-col>
|
||||||
|
</v-app-bar>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import router from '@/router';
|
||||||
|
import { useAccountStore } from '@/store/AccountStore';
|
||||||
|
|
||||||
|
import vcardUser from '@/components/UI/fiousercard/vcardUser.vue';
|
||||||
|
import AppNavigation from '@/components/UI/AppHeader/AppNavigation.vue';
|
||||||
|
|
||||||
|
const accountStore = useAccountStore()
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
showSideBar: Boolean,
|
||||||
|
logo: String,
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['showSide', 'showUser'])
|
||||||
|
|
||||||
|
const showUser = (val) => {
|
||||||
|
emit('showUser', val)
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<template>
|
||||||
|
<v-navigation-drawer :rail="props.isRail" permanent class="text-body-2">
|
||||||
|
<div class="d-flex flex-column h-100">
|
||||||
|
<v-list v-for="(nav, index) in props.asideNavigation" :key="index" density="compact" nav>
|
||||||
|
<v-list-item v-if="!('submenu' in nav)" :prepend-icon="nav.ico" @click="router.push(`${nav.path}`)">
|
||||||
|
{{ nav.name }}
|
||||||
|
<v-tooltip v-if="props.isRail" location="top" activator="parent">
|
||||||
|
{{ nav.name }}
|
||||||
|
</v-tooltip>
|
||||||
|
</v-list-item>
|
||||||
|
<v-list-group v-else :fluid="props.isRail ? true : false">
|
||||||
|
<template v-slot:activator="{ props: groupProps }">
|
||||||
|
<v-list-item v-bind="groupProps" :prepend-icon="nav.ico">
|
||||||
|
{{ nav.name }}
|
||||||
|
<v-tooltip v-if="props.isRail" location="top" activator="parent">
|
||||||
|
{{ nav.name }}
|
||||||
|
</v-tooltip>
|
||||||
|
</v-list-item>
|
||||||
|
</template>
|
||||||
|
<v-list-item v-for="(sub, index) in nav.submenu" :key="index" @click="router.push(`${sub.path}`)">
|
||||||
|
{{ props.isRail ? getAbbreviation(sub.name) : sub.name }}
|
||||||
|
<v-tooltip v-if="props.isRail" location="top" activator="parent">
|
||||||
|
{{ sub.name }}
|
||||||
|
</v-tooltip>
|
||||||
|
</v-list-item>
|
||||||
|
</v-list-group>
|
||||||
|
</v-list>
|
||||||
|
<v-list class="flex-grow-1" nav>
|
||||||
|
<v-list-item v-for="links in store.portallinks" :key="links.id" :href="links.link" target="_blank"
|
||||||
|
:prepend-icon="links.imagecode" link>
|
||||||
|
{{ links.name }}
|
||||||
|
<v-tooltip v-if="props.isRail" location="top" activator="parent">
|
||||||
|
{{ links.name }}
|
||||||
|
</v-tooltip>
|
||||||
|
</v-list-item>
|
||||||
|
</v-list>
|
||||||
|
<v-list v-if="accountUser.user.is_staff" class="text-blue-grey-lighten-1" nav>
|
||||||
|
<v-list-item prepend-icon="mdi-wrench" title="Панель администратора" :href="baseURL + 'admin'" target="_blank" link>
|
||||||
|
<v-tooltip v-if="props.isRail" location="top" activator="parent">
|
||||||
|
Панель администратора
|
||||||
|
</v-tooltip>
|
||||||
|
</v-list-item>
|
||||||
|
</v-list>
|
||||||
|
<page-counter :rail="props.isRail"/>
|
||||||
|
</div>
|
||||||
|
</v-navigation-drawer>
|
||||||
|
<v-navigation-drawer v-model="props.showUser" rail location="right">
|
||||||
|
<online-users />
|
||||||
|
</v-navigation-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import router from "@/router";
|
||||||
|
import { useMainmenuStore } from "@/store/MainmenuStore";
|
||||||
|
import { useAccountStore } from "@/store/AccountStore";
|
||||||
|
import { baseURL } from '@/utils/axios-api';
|
||||||
|
|
||||||
|
import pageCounter from "@/components/UI/defaultportal/page-counter.vue";
|
||||||
|
import onlineUsers from "@/components/UI/fiousercard/onlineUsers.vue";
|
||||||
|
|
||||||
|
const store = useMainmenuStore()
|
||||||
|
const accountUser = useAccountStore()
|
||||||
|
|
||||||
|
store.loadlinks()
|
||||||
|
defineEmits(['showUser'])
|
||||||
|
const props = defineProps({
|
||||||
|
isRail: Boolean,
|
||||||
|
showUser: Boolean,
|
||||||
|
asideNavigation: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [{
|
||||||
|
name: "",
|
||||||
|
ico: "",
|
||||||
|
path: "",
|
||||||
|
submenu: [{
|
||||||
|
name: "",
|
||||||
|
path: "",
|
||||||
|
}],
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const getAbbreviation = (text) => {
|
||||||
|
return text.substring(0, 2).toUpperCase();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,234 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-app>
|
<v-app>
|
||||||
<v-app-bar :elevation="accountStore.cod2user ? 2 : 0" density="compact" color="app_bar" class="pl-4">
|
<AppHeader @show-side="rail = !rail" :logo="imageSrc" @showUser="usersOnline" />
|
||||||
<v-icon v-if="accountStore.cod2user" class="px-3" size="20" color="black_and_white"
|
<AsideNav :asideNavigation="navigations" :isRail="rail" :showUser="showUser" />
|
||||||
:icon="rail ? 'mdi-chevron-right' : 'mdi-chevron-left'" @click="rail = !rail" />
|
<v-main class="d-flex">
|
||||||
|
|
||||||
<v-card v-if="accountStore.cod2user" class="bg-transparent py" color="black_and_white" density="compact"
|
|
||||||
:prepend-avatar="imageSrc" title="Портал МИ ФНС России по ЦОД № 2" variant="text" :to="'/'" />
|
|
||||||
<template v-slot:image>
|
|
||||||
<v-img class="bggrad" />
|
|
||||||
</template>
|
|
||||||
<template v-slot:append>
|
|
||||||
<template v-if="accountStore.cod2user">
|
|
||||||
<vcard-user :author="accountStore.user" />
|
|
||||||
<v-tooltip location="bottom">
|
|
||||||
|
|
||||||
|
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<v-btn color="black_and_white" v-bind="props" dark to="/faq" icon="mdi-comment-question-outline" />
|
|
||||||
</template>
|
|
||||||
<span>F.A.Q.</span>
|
|
||||||
</v-tooltip>
|
|
||||||
|
|
||||||
|
|
||||||
<v-dialog v-model="LikeDialog" persistent width="800">
|
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<v-btn color="black_and_white" v-bind="props" dark icon="mdi-thumb-up-outline">
|
|
||||||
<v-icon></v-icon>
|
|
||||||
<v-tooltip activator="parent" location="bottom">Обратная связь</v-tooltip>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<Card-like :LikeDialog="LikeDialog" @menusClose="closeinfo()" />
|
|
||||||
</v-dialog>
|
|
||||||
|
|
||||||
<v-tooltip location="bottom">
|
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<v-btn icon @click="toggleTheme">
|
|
||||||
<v-icon v-bind="props" class="mr-1" :color="theme.global.current.value.dark ? 'yellow' : 'lampa'">
|
|
||||||
mdi-lightbulb-outline
|
|
||||||
</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
<span> Сменить тему</span>
|
|
||||||
</v-tooltip>
|
|
||||||
|
|
||||||
<v-card v-show="message" class="" width="50">{{ name }}</v-card>
|
|
||||||
|
|
||||||
<v-tooltip location="bottom">
|
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<v-btn color="black_and_white" icon="mdi-account-multiple-outline" @click="drawer_right = !drawer_right"
|
|
||||||
v-bind="props" />
|
|
||||||
</template>
|
|
||||||
<span>
|
|
||||||
{{
|
|
||||||
drawer_right == true
|
|
||||||
? "Скрыть пользователей"
|
|
||||||
: "Показать пользователей"
|
|
||||||
}}
|
|
||||||
</span>
|
|
||||||
</v-tooltip>
|
|
||||||
<v-tooltip location="bottom">
|
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<v-btn color="black_and_white" icon="mdi-logout" @click="accountStore.logout" v-bind="props" />
|
|
||||||
</template>
|
|
||||||
<span> Выход </span>
|
|
||||||
</v-tooltip>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template v-else>
|
|
||||||
<v-row justify="center">
|
|
||||||
<Auth-form @challengealert="alert = true" />
|
|
||||||
</v-row>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</v-app-bar>
|
|
||||||
<v-navigation-drawer v-if="accountStore.cod2user" :width="245" :rail="rail" permanent v-model="drawer">
|
|
||||||
<v-row class="my-0 h-100">
|
|
||||||
<v-col class="flex-column d-flex">
|
|
||||||
<v-row><v-col>
|
|
||||||
<v-list nav density="compact">
|
|
||||||
<template v-for="(x, key) in navigations" :key="key">
|
|
||||||
<!-- v-if="!('submenu' in x) || (x.path== '/portal' && accountStore.user.is_staff)" -->
|
|
||||||
<v-list-item v-if="(x.path == '/portal'? accountStore.user.is_superuser : true) && !('submenu' in x)
|
|
||||||
" :key="x.key" :title="x.name" :value="x.name" :href="x.link" :disabled="x.path == ''" :to="x.path"
|
|
||||||
:target="x.link ? '_blank' : ''"
|
|
||||||
color="navigation"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<v-icon :icon="x.ico" />
|
|
||||||
<v-tooltip v-if="rail" activator="parent" location="top">
|
|
||||||
{{ x.name }}
|
|
||||||
</v-tooltip>
|
|
||||||
</template>
|
|
||||||
</v-list-item>
|
|
||||||
|
|
||||||
<v-list-group v-if="x.path != '/portal' && 'submenu' in x" :class="rail ? 'railmenu' : ''" :key="key"
|
|
||||||
:value="x.name">
|
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<v-list-item v-bind="props" :title="x.name" :prepend-icon="x.ico" color="navigation">
|
|
||||||
<v-tooltip v-if="rail" activator="parent" location="top">
|
|
||||||
{{ x.name }}
|
|
||||||
</v-tooltip>
|
|
||||||
</v-list-item>
|
|
||||||
</template>
|
|
||||||
<v-list-item v-for="(child, k) in x.submenu" color="navigation" :href="child.link" :key="k"
|
|
||||||
:value="child.name" :title="!rail ? child.name : menuTruncated(child.name)" :to="child.path"
|
|
||||||
:target="child.link ? '_blank' : ''">
|
|
||||||
<v-tooltip v-if="rail" activator="parent" location="top">
|
|
||||||
{{ child.name }}
|
|
||||||
</v-tooltip>
|
|
||||||
</v-list-item>
|
|
||||||
</v-list-group>
|
|
||||||
</template>
|
|
||||||
</v-list>
|
|
||||||
|
|
||||||
<v-list nav density="compact">
|
|
||||||
<v-list-item v-for="x of mainmenuStore.portallinks" :key="x.name" :title="x.name" :value="x.name"
|
|
||||||
:href="x.link" color="app_bar" :target="x.link ? '_blank' : ''">
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<v-icon :icon="x.imagecode" />
|
|
||||||
<v-tooltip v-if="rail" activator="parent" location="top">
|
|
||||||
{{ x.name }}
|
|
||||||
</v-tooltip>
|
|
||||||
</template>
|
|
||||||
</v-list-item>
|
|
||||||
</v-list>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
<v-row class="flex-grow-0" v-if="accountStore.user.is_staff">
|
|
||||||
<v-col>
|
|
||||||
<AdminMenu :rail="rail" />
|
|
||||||
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<v-row no-gutters class="flex-grow-0">
|
|
||||||
<v-col>
|
|
||||||
<page-counter :rail="rail" />
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-navigation-drawer>
|
|
||||||
|
|
||||||
<v-main v-if="accountStore.cod2user" class="d-flex bg-main_theme">
|
|
||||||
<router-view />
|
<router-view />
|
||||||
|
|
||||||
<alert-default />
|
<alert-default />
|
||||||
</v-main>
|
</v-main>
|
||||||
<v-main v-else class="d-flex align-center text-h3 bg-teal-lighten-2">
|
|
||||||
<v-card class="h-100 w-100 d-flex justify-center rounded-0 flex-column" :image="`${burl}${scrimg}`">
|
|
||||||
<v-card-text
|
|
||||||
class="justify-center bgCard h-100 ma-3 d-flex flex-column"
|
|
||||||
style="background: rgba(255, 255, 255, 0.3) !important; background-color: rgba(255, 255, 255, 0.3) !important;"
|
|
||||||
>
|
|
||||||
<v-row
|
|
||||||
class="bgText flex-grow-0"
|
|
||||||
style="background: rgba(255, 255, 255, 0.5) !important; background-color: rgba(255, 255, 255, 0.5) !important;"
|
|
||||||
>
|
|
||||||
<v-col class="text-center textcolor font-weight-black text-h3 pb-0">
|
|
||||||
Добро пожаловать на портал МИ ФНС России по ЦОД № 2
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<v-row
|
|
||||||
class="bgText flex-grow-0"
|
|
||||||
style="background: rgba(255, 255, 255, 0.5) !important; background-color: rgba(255, 255, 255, 0.5) !important;"
|
|
||||||
>
|
|
||||||
<v-col class="text-subtitle-1 text-center textcolor pt-0">
|
|
||||||
Авторизуйтесь для получения доступа к контенту портала
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card-text>
|
|
||||||
</v-card>
|
|
||||||
|
|
||||||
<alert-default />
|
|
||||||
</v-main>
|
|
||||||
<v-navigation-drawer v-if="accountStore.cod2user" v-model="drawer_right" rail permanent location="right"
|
|
||||||
@click="rail = false">
|
|
||||||
<Online-users />
|
|
||||||
</v-navigation-drawer>
|
|
||||||
</v-app>
|
</v-app>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, computed } from "vue";
|
import { ref, computed } from "vue";
|
||||||
import uf from "@/utils/universal_functions";
|
|
||||||
import { useAccountStore } from "@/store/AccountStore";
|
import { useAccountStore } from "@/store/AccountStore";
|
||||||
import { useMainmenuStore } from "@/store/MainmenuStore";
|
|
||||||
import { useTheme } from "vuetify";
|
|
||||||
import AuthForm from "@/components/UI/Auth-form.vue";
|
|
||||||
import OnlineUsers from "@/components/UI/fiousercard/onlineUsers.vue";
|
|
||||||
import CardLike from "@/components/cardLike.vue";
|
|
||||||
import { axiosApiInstance, 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 PageCounter from "@/components/UI/defaultportal/page-counter.vue";
|
|
||||||
import AdminMenu from "@/layouts/default/AdminMenu.vue";
|
|
||||||
|
|
||||||
import { useDisplay } from "vuetify";
|
import AppHeader from "./AppHeader.vue";
|
||||||
|
import AsideNav from "./AsideNav.vue";
|
||||||
|
import alertDefault from "./alertDefault.vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
AuthForm,
|
AppHeader,
|
||||||
OnlineUsers,
|
AsideNav,
|
||||||
CardLike,
|
alertDefault,
|
||||||
VcardUser,
|
|
||||||
PageCounter,
|
|
||||||
AdminMenu,
|
|
||||||
},
|
},
|
||||||
|
emits: ['showUser'],
|
||||||
mixins: [uf],
|
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
const { name } = useDisplay();
|
|
||||||
const theme = useTheme();
|
|
||||||
const mainmenuStore = useMainmenuStore();
|
|
||||||
const accountStore = useAccountStore();
|
const accountStore = useAccountStore();
|
||||||
const drawer = ref(true);
|
const showUser = ref(true);
|
||||||
const drawer_right = ref(true);
|
|
||||||
|
|
||||||
const LikeDialog = ref(false);
|
|
||||||
const rail = ref(false);
|
const rail = ref(false);
|
||||||
const showTooltip = ref(false);
|
|
||||||
const alert = ref(false);
|
const alert = ref(false);
|
||||||
const burl = baseURL.slice(0, -1);
|
const burl = baseURL.slice(0, -1);
|
||||||
const scrimg = ref([]);
|
const scrimg = ref([]);
|
||||||
|
|
||||||
|
const usersOnline = (val) => {
|
||||||
|
showUser.value = val;
|
||||||
|
}
|
||||||
const message = computed({
|
const message = computed({
|
||||||
get: () => {
|
get: () => {
|
||||||
return process.env.NODE_ENV == "development" ? true : false;
|
return process.env.NODE_ENV == "development" ? true : false;
|
||||||
@@ -246,20 +54,6 @@ export default {
|
|||||||
|
|
||||||
screenimg();
|
screenimg();
|
||||||
|
|
||||||
const menuTruncated = (menus) => {
|
|
||||||
return menus.slice(0, 2).toUpperCase();
|
|
||||||
};
|
|
||||||
|
|
||||||
const toggleTheme = () => {
|
|
||||||
theme.global.name.value = theme.global.current.value.dark
|
|
||||||
? "light"
|
|
||||||
: "dark";
|
|
||||||
};
|
|
||||||
|
|
||||||
mainmenuStore.loadlinks();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const navigations = ref([
|
const navigations = ref([
|
||||||
{
|
{
|
||||||
name: "Новости",
|
name: "Новости",
|
||||||
@@ -282,7 +76,7 @@ export default {
|
|||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
name: "Справочник",
|
name: "Справочник",
|
||||||
link: "http://10.252.44.33/accounting6/members.php",
|
path: "/employee_directory",
|
||||||
},
|
},
|
||||||
|
|
||||||
// {
|
// {
|
||||||
@@ -331,18 +125,13 @@ export default {
|
|||||||
path: "/portal",
|
path: "/portal",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
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;
|
||||||
});
|
});
|
||||||
|
|
||||||
const closeinfo = () => {
|
|
||||||
LikeDialog.value = false;
|
|
||||||
// feedalert.value=true
|
|
||||||
};
|
|
||||||
|
|
||||||
const getSafetyChapter = () => {
|
const getSafetyChapter = () => {
|
||||||
axiosApiInstance.get("api/safety/gettypes/").then((response) => {
|
axiosApiInstance.get("api/safety/gettypes/").then((response) => {
|
||||||
response.data.forEach((item) => {
|
response.data.forEach((item) => {
|
||||||
@@ -366,71 +155,23 @@ export default {
|
|||||||
// getSafetyChapter();
|
// getSafetyChapter();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
theme,
|
|
||||||
mainmenuStore,
|
|
||||||
accountStore,
|
accountStore,
|
||||||
drawer,
|
showUser,
|
||||||
drawer_right,
|
|
||||||
toggleTheme,
|
|
||||||
navigations,
|
navigations,
|
||||||
imageSrc,
|
imageSrc,
|
||||||
LikeDialog,
|
scrimg,
|
||||||
scrimg,
|
|
||||||
rail,
|
rail,
|
||||||
showTooltip,
|
|
||||||
menuTruncated,
|
|
||||||
alert,
|
alert,
|
||||||
burl,
|
burl,
|
||||||
name,
|
|
||||||
closeinfo,
|
|
||||||
baseURL,
|
baseURL,
|
||||||
|
usersOnline,
|
||||||
message,
|
message,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.bgCard {
|
|
||||||
background: rgba(255, 255, 255, 0.3) !important;
|
|
||||||
background-color: rgba(255, 255, 255, 0.3) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-card.bgCard {
|
|
||||||
background: rgba(255, 255, 255, 0.3) !important;
|
|
||||||
background-color: rgba(255, 255, 255, 0.3) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bgText {
|
|
||||||
background: rgba(255, 255, 255, 0.5) !important;
|
|
||||||
background-color: rgba(255, 255, 255, 0.5) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.textcolor {
|
|
||||||
color: #2f535e !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mystat {
|
|
||||||
position: fixed;
|
|
||||||
right: 10px;
|
|
||||||
bottom: 10px;
|
|
||||||
z-index: 1005;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btnNav .v-navigation-drawer__content {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.railmenu .v-list-group__items .v-list-item {
|
|
||||||
padding-inline-start: 11px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.textcolor {
|
.textcolor {
|
||||||
color: #2f535e;
|
color: #2f535e;
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
#tr-popup {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,10 +1,3 @@
|
|||||||
/**
|
|
||||||
* main.js
|
|
||||||
*
|
|
||||||
* Bootstraps Vuetify and other plugins then mounts the App`
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Components
|
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
|
|
||||||
// Composables
|
// Composables
|
||||||
@@ -27,10 +20,6 @@ components.forEach((component) => {
|
|||||||
|
|
||||||
app.component('vue3-autocounter', Vue3Autocounter)
|
app.component('vue3-autocounter', Vue3Autocounter)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Vue.use(VueScrollTo)
|
|
||||||
|
|
||||||
registerPlugins(app)
|
registerPlugins(app)
|
||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<v-app>
|
||||||
|
<v-app-bar density="compact" color="teal-darken-4" elevation="1">
|
||||||
|
<template v-slot:image>
|
||||||
|
<v-img gradient="to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)" />
|
||||||
|
</template>
|
||||||
|
<v-col class="d-flex justify-end">
|
||||||
|
<AuthForm @challengealert="alarm = true" />
|
||||||
|
</v-col>
|
||||||
|
</v-app-bar>
|
||||||
|
<v-card class="h-100 mt-11 pa-5 d-flex align-center text-center" variant="tonal" image="/src/assets/squirrel.jpg">
|
||||||
|
<v-card class="w-100 h-100 d-flex align-center bg-grey-lighten-1 opacity-70">
|
||||||
|
<!-- style="background-color: rgba(255, 255, 255, .5);" -->
|
||||||
|
<v-container class="opacity-100 mx-2 bg-grey-lighten-5" fluid>
|
||||||
|
<!-- style="background-color: #ffffff38;" -->
|
||||||
|
<v-col class=" font-weight-black text-text_card_auth text-h3">Добро пожаловать на портал МИ ФНС России по ЦОД № 2</v-col>
|
||||||
|
<v-col class="text-subtitle-1">Авторизуйтесь для получения доступа к контенту портала</v-col>
|
||||||
|
</v-container>
|
||||||
|
</v-card>
|
||||||
|
</v-card>
|
||||||
|
</v-app>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import AuthForm from "@/components/UI/Auth-form.vue"
|
||||||
|
|
||||||
|
</script>
|
||||||
@@ -7,16 +7,19 @@ import { ru } from 'vuetify/locale'
|
|||||||
|
|
||||||
|
|
||||||
export default createVuetify({
|
export default createVuetify({
|
||||||
|
|
||||||
locale: {
|
locale: {
|
||||||
messages: { ru, },
|
messages: { ru, },
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
VCalendar,
|
VCalendar,
|
||||||
|
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
defaultTheme: 'light',
|
defaultTheme: 'light',
|
||||||
|
options: {
|
||||||
|
customProperties: true
|
||||||
|
},
|
||||||
themes: {
|
themes: {
|
||||||
light: {
|
light: {
|
||||||
colors: {
|
colors: {
|
||||||
@@ -43,12 +46,13 @@ export default createVuetify({
|
|||||||
insert_table: '#FAFAFA',
|
insert_table: '#FAFAFA',
|
||||||
btn_text: '#00897B', // фигма, текст кнопки с иконкой
|
btn_text: '#00897B', // фигма, текст кнопки с иконкой
|
||||||
select_list: '#E0EAE8',
|
select_list: '#E0EAE8',
|
||||||
btn_gray: '#E0E0E0'
|
btn_gray: '#E0E0E0',
|
||||||
|
text_card_auth: '#2f535e',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
dark: {
|
dark: {
|
||||||
colors: {
|
colors: {
|
||||||
lampa: '#121212',
|
lampa: '#FFB300',
|
||||||
primary: '#1E88E5',
|
primary: '#1E88E5',
|
||||||
secondary: '#64B5F6',
|
secondary: '#64B5F6',
|
||||||
main_theme: "#121212",
|
main_theme: "#121212",
|
||||||
@@ -74,14 +78,12 @@ export default createVuetify({
|
|||||||
btn_gray: '#2C2C2C',
|
btn_gray: '#2C2C2C',
|
||||||
surface: '#1E1E1E',
|
surface: '#1E1E1E',
|
||||||
background: '#121212',
|
background: '#121212',
|
||||||
|
text_card_auth: '#2f535e',
|
||||||
'on-background': '#FFFFFF',
|
'on-background': '#FFFFFF',
|
||||||
'on-surface': '#FFFFFF',
|
'on-surface': '#FFFFFF',
|
||||||
'card-background': '#1E1E1E'
|
'card-background': '#1E1E1E'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: {
|
|
||||||
customProperties: true
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -1,15 +1,18 @@
|
|||||||
// Composables
|
|
||||||
import { createRouter, createWebHistory } from "vue-router";
|
import { createRouter, createWebHistory } from "vue-router";
|
||||||
import { useAccountStore } from "@/store/AccountStore";
|
import { useAccountStore } from "@/store/AccountStore";
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
|
{
|
||||||
|
path: "/auth",
|
||||||
|
component: () => import('@/pages/AuthorizePage.vue'),
|
||||||
|
name: "Auth",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
component: () => import("@/layouts/default/DefaultPortal.vue"),
|
component: () => import("@/layouts/default/DefaultPortal.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
title: "Вход",
|
requiresAuth: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
@@ -192,7 +195,13 @@ const routes = [
|
|||||||
name: 'Secret Page',
|
name: 'Secret Page',
|
||||||
component: () =>
|
component: () =>
|
||||||
import("@/views/secret/SecretPage.vue")
|
import("@/views/secret/SecretPage.vue")
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
path: '/employee_directory',
|
||||||
|
name: 'EmployeeDirectory',
|
||||||
|
component: () =>
|
||||||
|
import("@/views/employee_directory/EmployeeDirectoryMain.vue")
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -202,23 +211,12 @@ const router = createRouter({
|
|||||||
routes,
|
routes,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function isSuperuser() {
|
|
||||||
const accountStore = useAccountStore();
|
|
||||||
|
|
||||||
if (accountStore.user.is_superuser === false) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (to.meta.requiresAuth && isSuperuser()) {
|
const accountStore = useAccountStore();
|
||||||
|
if (to.meta.requiresAuth && !accountStore.cod2user) {
|
||||||
document.title = to.meta.title;
|
document.title = to.meta.title;
|
||||||
next("/");
|
next("/auth");
|
||||||
} else {
|
} else {
|
||||||
document.title = to.meta.title;
|
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ import { clearAxios, spravURL } from "@/utils/axios-api";
|
|||||||
import VueJwtDecode from "vue-jwt-decode";
|
import VueJwtDecode from "vue-jwt-decode";
|
||||||
import { checkremote } from "@/utils/universal_functions";
|
import { checkremote } from "@/utils/universal_functions";
|
||||||
import { useAppStore } from "@/store/app.js";
|
import { useAppStore } from "@/store/app.js";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
export const useAccountStore = defineStore("AccountStore", () => {
|
export const useAccountStore = defineStore("AccountStore", () => {
|
||||||
const AppStore = useAppStore();
|
const AppStore = useAppStore();
|
||||||
const user = ref(getuserFromStorage());
|
const user = ref(getuserFromStorage());
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ export const useAccountStore = defineStore("AccountStore", () => {
|
|||||||
if (settingsStorage.value === null) {
|
if (settingsStorage.value === null) {
|
||||||
settingsUp(defaultSettings)
|
settingsUp(defaultSettings)
|
||||||
}
|
}
|
||||||
|
console.log(user.value);
|
||||||
AppStore.loading = false;
|
AppStore.loading = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -72,7 +73,7 @@ export const useAccountStore = defineStore("AccountStore", () => {
|
|||||||
user.value = {};
|
user.value = {};
|
||||||
localStorage.removeItem("access");
|
localStorage.removeItem("access");
|
||||||
localStorage.removeItem("refresh");
|
localStorage.removeItem("refresh");
|
||||||
|
router.push('/auth')
|
||||||
};
|
};
|
||||||
watch(
|
watch(
|
||||||
user,
|
user,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import {ref, watch} from 'vue'
|
import { ref } from 'vue'
|
||||||
import { clearAxios } from '@/utils/axios-api'
|
import { clearAxios } from '@/utils/axios-api'
|
||||||
|
|
||||||
export const useMainmenuStore = defineStore('MainmenuStore', () => {
|
export const useMainmenuStore = defineStore('MainmenuStore', () => {
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row class="justify-center ma-0 ">
|
<v-row class="justify-center ma-0 h-100">
|
||||||
<v-col class="flex-column d-flex">
|
<v-col class="flex-column d-flex">
|
||||||
|
|
||||||
<news-crossroad />
|
<news-crossroad />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
File renamed without changes.
@@ -0,0 +1,42 @@
|
|||||||
|
<template>
|
||||||
|
<v-container fluid>
|
||||||
|
<HeaderEmployeeDirectory :department="department" v-model:selectedDep="selectedDep" v-model:isWork="isWork" v-model:search="search"/>
|
||||||
|
<CardEmployeeDirection :selectedDep="selectedDep" :isWork="isWork" :search="search"/>
|
||||||
|
</v-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, onMounted } from 'vue'
|
||||||
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
|
|
||||||
|
import HeaderEmployeeDirectory from '../../components/EmployeeDirectory/HeaderEmployeeDirectory.vue';
|
||||||
|
import CardEmployeeDirection from '../../components/EmployeeDirectory/CardEmployeeDirection.vue';
|
||||||
|
|
||||||
|
const department = ref([])
|
||||||
|
const selectedDep = ref({
|
||||||
|
id: 0,
|
||||||
|
persons: []
|
||||||
|
})
|
||||||
|
const isWork = ref(0)
|
||||||
|
const search = ref('')
|
||||||
|
|
||||||
|
async function getDepartment() {
|
||||||
|
try {
|
||||||
|
const response = await axiosApiInstance.get('api/userauth/getdepartments')
|
||||||
|
response.data[0].persons= response.data.reduce((acc,elm)=>{
|
||||||
|
acc.push(...elm.persons)
|
||||||
|
return acc},[]
|
||||||
|
)
|
||||||
|
department.value = response.data
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Ошибка запроса получения отделов:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getDepartment();
|
||||||
|
selectedDep.value = department.value[0]
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
Reference in new issue
Block a user