|
|
@ -2,9 +2,15 @@ |
|
|
|
<div :class="{ 'has-logo': showLogo }"> |
|
|
|
<logo v-if="showLogo" :collapse="isCollapse" /> |
|
|
|
<el-scrollbar wrap-class="scrollbar-wrapper"> |
|
|
|
<el-menu :default-active="$route.path" :background-color="variables.menuBg" :text-color="variables.menuText" |
|
|
|
:unique-opened="false" :active-text-color="variables.menuActiveText" :collapse-transition="false" |
|
|
|
mode="vertical"> |
|
|
|
<el-menu |
|
|
|
:default-active="$route.path" |
|
|
|
:background-color="variables.menuBg" |
|
|
|
:text-color="variables.menuText" |
|
|
|
:unique-opened="false" |
|
|
|
:active-text-color="variables.menuActiveText" |
|
|
|
:collapse-transition="false" |
|
|
|
mode="vertical" |
|
|
|
> |
|
|
|
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" /> |
|
|
|
</el-menu> |
|
|
|
</el-scrollbar> |
|
|
@ -14,92 +20,129 @@ |
|
|
|
<script> |
|
|
|
import { |
|
|
|
mapGetters |
|
|
|
} from "vuex"; |
|
|
|
import Logo from "./Logo"; |
|
|
|
import SidebarItem from "./SidebarItem"; |
|
|
|
import variables from "@/styles/variables.scss"; |
|
|
|
} from 'vuex' |
|
|
|
import Logo from './Logo' |
|
|
|
import SidebarItem from './SidebarItem' |
|
|
|
import variables from '@/styles/variables.scss' |
|
|
|
import { |
|
|
|
getrolemenus, |
|
|
|
loginDetails |
|
|
|
} from "@/api/system/Role/role.js"; |
|
|
|
} from '@/api/system/Role/role.js' |
|
|
|
import { |
|
|
|
getStorage |
|
|
|
} from "@/utils/auth"; |
|
|
|
} from '@/utils/auth' |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
SidebarItem, |
|
|
|
Logo, |
|
|
|
Logo |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
YongHuid: [], |
|
|
|
// routes: [], |
|
|
|
params: { |
|
|
|
sourceSid: "", |
|
|
|
userSid: "", |
|
|
|
sourceSid: '', |
|
|
|
userSid: '' |
|
|
|
}, |
|
|
|
routes: [{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "userInfo", |
|
|
|
component: 'userInfo', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-menu", |
|
|
|
title: "用户信息", |
|
|
|
icon: 'el-icon-menu', |
|
|
|
title: '用户信息' |
|
|
|
}, |
|
|
|
name: "/userInfo/index", |
|
|
|
path: "/userInfo/index" |
|
|
|
name: '/userInfo/index', |
|
|
|
path: '/userInfo/index' |
|
|
|
}, { |
|
|
|
alwaysShow: true, |
|
|
|
component: 'pms', |
|
|
|
meta: { |
|
|
|
icon: 'el-icon-menu', |
|
|
|
title: '商品管理' |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '/pms', |
|
|
|
path: '/pms', |
|
|
|
children: [{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "marketingCard", |
|
|
|
component: 'brand/index', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-menu", |
|
|
|
title: "营销卡设置", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '品牌管理' |
|
|
|
}, |
|
|
|
name: '/brand/index', |
|
|
|
path: '/brand/index' |
|
|
|
}, { |
|
|
|
alwaysShow: true, |
|
|
|
component: 'enterprise', |
|
|
|
meta: { |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '商品分类' |
|
|
|
}, |
|
|
|
name: '/cardManage/enterprise', |
|
|
|
path: '/cardManage/enterprise' |
|
|
|
}, { |
|
|
|
alwaysShow: true, |
|
|
|
component: 'giftCard', |
|
|
|
meta: { |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '商品类型' |
|
|
|
}, |
|
|
|
name: '/cardManage/giftCard', |
|
|
|
path: '/cardManage/giftCard' |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
name: "/marketingCard", |
|
|
|
path: "/marketingCard", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "index", |
|
|
|
component: 'marketingCard', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "小程序礼包设置", |
|
|
|
icon: 'el-icon-menu', |
|
|
|
title: '营销卡设置' |
|
|
|
}, |
|
|
|
name: "/marketingCard/applet", |
|
|
|
path: "/marketingCard/applet", |
|
|
|
name: '/marketingCard', |
|
|
|
path: '/marketingCard', |
|
|
|
children: [{ |
|
|
|
alwaysShow: true, |
|
|
|
component: 'index', |
|
|
|
meta: { |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '小程序礼包设置' |
|
|
|
}, |
|
|
|
name: '/marketingCard/applet', |
|
|
|
path: '/marketingCard/applet' |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "index", |
|
|
|
component: 'index', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "礼包设置", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '礼包设置' |
|
|
|
}, |
|
|
|
name: "/marketingCard/index", |
|
|
|
path: "/marketingCard/index", |
|
|
|
name: '/marketingCard/index', |
|
|
|
path: '/marketingCard/index' |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "pickupCardSet", |
|
|
|
component: 'pickupCardSet', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "个人卡设置", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '个人卡设置' |
|
|
|
}, |
|
|
|
name: "/marketingCard/pickupCardSet", |
|
|
|
path: "/marketingCard/pickupCardSet", |
|
|
|
name: '/marketingCard/pickupCardSet', |
|
|
|
path: '/marketingCard/pickupCardSet' |
|
|
|
}, |
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "corporateCardSet", |
|
|
|
component: 'corporateCardSet', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "企业卡设置", |
|
|
|
}, |
|
|
|
name: "/marketingCard/corporateCardSet", |
|
|
|
path: "/marketingCard/corporateCardSet", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '企业卡设置' |
|
|
|
}, |
|
|
|
name: '/marketingCard/corporateCardSet', |
|
|
|
path: '/marketingCard/corporateCardSet' |
|
|
|
} |
|
|
|
// { |
|
|
|
// alwaysShow: true, |
|
|
|
// component: "grantRecords", |
|
|
@ -124,127 +167,127 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "carManage", |
|
|
|
component: 'carManage', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-menu", |
|
|
|
title: "营销卡管理", |
|
|
|
icon: 'el-icon-menu', |
|
|
|
title: '营销卡管理' |
|
|
|
}, |
|
|
|
name: "/cardManage", |
|
|
|
path: "/cardManage", |
|
|
|
name: '/cardManage', |
|
|
|
path: '/cardManage', |
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "person", |
|
|
|
component: 'person', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "个人卡统计", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '个人卡统计' |
|
|
|
}, |
|
|
|
name: "/cardManage/person", |
|
|
|
path: "/cardManage/person", |
|
|
|
name: '/cardManage/person', |
|
|
|
path: '/cardManage/person' |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "enterprise", |
|
|
|
component: 'enterprise', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "企业卡统计", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '企业卡统计' |
|
|
|
}, |
|
|
|
name: "/cardManage/enterprise", |
|
|
|
path: "/cardManage/enterprise", |
|
|
|
name: '/cardManage/enterprise', |
|
|
|
path: '/cardManage/enterprise' |
|
|
|
}, { |
|
|
|
alwaysShow: true, |
|
|
|
component: "giftCard", |
|
|
|
component: 'giftCard', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "福利卡统计", |
|
|
|
}, |
|
|
|
name: "/cardManage/giftCard", |
|
|
|
path: "/cardManage/giftCard", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '福利卡统计' |
|
|
|
}, |
|
|
|
name: '/cardManage/giftCard', |
|
|
|
path: '/cardManage/giftCard' |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "pickupPoint", |
|
|
|
component: 'pickupPoint', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-menu", |
|
|
|
title: "提货地点", |
|
|
|
icon: 'el-icon-menu', |
|
|
|
title: '提货地点' |
|
|
|
}, |
|
|
|
name: "/pickupPoint/index", |
|
|
|
path: "/pickupPoint/index" |
|
|
|
name: '/pickupPoint/index', |
|
|
|
path: '/pickupPoint/index' |
|
|
|
}, |
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "network", |
|
|
|
component: 'network', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-menu", |
|
|
|
title: "支行管理", |
|
|
|
icon: 'el-icon-menu', |
|
|
|
title: '支行管理' |
|
|
|
}, |
|
|
|
name: "/network/index", |
|
|
|
path: "/network/index" |
|
|
|
name: '/network/index', |
|
|
|
path: '/network/index' |
|
|
|
}, |
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "commodity", |
|
|
|
component: 'commodity', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-menu", |
|
|
|
title: "商品信息", |
|
|
|
icon: 'el-icon-menu', |
|
|
|
title: '商品信息' |
|
|
|
}, |
|
|
|
name: "/commodity/index", |
|
|
|
path: "/commodity/index" |
|
|
|
name: '/commodity/index', |
|
|
|
path: '/commodity/index' |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "order", |
|
|
|
component: 'order', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-menu", |
|
|
|
title: "订单管理", |
|
|
|
icon: 'el-icon-menu', |
|
|
|
title: '订单管理' |
|
|
|
}, |
|
|
|
name: "/order", |
|
|
|
path: "/order", |
|
|
|
name: '/order', |
|
|
|
path: '/order', |
|
|
|
children: [{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "index", |
|
|
|
component: 'index', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "订单统计", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '订单统计' |
|
|
|
}, |
|
|
|
name: "/order/index", |
|
|
|
path: "/order/index", |
|
|
|
name: '/order/index', |
|
|
|
path: '/order/index' |
|
|
|
}, |
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "distributionCount", |
|
|
|
component: 'distributionCount', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "网点配货统计", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '网点配货统计' |
|
|
|
}, |
|
|
|
name: "/order/distributionCount", |
|
|
|
path: "/order/distributionCount", |
|
|
|
name: '/order/distributionCount', |
|
|
|
path: '/order/distributionCount' |
|
|
|
}, |
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "subBranch", |
|
|
|
component: 'subBranch', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "支行配货统计", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '支行配货统计' |
|
|
|
}, |
|
|
|
name: "/order/subBranch", |
|
|
|
path: "/order/subBranch", |
|
|
|
name: '/order/subBranch', |
|
|
|
path: '/order/subBranch' |
|
|
|
}, |
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "allDistributionCount", |
|
|
|
component: 'allDistributionCount', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "总配货统计", |
|
|
|
}, |
|
|
|
name: "/order/allDistributionCount", |
|
|
|
path: "/order/allDistributionCount", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '总配货统计' |
|
|
|
}, |
|
|
|
name: '/order/allDistributionCount', |
|
|
|
path: '/order/allDistributionCount' |
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
}, |
|
|
@ -260,46 +303,44 @@ |
|
|
|
// path: "/order/index" |
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "print", |
|
|
|
component: 'print', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-menu", |
|
|
|
title: "电子卡管理", |
|
|
|
icon: 'el-icon-menu', |
|
|
|
title: '电子卡管理' |
|
|
|
}, |
|
|
|
name: "/print", |
|
|
|
path: "/print", |
|
|
|
name: '/print', |
|
|
|
path: '/print', |
|
|
|
children: [{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "index", |
|
|
|
component: 'index', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-help", |
|
|
|
title: "打印电子卡", |
|
|
|
icon: 'el-icon-help', |
|
|
|
title: '打印电子卡' |
|
|
|
}, |
|
|
|
name: "/print/index", |
|
|
|
path: "/print/index", |
|
|
|
name: '/print/index', |
|
|
|
path: '/print/index' |
|
|
|
}, |
|
|
|
{ |
|
|
|
alwaysShow: true, |
|
|
|
component: "print", |
|
|
|
component: 'print', |
|
|
|
meta: { |
|
|
|
icon: "el-icon-menu", |
|
|
|
title: "打印企业卡", |
|
|
|
icon: 'el-icon-menu', |
|
|
|
title: '打印企业卡' |
|
|
|
}, |
|
|
|
name: "/print/enterpriseCrad", |
|
|
|
path: "/print/enterpriseCrad" |
|
|
|
}, |
|
|
|
|
|
|
|
name: '/print/enterpriseCrad', |
|
|
|
path: '/print/enterpriseCrad' |
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
}; |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapGetters(["sidebar"]), |
|
|
|
...mapGetters(['sidebar']), |
|
|
|
// routes() { |
|
|
|
// f4d2e507-c4ed-451c-b364-04c08f962045 |
|
|
|
// console.log('78979789', this.$router.options.routes) |
|
|
@ -315,20 +356,20 @@ |
|
|
|
// if (meta.activeMenu) { |
|
|
|
// return meta.activeMenu |
|
|
|
// } |
|
|
|
return "/index"; |
|
|
|
return '/index' |
|
|
|
}, |
|
|
|
showLogo() { |
|
|
|
return this.$store.state.settings.sidebarLogo; |
|
|
|
return this.$store.state.settings.sidebarLogo |
|
|
|
}, |
|
|
|
variables() { |
|
|
|
return variables; |
|
|
|
return variables |
|
|
|
}, |
|
|
|
isCollapse() { |
|
|
|
return !this.sidebar.opened; |
|
|
|
}, |
|
|
|
return !this.sidebar.opened |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.postHuoquyonghu(); |
|
|
|
this.postHuoquyonghu() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 获取用户信息 |
|
|
@ -342,12 +383,12 @@ |
|
|
|
// getrolemenus(this.params).then((res) => { |
|
|
|
// const userRoles = this.resRouter(res.data) |
|
|
|
this.routes.push({ |
|
|
|
path: "*", |
|
|
|
redirect: "/404", |
|
|
|
hidden: true, |
|
|
|
}); |
|
|
|
console.log("左侧菜单", this.routes); |
|
|
|
return this.routes; |
|
|
|
path: '*', |
|
|
|
redirect: '/404', |
|
|
|
hidden: true |
|
|
|
}) |
|
|
|
console.log('左侧菜单', this.routes) |
|
|
|
return this.routes |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }) |
|
|
@ -356,20 +397,20 @@ |
|
|
|
// 递归,将后台传来数组 |
|
|
|
for (var i = 0; i < menus.length; i++) { |
|
|
|
if (menus[i].children && menus[i].children.length != 0) { |
|
|
|
this.resRouter(menus[i].children); |
|
|
|
this.resRouter(menus[i].children) |
|
|
|
} |
|
|
|
if (menus[i].children.length == 0) { |
|
|
|
delete menus[i].children; |
|
|
|
delete menus[i].redirect; |
|
|
|
delete menus[i].children |
|
|
|
delete menus[i].redirect |
|
|
|
} |
|
|
|
if (menus[i].component == "") { |
|
|
|
console.log("55555", menus[i]); |
|
|
|
if (menus[i].component == '') { |
|
|
|
console.log('55555', menus[i]) |
|
|
|
menus[i] = { |
|
|
|
path: menus[i].path, |
|
|
|
component: "", |
|
|
|
component: '', |
|
|
|
redirect: menus[i].path, |
|
|
|
children: [menus[i]], |
|
|
|
}; |
|
|
|
children: [menus[i]] |
|
|
|
} |
|
|
|
} else { |
|
|
|
// menus[i] = { |
|
|
|
// path: menus[i].path, |
|
|
@ -379,10 +420,11 @@ |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
this.routes = menus; |
|
|
|
console.log("左侧菜单", this.routes); |
|
|
|
return menus; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
this.routes = menus |
|
|
|
console.log('左侧菜单', this.routes) |
|
|
|
return menus |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|