Commit c4ad0ff5 authored by wxk's avatar wxk

筛选框筛选ok

parent db83fe91
...@@ -6,21 +6,27 @@ ...@@ -6,21 +6,27 @@
</div> </div>
<el-row :gutter="20" class="operation-area"> <el-row :gutter="20" class="operation-area">
<el-col :span="16"> <el-col :span="16">
<div class="dashboard abnormal"> <div class="dashboard" :class="[robotDetailInfo.status]">
<div class="chart-box "> <div class="chart-box">
<p class="title">今日盈亏</p> <p class="title">今日盈亏</p>
<p class="data lose">-30.23%</p> <p v-show="robotDetailInfo.today_profit>0" class="data gain">+{{(robotDetailInfo.today_profit*100).toFixed(2)}}%</p>
<p v-show="robotDetailInfo.today_profit<0" class="data lose">-{{(robotDetailInfo.today_profit*100).toFixed(2)}}%</p>
<p v-show="robotDetailInfo.today_profit==0" class="data none">- -</p>
<div class="type-box"> <div class="type-box">
<p class="type">异常运行</p> <p v-show="robotDetailInfo.status==='normal'" class="type">正在运行</p>
<p v-show="robotDetailInfo.status==='stop'" class="type">停止运行</p>
<p> <p>
<span class="result">总盈亏</span> <span class="result">总盈亏</span>
<span class="data lose">+30.23%</span> <span v-show="robotDetailInfo.all_profit>0" class="data gain">+{{(robotDetailInfo.all_profit*100).toFixed(2)}}%</span>
<span v-show="robotDetailInfo.all_profit<0" class="data lose">-{{(robotDetailInfo.all_profit*100).toFixed(2)}}%</span>
<span v-show="robotDetailInfo.all_profit==0" class="data none">- -</span>
</p> </p>
</div> </div>
<div class="switch"> <div class="switch">
<span v-show="value1">关闭</span> <span v-show="value1">关闭</span>
<span v-show="!value1">开启</span> <span v-show="!value1">开启</span>
<el-switch <el-switch
disabled
v-model="value1" v-model="value1"
active-color="rgba(119,146,167,1)" active-color="rgba(119,146,167,1)"
inactive-color="rgba(236,239,241,1)"> inactive-color="rgba(236,239,241,1)">
...@@ -30,30 +36,31 @@ ...@@ -30,30 +36,31 @@
<div class="dashboard-details"> <div class="dashboard-details">
<p> <p>
<span>机器人名称</span> <span>机器人名称</span>
<span>YCC/BTC-SMALL-140025</span> <span>{{robotDetailInfo.tag}}</span>
</p> </p>
<p> <p>
<span>交易对</span> <span>交易对</span>
<span>YCC/BTC</span> <span>{{robotDetailInfo.coin}}/{{robotDetailInfo.base}}</span>
</p> </p>
<p> <p>
<span>账户地址</span> <span>账户地址</span>
<span>sdlahfoayqwp9yrewhfjksdvkjahdhofysafdoauoidfaosfuosydofiaysdfhvjchkhfiyefsdhksvbzxvihuwo</span> <span>{{robotDetailInfo.account}}</span>
</p> </p>
<p> <p>
<span>运行状态</span> <span>运行状态</span>
<span class="red">异常运行</span> <span v-show="robotDetailInfo.status==='normal'" class="green">正在运行</span>
<span v-show="robotDetailInfo.status==='stop'" class="red">停止运行</span>
</p> </p>
<p> <p>
<span>交易所</span> <span>交易所</span>
<span>找币网</span> <span>{{robotDetailInfo.platform}}</span>
</p> </p>
<p> <p>
<span>行情</span> <span>行情</span>
<span>$7376.84</span> <!--<span>$7376.84</span>-->
<span class="cny">≈¥47986.10</span> <!--<span class="cny">≈¥47986.10</span>-->
<br> <!--<br>-->
<span class="green">-1.82%</span> <!--<span class="green">-1.82%</span>-->
</p> </p>
</div> </div>
</div> </div>
...@@ -112,6 +119,7 @@ ...@@ -112,6 +119,7 @@
value1: true, value1: true,
} }
}, },
props: ['robotDetailInfo'],
methods: { methods: {
closeDetails() { closeDetails() {
Bus.$emit('hideDetails') Bus.$emit('hideDetails')
...@@ -209,7 +217,7 @@ ...@@ -209,7 +217,7 @@
bottom: -5px; bottom: -5px;
.type { .type {
font-size:14px; font-size:14px;
color:rgba(76,171,115,1); /*color:rgba(76,171,115,1);*/
line-height:20px; line-height:20px;
margin: -10px 0 4px 0; margin: -10px 0 4px 0;
} }
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<ul class="robots-box"> <ul class="robots-box">
<li v-for="(item,index) in robotList" :key="item.tag" :class="[item.status]"> <li v-for="(item,index) in robotList" :key="item.tag" :class="[item.status]">
<div class="operations"> <div class="operations">
<div class="detail" @click="showDetails()"> <div class="detail" @click="showDetails(index)">
<span>查看详情</span> <span>查看详情</span>
<i class="el-icon-caret-right"></i> <i class="el-icon-caret-right"></i>
</div> </div>
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
</ul> </ul>
<p v-if="robotList === null" class="no-data">暂无数据</p> <p v-if="robotList === null" class="no-data">暂无数据</p>
</div> </div>
<robot-details v-show="robotDetails"></robot-details> <robot-details v-show="robotDetails" :robotDetailInfo="robotDetailInfo"></robot-details>
</div> </div>
</template> </template>
...@@ -142,11 +142,13 @@ ...@@ -142,11 +142,13 @@
export default { export default {
data() { data() {
return { return {
platform: '',//导航选中的交易所
value1: true, //是否开启机器人 value1: true, //是否开启机器人
robotDetails: false, //是否查看机器人详情 robotDetails: false, //是否查看机器人详情
robotStatus: '', //机器人状态 robotStatus: '', //机器人状态
robotStatusList: [],//状态预警信息 robotStatusList: [],//状态预警信息
robotList: [],//符合条件的机器人列表 robotList: [],//符合条件的机器人列表
robotDetailInfo: '',
subtitle: '所有机器人', //副标题 subtitle: '所有机器人', //副标题
checkAll: false, //交易所筛选 checkAll: false, //交易所筛选
checkedWebs: [], checkedWebs: [],
...@@ -206,7 +208,7 @@ ...@@ -206,7 +208,7 @@
//筛选机器人参数 //筛选机器人参数
var ListParams = { var ListParams = {
class: "robot", //账户级别 class: "robot", //账户级别
coin: "", //目标币种,用于首页里的筛选和币种监控 可选参数 coin: [], //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: [], //币种对,用于网站监控里的筛选 可选参数 symbol: [], //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数 status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数 abnormal: "", //有profit,coin,base这三种异常类别 可选参数
...@@ -222,16 +224,16 @@ ...@@ -222,16 +224,16 @@
this.showWebFilter = true; this.showWebFilter = true;
this.showCurrencyFilter = this.showPairFilter = false; this.showCurrencyFilter = this.showPairFilter = false;
StatusParams.coin = RoutePath; StatusParams.coin = RoutePath;
ListParams.coin = RoutePath; ListParams.coin = [RoutePath];
break; break;
default: default:
this.showPairFilter = true; this.showPairFilter = true;
this.showWebFilter = this.showCurrencyFilter = false; this.showWebFilter = this.showCurrencyFilter = false;
var index = +RoutePath; var index = +RoutePath;
this.pairs = this.platInfo[index].symbol; this.pairs = this.platInfo[index].symbol;
const platform = this.platInfo[index].platform; this.platform = this.platInfo[index].platform;
StatusParams.platform = platform; StatusParams.platform = this.platform;
ListParams.platform = [platform]; ListParams.platform = [this.platform];
break; break;
} }
this.getRobotStatus(StatusParams); this.getRobotStatus(StatusParams);
...@@ -258,6 +260,15 @@ ...@@ -258,6 +260,15 @@
this.currencies = this.allCurrencies; this.currencies = this.allCurrencies;
this.checkedCurrencies = []; this.checkedCurrencies = [];
this.checkAll0 = false; this.checkAll0 = false;
var ListParams = {
class: "robot", //账户级别
coin: [], //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: [], //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数
platform: [] //交易所种类 可选参数
};
this.getRobotList(ListParams);
}, },
handleCheckedChange(value) { handleCheckedChange(value) {
let checkedCount = value.length; let checkedCount = value.length;
...@@ -278,29 +289,77 @@ ...@@ -278,29 +289,77 @@
} }
} }
} }
//筛选符合条件的机器人
var ListParams = {
class: "robot", //账户级别
coin: [], //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: [], //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数
platform: value //交易所种类 可选参数
};
this.getRobotList(ListParams);
}, },
//币种过滤 //币种过滤
handleCheckAllChange0(val) { handleCheckAllChange0(val) {
this.checkedCurrencies = val ? this.currencies : []; this.checkedCurrencies = val ? this.currencies : [];
this.isIndeterminate0 = false; this.isIndeterminate0 = false;
var ListParams = {
class: "robot", //账户级别
coin: [], //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: [], //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数
platform: this.checkedWebs //交易所种类 可选参数
};
this.getRobotList(ListParams);
}, },
handleCheckedChange0(value) { handleCheckedChange0(value) {
let checkedCount = value.length; let checkedCount = value.length;
this.checkAll0 = checkedCount === this.webs.length; this.checkAll0 = checkedCount === this.webs.length;
this.isIndeterminate0 = checkedCount > 0 && checkedCount < this.currencies.length; this.isIndeterminate0 = checkedCount > 0 && checkedCount < this.currencies.length;
var ListParams = {
class: "robot", //账户级别
coin: value, //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: [], //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数
platform: this.checkedWebs //交易所种类 可选参数
};
this.getRobotList(ListParams);
}, },
//交易对过滤 //交易对过滤
handleCheckAllChange1(val) { handleCheckAllChange1(val) {
this.checkedPairs = val ? this.pairs : []; this.checkedPairs = val ? this.pairs : [];
this.isIndeterminate1 = false; this.isIndeterminate1 = false;
var ListParams = {
class: "robot", //账户级别
coin: [], //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: [], //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数
platform: [this.platform] //交易所种类 可选参数
};
this.getRobotList(ListParams);
}, },
handleCheckedChange1(value) { handleCheckedChange1(value) {
let checkedCount = value.length; let checkedCount = value.length;
this.checkAll1 = checkedCount === this.pairs.length; this.checkAll1 = checkedCount === this.pairs.length;
this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.pairs.length; this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.pairs.length;
var ListParams = {
class: "robot", //账户级别
coin: [], //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: value, //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数
platform: [this.platform] //交易所种类 可选参数
};
this.getRobotList(ListParams);
}, },
showDetails() { showDetails(index) {
this.robotDetails = true; this.robotDetails = true;
this.robotDetailInfo = this.robotList[index];
console.log(this.robotDetailInfo)
}, },
clickSwitch(val) { clickSwitch(val) {
const Tips = val ? '此操作将开启机器人, 是否继续?' : '此操作将关闭机器人, 是否继续?'; const Tips = val ? '此操作将开启机器人, 是否继续?' : '此操作将关闭机器人, 是否继续?';
...@@ -333,7 +392,7 @@ ...@@ -333,7 +392,7 @@
//筛选机器人参数 //筛选机器人参数
var ListParams = { var ListParams = {
class: "robot", //账户级别 class: "robot", //账户级别
coin: "", //目标币种,用于首页里的筛选和币种监控 可选参数 coin: [], //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: [], //币种对,用于网站监控里的筛选 可选参数 symbol: [], //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数 status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数 abnormal: "", //有profit,coin,base这三种异常类别 可选参数
......
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