Commit fc556d1c authored by 汪晓凯's avatar 汪晓凯

bugfix_路由跳转bug

parent 52d4228b
<template>
<div class="nav-left">
<el-menu
:default-openeds="['1', '2']"
:default-active="active"
class="el-menu-vertical-demo"
:router="true"
@select="navClick">
<el-menu-item index="home">
<el-menu-item index="/monitor/home">
<span slot="title">首页</span>
</el-menu-item>
<el-submenu index="1">
<template slot="title">网站监控</template>
<el-menu-item :index="index+''" v-for="(item, index) in platInfo" :key="item.platform">{{item.platform}}</el-menu-item>
<el-menu-item :index="`/monitor/${index}`" v-for="(item, index) in platInfo" :key="item.platform">{{item.platform}}</el-menu-item>
</el-submenu>
<el-submenu index="2">
<template slot="title">币种监控</template>
<el-menu-item index="BTY">BTY</el-menu-item>
<el-menu-item index="YCC">YCC</el-menu-item>
<el-menu-item index="/monitor/BTY">BTY</el-menu-item>
<el-menu-item index="/monitor/YCC">YCC</el-menu-item>
</el-submenu>
<el-menu-item index="/monitor/account">
<span slot="title">银行账户</span>
......@@ -37,22 +38,28 @@
},
props: ['platInfo'],
created() {
this.active = this.$route.params.name || this.$route.path;
if (this.$route.path.split('/').pop() === 'RobotDetail') {
this.active = this.$route.path.split('/').splice(0,3).join('/');
}else {
this.active = this.$route.path;
}
},
methods: {
navClick(index) {
this.active = index;
this.$router.push(index);
if(index !== '/monitor/account' && index !== '/monitor/coinRecharge'){
this.$router.push(`/monitor/${index}`);
Bus.$emit('refresh');
}else {
this.$router.push(index);
}
}
},
watch: {
$route() {
this.active = this.$route.params.name || this.$route.path;
if (this.$route.path.split('/').pop() === 'RobotDetail') {
this.active = this.$route.path.split('/').splice(0,3).join('/');
}else {
this.active = this.$route.path;
}
},
},
}
......
......@@ -224,29 +224,29 @@
},
methods: {
init(type) {
const RoutePath = this.$route.params.name;
const RoutePath = this.$route.path;
// console.log(RoutePath);
var StatusParams = {platform: '', coin: ''};//预警状态查询入参
switch (RoutePath) {
case 'home':
case '/monitor/home':
this.showWebFilter = this.showCurrencyFilter = true;
this.showPairFilter = false;
this.RobotListParams.coin = [];
this.RobotListParams.platform = [];
break;
case 'BTY':
case 'YCC':
case '/monitor/BTY':
case '/monitor/YCC':
this.showWebFilter = true;
this.showCurrencyFilter = this.showPairFilter = false;
StatusParams.coin = RoutePath;
this.RobotListParams.coin = [RoutePath];
StatusParams.coin = RoutePath.split('/').pop();
this.RobotListParams.coin = [RoutePath.split('/').pop()];
this.RobotListParams.platform = [];
break;
default:
if (RoutePath) {
this.showPairFilter = true;
this.showWebFilter = this.showCurrencyFilter = false;
var index = +RoutePath;
var index = RoutePath.split('/').pop();
this.checkedPairs = this.pairs = JSON.parse(sessionStorage.getItem('platInfo'))[index].symbol;
this.platform = JSON.parse(sessionStorage.getItem('platInfo'))[index].platform;
StatusParams.platform = this.platform;
......
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