|
|
|
<template>
|
|
|
|
<v-layout wrap>
|
|
|
|
<v-container class="Header">
|
|
|
|
<v-icon class="Menu" @click.stop="drawer = !drawer" dark>fas fa-bars</v-icon>
|
|
|
|
<a :href="Routes.main()">
|
|
|
|
<v-icon class="Home" dark>fas fa-home</v-icon>
|
|
|
|
</a>
|
|
|
|
<div class="Time">
|
|
|
|
<div class="En WM-Font-22">{{ timeNow }}</div>
|
|
|
|
<div class="WM-Font-14">{{ new Date() | moment("dddd jDD jMMMM jYYYY") }}</div>
|
|
|
|
</div>
|
|
|
|
<!-- <div class="Notification" dark>
|
|
|
|
<wm-notifications></wm-notifications>
|
|
|
|
</div>-->
|
|
|
|
</v-container>
|
|
|
|
|
|
|
|
<v-navigation-drawer v-model="drawer" app temporary right>
|
|
|
|
<v-list class="pa-1">
|
|
|
|
<v-list-tile avatar>
|
|
|
|
<v-list-tile-avatar>
|
|
|
|
<img :src="$_getPath()+'images/Global/Tiles/UserLogo.png'" />
|
|
|
|
</v-list-tile-avatar>
|
|
|
|
|
|
|
|
<v-list-tile-content>
|
|
|
|
<v-list-tile-title class="Name">{{ getAuthUser.name }}</v-list-tile-title>
|
|
|
|
<div class="Role">مدیریت</div>
|
|
|
|
<a class="LogOut">
|
|
|
|
<v-tooltip bottom color="black">
|
|
|
|
<v-btn small @click.native.stop="logout" slot="activator" outline fab color="black" dark>
|
|
|
|
<v-icon dark>fas fa-power-off</v-icon>
|
|
|
|
</v-btn>
|
|
|
|
<span>خروج از حساب کاربری</span>
|
|
|
|
</v-tooltip>
|
|
|
|
</a>
|
|
|
|
</v-list-tile-content>
|
|
|
|
</v-list-tile>
|
|
|
|
</v-list>
|
|
|
|
|
|
|
|
<v-list class="pt-0" dense>
|
|
|
|
<v-divider class="Divider"></v-divider>
|
|
|
|
<a :href="item.href" v-for="(item, key) in Items" :key="key">
|
|
|
|
<template v-if="$_hasPermission(item.permission)">
|
|
|
|
<wm-list-tile :TitleFa="item.titleFa" :TitleEn="item.titleEn"></wm-list-tile>
|
|
|
|
</template>
|
|
|
|
</a>
|
|
|
|
</v-list>
|
|
|
|
</v-navigation-drawer>
|
|
|
|
</v-layout>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Tile from "@Global/components/Drawer/Tile";
|
|
|
|
import Notifications from "@Global/components/Drawer/Notifications";
|
|
|
|
import Routes from "@Global/utils/common/routes";
|
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
fav: true,
|
|
|
|
menu: true,
|
|
|
|
message: false,
|
|
|
|
hints: true,
|
|
|
|
drawer: false,
|
|
|
|
Items: [
|
|
|
|
// { titleEn: 'My Profile', titleFa: ' حساب کاربری من ', icon: 'dashboard', permission: "", href: '/User/List' },
|
|
|
|
// { titleEn: ' My Messages ', titleFa: ' پیام های من ', icon: 'question_answer', permission: "", href: '/User/List' },
|
|
|
|
{
|
|
|
|
titleEn: " My Users ",
|
|
|
|
titleFa: " کاربران مجموعه ی من ",
|
|
|
|
icon: "question_answer",
|
|
|
|
permission: "",
|
|
|
|
href: Routes.user()
|
|
|
|
}
|
|
|
|
],
|
|
|
|
user: { name: "" },
|
|
|
|
timeNow: "",
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted(){
|
|
|
|
var self = this;
|
|
|
|
self.getTime(new Date())
|
|
|
|
setInterval(function() {
|
|
|
|
self.getTime(new Date())
|
|
|
|
}, 2000);
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
"wm-list-tile": Tile,
|
|
|
|
"wm-notifications": Notifications
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters("auth", ["getAuthUser"]),
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions("auth", ["logout"]),
|
|
|
|
getTime(date) {
|
|
|
|
let h = this.addZero(date.getHours());
|
|
|
|
let m = this.addZero(date.getMinutes());
|
|
|
|
this.timeNow = h + ":" + m;
|
|
|
|
},
|
|
|
|
addZero(i) {
|
|
|
|
if (i < 10) {
|
|
|
|
i = "0" + i;
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.Header .Menu {
|
|
|
|
position: absolute;
|
|
|
|
right: 20px;
|
|
|
|
top: 20px;
|
|
|
|
}
|
|
|
|
.Header .Home {
|
|
|
|
position: absolute;
|
|
|
|
right: 50px;
|
|
|
|
top: 20px;
|
|
|
|
}
|
|
|
|
.Notification {
|
|
|
|
position: absolute;
|
|
|
|
left: 20px;
|
|
|
|
top: 20px;
|
|
|
|
}
|
|
|
|
.Divider {
|
|
|
|
margin: 0px;
|
|
|
|
}
|
|
|
|
.Name {
|
|
|
|
font-size: 18px;
|
|
|
|
}
|
|
|
|
.Role {
|
|
|
|
font-size: 14px;
|
|
|
|
color: #aaaaaa;
|
|
|
|
}
|
|
|
|
.Time {
|
|
|
|
text-align: center;
|
|
|
|
color: #fff;
|
|
|
|
margin-top: -10px;
|
|
|
|
}
|
|
|
|
.Header {
|
|
|
|
padding-bottom: 0px;
|
|
|
|
}
|
|
|
|
.LogOut {
|
|
|
|
position: absolute;
|
|
|
|
left: 10px;
|
|
|
|
}
|
|
|
|
.drawer-trigger {
|
|
|
|
position: fixed;
|
|
|
|
top: 0px;
|
|
|
|
padding: 40px;
|
|
|
|
background-color: white;
|
|
|
|
left: 400px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.drawer-trigger.active {
|
|
|
|
color: red;
|
|
|
|
}
|
|
|
|
|
|
|
|
.drawer {
|
|
|
|
position: fixed;
|
|
|
|
top: 0px;
|
|
|
|
left: -400px;
|
|
|
|
bottom: 0px;
|
|
|
|
background-color: white;
|
|
|
|
width: 400px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.drawer.open {
|
|
|
|
left: 0px;
|
|
|
|
}
|
|
|
|
</style>
|