refactor [X-06]: переделаны пользователи онлайн, кнопка скрыть/показать
This commit is contained in:
1 parent
66a4051575
commit
9ede353cf9
4 files changed
+34
-36
No files matched your search
@@ -14,15 +14,20 @@
|
|||||||
import router from '@/router';
|
import router from '@/router';
|
||||||
import { useTheme } from "vuetify";
|
import { useTheme } from "vuetify";
|
||||||
import { useAccountStore } from '@/store/AccountStore';
|
import { useAccountStore } from '@/store/AccountStore';
|
||||||
import { ref } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
|
|
||||||
import CardLike from '@/components/cardLike.vue'
|
import CardLike from '@/components/cardLike.vue'
|
||||||
|
|
||||||
const userStore = useAccountStore()
|
const userStore = useAccountStore()
|
||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
const isDialog = ref(null)
|
const isDialog = ref(null)
|
||||||
|
const rightRail = ref(true)
|
||||||
|
|
||||||
const navMenu = ref([
|
const emit = defineEmits(['showUser'])
|
||||||
|
|
||||||
|
|
||||||
|
const navMenu = computed(() => {
|
||||||
|
return [
|
||||||
{
|
{
|
||||||
text: 'F.A.Q.',
|
text: 'F.A.Q.',
|
||||||
icon: 'mdi-comment-question-outline',
|
icon: 'mdi-comment-question-outline',
|
||||||
@@ -31,7 +36,6 @@ const navMenu = ref([
|
|||||||
{
|
{
|
||||||
text: 'Обратная связь',
|
text: 'Обратная связь',
|
||||||
icon: 'mdi-thumb-up-outline',
|
icon: 'mdi-thumb-up-outline',
|
||||||
// Добавить открытие модалки
|
|
||||||
event: () => isDialog.value = true,
|
event: () => isDialog.value = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -41,14 +45,17 @@ const navMenu = ref([
|
|||||||
event: () => theme.toggle(),
|
event: () => theme.toggle(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Скрыть пользователей',
|
text: `${rightRail.value == true ? 'Скрыть ' : 'Показать '} пользователей`,
|
||||||
icon: 'mdi-account-multiple-outline',
|
icon: 'mdi-account-multiple-outline',
|
||||||
event: () => router.push('/faq'),
|
event: () => {
|
||||||
|
rightRail.value = !rightRail.value
|
||||||
|
emit('showUser', rightRail.value)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Выход',
|
text: 'Выход',
|
||||||
icon: 'mdi-logout',
|
icon: 'mdi-logout',
|
||||||
event: () => userStore.logout(),
|
event: () => userStore.logout(),
|
||||||
},
|
},
|
||||||
])
|
]})
|
||||||
</script>
|
</script>
|
||||||
@@ -10,17 +10,9 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="d-flex justify-end align-center">
|
<v-col class="d-flex justify-end align-center">
|
||||||
<vcard-user :author="accountStore.user"/>
|
<vcard-user :author="accountStore.user"/>
|
||||||
<AppNavigation />
|
<AppNavigation @showUser="showUser"/>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
<!-- <v-app-bar v-else 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> -->
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -30,8 +22,6 @@ import { useAccountStore } from '@/store/AccountStore';
|
|||||||
import vcardUser from '@/components/UI/fiousercard/vcardUser.vue';
|
import vcardUser from '@/components/UI/fiousercard/vcardUser.vue';
|
||||||
import AppNavigation from '@/components/UI/AppHeader/AppNavigation.vue';
|
import AppNavigation from '@/components/UI/AppHeader/AppNavigation.vue';
|
||||||
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
const accountStore = useAccountStore()
|
const accountStore = useAccountStore()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -39,8 +29,10 @@ const props = defineProps({
|
|||||||
logo: String,
|
logo: String,
|
||||||
})
|
})
|
||||||
|
|
||||||
defineEmits(['showSide'])
|
const emit = defineEmits(['showSide', 'showUser'])
|
||||||
|
|
||||||
const alarm = ref(false)
|
const showUser = (val) => {
|
||||||
|
emit('showUser', val)
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -44,23 +44,28 @@
|
|||||||
<page-counter :rail="props.isRail"/>
|
<page-counter :rail="props.isRail"/>
|
||||||
</div>
|
</div>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
|
<v-navigation-drawer v-model="props.showUser" rail location="right">
|
||||||
|
<online-users />
|
||||||
|
</v-navigation-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import router from "@/router"
|
import router from "@/router";
|
||||||
import { useMainmenuStore } from "@/store/MainmenuStore";
|
import { useMainmenuStore } from "@/store/MainmenuStore";
|
||||||
import { useAccountStore } from "@/store/AccountStore";
|
import { useAccountStore } from "@/store/AccountStore";
|
||||||
import { baseURL } from '@/utils/axios-api';
|
import { baseURL } from '@/utils/axios-api';
|
||||||
|
|
||||||
import pageCounter from "@/components/UI/defaultportal/page-counter.vue";
|
import pageCounter from "@/components/UI/defaultportal/page-counter.vue";
|
||||||
|
import onlineUsers from "@/components/UI/fiousercard/onlineUsers.vue";
|
||||||
|
|
||||||
const store = useMainmenuStore()
|
const store = useMainmenuStore()
|
||||||
const accountUser = useAccountStore()
|
const accountUser = useAccountStore()
|
||||||
|
|
||||||
store.loadlinks()
|
store.loadlinks()
|
||||||
|
defineEmits(['showUser'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isRail: Boolean,
|
isRail: Boolean,
|
||||||
|
showUser: Boolean,
|
||||||
asideNavigation: {
|
asideNavigation: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [{
|
default: () => [{
|
||||||
@@ -78,5 +83,4 @@ const props = defineProps({
|
|||||||
const getAbbreviation = (text) => {
|
const getAbbreviation = (text) => {
|
||||||
return text.substring(0, 2).toUpperCase();
|
return text.substring(0, 2).toUpperCase();
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-app>
|
<v-app>
|
||||||
<AppHeader @show-side="rail = !rail" :showSideBar="rail" :logo="imageSrc"/>
|
<AppHeader @show-side="rail = !rail" :logo="imageSrc" @showUser="usersOnline" />
|
||||||
<AsideNav :asideNavigation="navigations" :isRail="rail"/>
|
<AsideNav :asideNavigation="navigations" :isRail="rail" :showUser="showUser" />
|
||||||
<v-main class="d-flex">
|
<v-main class="d-flex">
|
||||||
<router-view />
|
<router-view />
|
||||||
<alert-default />
|
<alert-default />
|
||||||
@@ -24,10 +24,6 @@
|
|||||||
|
|
||||||
<alert-default />
|
<alert-default />
|
||||||
</v-main> -->
|
</v-main> -->
|
||||||
<v-navigation-drawer v-model="drawer_right" rail permanent location="right"
|
|
||||||
@click="rail = false">
|
|
||||||
<Online-users />
|
|
||||||
</v-navigation-drawer>
|
|
||||||
</v-app>
|
</v-app>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -38,28 +34,29 @@ import { useTheme } from "vuetify";
|
|||||||
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 OnlineUsers from "@/components/UI/fiousercard/onlineUsers.vue";
|
|
||||||
import AppHeader from "./AppHeader.vue";
|
import AppHeader from "./AppHeader.vue";
|
||||||
import AsideNav from "./AsideNav.vue";
|
import AsideNav from "./AsideNav.vue";
|
||||||
import alertDefault from "./alertDefault.vue"
|
import alertDefault from "./alertDefault.vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
OnlineUsers,
|
|
||||||
AppHeader,
|
AppHeader,
|
||||||
AsideNav,
|
AsideNav,
|
||||||
alertDefault,
|
alertDefault,
|
||||||
},
|
},
|
||||||
|
emits: ['showUser'],
|
||||||
setup() {
|
setup() {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const accountStore = useAccountStore();
|
const accountStore = useAccountStore();
|
||||||
const drawer_right = ref(true);
|
const showUser = ref(true);
|
||||||
const rail = ref(false);
|
const rail = 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;
|
||||||
@@ -180,7 +177,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
theme,
|
theme,
|
||||||
accountStore,
|
accountStore,
|
||||||
drawer_right,
|
showUser,
|
||||||
navigations,
|
navigations,
|
||||||
imageSrc,
|
imageSrc,
|
||||||
scrimg,
|
scrimg,
|
||||||
@@ -189,15 +186,13 @@ export default {
|
|||||||
burl,
|
burl,
|
||||||
name,
|
name,
|
||||||
baseURL,
|
baseURL,
|
||||||
|
usersOnline,
|
||||||
message,
|
message,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
||||||
|
|
||||||
.textcolor {
|
.textcolor {
|
||||||
color: #2f535e;
|
color: #2f535e;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user