You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
willaengine/resources/js/Global/components/Drawer/SideBar.vue

175 lines
3.8 KiB

<template>
5 years ago
<v-layout wrap>
<v-container class="Header">
<v-icon class="Menu" @click.stop="drawer = !drawer" dark>fas fa-bars</v-icon>
5 years ago
<a :href="mainHref">
5 years ago
<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>
5 years ago
</div>-->
</v-container>
5 years ago
<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>
5 years ago
<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>
5 years ago
<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>
5 years ago
import Tile from "@Global/components/Drawer/Tile";
import Notifications from "@Global/components/Drawer/Notifications";
5 years ago
import Routes from "@Global/utils/common/routes";
5 years ago
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: "",
5 years ago
href: Routes.user(),
5 years ago
}
],
user: { name: "" },
timeNow: "",
5 years ago
mainHref: Routes.main(),
5 years ago
};
},
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>
5 years ago
.Header .Menu {
5 years ago
position: absolute;
right: 20px;
top: 20px;
}
5 years ago
.Header .Home {
5 years ago
position: absolute;
right: 50px;
top: 20px;
5 years ago
}
.Notification {
5 years ago
position: absolute;
left: 20px;
top: 20px;
}
.Divider {
5 years ago
margin: 0px;
}
.Name {
5 years ago
font-size: 18px;
}
.Role {
5 years ago
font-size: 14px;
color: #aaaaaa;
}
.Time {
5 years ago
text-align: center;
color: #fff;
margin-top: -10px;
}
.Header {
5 years ago
padding-bottom: 0px;
}
.LogOut {
5 years ago
position: absolute;
left: 10px;
}
.drawer-trigger {
5 years ago
position: fixed;
top: 0px;
padding: 40px;
background-color: white;
left: 400px;
}
.drawer-trigger.active {
5 years ago
color: red;
}
.drawer {
5 years ago
position: fixed;
top: 0px;
left: -400px;
bottom: 0px;
background-color: white;
width: 400px;
}
.drawer.open {
5 years ago
left: 0px;
}
</style>