产品分化课程设计页面调整

刷新页面菜单栏选中状态调整
This commit is contained in:
joylink_cuiweidong 2019-10-10 16:18:31 +08:00
parent 059a4134d5
commit 17ed79b2dd
4 changed files with 19 additions and 5 deletions

View File

@ -2,7 +2,7 @@
<el-menu <el-menu
class="navbar" class="navbar"
router router
:default-active="$route.path" :default-active="activePath"
mode="horizontal" mode="horizontal"
background-color="#545c64" background-color="#545c64"
text-color="#fff" text-color="#fff"
@ -24,6 +24,7 @@
</template> </template>
<template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow"> <template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow">
<template :to="item.path+'/'+item.children[0].path"> <template :to="item.path+'/'+item.children[0].path">
<!-- -->
<el-menu-item :key="idx" :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)"> <el-menu-item :key="idx" :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
<span <span
v-if="item.children[0].meta&&item.children[0].meta.i18n" v-if="item.children[0].meta&&item.children[0].meta.i18n"
@ -89,6 +90,7 @@ export default {
return { return {
routes: [], routes: [],
isShow:false, isShow:false,
activePath:'',
}; };
}, },
computed: { computed: {
@ -104,6 +106,15 @@ export default {
} }
else{ else{
this.isShow=true; this.isShow=true;
}
if(this.$route.fullPath.indexOf('design/userlist')>=0){
this.activePath='/design/userlist/home';
}
else if(this.$route.fullPath.indexOf('design/lesson')>=0 || this.$route.fullPath.indexOf('design/script')>=0 || this.$route.fullPath.indexOf('design/runPlan')>=0){
this.activePath='/design/home';
}
else{
this.activePath=this.$route.path;
} }
}, },
methods: { methods: {

View File

@ -407,6 +407,7 @@ export const asyncRouter = [
}, },
{ {
path: '/design/userlist', path: '/design/userlist',
redirect: '/design/userlist/home',
component: Layout, component: Layout,
meta: { meta: {
roles: [admin, user, userDesign] roles: [admin, user, userDesign]

View File

@ -8,7 +8,7 @@
<transition> <transition>
<!-- position:'relative', --> <!-- position:'relative', -->
<!-- :style="{left:widthLeft+'px', width: (width - widthLeft)+'px'}" --> <!-- :style="{left:widthLeft+'px', width: (width - widthLeft)+'px'}" -->
<router-view :product-list="productList" /> <router-view :product-list="productList" :style="{width:(width - widthLeft)+'px',display:'inline-block'}"/>
</transition> </transition>
</el-scrollbar> </el-scrollbar>
</div> </div>

View File

@ -1,6 +1,7 @@
<template> <template>
<div class="mainContext"> <div class="mainContext">
<div class="draftContext" :style="{width: width +'px'}"> <div class="draftContext">
<!--:style="{width: width +'px'} -->
<div v-if="lessonShow"> <div v-if="lessonShow">
<lesson-edit ref="lesson" :height="height" @refresh="refresh" /> <lesson-edit ref="lesson" :height="height" @refresh="refresh" />
</div> </div>
@ -19,6 +20,7 @@ import CourceCategory from './category/tree';
import LessonEdit from './edit/lesson/index'; import LessonEdit from './edit/lesson/index';
import ChapterEdit from './edit/chapter/index'; import ChapterEdit from './edit/chapter/index';
import SortTree from './edit/sorttree/index'; import SortTree from './edit/sorttree/index';
import localStore from 'storejs';
export default { export default {
name: 'LessonDraft', name: 'LessonDraft',
@ -40,7 +42,7 @@ export default {
}, },
computed: { computed: {
width() { width() {
return this.$store.state.app.width - 420; return this.$store.state.app.width - localStore.get('LeftWidth');
}, },
height() { height() {
return this.$store.state.app.height - 102; return this.$store.state.app.height - 102;
@ -123,6 +125,6 @@ export default {
} }
.draftContext { .draftContext {
float: left; // float: left;
} }
</style> </style>