Commit 7f17940f authored by wxk's avatar wxk

优化、bugfix

parent 2a187317
......@@ -38,20 +38,15 @@
},
methods: {
navClick(index) {
this.active = index;
if(index != 'account'){
Bus.$emit('refresh');
console.log('111')
this.$router.push(`/monitor/${index}`);
Bus.$emit('refresh');
}else{
this.$router.push('/monitor/account');
}
}
},
watch: {
$route() {
this.active = this.$route.params.name || 'account';
}
}
}
</script>
......
<template>
<div class="box">
<router-view :platInfo="platInfo"></router-view>
<keep-alive>
<router-view :platInfo="platInfo"></router-view>
</keep-alive>
</div>
</template>
......
......@@ -531,6 +531,7 @@
methods: {
//页面初始化
init() {
this.robotDetailInfo = JSON.parse(sessionStorage.getItem('robotDetailInfo'));
this.coins = [this.robotDetailInfo.coin, this.robotDetailInfo.base];
this.getWalletInfo();
this.getTransaction();
......@@ -540,7 +541,7 @@
},
//返回上一页(关闭详情)
closeDetails() {
// Bus.$emit('back');
Bus.$emit('back');
this.$router.go(-1);
},
//查询行情信息
......@@ -864,12 +865,11 @@
}
},
watch: {
/*$route() {
this.robotDetailInfo = JSON.parse(sessionStorage.getItem('robotDetailInfo'));
this.init();
},*/
robotDetailInfo() {
this.init();
$route() {
// console.log(this.$route.path.indexOf('RobotDetail'))
if (this.$route.path.indexOf('RobotDetail') !== -1) {
this.init();
}
},
//交易记录时间筛选
transactionTime(val) {
......
......@@ -157,7 +157,7 @@
checkAll0: false, //币种筛选
checkedCurrencies: [],
allCurrencies: [],//所有币种
currencies: [],
currencies: [],//符合交易所条件的所有币种
isIndeterminate0: true,
foldExchange0: true,
checkAll1: false, //交易对筛选
......@@ -172,42 +172,41 @@
},
props: ['platInfo'],
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();
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();
},0)
},0)*/
});
/*Bus.$on('back', ()=>{
let Params = {
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);
})*/
Bus.$on('back', ()=>{
this.init('back');
})
},
beforeDestroy() {
Bus.$off('refresh');
Bus.$off('back');
},
methods: {
init() {
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;
init(type) {
const RoutePath = this.$route.params.name;
// console.log(RoutePath);
var StatusParams = {platform: '', coin: ''};//预警状态查询入参
......@@ -240,7 +239,32 @@
break;
}
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) {
......@@ -276,7 +300,8 @@
this.checkAll0 = false;
let ListParams = this.RobotListParams;
ListParams.platform = [];
ListParams.coin = [];
const RoutePath = this.$route.params.name;
ListParams.coin = RoutePath === 'BTY' || RoutePath === 'YCC' ? [RoutePath] : [];
this.getRobotList(ListParams);
},
handleCheckedChange(value) {
......@@ -301,6 +326,8 @@
//筛选符合条件的机器人
let ListParams = this.RobotListParams;
ListParams.platform = value;
const RoutePath = this.$route.params.name;
ListParams.coin = RoutePath === 'BTY' || RoutePath === 'YCC' ? [RoutePath] : [];
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