Commit 03beac6e authored by 汪晓凯's avatar 汪晓凯

查看、修改机器人配置

parent 311ff67d
......@@ -20,7 +20,7 @@ const Api = {
GetBankConfig: originUrl + '/getBankConfig', //获取银行配置
UpdateBankConfig: originUrl + '/updateBankConfig', //修改银行配置
GetRobotConfig: originUrl + '/getRobotConfig', //获取机器人配置
UpdateRobotConfig: originUrl + 'updateRobotConfig', //修改机器人配置接口
UpdateRobotConfig: originUrl + '/updateRobotConfig', //修改机器人配置接口
}
export default Api;
<template>
<div class="detail-box">
<div class="back-button" @click="closeDetails()">
<div class="clearfix">
<div class="back-button fl" @click="closeDetails()">
<i class="el-icon-arrow-left"></i>
<span>返回</span>
</div>
<el-button
class="fr update-button"
@click.native.prevent="clickUpdate"
type="primary"
size="small">
修改配置
</el-button>
</div>
<el-row :gutter="20" class="operation-area">
<el-col :span="16">
<div class="dashboard"
......@@ -488,6 +497,73 @@
:total="total">
</el-pagination>
</div>
<!-- 修改配置弹框 -->
<el-dialog
title="修改配置"
:visible.sync="dialogFormVisible2"
:before-close="handleClose"
:close-on-click-modal = "false"
center>
<!-- 内层确认弹框 -->
<el-dialog
width="40%"
title="确认修改"
:visible.sync="innerVisible2"
:before-close="handleClose"
:close-on-click-modal = "false"
append-to-body
center>
<el-card class="box-card" style="text-align:left;">
<p>账户地址:<span>{{updateRobotConfig.account}}</span></p>
<p>目标币种:<span>{{updateRobotConfig.coin}}</span></p>
<p>基础币种:<span>{{updateRobotConfig.base}}</span></p>
<p>目标币种标准:<span>{{updateRobotConfig.coin_normal}}</span></p>
<p>基础币种标准:<span>{{updateRobotConfig.base_normal}}</span></p>
<p>盈亏范围:<span>{{updateRobotConfig.profit_range}}</span></p>
<p>币数量范围:<span>{{updateRobotConfig.amount_range}}</span></p>
<p>交易所:<span>{{updateRobotConfig.platform}}</span></p>
<p>标签:<span>{{updateRobotConfig.tag}}</span></p>
</el-card>
<p class="tips">操作前请确认信息</p>
<div slot="footer" class="dialog-footer">
<el-button @click="innerVisible2 = false">取 消</el-button>
<el-button type="primary" @click="sure_recharge1" :disabled="transferok">确认修改</el-button>
</div>
</el-dialog>
<el-form>
<el-form-item label="账户地址" label-width="120px">
<el-input v-model="updateRobotConfig.account " :disabled="true"></el-input>
</el-form-item>
<el-form-item label="目标币种" label-width="120px">
<el-input v-model="updateRobotConfig.coin" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="基础币种" label-width="120px">
<el-input v-model="updateRobotConfig.base" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="目标币种标准" label-width="120px">
<el-input v-model="updateRobotConfig.coin_normal" type="number"></el-input>
</el-form-item>
<el-form-item label="基础币种标准" label-width="120px">
<el-input v-model="updateRobotConfig.base_normal" type="number"></el-input>
</el-form-item>
<el-form-item label="盈亏范围" label-width="120px">
<el-input v-model="updateRobotConfig.profit_range" type="number"></el-input>
</el-form-item>
<el-form-item label="币数量范围" label-width="120px">
<el-input v-model="updateRobotConfig.amount_range" type="number"></el-input>
</el-form-item>
<el-form-item label="交易所" label-width="120px">
<el-input v-model="updateRobotConfig.platform" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="标签" label-width="120px">
<el-input v-model="updateRobotConfig.tag" :disabled="true"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel(),dialogFormVisible2 = false">取 消</el-button>
<el-button type="primary" @click="updateRobotConfig.coin_normal && updateRobotConfig.base_normal && updateRobotConfig.profit_range && updateRobotConfig.amount_range ? innerVisible2=true : innerVisible2=false">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
......@@ -547,6 +623,12 @@
Loading: false,//充提币后数据加载标志
transactionLoading: false, //充提记录查询加载
recordsLoading: false,//交易记录查询加载
robotConfig: {}, //机器人配置
updateRobotConfig: {}, //修改的机器人配置
/*修改配置弹框参数*/
dialogFormVisible2:false,//充值弹框
innerVisible2: false,//确认弹框
}
},
created() {
......@@ -562,6 +644,7 @@
this.getRecords();
this.getCurrentRobot();
this.getTicket();
this.getRobotConfig();
},
//返回上一页(关闭详情)
closeDetails() {
......@@ -603,6 +686,19 @@
});
})
},
//查询机器人配置
getRobotConfig() {
const params = {
account: this.robotDetailInfo.account,
coin: this.robotDetailInfo.coin,
base: this.robotDetailInfo.base,
};
axios.post(ApiConfig.GetRobotConfig, params).then( res => {
if(res.data.code === 200) {
this.updateRobotConfig = this.robotConfig = res.data.data;
}
})
},
//查询账户资金信息
getWalletInfo() {
const params = {
......@@ -636,7 +732,7 @@
this.account_symbol = symbol;
this.dialogFormVisible = true;
},
//取消充值
//取消
cancel() {
this.amount_num = '';
this.recharge_list_value = '';
......@@ -891,7 +987,54 @@
const href = ApiConfig.Excle + '?' + this.toQueryString(params);
downloadHref.setAttribute('href', href);
downloadHref.click();
},
//修改机器人配置
clickUpdate() {
this.updateRobotConfig = this.robotConfig;
this.dialogFormVisible2 = true;
},
//弹框确认修改
sure_recharge1(){
this.transferok = true;
this.Loading = true;
axios.post(ApiConfig.UpdateRobotConfig, this.updateRobotConfig).then(res=>{
if(res.data.code === 200){
this.$notify({
title: '提示',
message: '修改成功',
type: 'success',
duration:'2000',
});
this.Loading = false;
setTimeout(()=>{
this.init();
},500)
}else{
this.Loading = false;
this.$notify({
title: '提示',
message: res.data.msg,
type: 'error',
duration:'2000',
})
}
this.dialogFormVisible2 = false;
this.innerVisible2 = false;
this.transferok = false;
}).catch( error => {
this.Loading = false;
this.dialogFormVisible2 = false;
this.innerVisible2 = false;
this.transferok = false;
this.$notify({
title: '错误',
message: "服务器崩溃啦,请稍后再试",
type: 'error',
duration:'2000',
});
});
},
},
watch: {
$route() {
......@@ -1221,7 +1364,7 @@
<style>
/*select组件样式覆盖*/
.detail-box {
.count-box .el-button {
.record-box .el-button, .el-button.update-button{
background: rgba(119, 146, 167, 1);
border: none;
}
......
......@@ -179,7 +179,7 @@
<p class="tips">操作前请确认信息</p>
<div slot="footer" class="dialog-footer">
<el-button @click="innerVisible1 = false">取 消</el-button>
<el-button type="primary" @click="sure_recharge1" :disabled="transferok1">确认充值</el-button>
<el-button type="primary" @click="sure_recharge1" :disabled="transferok1">确认修改</el-button>
</div>
</el-dialog>
<el-form>
......
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