Commit 2372eb28 by caoyanzhi

update: 错误页面加上主菜单

parent 5e67f7f8
<template> <template>
<div class="hb-layout" v-loading="fullLoading.visible"> <div class="hb-layout" v-loading="fullLoading.visible">
<main-menu ref="mainMenu" :menu-list="menuList" :actived-code="activedMenu.length > 0 ? activedMenu[0].menuCode : ''" @showLoading="onShowLoading"></main-menu> <main-menu ref="mainMenu" :menu-list="menuList" :actived-code="activedMenu.length > 0 ? activedMenu[0].menuCode : ''" @showLoading="onShowLoading"></main-menu>
<aside-menu :menu-list="activedMenu.length > 0 ? activedMenu[0].childList : []" :actived-code="activedMenu.length > 2 ? activedMenu[2].menuCode : ''"></aside-menu> <aside-menu v-show="showAside" :menu-list="activedMenu.length > 0 ? activedMenu[0].childList : []" :actived-code="activedMenu.length > 2 ? activedMenu[2].menuCode : ''"></aside-menu>
<div class="hb-layout-content"> <div class="hb-layout-content">
<bread-menu v-if="activedMenu.length > 3" :menu-list="activedMenu.slice(2)"></bread-menu> <bread-menu v-if="activedMenu.length > 3" :menu-list="activedMenu.slice(2)"></bread-menu>
<div class="hb-layout-pager" :style="{ height: activedMenu.length > 3 ? `calc(100% - 30px)` : '100%' }"> <div class="hb-layout-pager" :style="{ height: activedMenu.length > 3 ? `calc(100% - 30px)` : '100%' }">
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
}, },
data() { data() {
return { return {
breadShow: true, showAside: true,
enterpriseId: '', enterpriseId: '',
// 菜单平铺数据 // 菜单平铺数据
flatMenuList: [], flatMenuList: [],
...@@ -126,7 +126,9 @@ export default { ...@@ -126,7 +126,9 @@ export default {
}, },
onCommand(command) { onCommand(command) {
const methods = { const methods = {
updateApplyCount: () => this.$refs.mainMenu.updateAplyCount() updateApplyCount: () => this.$refs.mainMenu.updateAplyCount(),
showAside: () => (this.showAside = true),
hideAside: () => (this.showAside = false)
}; };
if (typeof methods[command] == 'function') { if (typeof methods[command] == 'function') {
methods[command](); methods[command]();
......
...@@ -416,8 +416,6 @@ export const constantRouterMap = [ ...@@ -416,8 +416,6 @@ export const constantRouterMap = [
path: '/bad-evaluate', path: '/bad-evaluate',
name: '不良评价回访设置', name: '不良评价回访设置',
component: _import('apps/order-evaluate', 'bad-evaluate-set') component: _import('apps/order-evaluate', 'bad-evaluate-set')
}
]
}, },
{ {
...@@ -440,6 +438,8 @@ export const constantRouterMap = [ ...@@ -440,6 +438,8 @@ export const constantRouterMap = [
name: 'error500', name: 'error500',
component: errorPage component: errorPage
} }
]
}
]; ];
export default new Router({ export default new Router({
// mode:'history', // mode:'history',
......
...@@ -26,6 +26,7 @@ import img_404 from '@/assets/gic-error.png'; ...@@ -26,6 +26,7 @@ import img_404 from '@/assets/gic-error.png';
export default { export default {
name: 'page404', name: 'page404',
inject: ['layoutVm'],
data() { data() {
return { return {
img_404 img_404
...@@ -36,9 +37,12 @@ export default { ...@@ -36,9 +37,12 @@ export default {
return '登录遇到错误啦!请确认您是否是好办小程序管理员。如不是,请联系管理员在<企业微信-我的企业-权限管理>添加好办管理员。'; return '登录遇到错误啦!请确认您是否是好办小程序管理员。如不是,请联系管理员在<企业微信-我的企业-权限管理>添加好办管理员。';
} }
}, },
destroyed() {
this.layoutVm.$emit('command', 'showAside');
},
/* eslint-disable */ /* eslint-disable */
mounted() { mounted() {
this.layoutVm.$emit('command', 'hideAside');
} }
}; };
</script> </script>
......
...@@ -28,6 +28,7 @@ import img_500 from '@/assets/500_images/error_500.svg'; ...@@ -28,6 +28,7 @@ import img_500 from '@/assets/500_images/error_500.svg';
export default { export default {
name: 'errpage', name: 'errpage',
inject: ['layoutVm'],
data() { data() {
return { return {
imgSrc: '', imgSrc: '',
...@@ -44,11 +45,15 @@ export default { ...@@ -44,11 +45,15 @@ export default {
} }
}; };
}, },
destroyed() {
this.layoutVm.$emit('command', 'showAside');
},
mounted() { mounted() {
var that = this; var that = this;
var path = that.$route.path.split('/')[1]; var path = that.$route.path.split('/')[1];
that.imgSrc = that.srcList[path]; that.imgSrc = that.srcList[path];
that.message = that.msgList[path]; that.message = that.msgList[path];
this.layoutVm.$emit('command', 'hideAside');
} }
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment