Browse Source

editModule

master
lizhixin 4 years ago
parent
commit
cd4353d19b
  1. 32
      src/components/MovementPolicyForm.vue
  2. 2
      src/components/SidebarPlugin/SideBar.vue
  3. 15
      src/main.js
  4. 84
      src/pages/Robot/edit.vue
  5. 148
      src/pages/Robot/log.vue
  6. 350
      src/pages/Robot/order.vue
  7. 262
      src/pages/prePages/js/columns.js

32
src/components/MovementPolicyForm.vue

@ -344,7 +344,9 @@
</base-input> </base-input>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<base-button type="primary" fill>更新</base-button> <base-button type="primary" fill @click="updateTrend"
>更新</base-button
>
</div> </div>
</div> </div>
</card> </card>
@ -366,7 +368,7 @@ import {
import BaseRadio from "@/components/BaseRadio.vue"; import BaseRadio from "@/components/BaseRadio.vue";
export default { export default {
model: { prop: "myForm", event: "getForm" }, model: { prop: "myForm", event: "getForm" },
props: { myForm: { type: Object, default: () => {} } }, props: { myForm: { type: Object, default: () => {} }, robotId: "" },
components: { BaseRadio }, components: { BaseRadio },
watch: { watch: {
form() { form() {
@ -465,6 +467,32 @@ export default {
)[0].content; )[0].content;
console.log(result, "source"); console.log(result, "source");
return result; return result;
},
updateTrend() {
this.$http
.post("/Api/Signal/ReceiveSignal", {
NotifyType: this.NotifyType,
Symbol: this.form.Symbol,
KLinePeriodic: this.form.PeriodicSignal,
ClosePrice: this.ClosePrice,
RobotId: this.robotId,
IsDebug: true
})
.then(res => {
if (res.Code == 200) {
this.sMessage("success", "更新成功");
} else {
this.sMessage("danger", res.Message);
}
});
},
// showNotification
sMessage(type, message) {
this.$notify({
type: type,
message,
timeout: 1800
});
} }
} }
}; };

2
src/components/SidebarPlugin/SideBar.vue

File diff suppressed because one or more lines are too long

15
src/main.js

@ -20,7 +20,17 @@ import router from "./router/index";
import BlackDashboard from "./plugins/blackDashboard"; import BlackDashboard from "./plugins/blackDashboard";
import AxiosPlugin from "./utils/plugin/axios-plugin"; import AxiosPlugin from "./utils/plugin/axios-plugin";
import { Table, TableColumn, Tooltip, Switch,Select,Option } from "element-ui"; import {
Table,
TableColumn,
Tooltip,
Switch,
Select,
Option,
Tabs,
TabPane,
Pagination
} from "element-ui";
import "element-ui/lib/theme-chalk/index.css"; import "element-ui/lib/theme-chalk/index.css";
import i18n from "./i18n"; import i18n from "./i18n";
import "./registerServiceWorker"; import "./registerServiceWorker";
@ -34,6 +44,9 @@ Vue.use(Tooltip);
Vue.use(Switch); Vue.use(Switch);
Vue.use(Select); Vue.use(Select);
Vue.use(Option); Vue.use(Option);
Vue.use(Tabs);
Vue.use(TabPane);
Vue.use(Pagination);
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
router, router,

84
src/pages/Robot/edit.vue

@ -1,20 +1,65 @@
<template> <template>
<div> <div>
<movement-policy-form v-model="form"> </movement-policy-form> <el-tabs v-model="activeName">
<base-button slot="footer" type="primary" fill @click="saveRobotSetting" <el-tab-pane label="策略编辑" name="first">
>Save</base-button <div>
<movement-policy-form v-model="form" :robotId="RobotId">
</movement-policy-form>
<base-button
slot="footer"
type="primary"
fill
@click="confirmVisible = true"
>保存设置</base-button
> >
</div> </div>
</el-tab-pane>
<el-tab-pane label="订单详情" name="second"
><Order :RobotId="RobotId"
/></el-tab-pane>
<el-tab-pane label="交易日志" name="third"
><Log :RobotId="RobotId"
/></el-tab-pane>
</el-tabs>
<!-- 编辑页配置提醒 -->
<modal :show.sync="confirmVisible">
<template slot="header">
<h5 class="modal-title" id="exampleModalLabel">温馨提示</h5>
</template>
<div>
是否清除本轮购买参数?
</div>
<template slot="footer">
<base-button type="secondary" @click="saveRobotSetting(false)"
></base-button
>
<base-button type="primary" @click="saveRobotSetting(true)"
></base-button
>
</template>
</modal>
</div>
</template> </template>
<script> <script>
import MovementPolicyForm from "@/components/MovementPolicyForm"; import MovementPolicyForm from "@/components/MovementPolicyForm";
import { Modal } from "@/components";
import Order from "./order";
import Log from "./log";
export default { export default {
data() { data() {
return { form: {}, RobotId: "" }; return {
form: {},
RobotId: "",
confirmVisible: false,
activeName: "first"
};
}, },
components: { components: {
MovementPolicyForm MovementPolicyForm,
Modal,
Order,
Log
}, },
created() { created() {
console.log(this.$route, this.$router); console.log(this.$route, this.$router);
@ -29,20 +74,21 @@ export default {
methods: { methods: {
saveRobotSetting(isClearCurrentRoundPurchaseInfo) { saveRobotSetting(isClearCurrentRoundPurchaseInfo) {
console.log(this.form); console.log(this.form);
// this.$http this.$http
// .put("/Api/MomentumWavePolicy/Edit", { .put("/Api/MomentumWavePolicy/Edit", {
// ...this.form, ...this.form,
// MinTradePrice: this.form.lowestPrice, MinTradePrice: this.form.lowestPrice,
// isClearCurrentRoundPurchaseInfo, isClearCurrentRoundPurchaseInfo,
// RobotId: this.RobotId RobotId: this.RobotId
// }) })
// .then(res => { .then(res => {
// if (res.Code == 200) { this.confirmVisible = false;
// this.sMessage("success", ""); if (res.Code == 200) {
// } else { this.sMessage("success", "设置成功");
// this.sMessage("danger", res.Message); } else {
// } this.sMessage("danger", res.Message);
// }); }
});
}, },
// showNotification // showNotification
sMessage(type, message) { sMessage(type, message) {

148
src/pages/Robot/log.vue

@ -0,0 +1,148 @@
<template>
<custom-base-table
:data="data"
:columns="columns"
thead-classes="text-primary"
>
<template slot="LogType" slot-scope="item">
{{ typeRender(item.row.item.LogType) }}
</template>
</custom-base-table>
</template>
<script>
import Bus from "../../common/bus";
import CustomBaseTable from "../../components/CustomBaseTable";
import moment from "moment";
export default {
props: {
RobotId: { type: String, default: "60521323-28C3-AC14-0076-48B075584510" }
},
components: { CustomBaseTable },
data() {
return {
columns: [
{ name: "RobotId", prop: "RobotId" },
{ name: "内容", prop: "Content" },
{
name: "日志类型",
prop: "LogType",
customSlot: "LogType"
},
{
name: "订单Id",
prop: "SpotGoodsOrderId"
},
{ name: "创建时间", prop: "CreateTime" }
],
data: [],
noMoreData: false,
endTime: null,
scrollInstance: null,
nullPlusTime: 0
};
},
created() {
let endTime = moment();
this.endTime = endTime;
this.getLatestLog(endTime);
},
mounted() {
Bus.$on("tradeLog", data => {
console.log(data, "received from ws Bus");
this.data.unshift(data);
});
this.initScroller();
},
destroyed() {
if (this.scrollInstance)
this.scrollInstance.removeEventListener("scroll", this.scrollerListener);
},
methods: {
initScroller() {
let target = document.getElementById("tradeLog");
this.scrollInstance = target;
this.scrollInstance.addEventListener(
"scroll",
this.scrollerListener,
false
);
},
getPreday() {},
scrollerListener() {
// console.log(
// this.scrollInstance.scrollTop,
// this.scrollInstance.scrollHeight,
// this.scrollInstance.clientHeight
// );
if (
this.scrollInstance.scrollTop + this.scrollInstance.clientHeight ==
this.scrollInstance.scrollHeight
) {
if (!this.spinning && !this.noMoreData) this.getLatestLog(this.endTime);
}
},
typeRender(logType) {
switch (logType) {
case 0:
return "买入";
case 1:
return "卖出";
case 2:
return "做多";
case 3:
return "做空";
case 4:
return "大趋势看多";
case 5:
return "大趋势看空";
case 10:
return "自动卖出";
}
},
getLatestLog(endTime) {
this.spinning = true;
let _endTime = endTime.format("YYYY-MM-DD HH:mm:ss");
this.$http
.get(
`/Api/ExecutionLog/GetList?robotId=${this.RobotId}&endTime=${_endTime}`
)
.then(res => {
this.spinning = false;
if (res.Code == 200) {
if (res.Data.length > 0) {
if (this.data.length > 0) {
res.Data.forEach(item => this.data.push(item));
this.endTime = moment(
this.data[this.data.length - 1].CreateTime
);
} else {
this.data = res.Data;
}
} else {
this.noMoreData = true;
this.sMessage("danger", "已经没有更多日志了");
}
}
});
},
// showNotification
sMessage(type, message) {
this.$notify({
type: type,
message,
timeout: 1800
});
}
}
};
</script>
<style scoped></style>

350
src/pages/Robot/order.vue

@ -0,0 +1,350 @@
<template>
<card>
<el-tabs v-model="activeName">
<el-tab-pane label="历史订单" name="first">
<custom-base-table
:data="historyOrders"
:columns="OrderColumns.filter(item => !item.hidden)"
thead-classes="text-primary"
></custom-base-table>
<el-pagination
small
:hide-on-single-page="true"
layout="prev, pager, next"
:total="historyOrdersPagination.total"
:page-size="historyOrdersPagination.pageSize"
:current-page="historyOrdersPagination.current"
>
</el-pagination>
</el-tab-pane>
<el-tab-pane label="持仓订单" name="second">
<custom-base-table
:data="nowOrders"
:columns="OrderColumns"
thead-classes="text-primary"
></custom-base-table>
</el-tab-pane>
</el-tabs>
<card>
<h5 slot="header" class="title">账号配置信息</h5>
<div class="row">
<div class="col-md-3">
<base-input v-model="basic.CoinCount" label="持币数量" disabled>
</base-input>
</div>
<div class="col-md-3">
<base-input
v-model="basic.TotalPurchasePrice"
label="持仓总价"
disabled
>
</base-input>
</div>
<div class="col-md-3">
<base-input
v-model="basic.AvgPurchasePrice"
label="持仓均价"
disabled
>
</base-input>
</div>
<div class="col-md-3">
<base-input
v-model="basic.TotalPurchasePriceRatio"
label="持仓占比(%)"
disabled
>
</base-input>
</div>
<div class="col-md-3">
<base-input v-model="basic.FloatingPL" label="浮动盈亏(%)" disabled>
</base-input>
</div>
<div class="col-md-3">
<base-input
v-model="basic.TotalPurchasePriceProfit"
label="浮动持仓利润(已预扣手续费)"
disabled
>
</base-input>
</div>
<div class="col-md-3">
<base-input
v-model="basic.TotalProfit"
label="总利润(已预扣手续费)"
disabled
>
</base-input>
</div>
<div class="col-md-3">
<base-input v-model="basic.NewestPrice" label="最新成交价" disabled>
</base-input>
</div>
</div>
</card>
</card>
</template>
<script>
import { OrderColumns } from "../../pages/prePages/js/columns";
import CustomBaseTable from "../../components/CustomBaseTable";
import Bus from "../../common/bus";
import {
sendSock,
initWebSocket,
closeWebSocket
} from "../../utils/plugin/socket";
const S_PING = 100;
const R_PONG = 101;
const SUBSCRIBE = 102;
const ACCOUNT_INFO = 103;
const ORDER_PUBLISH = 104;
const TRADE_LOG = 105;
export default {
components: { CustomBaseTable },
props: {
RobotId: { type: String, default: "60521323-28C3-AC14-0076-48B075584510" }
},
data() {
return {
activeName: "first",
OrderColumns,
historyOrders: [],
nowOrders: [],
basic: {},
historyOrdersPagination: { current: 1, pageSize: 15 },
pingInterval: null
};
},
created() {
this.initOrders(); //
},
mounted() {
console.log("connecting");
this.initWs(); //ws
},
beforeDestroy() {
closeWebSocket();
localStorage.clear();
clearInterval(this.pingInterval);
},
methods: {
initOrders() {
this.initHistoryOrders();
this.initNowOrders();
},
initHistoryOrders() {
let pageIndex = this.historyOrdersPagination.current;
let pageSize = this.historyOrdersPagination.pageSize;
this.$http
.get(
`/Api/Order/GetHistorySpotGoodsOrder?pageIndex=${pageIndex}&pageSize=${pageSize}&robotId=${this.RobotId}`
)
.then(res => {
if (res.Code == 200) {
this.historyOrders = res.Data.List;
const pager = { ...this.historyOrdersPagination };
pager.total = res.Data.Count;
this.historyOrdersPagination = pager;
}
});
},
//
historyOrdersChange(pagination) {
this.historyOrdersPagination = pagination;
this.initHistoryOrders();
},
initNowOrders() {
this.$http
.get(`/Api/Order/GetRuningSpotGoodsOrder?robotId=${this.RobotId}`)
.then(res => {
if (res.Code == 200) {
this.nowOrders = res.Data;
}
});
},
initWs() {
let that = this;
initWebSocket("ws://54.249.164.224").then(
rs => {
//
sendSock(
{
Notify: SUBSCRIBE,
RobotId: this.RobotId
},
that.wsCb
);
//ping
that.pingIntervalKeeper();
},
rj => {
that.$message.error("连接websocket失败,正在重连");
that.initWs();
}
);
},
wsCb(data) {
console.log("ws received", data);
if (data && data.Notify == ACCOUNT_INFO) {
this.dealAccountInfo(data);
} else if (data && data.Notify == ORDER_PUBLISH) {
this.dealOrder(data);
} else if (data && data.Notify == R_PONG) {
this.dealPong(data);
} else if (data && data.Notify == TRADE_LOG) {
Bus.$emit("tradeLog", data);
}
},
pingPkg() {
console.log("心跳包检测发送");
let timeStamp = Date.now();
let that = this;
sendSock(
{
Notify: S_PING,
TimeStamp: timeStamp
},
that.wsCb
);
localStorage.setItem("pingTimeStamp", timeStamp);
if (!localStorage.getItem("missPkg")) {
localStorage.setItem("missPkg", 1);
} else {
let missPkgCount = parseInt(localStorage.getItem("missPkg")) + 1;
localStorage.setItem("missPkg", missPkgCount);
console.log("丢包次数增加1", missPkgCount);
if (missPkgCount > 3) {
/**
* 1.停止ping包interval
* 2.关闭ws
* 3.重新获取订单列表
*/
console.log("达到丢包次数", missPkgCount);
clearInterval(this.pingInterval);
localStorage.clear();
closeWebSocket();
this.initOrders();
this.initWs();
}
}
},
//ping
pingIntervalKeeper() {
let that = this;
that.pingPkg();
this.pingInterval = setInterval(() => {
that.pingPkg();
}, 30000);
},
//pong
dealPong(data) {
//pongtimeStamp-1
let timeStamp = localStorage.getItem("pingTimeStamp");
let missPkgCount = parseInt(localStorage.getItem("missPkg"));
if (data.TimeStamp == timeStamp) {
missPkgCount--;
console.log("丢包次数减少1", missPkgCount);
localStorage.setItem("missPkg", missPkgCount);
}
},
//
dealAccountInfo(data) {
this.basic = { ...this.basic, ...data };
if (
this.nowOrders.length > 0 &&
data.NewestPrice &&
data.NewestPrice != 0
) {
this.nowOrders.forEach(item => {
let totalSalePrice = data.NewestPrice * item.PurchaseCoinCount; //
let saleFee = totalSalePrice * 0.02; //
let Profit =
totalSalePrice -
item.TotalPurchasePrice -
saleFee -
item.PurchaseFee;
item.Profit = Profit.toFixed(5); //
item.UnstableProfit = (
(data.NewestPrice / item.PurchasePrice - 1) *
100
).toFixed(5); //
// console.log(item.UnstableProfit, "");
});
}
},
//
dealOrder(data) {
//4|| 6
let targetIndex = -1;
for (let i = 0; i < this.nowOrders.length; i++) {
if (data.Id == this.nowOrders[i].Id) {
targetIndex = i;
break;
}
}
if (targetIndex == -1) {
this.nowOrders.push(data);
} else {
this.nowOrders[targetIndex] = {
...this.nowOrders[targetIndex],
...data
};
if (data.Status == 4 || data.Status == 6) {
this.nowOrders.splice(targetIndex, 1);
if (this.historyOrdersPagination.current == 1)
this.initHistoryOrders();
}
}
},
statusRender(status) {
//=0,=1,=2,=3,=4,=5,=6,=7,=8
switch (status) {
case 0:
return "已创建";
case 1:
return "部分购买";
case 2:
return "已购买";
case 3:
return "部分购买被撤销";
case 4:
return "购买被撤销";
case 5:
return "部分卖出";
case 6:
return "已卖出";
case 7:
return "部分卖出已撤销";
case 8:
return "卖出已撤销";
}
}
}
};
</script>
<style>
.el-pagination button:disabled {
background-color: transparent;
}
.el-pager li {
background-color: transparent;
}
</style>

262
src/pages/prePages/js/columns.js

@ -1,223 +1,223 @@
export const OrderColumns = [ export const OrderColumns = [
{ {
title: "利润", name: "利润",
dataIndex: "Profit", prop: "Profit",
key: "Profit", key: "Profit",
scopedSlots: { customRender: "Profit" }, customSlot: "Profit"
}, },
{ {
title: "购买成交量", name: "购买成交量",
dataIndex: "PurchaseCoinCount", prop: "PurchaseCoinCount",
key: "PurchaseCoinCount", key: "PurchaseCoinCount"
}, },
{ title: "购买手续费", dataIndex: "PurchaseFee", key: "PurchaseFee" }, { name: "购买手续费", prop: "PurchaseFee", key: "PurchaseFee" },
{ title: "购买成交价", dataIndex: "PurchasePrice", key: "PurchasePrice" }, { name: "购买成交价", prop: "PurchasePrice", key: "PurchasePrice" },
{ {
title: "购买成交次数", name: "购买成交次数",
dataIndex: "PurchaseTradeCount", prop: "PurchaseTradeCount",
key: "PurchaseTradeCount", key: "PurchaseTradeCount"
}, },
{ title: "机器人名称", dataIndex: "RobotName", key: "RobotName" }, { name: "机器人名称", prop: "RobotName", key: "RobotName" },
{ title: "销售成交量", dataIndex: "SaleCoinCount", key: "SaleCoinCount" }, { name: "销售成交量", prop: "SaleCoinCount", key: "SaleCoinCount" },
{ title: "销售手续费", dataIndex: "SaleFee", key: "SaleFee" }, { name: "销售手续费", prop: "SaleFee", key: "SaleFee" },
{ title: "销售成交价", dataIndex: "SalePrice", key: "SalePrice" }, { name: "销售成交价", prop: "SalePrice", key: "SalePrice" },
{ title: "销售成交次数", dataIndex: "SaleTradeCount", key: "SaleTradeCount" }, { name: "销售成交次数", prop: "SaleTradeCount", key: "SaleTradeCount" },
{ {
title: "订单状态", name: "订单状态",
dataIndex: "Status", prop: "Status",
key: "Status", key: "Status",
scopedSlots: { customRender: "status" }, customSlot: "status"
}, },
{ title: "订单交易对", dataIndex: "Symbol", key: "Symbol" }, { name: "订单交易对", prop: "Symbol", key: "Symbol" },
{ {
title: "订单购买总价", name: "订单购买总价",
dataIndex: "TotalPurchasePrice", prop: "TotalPurchasePrice",
key: "TotalPurchasePrice", key: "TotalPurchasePrice"
}, },
{ title: "订单销售总价", dataIndex: "TotalSalePrice", key: "TotalSalePrice" }, { name: "订单销售总价", prop: "TotalSalePrice", key: "TotalSalePrice" },
{ {
title: "浮动盈亏", name: "浮动盈亏",
dataIndex: "UnstableProfit", prop: "UnstableProfit",
key: "UnstableProfit", key: "UnstableProfit",
scopedSlots: { customRender: "UnstableProfit" }, customSlot: "UnstableProfit",
hidden: true, hidden: true
}, },
{ {
title: "最后购买交易时间", name: "最后购买交易时间",
dataIndex: "LastPurchaseTradeTime", prop: "LastPurchaseTradeTime",
key: "LastPurchaseTradeTime", key: "LastPurchaseTradeTime"
}, },
{ {
title: "最后交易时间", name: "最后交易时间",
dataIndex: "LastSaleTradeTime", prop: "LastSaleTradeTime",
key: "LastSaleTradeTime", key: "LastSaleTradeTime"
}, },
{ {
title: "挂单时间", name: "挂单时间",
dataIndex: "CreateTime", prop: "CreateTime",
key: "CreateTime", key: "CreateTime"
}, }
]; ];
export const RobotColumns = [ export const RobotColumns = [
{ {
title: "机器人名称", name: "机器人名称",
dataIndex: "Robot.Name", prop: "Robot.Name",
key: "Robot.Name", key: "Robot.Name"
}, },
{ title: "货币对", dataIndex: "Robot.Symbol", key: "Robot.Symbol" }, { name: "货币对", prop: "Robot.Symbol", key: "Robot.Symbol" },
{ {
title: "运行状态", name: "运行状态",
dataIndex: "Robot.Status", prop: "Robot.Status",
key: "Robot.Status", key: "Robot.Status",
scopedSlots: { customRender: "Status" }, customSlot: "Status"
}, },
{ {
title: "只卖", name: "只卖",
dataIndex: "WaveBandPolicy.IsEnabledBuySignal", prop: "WaveBandPolicy.IsEnabledBuySignal",
key: "WaveBandPolicy.IsEnabledBuySignal", key: "WaveBandPolicy.IsEnabledBuySignal",
scopedSlots: { customRender: "OnlySale" }, customSlot: "OnlySale"
}, },
{ {
title: "持仓费用", name: "持仓费用",
dataIndex: "RobotAccount.TotalPurchasePrice", prop: "RobotAccount.TotalPurchasePrice",
key: "RobotAccount.TotalPurchasePrice", key: "RobotAccount.TotalPurchasePrice"
}, },
{ {
title: "持仓均价", name: "持仓均价",
dataIndex: "RobotAccount.AvgPurchasePrice", prop: "RobotAccount.AvgPurchasePrice",
key: "RobotAccount.AvgPurchasePrice", key: "RobotAccount.AvgPurchasePrice"
}, },
{ {
title: "浮动盈亏", name: "浮动盈亏",
dataIndex: "RobotAccount.FloatingPL", prop: "RobotAccount.FloatingPL",
key: "RobotAccount.FloatingPL", key: "RobotAccount.FloatingPL"
}, },
{ {
title: "总利润", name: "总利润",
dataIndex: "RobotAccount.TotalProfit", prop: "RobotAccount.TotalProfit",
key: "RobotAccount.TotalProfit", key: "RobotAccount.TotalProfit"
}, },
{ {
title: "配置", name: "配置",
dataIndex: "Robot.CommonSetting", prop: "Robot.CommonSetting",
key: "Robot.CommonSetting", key: "Robot.CommonSetting",
scopedSlots: { customRender: "CommonSetting" }, customSlot: "CommonSetting"
}, },
{ {
title: "周期指标", name: "周期指标",
dataIndex: "Robot.IntervalSetting", prop: "Robot.IntervalSetting",
key: "Robot.IntervalSetting", key: "Robot.IntervalSetting",
scopedSlots: { customRender: "IntervalSetting" }, customSlot: "IntervalSetting"
}, },
{ {
title: "卖出设置", name: "卖出设置",
dataIndex: "Robot.SaleSetting", prop: "Robot.SaleSetting",
key: "Robot.SaleSetting", key: "Robot.SaleSetting",
scopedSlots: { customRender: "SaleSetting" }, customSlot: "SaleSetting"
}, },
{ {
title: "操作", name: "操作",
dataIndex: "action", prop: "action",
key: "action", key: "action",
scopedSlots: { customRender: "Action" }, customSlot: "Action"
}, }
]; ];
export const AccountColumns = [ export const AccountColumns = [
{ {
title: "账号名称", name: "账号名称",
dataIndex: "Name", prop: "Name",
key: "Name", key: "Name"
}, },
{ {
title: "账号AccessKey", name: "账号AccessKey",
dataIndex: "AccessKey", prop: "AccessKey",
key: "AccessKey", key: "AccessKey"
}, },
{ {
title: "账号SecretKey", name: "账号SecretKey",
dataIndex: "SecretKey", prop: "SecretKey",
key: "SecretKey", key: "SecretKey"
}, },
{ {
title: "帐号类型", name: "帐号类型",
dataIndex: "AccountType", prop: "AccountType",
key: "AccountType", key: "AccountType",
scopedSlots: { customRender: "AccountType" }, customSlot: "AccountType"
}, },
{ {
title: "创建时间", name: "创建时间",
dataIndex: "CreateTime", prop: "CreateTime",
key: "CreateTime", key: "CreateTime"
}, }
]; ];
export const tradeColumns = [ export const tradeColumns = [
{ {
title: "ID", name: "ID",
dataIndex: "Id", prop: "Id",
key: "Id", key: "Id"
}, },
{ {
title: "类型", name: "类型",
dataIndex: "OrderType", prop: "OrderType",
key: "OrderType", key: "OrderType",
scopedSlots: { customRender: "OrderType" }, customSlot: "OrderType"
}, },
{ {
title: "时间", name: "时间",
dataIndex: "purchaseKLineId", prop: "purchaseKLineId",
key: "purchaseKLineId", key: "purchaseKLineId",
scopedSlots: { customRender: "KLineId" }, customSlot: "KLineId"
}, },
{ {
title: "价格", name: "价格",
dataIndex: "Price", prop: "Price",
key: "Price", key: "Price",
scopedSlots: { customRender: "Price" }, customSlot: "Price"
}, },
{ {
title: "数量", name: "数量",
dataIndex: "Count", prop: "Count",
key: "Count", key: "Count",
scopedSlots: { customRender: "Count" }, customSlot: "Count"
}, },
{ {
title: "最大浮亏", name: "最大浮亏",
dataIndex: "MaxLossRatio", prop: "MaxLossRatio",
key: "MaxLossRatio", key: "MaxLossRatio",
scopedSlots: { customRender: "MaxLossRatio" }, customSlot: "MaxLossRatio"
}, },
{ {
title: "盈亏", name: "盈亏",
dataIndex: "Profit", prop: "Profit",
key: "Profit", key: "Profit",
scopedSlots: { customRender: "Profit" }, customSlot: "Profit"
}, },
{ {
title: "累计盈亏", name: "累计盈亏",
dataIndex: "TotalProfit", prop: "TotalProfit",
key: "TotalProfit", key: "TotalProfit",
scopedSlots: { customRender: "TotalProfit" }, customSlot: "TotalProfit"
}, }
]; ];
export const logColumns = [ export const logColumns = [
{ {
title: "订单ID", name: "订单ID",
dataIndex: "SpotGoodsOrderId", prop: "SpotGoodsOrderId",
key: "SpotGoodsOrderId", key: "SpotGoodsOrderId"
}, },
{ {
title: "内容", name: "内容",
dataIndex: "Content", prop: "Content",
key: "Content", key: "Content"
}, },
{ {
title: "日志类型", name: "日志类型",
dataIndex: "LogType", prop: "LogType",
key: "LogType", key: "LogType",
width: 150, width: 150,
filters: [ filters: [
@ -228,20 +228,20 @@ export const logColumns = [
{ text: "大趋势看多", value: 4 }, { text: "大趋势看多", value: 4 },
{ text: "大趋势看空", value: 5 }, { text: "大趋势看空", value: 5 },
{ text: "自动卖出", value: 10 }, { text: "自动卖出", value: 10 },
{ text: "自动卖出(趋势收益)", value: 11 }, { text: "自动卖出(趋势收益)", value: 11 }
], ],
onFilter: (value, record) => record.LogType == value, onFilter: (value, record) => record.LogType == value,
scopedSlots: { customRender: "LogType" }, customSlot: "LogType"
}, },
{ {
title: "机器人ID", name: "机器人ID",
dataIndex: "RobotId", prop: "RobotId",
key: "RobotId", key: "RobotId"
}, },
{ {
title: "创建时间", name: "创建时间",
dataIndex: "CreateTime", prop: "CreateTime",
key: "CreateTime", key: "CreateTime"
}, }
]; ];

Loading…
Cancel
Save