Files
PORTAL_COD2/front/src/layouts/default/DefaultPortal.vue
T
2023-10-05 13:41:30 +03:00

548 lines
12 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<v-app>
<v-app-bar
:elevation="2"
density="compact"
color="teal-darken-4"
class="pl-4"
>
<v-icon
class="px-3"
size="20"
:icon="`mdi-chevron${rail?'-right':'-left'}`"
@click="rail = !rail"
/>
<v-card
class="bg-transparent py"
density="compact"
:prepend-avatar="imageSrc"
title="Портал МиФНС по ЦОД № 2"
variant="text"
:to="'/'"
/>
<!-- @click="drawer = !drawer" -->
<!-- <v-app-bar-nav-icon
:to="'/'"
>
<img
style="cursor:pointer"
:src="imageSrc"
/>
</v-app-bar-nav-icon> -->
<!-- <v-toolbar-title >
Портал МиФНС по ЦОД № 2
</v-toolbar-title> -->
<template v-slot:image>
<v-img
gradient="to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)"
/>
</template>
<template v-slot:append>
<template v-if="accountStore.cod2user">
<v-card
class="bg-transparent"
density="compact"
:prepend-avatar="accountStore.user.photo"
:title="accountStore.user.fio"
:subtitle="accountStore.user.post"
variant="text"
@click="getcard"
/>
<v-dialog
v-model="menuGetUserDialog"
persistent
width="600"
>
<Card-users
:menuGetUserDialog="menuGetUserDialog"
:loging="accountStore.user.login"
@menusClose="menuGetUserDialog=false"
/>
</v-dialog>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
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
v-bind="props"
dark
icon="mdi-thumb-up-outline"
/>
</template>
<Card-like
:LikeDialog="LikeDialog"
@menusClose="LikeDialog=false"
/>
</v-dialog>
<v-btn
icon
@click="toggleTheme"
>
<v-icon
class="mr-1"
color="lampa"
>
mdi-lightbulb-outline
</v-icon>
</v-btn>
<v-btn dark icon="mdi-magnify"/>
<v-btn
dark
icon="mdi-account-multiple-outline"
@click="drawer_right=!drawer_right"
/>
<v-btn
dark
icon="mdi-logout"
@click="accountStore.logout"
/>
</template>
<template v-else>
<v-row justify="center">
<Auth-form/>
</v-row>
</template>
</template>
</v-app-bar>
<v-navigation-drawer
: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">
<v-list-item
v-if="!('submenu' in x)"
:key="x.key"
:title="x.name"
:value="x.name"
:href="x.link"
:to="x.path"
color="navigation"
>
<template v-slot:prepend>
<v-icon
:icon="x.ico"
/>
</template>
</v-list-item>
<v-list-group
v-else
:key="key"
:value="x.name"
>
<template v-slot:activator="{ props }">
<v-list-item
v-bind="props"
:title="x.name"
:prepend-icon="x.ico"
/>
</template>
<v-list-item
v-for="(child, k) in x.submenu"
:href="child.link"
:key="k"
:value="child.name"
:title="child.name"
:to="child.path"
/>
</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="teal-darken-4"
>
<template v-slot:prepend>
<v-icon
:icon="x.imagecode"
/>
</template>
</v-list-item>
</v-list>
</v-col></v-row>
<v-row class="flex-grow-0">
<v-col class="py-0 pl-1">
<v-list>
<v-list-item class="text-caption font-weight-bold text-truncate">
<p >Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
<v-divider/>
<p>Посещений сегодня: {{ appStore.countvisitor.visittoday }}</p>
<v-divider/>
<p>Уникальных посещений: {{ appStore.countvisitor.uniqtoday }}</p>
<v-divider/>
</v-list-item>
</v-list>
</v-col>
</v-row>
</v-col>
<!-- <v-col class="pointer align-self-center flex-grow-0"
@click="rail = !rail">
<v-icon
size="20"
:icon="rail?'mdi-chevron-right':'mdi-chevron-left'"
/>
</v-col> -->
</v-row>
<!-- <div class="d-flex flex-column h-100">
<v-row>
<v-col>
<v-divider/>
<v-list
nav
density="compact">
<template v-for="(x, key) in navigations">
<v-list-item
v-if="!('submenu' in x)"
:key="x.key"
:title="x.name"
:value="x.name"
:href="x.link"
:to="x.path"
color="navigation"
>
<template v-slot:prepend>
<v-icon
:icon="x.ico"
/>
</template>
</v-list-item>
<v-list-group
v-else
:key="key"
:value="x.name"
>
<template v-slot:activator="{ props }">
<v-list-item
v-bind="props"
:title="x.name"
:prepend-icon="x.ico"
/>
</template>
<v-list-item
v-for="(child, k) in x.submenu"
:href="child.link"
:key="k"
:value="child.name"
:title="child.name"
:to="child.path"
/>
</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="teal-darken-4"
>
<template v-slot:prepend>
<v-icon
:icon="x.imagecode"
/>
</template>
</v-list-item>
</v-list>
</v-col>
</v-row>
<v-row class="flex-grow-0 mb-1 text-caption font-weight-bold text-truncate">
<v-col>
<v-list>
<v-list-item >
<p class="pb-2">Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
<p class="pb-2">Посещений сегодня: {{ appStore.countvisitor.visittoday }}</p>
<p class="pb-2">Уникальных посещений: {{ appStore.countvisitor.uniqtoday }}</p>
</v-list-item>
</v-list>
</v-col>
</v-row>
</div> -->
</v-navigation-drawer>
<!-- <v-navigation-drawer
:width="8"
class="btnNav pointer"
@click="rail = !rail"
>
<v-list>
<v-icon
size="10"
:icon="rail?'mdi-chevron-right':'mdi-chevron-left'"
/>
</v-list>
</v-navigation-drawer> -->
<v-main class="d-flex bg-main_theme">
<router-view
/>
<!-- <div class="mystat d-flex flex-column">
<v-btn
class="mb-1"
prepend-icon="mdi-wikipedia"
size="small"
variant="outlined"
height="30"
>
Wiki
</v-btn>
<v-btn
height="30"
prepend-icon="mdi-apple-finder"
size="small"
variant="outlined"
>
МС
</v-btn>
</div> -->
</v-main>
<v-navigation-drawer
v-if="accountStore.cod2user"
v-model="drawer_right"
rail
permanent
location="right"
@click="rail = false"
>
<Online-users/>
<!-- <template v-slot:append>
<v-list lines="one">
<v-list-item
v-for="(val,key) in appStore.countvisitor"
:key="key"
:title="val"
></v-list-item>
</v-list>
</template> -->
</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 {useAppStore} from '@/store/app'
import { useTheme } from "vuetify";
import AuthForm from '@/components/UI/Auth-form.vue'
import OnlineUsers from '@/components/onlineUsers.vue'
import CardUsers from '@/components/cardUsers.vue'
import CardLike from '@/components/cardLike.vue'
import { pagecounter } from '@/utils/universal_functions'
export default {
components: { AuthForm, OnlineUsers, CardUsers, CardLike},
mixins:[uf],
setup(){
pagecounter()
const appStore = useAppStore()
const theme = useTheme();
const mainmenuStore= useMainmenuStore()
const accountStore = useAccountStore()
const drawer = ref(true)
const drawer_right=ref(true)
const menuGetUserDialog=ref(false)
const LikeDialog=ref(false)
const rail = ref(false)
const toggleTheme = () => {
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
}
mainmenuStore.loadlinks()
const navigations = [
{
name: 'Структура',
ico: 'mdi-source-branch',
path: "/structure"
},
{
name: 'Сотрудники',
ico: 'mdi-account-multiple-outline',
submenu:[
{
name: 'Справочник',
link: 'http://10.252.44.33/accounting6/members.php'
},
]
},
{
name: 'Деятельность',
ico: 'mdi-bulletin-board',
submenu:[
{
name: 'Обеспечивающая',
path:"/providing"
}
]
},
{
name: 'Безопасность',
ico: 'mdi-routes',
path:"/securyty"
},
{
name: 'Новости',
ico: 'mdi-newspaper',
path:"/news"
},
{
name: 'О портале',
ico: 'mdi-information-variant',
path:"/portal"
},
{
name: 'Об инспекции',
ico: 'mdi-city',
path:"/inspection"
}
]
const imageSrc=computed(()=> {
return new URL(`@/assets/FNS-logo-xs.png`, import.meta.url).href;
})
const getcard = async() => {
menuGetUserDialog.value = true
}
return {
theme,
mainmenuStore,
accountStore,
drawer,
drawer_right,
toggleTheme,
navigations,
imageSrc,
getcard,
menuGetUserDialog,
LikeDialog,
// userlinks,
appStore,
rail
}
}
}
</script>
<style lang="scss">
.mystat {
position: fixed;
right: 10px;
bottom: 10px;
z-index: 1005;
}
.btnNav .v-navigation-drawer__content {
display: flex;
align-items: center;
}
</style>