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

222 lines
5.5 KiB

<template>
5 years ago
<v-layout wrap>
<v-container class="Header">
<v-icon class="Menu" @click.stop="drawer = !drawer" dark>WMi-menu</v-icon>
5 years ago
<a :href="mainHref">
<v-icon class="Home" dark>WMi-Real-Estate</v-icon>
5 years ago
</a>
5 years ago
<div class="Name caption"> {{ getAuthUser.name }} </div>
5 years ago
<div class="Time">
4 years ago
<div class="En Bold">{{ getCurrentTime }}</div>
<div class="Fa Thin">{{ new Date() | moment("dddd jDD jMMMM jYYYY") }}</div>
5 years ago
</div>
<!-- <div class="Notification" dark>
<wm-notifications></wm-notifications>
5 years ago
</div>-->
</v-container>
4 years ago
<v-navigation-drawer v-model="drawer" app temporary right width="320">
5 years ago
<v-list class="pa-1">
5 years ago
<div class="row user-info">
<v-flex lg9 class="pa-3">
<img class="Avatar" :src="$_getPath()+'images/Global/Misc/Avatar.png'" />
<div class="Title">
<div class="Name Fa">{{ getAuthUser.name }}</div>
<div class="Role Fa">مدیریت</div>
</div>
</v-flex>
<v-flex lg3>
<a class="LogOut">
<v-tooltip bottom color="black" transition="slide-x-transition">
<template v-slot:activator="{ on }">
<v-btn class="mt-4" small @click.native.stop="logout" slot="activator" outlined fab color="black" dark v-on="on">
<v-icon dark>WMi-off-1</v-icon>
5 years ago
</v-btn>
</template>
<span>خروج از حساب کاربری</span>
</v-tooltip>
</a>
</v-flex>
</div>
5 years ago
</v-list>
5 years ago
<v-list class="pt-0" dense>
5 years ago
<v-divider class="Divider"/>
5 years ago
<a :href="item.href" v-for="(item, key) in Items" :key="key">
4 years ago
<template v-if="(!item.permissionClass || $_can(item.permissionClass, false, item.module)) && ($_hasModule(item.moduleName, true))">
5 years ago
<wm-list-tile :TitleFa="item.titleFa" :TitleEn="item.titleEn" :icon="item.icon" :tileClass="item.tileClass"/>
5 years ago
</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: [
4 years ago
{ titleEn: 'My Profile', titleFa: ' حساب کاربری من ', icon: 'user', permissionClass: null, href: '/user/profile' },
5 years ago
{
titleEn: " My Users ",
titleFa: " کاربران مجموعه ی من ",
5 years ago
icon: "users",
5 years ago
permissionClass: "User::index",
5 years ago
module: "core",
4 years ago
href: Routes.user(),
5 years ago
tileClass: 'red-theme',
},
{
titleEn: " Product Management ",
titleFa: " مدیریت محصولات ",
5 years ago
icon: "dropbox",
href: '/product/home',
5 years ago
tileClass: 'cyan-theme',
},
5 years ago
{
titleEn: " Blog Management ",
titleFa: " مدیریت خبرنامه ",
moduleName: "blog",
5 years ago
icon: "rss",
href: '/blog',
tileClass: 'orange-theme',
},
{
titleEn: " Portfolio Management ",
titleFa: " مدیریت نمونه کارها ",
moduleName: "portfolio",
5 years ago
icon: "art-gallery",
5 years ago
href: '/portfolio',
},
// {
// titleEn: " SMS Management ",
// titleFa: " مدیریت پیام های کوتاه ",
// icon: "comment-alt",
// permissionClass: "SMS::manage",
// href: '/sms/manage',
// }
5 years ago
],
user: { name: "" },
5 years ago
mainHref: Routes.main(),
5 years ago
};
},
components: {
5 years ago
"wm-list-tile": Tile,
"wm-notifications": Notifications
},
methods: {
...mapActions("auth", ["logout"]),
},
computed: {
5 years ago
...mapGetters("auth", ["getAuthUser"]),
...mapGetters("common", ["getCurrentTime"]),
...mapGetters("rolePermission", ["getModules"]),
}
5 years ago
};
</script>
<style lang="scss" scoped>
5 years ago
.user-info .Title {
float: right;
}
.user-info .Avatar {
float: right;
width: 48px;
margin: 0px 10px;
}
5 years ago
.user-info .Title .Name {
font-size: 14px;
}
5 years ago
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
}
5 years ago
.Header .Name {
position: absolute;
right: 80px;
top: 20px;
color: #fff;
line-height: 18px;
}
.Notification {
5 years ago
position: absolute;
left: 20px;
top: 20px;
}
.Divider {
5 years ago
margin: 0px;
}
.Name {
5 years ago
font-size: 16px;
}
.Role {
5 years ago
font-size: 14px;
color: #aaaaaa;
}
.Time {
5 years ago
text-align: center;
color: #fff;
}
4 years ago
.Time .En {
font-size: 22px;
}
.Time .Fa {
font-size: 14px;
margin-top: -5px;
}
.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;
5 years ago
left: -600px;
5 years ago
bottom: 0px;
background-color: white;
5 years ago
width: 600px;
}
.drawer.open {
5 years ago
left: 0px;
}
.v-application .caption {
font-family: iranyekan-regular!important;
}
</style>