create tooltip in sidebar-left

This commit is contained in:
Alex committed 2023-10-05 15:48:10 +03:00
1 parent f6b78a5240
commit c6cdbcc3fe
2 files changed
+182 -282

No files matched your search

+182 -282
View File
@@ -1,30 +1,12 @@
<template>
<v-app>
<v-app-bar
:elevation="2"
density="compact"
color="teal-darken-4"
class="pl-4"
>
<v-app-bar :elevation="2" density="compact" color="teal-darken-4" class="pl-4">
<v-icon
class="px-3"
size="20"
:icon="rail?'mdi-chevron-right':'mdi-chevron-left'"
@click="rail = !rail"
/>
<v-card
class="bg-transparent py"
density="compact"
:prepend-avatar="imageSrc"
title="Портал МиФНС по ЦОД № 2"
variant="text"
:to="'/'"
/>
<!-- @click="drawer = !drawer" -->
<v-icon class="px-3" size="20" :icon="rail ? 'mdi-chevron-right' : 'mdi-chevron-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="'/'"
>
@@ -42,203 +24,127 @@ size="20"
</v-toolbar-title> -->
<template v-slot:image>
<v-img
gradient="to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)"
/>
<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-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-model="menuGetUserDialog" persistent width="600">
<Card-users :menuGetUserDialog="menuGetUserDialog" :loging="accountStore.user.login"
@menusClose="menuGetUserDialog = false" />
</v-dialog>
</v-dialog>
<v-tooltip location="bottom">
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
dark
to="/faq"
icon="mdi-comment-question-outline"
/>
<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"
/>
<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"
>
<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"
/>
<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 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>
</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-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="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 v-if="!rail" 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-item v-else>
<v-tooltip v-model="showTooltip" location="top">
<template v-slot:activator="{ props }">
<v-icon v-bind="props">
mdi-account-eye
</v-icon>
</template>
<p>Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
<v-divider />
<p>Посещений сегодня: {{ appStore.countvisitor.visittoday }}</p>
<v-divider />
<p>Уникальных посещений: {{ appStore.countvisitor.uniqtoday }}</p>
</v-tooltip>
</v-list-item>
</v-list>
</v-col>
</v-row>
</v-col>
</v-row>
</v-col>
<!-- <v-col class="pointer align-self-center flex-grow-0"
<!-- <v-col class="pointer align-self-center flex-grow-0"
@click="rail = !rail">
<v-icon
@@ -249,8 +155,8 @@ size="20"
/>
</v-col> -->
</v-row>
<!-- <div class="d-flex flex-column h-100">
</v-row>
<!-- <div class="d-flex flex-column h-100">
<v-row>
<v-col>
<v-divider/>
@@ -339,7 +245,7 @@ size="20"
</div> -->
</v-navigation-drawer>
<!-- <v-navigation-drawer
<!-- <v-navigation-drawer
:width="8"
class="btnNav pointer"
@@ -357,11 +263,9 @@ size="20"
</v-navigation-drawer> -->
<v-main class="d-flex bg-main_theme">
<router-view
/>
<!-- <div class="mystat d-flex flex-column">
<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"
@@ -380,19 +284,13 @@ size="20"
МС
</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-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"
@@ -403,48 +301,49 @@ size="20"
</v-list>
</template> -->
</v-navigation-drawer>
</v-app>
</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 {
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},
components: { AuthForm, OnlineUsers, CardUsers, CardLike },
mixins:[uf],
mixins: [uf],
setup(){
pagecounter()
const appStore = useAppStore()
setup() {
pagecounter()
const appStore = useAppStore()
const theme = useTheme();
const mainmenuStore= useMainmenuStore()
const mainmenuStore = useMainmenuStore()
const accountStore = useAccountStore()
const drawer = ref(true)
const drawer_right=ref(true)
const menuGetUserDialog=ref(false)
const LikeDialog=ref(false)
const drawer_right = ref(true)
const menuGetUserDialog = ref(false)
const LikeDialog = ref(false)
const rail = ref(true)
const showTooltip = ref(false)
const toggleTheme = () => {
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
}
mainmenuStore.loadlinks()
@@ -459,73 +358,74 @@ size="20"
{
name: 'Сотрудники',
ico: 'mdi-account-multiple-outline',
submenu:[
{
name: 'Справочник',
link: 'http://10.252.44.33/accounting6/members.php'
},
]
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-information-variant',
path:"/portal"
},
{
name: 'Об инспекции',
ico: 'mdi-city',
path:"/inspection"
}
submenu: [
{
name: 'Обеспечивающая',
path: "/providing"
}
]
},
{
name: 'Безопасность',
ico: 'mdi-routes',
path: "/securyty"
},
{
name: 'О портале',
ico: 'mdi-information-variant',
path: "/portal"
},
{
name: 'Об инспекции',
ico: 'mdi-city',
path: "/inspection"
}
]
const imageSrc=computed(()=> {
const imageSrc = computed(() => {
return new URL(`@/assets/FNS-logo-xs.png`, import.meta.url).href;
})
const getcard = async() => {
const getcard = async () => {
menuGetUserDialog.value = true
}
return {
theme,
mainmenuStore,
accountStore,
accountStore,
drawer,
drawer_right,
toggleTheme,
navigations,
navigations,
imageSrc,
getcard,
menuGetUserDialog,
LikeDialog,
LikeDialog,
// userlinks,
appStore,
rail
rail,
showTooltip
}
}
}
}
</script>
<style lang="scss">
.mystat {