|
|
@ -12,7 +12,7 @@ |
|
|
|
<card> |
|
|
|
<el-table |
|
|
|
size="mini" |
|
|
|
:data="props.row.subTable" |
|
|
|
:data="props.row.APIKeyList" |
|
|
|
class="customer-no-border-table" |
|
|
|
> |
|
|
|
<el-table-column |
|
|
@ -34,6 +34,14 @@ |
|
|
|
:prop="i.props" |
|
|
|
:key="i.props" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="i.props == 'AccountType'"> |
|
|
|
{{ |
|
|
|
accountTypes.filter(a => a.value == scope.row[i.props])[0].title |
|
|
|
}}</span |
|
|
|
> |
|
|
|
<span v-else> {{ scope.row[i.props] }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column> |
|
|
|
<template slot-scope="scope"> |
|
|
@ -62,7 +70,7 @@ |
|
|
|
|
|
|
|
<!-- 添加账户 --> |
|
|
|
<modal |
|
|
|
:show.sync="modal.apiKeyVisible" |
|
|
|
:show.sync="modal.accountAddVisible" |
|
|
|
body-classes="p-0" |
|
|
|
modal-classes="modal-dialog-centered modal-sm" |
|
|
|
> |
|
|
@ -74,9 +82,15 @@ |
|
|
|
> |
|
|
|
<template> |
|
|
|
<div class="text-muted text-center mb-3"> |
|
|
|
<small>添加API Key</small> |
|
|
|
<small>添加账号</small> |
|
|
|
</div> |
|
|
|
<form role="form"> |
|
|
|
<base-input |
|
|
|
label="登陆名" |
|
|
|
placeholder="请填写登陆名" |
|
|
|
v-model="apiKeyform.LoginName" |
|
|
|
> |
|
|
|
</base-input> |
|
|
|
<base-input |
|
|
|
label="账号AccessKey" |
|
|
|
placeholder="请填写账号AccessKey" |
|
|
@ -114,7 +128,7 @@ |
|
|
|
<base-button |
|
|
|
type="primary" |
|
|
|
class="my-4" |
|
|
|
@click="createRobot" |
|
|
|
@click="addAccount" |
|
|
|
:loading="createLoading" |
|
|
|
>添加</base-button |
|
|
|
> |
|
|
@ -126,7 +140,7 @@ |
|
|
|
|
|
|
|
<!-- 添加账户 --> |
|
|
|
<modal |
|
|
|
:show.sync="modal.accountAddVisible" |
|
|
|
:show.sync="modal.apiKeyVisible" |
|
|
|
body-classes="p-0" |
|
|
|
modal-classes="modal-dialog-centered modal-sm" |
|
|
|
> |
|
|
@ -138,7 +152,7 @@ |
|
|
|
> |
|
|
|
<template> |
|
|
|
<div class="text-muted text-center mb-3"> |
|
|
|
<small>添加账户</small> |
|
|
|
<small>添加ApiKey</small> |
|
|
|
</div> |
|
|
|
<form role="form"> |
|
|
|
<base-input |
|
|
@ -159,7 +173,7 @@ |
|
|
|
<base-button |
|
|
|
type="primary" |
|
|
|
class="my-4" |
|
|
|
@click="createRobot" |
|
|
|
@click="addRobot" |
|
|
|
:loading="createLoading" |
|
|
|
>添加</base-button |
|
|
|
> |
|
|
@ -249,7 +263,7 @@ |
|
|
|
<base-button |
|
|
|
type="primary" |
|
|
|
class="my-4" |
|
|
|
@click="createRobot" |
|
|
|
@click="transferMoney" |
|
|
|
:loading="createLoading" |
|
|
|
>确定</base-button |
|
|
|
> |
|
|
@ -278,19 +292,19 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
const MainColumns = [ |
|
|
|
{ label: "登录名", props: "account" }, |
|
|
|
{ label: "UID", props: "account1" }, |
|
|
|
{ label: "账户类型", props: "account2" }, |
|
|
|
{ label: "账户余额", props: "account3" }, |
|
|
|
{ label: "保底运营资金", props: "account4" }, |
|
|
|
{ label: "登录名", props: "LoginName" }, |
|
|
|
{ label: "UID", props: "UID" }, |
|
|
|
{ label: "账户类型", props: "AccountType" }, |
|
|
|
{ label: "账户余额", props: "Balance" }, |
|
|
|
|
|
|
|
{ label: "可转资金", props: "account5" } |
|
|
|
]; |
|
|
|
|
|
|
|
const SubColumns = [ |
|
|
|
{ label: "API Key", props: "Apikey1" }, |
|
|
|
{ label: "交易对", props: "Apikey2" }, |
|
|
|
{ label: "保底运营资金", props: "Apikey3" }, |
|
|
|
{ label: "机器人ID", props: "Apikey4" } |
|
|
|
{ label: "API Key", props: "AccessKey" }, |
|
|
|
{ label: "交易对", props: "Symbol" }, |
|
|
|
{ label: "保底运营资金", props: "MinimumWorkingCapital" }, |
|
|
|
{ label: "机器人ID", props: "RobotId" } |
|
|
|
]; |
|
|
|
|
|
|
|
import { Modal } from "@/components"; |
|
|
@ -312,93 +326,62 @@ export default { |
|
|
|
apiKeyform: {}, |
|
|
|
accountForm: {}, |
|
|
|
moneyForm: {}, |
|
|
|
tableData: [ |
|
|
|
{ account: "1", subTable: [{ Apikey1: "01" }] }, |
|
|
|
{ account: "2", subTable: [{ Apikey1: "2" }] }, |
|
|
|
{ account: "3", subTable: [{ Apikey1: "3" }] } |
|
|
|
] |
|
|
|
createLoading: false, |
|
|
|
tableData: [] |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getAccounts(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getAccounts() { |
|
|
|
this.$http |
|
|
|
.get("/Api/StockExchangeAccount/GetListByGroup?policyType=2") |
|
|
|
.then(res => { |
|
|
|
if (res.Code == 200) { |
|
|
|
this.tableData = res.Data; |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
handleCommand(command) { |
|
|
|
this.modal[command] = true; |
|
|
|
}, |
|
|
|
|
|
|
|
addAccount() { |
|
|
|
this.createLoading = true; |
|
|
|
this.$http |
|
|
|
.post("/Api/StockExchangeAccount/Add", { |
|
|
|
...this.apiKeyform, |
|
|
|
PolicyType: 2 |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
this.createLoading = false; |
|
|
|
if (res.Code == 200) { |
|
|
|
this.sMessage("success", "添加成功"); |
|
|
|
this.getAccounts(); |
|
|
|
this.accountAddVisible = false; |
|
|
|
} else { |
|
|
|
this.sMessage("danger", res.Message); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
//添加apikey |
|
|
|
addRobot() {}, |
|
|
|
//划转资金 |
|
|
|
transferMoney() {}, |
|
|
|
// 封装showNotification |
|
|
|
sMessage(type, message) { |
|
|
|
this.$notify({ |
|
|
|
type: type, |
|
|
|
message, |
|
|
|
timeout: 1800 |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style> |
|
|
|
.el-table th { |
|
|
|
color: #a2a2a3; /* 字体颜色 */ |
|
|
|
font-size: 16px; |
|
|
|
background-color: transparent !important; /* 背景透明 */ |
|
|
|
border: 0 !important; |
|
|
|
height: 22px; |
|
|
|
line-height: 22px; |
|
|
|
} |
|
|
|
.el-table tr, |
|
|
|
.el-table td { |
|
|
|
color: #a2a2a3; |
|
|
|
font-size: 12px; |
|
|
|
background-color: transparent !important; /* 背景透明 */ |
|
|
|
border: 0 !important; |
|
|
|
height: 22px; |
|
|
|
line-height: 22px; |
|
|
|
} |
|
|
|
|
|
|
|
.el-table, |
|
|
|
.el-table__expanded-cell { |
|
|
|
background-color: transparent !important; |
|
|
|
} |
|
|
|
.el-table th, |
|
|
|
.el-table tr, |
|
|
|
.el-table td { |
|
|
|
background-color: transparent !important; |
|
|
|
} |
|
|
|
|
|
|
|
/*去掉表格单元格边框*/ |
|
|
|
.customer-no-border-table th { |
|
|
|
border: none; |
|
|
|
} |
|
|
|
.customer-no-border-table td, |
|
|
|
.customer-no-border-table th.is-leaf { |
|
|
|
border: none; |
|
|
|
} |
|
|
|
/*表格最外边框*/ |
|
|
|
.customer-no-border-table .el-table--border, |
|
|
|
.el-table--group { |
|
|
|
border: none; |
|
|
|
} |
|
|
|
/*头部边框*/ |
|
|
|
.customer-no-border-table thead tr th.is-leaf { |
|
|
|
border: 0px solid #ebeef5; |
|
|
|
border-right: none; |
|
|
|
} |
|
|
|
.customer-no-border-table thead tr th:nth-last-of-type(2) { |
|
|
|
border-right: 0px solid #ebeef5; |
|
|
|
} |
|
|
|
/*表格最外层边框-底部边框*/ |
|
|
|
.customer-no-border-table .el-table--border::after, |
|
|
|
.customer-no-border-table .el-table--group::after { |
|
|
|
width: 0; |
|
|
|
} |
|
|
|
.customer-no-border-table::before { |
|
|
|
width: 0; |
|
|
|
} |
|
|
|
.customer-no-border-table .el-table__fixed-right::before, |
|
|
|
.el-table__fixed::before { |
|
|
|
width: 0; |
|
|
|
} |
|
|
|
.customer-no-border-table .el-table__header tr th { |
|
|
|
background: #fff; |
|
|
|
padding: 3px; |
|
|
|
font-weight: 550; |
|
|
|
height: 36px; |
|
|
|
border: 0px; |
|
|
|
font-size: 15px; |
|
|
|
} |
|
|
|
|
|
|
|
.el-table__expanded-cell[class*="cell"] { |
|
|
|
padding: 0 20px; |
|
|
|
} |
|
|
|
</style> |
|
|
|