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. 106
      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>
</div>
<div class="col-md-3">
<base-button type="primary" fill>更新</base-button>
<base-button type="primary" fill @click="updateTrend"
>更新</base-button
>
</div>
</div>
</card>
@ -366,7 +368,7 @@ import {
import BaseRadio from "@/components/BaseRadio.vue";
export default {
model: { prop: "myForm", event: "getForm" },
props: { myForm: { type: Object, default: () => {} } },
props: { myForm: { type: Object, default: () => {} }, robotId: "" },
components: { BaseRadio },
watch: {
form() {
@ -465,6 +467,32 @@ export default {
)[0].content;
console.log(result, "source");
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 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 i18n from "./i18n";
import "./registerServiceWorker";
@ -34,6 +44,9 @@ Vue.use(Tooltip);
Vue.use(Switch);
Vue.use(Select);
Vue.use(Option);
Vue.use(Tabs);
Vue.use(TabPane);
Vue.use(Pagination);
/* eslint-disable no-new */
new Vue({
router,

106
src/pages/Robot/edit.vue

@ -1,48 +1,94 @@
<template>
<div>
<movement-policy-form v-model="form"> </movement-policy-form>
<base-button slot="footer" type="primary" fill @click="saveRobotSetting"
>Save</base-button
>
<el-tabs v-model="activeName">
<el-tab-pane label="策略编辑" name="first">
<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>
</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>
<script>
import MovementPolicyForm from "@/components/MovementPolicyForm";
import { Modal } from "@/components";
import Order from "./order";
import Log from "./log";
export default {
data() {
return { form: {}, RobotId: "" };
return {
form: {},
RobotId: "",
confirmVisible: false,
activeName: "first"
};
},
components: {
MovementPolicyForm
MovementPolicyForm,
Modal,
Order,
Log
},
created() {
console.log(this.$route, this.$router);
this.RobotId = this.$route.params.id;
this.$http
.get("/Api/MomentumWavePolicy/Get?robotId=" + this.RobotId)
.then(res => {
this.form = { ...this.form, ...res.Data };
console.log("this.form", this.form);
});
},
created() {
console.log(this.$route, this.$router);
this.RobotId = this.$route.params.id;
this.$http
.get("/Api/MomentumWavePolicy/Get?robotId=" + this.RobotId)
.then(res => {
this.form = { ...this.form, ...res.Data };
console.log("this.form", this.form);
});
},
methods: {
saveRobotSetting(isClearCurrentRoundPurchaseInfo) {
console.log(this.form);
// this.$http
// .put("/Api/MomentumWavePolicy/Edit", {
// ...this.form,
// MinTradePrice: this.form.lowestPrice,
// isClearCurrentRoundPurchaseInfo,
// RobotId: this.RobotId
// })
// .then(res => {
// if (res.Code == 200) {
// this.sMessage("success", "");
// } else {
// this.sMessage("danger", res.Message);
// }
// });
this.$http
.put("/Api/MomentumWavePolicy/Edit", {
...this.form,
MinTradePrice: this.form.lowestPrice,
isClearCurrentRoundPurchaseInfo,
RobotId: this.RobotId
})
.then(res => {
this.confirmVisible = false;
if (res.Code == 200) {
this.sMessage("success", "设置成功");
} else {
this.sMessage("danger", res.Message);
}
});
},
// showNotification
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 = [
{
title: "利润",
dataIndex: "Profit",
name: "利润",
prop: "Profit",
key: "Profit",
scopedSlots: { customRender: "Profit" },
customSlot: "Profit"
},
{
title: "购买成交量",
dataIndex: "PurchaseCoinCount",
key: "PurchaseCoinCount",
name: "购买成交量",
prop: "PurchaseCoinCount",
key: "PurchaseCoinCount"
},
{ title: "购买手续费", dataIndex: "PurchaseFee", key: "PurchaseFee" },
{ title: "购买成交价", dataIndex: "PurchasePrice", key: "PurchasePrice" },
{ name: "购买手续费", prop: "PurchaseFee", key: "PurchaseFee" },
{ name: "购买成交价", prop: "PurchasePrice", key: "PurchasePrice" },
{
title: "购买成交次数",
dataIndex: "PurchaseTradeCount",
key: "PurchaseTradeCount",
name: "购买成交次数",
prop: "PurchaseTradeCount",
key: "PurchaseTradeCount"
},
{ title: "机器人名称", dataIndex: "RobotName", key: "RobotName" },
{ title: "销售成交量", dataIndex: "SaleCoinCount", key: "SaleCoinCount" },
{ title: "销售手续费", dataIndex: "SaleFee", key: "SaleFee" },
{ title: "销售成交价", dataIndex: "SalePrice", key: "SalePrice" },
{ title: "销售成交次数", dataIndex: "SaleTradeCount", key: "SaleTradeCount" },
{ name: "机器人名称", prop: "RobotName", key: "RobotName" },
{ name: "销售成交量", prop: "SaleCoinCount", key: "SaleCoinCount" },
{ name: "销售手续费", prop: "SaleFee", key: "SaleFee" },
{ name: "销售成交价", prop: "SalePrice", key: "SalePrice" },
{ name: "销售成交次数", prop: "SaleTradeCount", key: "SaleTradeCount" },
{
title: "订单状态",
dataIndex: "Status",
name: "订单状态",
prop: "Status",
key: "Status",
scopedSlots: { customRender: "status" },
customSlot: "status"
},
{ title: "订单交易对", dataIndex: "Symbol", key: "Symbol" },
{ name: "订单交易对", prop: "Symbol", key: "Symbol" },
{
title: "订单购买总价",
dataIndex: "TotalPurchasePrice",
key: "TotalPurchasePrice",
name: "订单购买总价",
prop: "TotalPurchasePrice",
key: "TotalPurchasePrice"
},
{ title: "订单销售总价", dataIndex: "TotalSalePrice", key: "TotalSalePrice" },
{ name: "订单销售总价", prop: "TotalSalePrice", key: "TotalSalePrice" },
{
title: "浮动盈亏",
dataIndex: "UnstableProfit",
name: "浮动盈亏",
prop: "UnstableProfit",
key: "UnstableProfit",
scopedSlots: { customRender: "UnstableProfit" },
hidden: true,
customSlot: "UnstableProfit",
hidden: true
},
{
title: "最后购买交易时间",
dataIndex: "LastPurchaseTradeTime",
key: "LastPurchaseTradeTime",
name: "最后购买交易时间",
prop: "LastPurchaseTradeTime",
key: "LastPurchaseTradeTime"
},
{
title: "最后交易时间",
dataIndex: "LastSaleTradeTime",
key: "LastSaleTradeTime",
name: "最后交易时间",
prop: "LastSaleTradeTime",
key: "LastSaleTradeTime"
},
{
title: "挂单时间",
dataIndex: "CreateTime",
key: "CreateTime",
},
name: "挂单时间",
prop: "CreateTime",
key: "CreateTime"
}
];
export const RobotColumns = [
{
title: "机器人名称",
dataIndex: "Robot.Name",
key: "Robot.Name",
name: "机器人名称",
prop: "Robot.Name",
key: "Robot.Name"
},
{ title: "货币对", dataIndex: "Robot.Symbol", key: "Robot.Symbol" },
{ name: "货币对", prop: "Robot.Symbol", key: "Robot.Symbol" },
{
title: "运行状态",
dataIndex: "Robot.Status",
name: "运行状态",
prop: "Robot.Status",
key: "Robot.Status",
scopedSlots: { customRender: "Status" },
customSlot: "Status"
},
{
title: "只卖",
dataIndex: "WaveBandPolicy.IsEnabledBuySignal",
name: "只卖",
prop: "WaveBandPolicy.IsEnabledBuySignal",
key: "WaveBandPolicy.IsEnabledBuySignal",
scopedSlots: { customRender: "OnlySale" },
customSlot: "OnlySale"
},
{
title: "持仓费用",
dataIndex: "RobotAccount.TotalPurchasePrice",
key: "RobotAccount.TotalPurchasePrice",
name: "持仓费用",
prop: "RobotAccount.TotalPurchasePrice",
key: "RobotAccount.TotalPurchasePrice"
},
{
title: "持仓均价",
dataIndex: "RobotAccount.AvgPurchasePrice",
key: "RobotAccount.AvgPurchasePrice",
name: "持仓均价",
prop: "RobotAccount.AvgPurchasePrice",
key: "RobotAccount.AvgPurchasePrice"
},
{
title: "浮动盈亏",
dataIndex: "RobotAccount.FloatingPL",
key: "RobotAccount.FloatingPL",
name: "浮动盈亏",
prop: "RobotAccount.FloatingPL",
key: "RobotAccount.FloatingPL"
},
{
title: "总利润",
dataIndex: "RobotAccount.TotalProfit",
key: "RobotAccount.TotalProfit",
name: "总利润",
prop: "RobotAccount.TotalProfit",
key: "RobotAccount.TotalProfit"
},
{
title: "配置",
dataIndex: "Robot.CommonSetting",
name: "配置",
prop: "Robot.CommonSetting",
key: "Robot.CommonSetting",
scopedSlots: { customRender: "CommonSetting" },
customSlot: "CommonSetting"
},
{
title: "周期指标",
dataIndex: "Robot.IntervalSetting",
name: "周期指标",
prop: "Robot.IntervalSetting",
key: "Robot.IntervalSetting",
scopedSlots: { customRender: "IntervalSetting" },
customSlot: "IntervalSetting"
},
{
title: "卖出设置",
dataIndex: "Robot.SaleSetting",
name: "卖出设置",
prop: "Robot.SaleSetting",
key: "Robot.SaleSetting",
scopedSlots: { customRender: "SaleSetting" },
customSlot: "SaleSetting"
},
{
title: "操作",
dataIndex: "action",
name: "操作",
prop: "action",
key: "action",
scopedSlots: { customRender: "Action" },
},
customSlot: "Action"
}
];
export const AccountColumns = [
{
title: "账号名称",
dataIndex: "Name",
key: "Name",
name: "账号名称",
prop: "Name",
key: "Name"
},
{
title: "账号AccessKey",
dataIndex: "AccessKey",
key: "AccessKey",
name: "账号AccessKey",
prop: "AccessKey",
key: "AccessKey"
},
{
title: "账号SecretKey",
dataIndex: "SecretKey",
key: "SecretKey",
name: "账号SecretKey",
prop: "SecretKey",
key: "SecretKey"
},
{
title: "帐号类型",
dataIndex: "AccountType",
name: "帐号类型",
prop: "AccountType",
key: "AccountType",
scopedSlots: { customRender: "AccountType" },
customSlot: "AccountType"
},
{
title: "创建时间",
dataIndex: "CreateTime",
key: "CreateTime",
},
name: "创建时间",
prop: "CreateTime",
key: "CreateTime"
}
];
export const tradeColumns = [
{
title: "ID",
dataIndex: "Id",
key: "Id",
name: "ID",
prop: "Id",
key: "Id"
},
{
title: "类型",
dataIndex: "OrderType",
name: "类型",
prop: "OrderType",
key: "OrderType",
scopedSlots: { customRender: "OrderType" },
customSlot: "OrderType"
},
{
title: "时间",
dataIndex: "purchaseKLineId",
name: "时间",
prop: "purchaseKLineId",
key: "purchaseKLineId",
scopedSlots: { customRender: "KLineId" },
customSlot: "KLineId"
},
{
title: "价格",
dataIndex: "Price",
name: "价格",
prop: "Price",
key: "Price",
scopedSlots: { customRender: "Price" },
customSlot: "Price"
},
{
title: "数量",
dataIndex: "Count",
name: "数量",
prop: "Count",
key: "Count",
scopedSlots: { customRender: "Count" },
customSlot: "Count"
},
{
title: "最大浮亏",
dataIndex: "MaxLossRatio",
name: "最大浮亏",
prop: "MaxLossRatio",
key: "MaxLossRatio",
scopedSlots: { customRender: "MaxLossRatio" },
customSlot: "MaxLossRatio"
},
{
title: "盈亏",
dataIndex: "Profit",
name: "盈亏",
prop: "Profit",
key: "Profit",
scopedSlots: { customRender: "Profit" },
customSlot: "Profit"
},
{
title: "累计盈亏",
dataIndex: "TotalProfit",
name: "累计盈亏",
prop: "TotalProfit",
key: "TotalProfit",
scopedSlots: { customRender: "TotalProfit" },
},
customSlot: "TotalProfit"
}
];
export const logColumns = [
{
title: "订单ID",
dataIndex: "SpotGoodsOrderId",
key: "SpotGoodsOrderId",
name: "订单ID",
prop: "SpotGoodsOrderId",
key: "SpotGoodsOrderId"
},
{
title: "内容",
dataIndex: "Content",
key: "Content",
name: "内容",
prop: "Content",
key: "Content"
},
{
title: "日志类型",
dataIndex: "LogType",
name: "日志类型",
prop: "LogType",
key: "LogType",
width: 150,
filters: [
@ -228,20 +228,20 @@ export const logColumns = [
{ text: "大趋势看多", value: 4 },
{ text: "大趋势看空", value: 5 },
{ text: "自动卖出", value: 10 },
{ text: "自动卖出(趋势收益)", value: 11 },
{ text: "自动卖出(趋势收益)", value: 11 }
],
onFilter: (value, record) => record.LogType == value,
scopedSlots: { customRender: "LogType" },
customSlot: "LogType"
},
{
title: "机器人ID",
dataIndex: "RobotId",
key: "RobotId",
name: "机器人ID",
prop: "RobotId",
key: "RobotId"
},
{
title: "创建时间",
dataIndex: "CreateTime",
key: "CreateTime",
},
name: "创建时间",
prop: "CreateTime",
key: "CreateTime"
}
];

Loading…
Cancel
Save