651 lines
18 KiB
Vue
651 lines
18 KiB
Vue
<template>
|
||
<v-app>
|
||
<v-app-bar v-if="accountStore.cod2user" density="compact" color="#263f40" class="pl-4" style="box-shadow: none">
|
||
<v-icon class="px-3" size="20"
|
||
:icon="rail ? 'mdi-chevron-right' : 'mdi-chevron-left'" @click="rail = !rail" />
|
||
<v-card class="bg-transparent" density="compact"
|
||
:prepend-avatar="imageSrc" title="Портал МИ ФНС России по ЦОД № 2" variant="text" :to="'/'" />
|
||
<template v-slot:append>
|
||
<div class="fns-actions">
|
||
<vcard-user :author="accountStore.user" />
|
||
<v-tooltip location="bottom">
|
||
<template v-slot:activator="{ props }">
|
||
<button class="fns-btn" v-bind="props" @click="$router.push('/faq')">
|
||
<v-icon size="27">mdi-comment-question-outline</v-icon>
|
||
</button>
|
||
</template>
|
||
<span>F.A.Q.</span>
|
||
</v-tooltip>
|
||
|
||
<v-dialog v-model="LikeDialog" persistent width="800">
|
||
<template v-slot:activator="{ props }">
|
||
<v-tooltip location="bottom">
|
||
<template v-slot:activator="{ props: t }">
|
||
<button class="fns-btn" v-bind="{ ...props, ...t }">
|
||
<v-icon size="27">mdi-thumb-up-outline</v-icon>
|
||
</button>
|
||
</template>
|
||
<span>Обратная связь</span>
|
||
</v-tooltip>
|
||
</template>
|
||
<Card-like :LikeDialog="LikeDialog" @menusClose="closeinfo()" />
|
||
</v-dialog>
|
||
|
||
<span v-show="message" class="fns-dev-badge">DEV · {{ name }}</span>
|
||
|
||
<v-tooltip location="bottom">
|
||
<template v-slot:activator="{ props }">
|
||
<button class="fns-btn" v-bind="props" @click="drawer_right = !drawer_right">
|
||
<v-icon size="27">mdi-account-multiple-outline</v-icon>
|
||
</button>
|
||
</template>
|
||
<span>{{ drawer_right ? 'Скрыть пользователей' : 'Показать пользователей' }}</span>
|
||
</v-tooltip>
|
||
|
||
<div class="fns-divider-v fns-divider-v--sm" />
|
||
|
||
<v-tooltip location="bottom">
|
||
<template v-slot:activator="{ props }">
|
||
<button class="fns-btn fns-btn--danger" v-bind="props" @click="accountStore.logout">
|
||
<v-icon size="27">mdi-logout</v-icon>
|
||
</button>
|
||
</template>
|
||
<span>Выход</span>
|
||
</v-tooltip>
|
||
</div>
|
||
</template>
|
||
</v-app-bar>
|
||
|
||
<!-- ═══════════════════════════════════════════════
|
||
SIDEBAR — ФНС Navigation
|
||
═══════════════════════════════════════════════ -->
|
||
<v-navigation-drawer
|
||
v-if="accountStore.cod2user"
|
||
:width="248"
|
||
:rail="rail"
|
||
permanent
|
||
v-model="drawer"
|
||
class="text-white px-2"
|
||
style="background-color: #335455 !important;"
|
||
>
|
||
|
||
<v-row class="my-0 h-100">
|
||
<v-col class="flex-column d-flex pa-2">
|
||
<v-row>
|
||
<v-col>
|
||
<!-- Основная навигация -->
|
||
<v-list nav density="compact" class="fns-nav-list">
|
||
<template v-for="(x, key) in navigations" :key="key">
|
||
|
||
<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"
|
||
class="fns-nav-item"
|
||
rounded="lg"
|
||
>
|
||
<template v-slot:prepend>
|
||
<v-icon :icon="x.ico" size="17" />
|
||
<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"
|
||
class="fns-nav-item"
|
||
rounded="lg"
|
||
>
|
||
<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' : ''"
|
||
class="fns-nav-item fns-nav-item--child"
|
||
rounded="lg"
|
||
>
|
||
<v-tooltip v-if="rail" activator="parent" location="top">{{ child.name }}</v-tooltip>
|
||
</v-list-item>
|
||
</v-list-group>
|
||
</template>
|
||
</v-list>
|
||
|
||
<!-- Ссылки портала -->
|
||
<div class="fns-nav-divider" />
|
||
<div class="fns-nav-section-label" v-if="!rail">Внешние ресурсы</div>
|
||
<v-list nav density="compact" class="fns-nav-list">
|
||
<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' : ''"
|
||
class="fns-nav-item fns-nav-item--external"
|
||
rounded="lg"
|
||
>
|
||
<template v-slot:prepend>
|
||
<v-icon :icon="x.imagecode" size="17" />
|
||
<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>
|
||
<div class="fns-nav-divider" />
|
||
<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" style="background-color: #f4f9f9;">
|
||
<router-view />
|
||
<alert-default />
|
||
</v-main>
|
||
|
||
<v-main v-else class="fns-login-main">
|
||
<LoginPage />
|
||
<alert-default />
|
||
</v-main>
|
||
|
||
<!-- Right drawer -->
|
||
<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>
|
||
</template>
|
||
|
||
<script>
|
||
import { ref, computed } from 'vue';
|
||
import uf from '@/utils/universal_functions';
|
||
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 { 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 LoginPage from '../../views/LoginPage.vue';
|
||
|
||
export default {
|
||
components: { LoginPage, AuthForm, OnlineUsers, CardLike, VcardUser, PageCounter, AdminMenu },
|
||
mixins: [uf],
|
||
|
||
setup() {
|
||
const { name } = useDisplay();
|
||
const theme = useTheme();
|
||
const mainmenuStore = useMainmenuStore();
|
||
const accountStore = useAccountStore();
|
||
const drawer = ref(true);
|
||
const drawer_right = ref(false);
|
||
const LikeDialog = ref(false);
|
||
const rail = ref(false);
|
||
const showTooltip = ref(false);
|
||
const alert = ref(false);
|
||
const burl = baseURL.slice(0, -1);
|
||
const scrimg = ref([]);
|
||
|
||
const message = computed(() => process.env.NODE_ENV === 'development');
|
||
|
||
const menuTruncated = (menus) => menus.slice(0, 2).toUpperCase();
|
||
|
||
const toggleTheme = () => {
|
||
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark';
|
||
};
|
||
|
||
mainmenuStore.loadlinks();
|
||
|
||
const navigations = ref([
|
||
{
|
||
name: 'Новости',
|
||
ico: 'mdi-newspaper',
|
||
path: '/news',
|
||
},
|
||
{
|
||
name: 'Об инспекции',
|
||
ico: 'mdi-city',
|
||
path: '/inspection',
|
||
},
|
||
{
|
||
name: 'Структура',
|
||
ico: 'mdi-source-branch',
|
||
submenu: [
|
||
{
|
||
name: 'ОКиБ',
|
||
path: '/okib',
|
||
},
|
||
],
|
||
},
|
||
{
|
||
name: 'Сотрудники',
|
||
ico: 'mdi-account-multiple-outline',
|
||
submenu: [
|
||
{
|
||
name: 'Справочник',
|
||
link: 'http://10.252.44.33/accounting6/members.php',
|
||
},
|
||
],
|
||
},
|
||
{
|
||
name: 'Календарь',
|
||
ico: 'mdi-calendar',
|
||
path: '/ical',
|
||
},
|
||
{
|
||
name: 'Голосование',
|
||
ico: 'mdi-vote',
|
||
path: '/vote',
|
||
},
|
||
{
|
||
name: 'Тестирование',
|
||
ico: 'mdi-book-open-blank-variant',
|
||
path: '/test',
|
||
},
|
||
{
|
||
name: 'О портале',
|
||
ico: 'mdi-information-variant',
|
||
path: '/portal',
|
||
},
|
||
|
||
|
||
]);
|
||
|
||
const imageSrc = computed(() => {
|
||
return new URL(`@/assets/logo.svg`, import.meta.url).href;
|
||
});
|
||
|
||
const closeinfo = () => {
|
||
LikeDialog.value = false;
|
||
};
|
||
|
||
return {
|
||
theme, mainmenuStore, accountStore, drawer, drawer_right, toggleTheme,
|
||
navigations, imageSrc, LikeDialog, scrimg, rail, showTooltip,
|
||
menuTruncated, alert, burl, name, closeinfo, baseURL, message,
|
||
};
|
||
},
|
||
};
|
||
</script>
|
||
|
||
<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;
|
||
}
|
||
|
||
/* ─────────────────────────────────────────────────
|
||
APP BAR
|
||
───────────────────────────────────────────────── */
|
||
.fns-appbar.v-app-bar {
|
||
border-bottom: 2px solid var(--fns-red) !important;
|
||
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28) !important;
|
||
height: var(--fns-bar-h) !important;
|
||
}
|
||
|
||
/* Брендинг */
|
||
.fns-brand {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
cursor: pointer;
|
||
padding: 4px 8px;
|
||
border-radius: var(--fns-radius-sm);
|
||
transition: background var(--fns-transition);
|
||
|
||
&:hover {
|
||
background: rgba(255, 255, 255, 0.10);
|
||
}
|
||
}
|
||
|
||
.fns-emblem-wrap {
|
||
width: 32px;
|
||
height: 32px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.fns-logo-img {
|
||
width: 30px;
|
||
height: 30px;
|
||
object-fit: contain;
|
||
}
|
||
|
||
.fns-brand-text {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 1px;
|
||
}
|
||
|
||
.fns-brand-main {
|
||
font-family: var(--fns-font);
|
||
font-size: 13.5px;
|
||
font-weight: 700;
|
||
color: var(--fns-white);
|
||
letter-spacing: 0.02em;
|
||
line-height: 1;
|
||
}
|
||
|
||
.fns-brand-sub {
|
||
font-size: 10px;
|
||
font-weight: 400;
|
||
letter-spacing: 0.01em;
|
||
}
|
||
|
||
/* Вертикальный разделитель */
|
||
.fns-divider-v {
|
||
width: 1px;
|
||
height: 28px;
|
||
background: rgba(255, 255, 255, 0.22);
|
||
margin: 0 8px;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.fns-divider-v--sm {
|
||
height: 20px;
|
||
margin: 0 4px;
|
||
}
|
||
|
||
.rail-toggle {
|
||
color: rgba(255, 255, 255, 0.7) !important;
|
||
cursor: pointer;
|
||
border-radius: 6px;
|
||
transition: all var(--fns-transition);
|
||
|
||
&:hover {
|
||
color: #fff !important;
|
||
background: rgba(255, 255, 255, 0.12);
|
||
}
|
||
}
|
||
|
||
/* ─────────────────────────────────────────────────
|
||
КНОПКИ ПАНЕЛИ
|
||
───────────────────────────────────────────────── */
|
||
.fns-actions {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 2px;
|
||
}
|
||
|
||
.fns-btn {
|
||
position: relative;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
width: 54px;
|
||
height: 54px;
|
||
border: none;
|
||
border-radius: var(--fns-radius-sm);
|
||
background: transparent;
|
||
cursor: pointer;
|
||
color: rgba(255, 255, 255, 0.85);
|
||
transition: all var(--fns-transition);
|
||
|
||
&:hover {
|
||
background: rgba(255, 255, 255, 0.14);
|
||
color: #fff;
|
||
transform: translateY(-1px);
|
||
}
|
||
|
||
&:active {
|
||
transform: scale(0.93);
|
||
}
|
||
}
|
||
|
||
.fns-btn--danger:hover {
|
||
background: rgba(204, 0, 0, 0.35) !important;
|
||
color: #ffaaaa !important;
|
||
}
|
||
|
||
.fns-dev-badge {
|
||
font-size: 10px;
|
||
font-weight: 700;
|
||
padding: 2px 7px;
|
||
border-radius: 20px;
|
||
background: var(--fns-orange);
|
||
color: #fff;
|
||
letter-spacing: 0.06em;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
/* Шапка сайдбара */
|
||
.fns-nav-header {
|
||
background: linear-gradient(135deg, var(--fns-blue-dark), var(--fns-blue));
|
||
padding: 10px 12px 8px;
|
||
margin-bottom: 2px;
|
||
}
|
||
|
||
.fns-nav-header-badge {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 5px;
|
||
background: rgba(255, 255, 255, 0.15);
|
||
border: 1px solid rgba(255, 255, 255, 0.25);
|
||
border-radius: 20px;
|
||
padding: 3px 8px 3px 6px;
|
||
font-size: 10px;
|
||
font-weight: 600;
|
||
color: rgba(255, 255, 255, 0.90);
|
||
letter-spacing: 0.04em;
|
||
}
|
||
|
||
.fns-nav-section-label {
|
||
font-size: 10px;
|
||
font-weight: 700;
|
||
color: var(--fns-gray-600);
|
||
letter-spacing: 0.08em;
|
||
text-transform: uppercase;
|
||
padding: 8px 12px 4px;
|
||
}
|
||
|
||
.fns-nav-divider {
|
||
height: 1px;
|
||
background: var(--fns-gray-200);
|
||
margin: 6px 8px;
|
||
}
|
||
|
||
/* ─────────────────────────────────────────────────
|
||
НАВИГАЦИОННЫЕ ПУНКТЫ
|
||
───────────────────────────────────────────────── */
|
||
.fns-nav-list {
|
||
padding: 2px 4px !important;
|
||
|
||
.v-list-item {
|
||
border-radius: var(--fns-radius-sm) !important;
|
||
min-height: 38px !important;
|
||
margin-bottom: 1px;
|
||
font-size: 12.5px !important;
|
||
font-weight: 500 !important;
|
||
color: var(--fns-gray-800) !important;
|
||
transition: all var(--fns-transition) !important;
|
||
|
||
&:hover {
|
||
background: var(--fns-blue-ultra) !important;
|
||
color: var(--fns-blue-dark) !important;
|
||
}
|
||
|
||
&.v-list-item--active {
|
||
background: var(--fns-blue-pale) !important;
|
||
color: var(--fns-blue-dark) !important;
|
||
font-weight: 700 !important;
|
||
border-left: 3px solid var(--fns-blue) !important;
|
||
border-radius: 0 var(--fns-radius-sm) var(--fns-radius-sm) 0 !important;
|
||
box-shadow: 0 2px 8px rgba(0, 62, 165, 0.12) !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
.fns-nav-item--child {
|
||
padding-left: 32px !important;
|
||
font-size: 12px !important;
|
||
opacity: 0.85;
|
||
}
|
||
|
||
.railmenu .v-list-group__items .v-list-item {
|
||
padding-inline-start: 11px !important;
|
||
}
|
||
|
||
/* ─────────────────────────────────────────────────
|
||
ЭКРАН ВХОДА
|
||
───────────────────────────────────────────────── */
|
||
.fns-login-main {
|
||
min-height: 100vh;
|
||
display: flex;
|
||
align-items: stretch;
|
||
}
|
||
|
||
.fns-login-bg {
|
||
position: relative;
|
||
width: 100%;
|
||
min-height: 100vh;
|
||
background-size: cover;
|
||
background-position: center;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.fns-login-overlay {
|
||
position: absolute;
|
||
inset: 0;
|
||
}
|
||
|
||
/* Карточка входа */
|
||
.fns-login-card {
|
||
position: relative;
|
||
z-index: 10;
|
||
width: min(460px, 94vw);
|
||
border-radius: 8px;
|
||
padding: 40px 40px 36px;
|
||
background: rgba(255, 255, 255, 0.04);
|
||
backdrop-filter: blur(8px);
|
||
-webkit-backdrop-filter: saturate(180%) blur(32px);
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
gap: 14px;
|
||
}
|
||
|
||
|
||
/* Герб */
|
||
.fns-login-emblem {
|
||
width: 72px;
|
||
height: 72px;
|
||
border-radius: 50%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
|
||
margin-bottom: 2px;
|
||
}
|
||
|
||
.fns-login-emblem-img {
|
||
width: 72px;
|
||
height: 72px;
|
||
object-fit: contain;
|
||
}
|
||
|
||
.fns-login-title {
|
||
font-family: var(--fns-font);
|
||
font-size: clamp(15px, 2.2vw, 19px);
|
||
font-weight: 700;
|
||
color: #ffffff;
|
||
text-align: center;
|
||
line-height: 1.35;
|
||
letter-spacing: -0.01em;
|
||
text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
|
||
margin: 0;
|
||
}
|
||
|
||
.fns-login-sub {
|
||
font-size: 13px;
|
||
text-align: center;
|
||
margin: 0;
|
||
letter-spacing: 0.01em;
|
||
}
|
||
|
||
.fns-login-form {
|
||
width: 100%;
|
||
margin-top: 4px;
|
||
}
|
||
|
||
.fns-login-footer {
|
||
font-size: 10.5px;
|
||
color: rgba(255, 255, 255, 0.40);
|
||
text-align: center;
|
||
letter-spacing: 0.02em;
|
||
margin: 4px 0 0;
|
||
border-top: 1px solid rgba(255, 255, 255, 0.12);
|
||
padding-top: 12px;
|
||
width: 100%;
|
||
}
|
||
|
||
/* ─────────────────────────────────────────────────
|
||
MISC
|
||
───────────────────────────────────────────────── */
|
||
.mystat {
|
||
position: fixed;
|
||
right: 10px;
|
||
bottom: 10px;
|
||
z-index: 1005;
|
||
}
|
||
|
||
#tr-popup {
|
||
display: none;
|
||
}
|
||
</style>
|