This commit is contained in:
fan 2019-11-14 18:55:07 +08:00
commit 898e18056f
2 changed files with 22 additions and 9 deletions

View File

@ -11,7 +11,7 @@
@select="handleSelect"
>
<system-title />
<template v-for="(item,idx) in routers">
<template v-for="(item, idx) in routers">
<template v-if="!item.hidden&&item.children">
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
<template>
@ -26,7 +26,6 @@
</template>
<template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow">
<template :to="item.path+'/'+item.children[0].path">
<!-- -->
<el-menu-item :key="idx" :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
<span
v-if="item.children[0].meta&&item.children[0].meta.i18n"
@ -35,14 +34,14 @@
</el-menu-item>
</template>
</template>
<el-submenu v-else :key="idx" :index="item.name||item.path" :show-timeout="100">
<el-submenu v-else :key="idx" :index="item.path" :show-timeout="100">
<template slot="title">
<span v-if="item.meta" slot="title">{{ $t(item.meta.i18n) }}</span>
</template>
<template v-for="(child,cdx) in item.children">
<template v-if="!child.hidden">
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
<el-submenu :key="cdx" :index="child.name||child.path" :show-timeout="100">
<el-submenu :key="cdx" :index="child.path" :show-timeout="100">
<template slot="title">
<span v-if="child.meta" slot="title">{{ $t(child.meta.i18n) }}</span>
</template>
@ -107,6 +106,7 @@ export default {
if (val.path === '/orderauthor/rules/manage') {
this.$refs.keMenu.activeIndex = val.path;
}
this.refreshRoute(val);
}
},
mounted() {
@ -120,6 +120,20 @@ export default {
}
},
methods: {
//
refreshRoute(val) {
let routePath = '';
if (val.path.indexOf('design/userlist') >= 0) {
routePath = '/design/userlist/home';
} else if (val.path.includes('design/lesson') || val.path.includes('design/script') || val.path.includes('design/runPlan') || val.path.includes('design/mapPreview')) {
routePath = '/design/home';
} else {
routePath = this.$route.path;
}
setTimeout(() => { //
this.$refs.keMenu.activeIndex = routePath;
}, 100);
},
toggleSideBar() {
this.$store.dispatch('ToggleSideBar');
},
@ -134,9 +148,7 @@ export default {
},
hasOneScreenShowingChildren(children) {
const showingChildren = children.filter(item => {
if (!item.hidden && item.target) {
return item;
}
if (!item.hidden && item.target) { return item; }
});
if (showingChildren.length === 1) {
return true;

View File

@ -262,6 +262,7 @@ export default {
}
if (item.name == 'trainLabel') {
item.data = [];
op.series.splice(index, 1);
}
});
this.myChart.setOption(op);
@ -276,7 +277,7 @@ export default {
const data = [];
tripNumber = row.tripNumber;
const op = this.myChart.getOption();
op.series.forEach(item => {
op.series.forEach((item, index) => {
if (item.name == serviceNumber) {
item.data.forEach(nor => {
if (nor[3] == tripNumber) {
@ -286,6 +287,7 @@ export default {
}
if (item.name == 'trainLabel') {
item.data = [];
op.series.splice(index, 1);
}
});
op.series.push({
@ -339,7 +341,6 @@ export default {
}
height = height - top;
debugger;
this.$store.dispatch('runPlan/resize', { width, height });
if (this.top != top) {