Commit 936d6297 authored by xiedong's avatar xiedong

修改

parent 9511ea6d
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<template slot="title">网站监控</template> <template slot="title">网站监控</template>
<el-menu-item :index="`/monitor/${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>
<el-submenu index="2"> <el-submenu index="2" v-if="environment=='inside'">>
<template slot="title">币种监控</template> <template slot="title">币种监控</template>
<el-menu-item index="/monitor/BTY">BTY</el-menu-item> <el-menu-item index="/monitor/BTY">BTY</el-menu-item>
<el-menu-item index="/monitor/YCC">YCC</el-menu-item> <el-menu-item index="/monitor/YCC">YCC</el-menu-item>
......
...@@ -34,13 +34,14 @@ ...@@ -34,13 +34,14 @@
</p> </p>
</div> </div>
<div class="switch"> <div class="switch">
<span v-show="value1">关闭</span> <span v-show="robotDetailInfo.status=='normal'">关闭</span>
<span v-show="!value1">开启</span> <span v-show="!robotDetailInfo.status=='normal'">开启</span>
<el-switch <el-switch
disabled :value="robotDetailInfo.status=='normal'"
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)"
@change="clickSwitch(robotDetailInfo)"
>
</el-switch> </el-switch>
</div> </div>
</div> </div>
...@@ -1120,7 +1121,46 @@ ...@@ -1120,7 +1121,46 @@
duration:'2000', duration:'2000',
}); });
}) })
} },
//机器人开关
clickSwitch(val) {
const Tips = val.status=='close' ? '此操作将开启机器人, 是否继续?' : '此操作将关闭机器人, 是否继续?';
// const Message = val.status=='close' ? '开启机器人成功' : '关闭机器人成功';
this.$confirm( Tips, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
axios.post(ApiConfig.changeStatus,{
account: val.account,
symbol:`${val.coin}/${val.base}`,
new_status:val.status=='normal'&&'close'||'open'
}).then(res=>{
if(res.data.code==200){
//为了改变switch的状态
this.robotBankList.status=res.data.data.new_status
sessionStorage.robotDetailInfo.status=res.data.data.new_status
this.$message({
type: 'success',
message: res.data.msg
});
}else{
this.$message({
type: 'error',
message: res.data.msg
});
}
})
}).catch(() => {
this.value1 = !val;
this.$message({
type: 'info',
message: '已取消操作'
});
});
},
}, },
watch: { watch: {
$route() { $route() {
......
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