Commit 7f17940f authored by wxk's avatar wxk

优化、bugfix

parent 2a187317
...@@ -38,20 +38,15 @@ ...@@ -38,20 +38,15 @@
}, },
methods: { methods: {
navClick(index) { navClick(index) {
this.active = index;
if(index != 'account'){ if(index != 'account'){
Bus.$emit('refresh');
console.log('111')
this.$router.push(`/monitor/${index}`); this.$router.push(`/monitor/${index}`);
Bus.$emit('refresh');
}else{ }else{
this.$router.push('/monitor/account'); this.$router.push('/monitor/account');
} }
} }
}, },
watch: {
$route() {
this.active = this.$route.params.name || 'account';
}
}
} }
</script> </script>
......
<template> <template>
<div class="box"> <div class="box">
<router-view :platInfo="platInfo"></router-view> <keep-alive>
<router-view :platInfo="platInfo"></router-view>
</keep-alive>
</div> </div>
</template> </template>
......
...@@ -531,6 +531,7 @@ ...@@ -531,6 +531,7 @@
methods: { methods: {
//页面初始化 //页面初始化
init() { init() {
this.robotDetailInfo = JSON.parse(sessionStorage.getItem('robotDetailInfo'));
this.coins = [this.robotDetailInfo.coin, this.robotDetailInfo.base]; this.coins = [this.robotDetailInfo.coin, this.robotDetailInfo.base];
this.getWalletInfo(); this.getWalletInfo();
this.getTransaction(); this.getTransaction();
...@@ -540,7 +541,7 @@ ...@@ -540,7 +541,7 @@
}, },
//返回上一页(关闭详情) //返回上一页(关闭详情)
closeDetails() { closeDetails() {
// Bus.$emit('back'); Bus.$emit('back');
this.$router.go(-1); this.$router.go(-1);
}, },
//查询行情信息 //查询行情信息
...@@ -864,12 +865,11 @@ ...@@ -864,12 +865,11 @@
} }
}, },
watch: { watch: {
/*$route() { $route() {
this.robotDetailInfo = JSON.parse(sessionStorage.getItem('robotDetailInfo')); // console.log(this.$route.path.indexOf('RobotDetail'))
this.init(); if (this.$route.path.indexOf('RobotDetail') !== -1) {
},*/ this.init();
robotDetailInfo() { }
this.init();
}, },
//交易记录时间筛选 //交易记录时间筛选
transactionTime(val) { transactionTime(val) {
......
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
checkAll0: false, //币种筛选 checkAll0: false, //币种筛选
checkedCurrencies: [], checkedCurrencies: [],
allCurrencies: [],//所有币种 allCurrencies: [],//所有币种
currencies: [], currencies: [],//符合交易所条件的所有币种
isIndeterminate0: true, isIndeterminate0: true,
foldExchange0: true, foldExchange0: true,
checkAll1: false, //交易对筛选 checkAll1: false, //交易对筛选
...@@ -172,42 +172,41 @@ ...@@ -172,42 +172,41 @@
}, },
props: ['platInfo'], props: ['platInfo'],
created() { created() {
this.webs = this.webs.length === 0 && sessionStorage.getItem('webs') ? JSON.parse(sessionStorage.getItem('webs')) : this.webs;
this.currencies = this.currencies.length === 0 && sessionStorage.getItem('currencies') ? JSON.parse(sessionStorage.getItem('currencies')) : this.currencies;
this.init(); this.init();
Bus.$on('refresh', ()=>{ Bus.$on('refresh', ()=>{
setTimeout(()=>{ this.checkAll = false;
this.isIndeterminate = true;
this.foldExchange = true;
this.checkAll0 = false;
this.isIndeterminate0 = true;
this.foldExchange0 = true;
this.checkAll1 = false;
this.checkedPairs = [];
this.isIndeterminate1 = true;
this.foldExchange1 = true;
this.checkedWebs = [];
this.checkedCurrencies = [];
this.checkedPairs = [];
this.robotStatus = '', //机器人状态
this.subtitle = '所有机器人';
this.init();
/* setTimeout(()=>{
this.init(); this.init();
},0) },0)*/
}); });
/*Bus.$on('back', ()=>{ Bus.$on('back', ()=>{
let Params = { this.init('back');
class: "robot", //账户级别 })
coin: [], //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: [], //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数
platform: [] //交易所种类 可选参数
};
if (this.robotStatus==='normal' || this.robotStatus==='stop') {
Params.status = this.robotStatus;
}else {
Params.abnormal = this.robotStatus;
}
if(!this.robotStatus) {
Params.coin = this.checkedCurrencies;
Params.symbol = this.checkedPairs;
Params.platform = this.checkedWebs;
}
this.getRobotList(Params);
})*/
}, },
beforeDestroy() { beforeDestroy() {
Bus.$off('refresh'); Bus.$off('refresh');
Bus.$off('back');
}, },
methods: { methods: {
init() { init(type) {
this.robotStatus = '', //机器人状态
this.webs = this.webs.length === 0 && sessionStorage.getItem('webs') ? JSON.parse(sessionStorage.getItem('webs')) : this.webs;
this.currencies = this.currencies.length === 0 && sessionStorage.getItem('currencies') ? JSON.parse(sessionStorage.getItem('currencies')) : this.currencies;
const RoutePath = this.$route.params.name; const RoutePath = this.$route.params.name;
// console.log(RoutePath); // console.log(RoutePath);
var StatusParams = {platform: '', coin: ''};//预警状态查询入参 var StatusParams = {platform: '', coin: ''};//预警状态查询入参
...@@ -240,7 +239,32 @@ ...@@ -240,7 +239,32 @@
break; break;
} }
this.getRobotStatus(StatusParams); this.getRobotStatus(StatusParams);
this.getRobotList(this.RobotListParams); if (type === 'back') {
let Coin = RoutePath === 'BTY' || RoutePath === 'YCC' ? [RoutePath] : [];
let Platform = (RoutePath!=='home'&&RoutePath!=='BTY'&&RoutePath !== 'YCC') ? [this.platform] : [];
var Params = {//详情返回时的请求参数
class: "robot", //账户级别
coin: Coin, //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: "", //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数
platform: Platform //交易所种类 可选参数
};
if (this.robotStatus==='normal' || this.robotStatus==='stop') {
Params.status = this.robotStatus;
}else {
Params.abnormal = this.robotStatus;
}
if (!this.robotStatus) {
Params.coin = Coin.length !== 0 ? Coin : this.checkedCurrencies;
Params.platform = Platform.length !== 0 ? Platform : this.checkedWebs;
Params.symbol = this.checkedPairs;
console.log(Params.platform)
}
this.getRobotList(Params);
}else {
this.getRobotList(this.RobotListParams);
}
}, },
//机器人预警状态查询 //机器人预警状态查询
getRobotStatus(params) { getRobotStatus(params) {
...@@ -276,7 +300,8 @@ ...@@ -276,7 +300,8 @@
this.checkAll0 = false; this.checkAll0 = false;
let ListParams = this.RobotListParams; let ListParams = this.RobotListParams;
ListParams.platform = []; ListParams.platform = [];
ListParams.coin = []; const RoutePath = this.$route.params.name;
ListParams.coin = RoutePath === 'BTY' || RoutePath === 'YCC' ? [RoutePath] : [];
this.getRobotList(ListParams); this.getRobotList(ListParams);
}, },
handleCheckedChange(value) { handleCheckedChange(value) {
...@@ -301,6 +326,8 @@ ...@@ -301,6 +326,8 @@
//筛选符合条件的机器人 //筛选符合条件的机器人
let ListParams = this.RobotListParams; let ListParams = this.RobotListParams;
ListParams.platform = value; ListParams.platform = value;
const RoutePath = this.$route.params.name;
ListParams.coin = RoutePath === 'BTY' || RoutePath === 'YCC' ? [RoutePath] : [];
this.getRobotList(ListParams); this.getRobotList(ListParams);
}, },
//币种过滤 //币种过滤
......
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