Browse Source

各种改动

master
lizhixin 4 years ago
parent
commit
14032ee411
  1. 2
      public/index.html
  2. 74
      src/App.vue
  3. 96
      src/pages/ReCheck/OrderTable.vue
  4. 15
      src/pages/ReCheck/index.vue
  5. 4
      src/pages/Robot/index.vue
  6. 171
      src/pages/RobotSec/Account.vue
  7. 22
      src/pages/prePages/js/columns.js
  8. 4
      src/utils/plugin/axios-plugin.js

2
public/index.html

@ -27,7 +27,7 @@
<link href="https://fonts.googleapis.com/css?family=Poppins:200,300,400,600,700,800" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Poppins:200,300,400,600,700,800" rel="stylesheet">
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet"> <link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
<!-- <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE"></script> --> <!-- <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE"></script> -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.4.0/css/bootstrap-rtl.css" rel="stylesheet" /> <!-- <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.4.0/css/bootstrap-rtl.css" rel="stylesheet" /> -->
</head> </head>
<body> <body>

74
src/App.vue

@ -41,4 +41,78 @@ export default {
.el-input { .el-input {
background-color: transparent; background-color: transparent;
} }
.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> </style>

96
src/pages/ReCheck/OrderTable.vue

@ -16,23 +16,32 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<div class="table-full-width table-responsive" style="height:500px">
<custom-base-table <el-table :data="data" height="600" class="customer-no-border-table">
:data="data" <el-table-column
:columns="columns" v-for="i in columns"
thead-classes="text-primary" :label="i.name"
:width="i.width || 160"
:prop="i.prop"
:key="i.prop"
> >
<template slot-scope="scope">
<!-- 卖卖类型 --> <!-- 卖卖类型 -->
<template slot="OrderType"> <div v-if="i.customSlot == 'OrderType'">
<p>买入</p> <p>买入</p>
<p>卖出</p> <p>卖出</p>
</template> </div>
<!-- 手持资金 -->
<div v-else-if="i.customSlot == 'CapitalAfter'">
<p>{{ scope.row.CapitalAfterPurchase || 0 }}</p>
<p>{{ scope.row.CapitalAfterSale || 0 }}</p>
</div>
<!-- 买卖时间 --> <!-- 买卖时间 -->
<template slot="KLineId" slot-scope="item"> <div v-else-if="i.customSlot == 'KLineId'">
<p> <p>
{{ {{
item.row.item.PurchaseKLineId scope.row.PurchaseKLineId
? moment(item.row.item.PurchaseKLineId * 1000).format( ? moment(scope.row.PurchaseKLineId * 1000).format(
"YYYY-MM-DD HH:mm:ss" "YYYY-MM-DD HH:mm:ss"
) )
: "-" : "-"
@ -40,52 +49,61 @@
</p> </p>
<p> <p>
{{ {{
item.row.item.SaleKLineId scope.row.SaleKLineId
? moment(item.row.item.SaleKLineId * 1000).format( ? moment(scope.row.SaleKLineId * 1000).format(
"YYYY-MM-DD HH:mm:ss" "YYYY-MM-DD HH:mm:ss"
) )
: "-" : "-"
}} }}
</p> </p>
</template> </div>
<!-- 买卖价格 --> <!-- 买卖价格 -->
<template slot="Price" slot-scope="item"> <div v-else-if="i.customSlot == 'Price'">
<p>{{ item.row.item.PurchasePrice || "-" }}</p> <p>{{ scope.row.PurchasePrice }}</p>
<p>{{ item.row.item.SalePrice || "-" }}</p> <p>{{ scope.row.SalePrice }}</p>
</template> </div>
<!-- 买卖数量 --> <!-- 买卖数量 -->
<template slot="Count" slot-scope="item"> <div v-else-if="i.customSlot == 'Count'">
<p>{{ item.row.item.PurchaseCoinCount || "-" }}</p> <p>{{ scope.row.PurchaseCoinCount || "-" }}</p>
<p>{{ item.row.item.SaleCoinCount || "-" }}</p> <p>{{ scope.row.SaleCoinCount || "-" }}</p>
</template> </div>
<!-- 成交总价 -->
<div v-else-if="i.customSlot == 'Total'">
<p>{{ scope.row.TotalPurchasePrice || "-" }}</p>
<p>{{ scope.row.TotalSalePrice || "-" }}</p>
</div>
<!-- 最大浮亏 --> <!-- 最大浮亏 -->
<template slot="MaxLossRatio" slot-scope="item"> <div v-else-if="i.customSlot == 'MaxLossRatio'">
<p>{{ item.row.item.MaxLossPrice || "-" }}</p> <p>{{ scope.row.MaxLossPrice || "-" }}</p>
<p>{{ item.row.item.MaxLossRatio || "-" }}%</p> <p>{{ scope.row.MaxLossRatio || "-" }}%</p>
</template> </div>
<!-- 盈亏 --> <!-- 盈亏 -->
<template slot="Profit" slot-scope="item"> <div v-else-if="i.customSlot == 'Profit'">
<p>{{ item.row.item.Profit }}</p> <p>{{ scope.row.Profit }}</p>
<p v-if="item.row.item.Profit"> <p v-if="scope.row.Profit">
{{ {{
( (
(item.row.item.Profit / item.row.item.TotalPurchasePrice) * (scope.row.Profit / scope.row.TotalPurchasePrice) *
100 100
).toFixed(2) ).toFixed(2)
}}% }}%
</p> </p>
<p v-else>-</p> <p v-else>-</p>
</template> </div>
<!-- 累计盈亏 --> <!-- 累计盈亏 -->
<template slot="TotalProfit" slot-scope="item"> <div v-else-if="i.customSlot == 'TotalProfit'">
<p>{{ item.row.item.TotalProfit }}</p> <p>{{ scope.row.TotalProfit }}</p>
<p v-if="item.row.item.TotalProfit"> <p v-if="scope.row.TotalProfit">
{{ item.row.item.TotalProfitRatio }}% {{ scope.row.TotalProfitRatio }}%
</p> </p>
<p v-else>-</p> <p v-else>-</p>
</template>
</custom-base-table>
</div> </div>
<div v-else>
<p>{{ scope.row[i.prop] }}</p>
</div>
</template>
</el-table-column>
</el-table>
</div> </div>
</template> </template>
@ -122,3 +140,9 @@ export default {
} }
}; };
</script> </script>
<style>
p {
word-break: break-all;
white-space: nowrap;
}
</style>

15
src/pages/ReCheck/index.vue

@ -133,8 +133,13 @@
v-model="trendForm" v-model="trendForm"
></move-trend> ></move-trend>
<div v-else-if="policyMode == 3"> <div v-else-if="policyMode == 3">
<base-input v-model="TradeCoinCount" label="币交易数量"> <base-input v-model="vTForm.TradeCoinCount" label="币交易数量">
</base-input> </base-input>
<div>
<base-checkbox inline v-model="vTForm.IsEnableAdditionalQuantity">
启用增购
</base-checkbox>
</div>
</div> </div>
<!-- <top-end-policy v-else v-model="policyFormData" /> --> <!-- <top-end-policy v-else v-model="policyFormData" /> -->
</el-tab-pane> </el-tab-pane>
@ -256,6 +261,7 @@ export default {
lineSelect: "", lineSelect: "",
tradeColumns, tradeColumns,
logColumns, logColumns,
vTForm: { TradeCoinCount: 10, IsEnableAdditionalQuantity: false },
logData: [], logData: [],
PositionFund: 1, PositionFund: 1,
RobotPolicyType, RobotPolicyType,
@ -765,7 +771,12 @@ export default {
// -end // -end
let params = let params =
this.policyMode == 3 this.policyMode == 3
? { TradeCoinCount: this.TradeCoinCount, SymbolList: newExcelData } ? {
TradeCoinCount: this.vTForm.TradeCoinCount,
IsEnableAdditionalQuantity: this.vTForm
.IsEnableAdditionalQuantity,
SymbolList: newExcelData
}
: { : {
Capital: this.trendForm, Capital: this.trendForm,
IsEnabledLimit: this.trendForm.IsEnabledLimit, IsEnabledLimit: this.trendForm.IsEnabledLimit,

4
src/pages/Robot/index.vue

@ -31,13 +31,13 @@
class="select-danger mb-4" class="select-danger mb-4"
style="width:100%" style="width:100%"
placeholder="选择关联账户" placeholder="选择关联账户"
v-model="form.StockAccountId" v-model="form.AccessKey"
> >
<el-option <el-option
v-for="item in accountList" v-for="item in accountList"
class="select-danger" class="select-danger"
:value="item.Id" :value="item.Id"
:label="`${item.Name}(${item.UseCount}/10)`" :label="`${item.AccessKey}(${item.UseCount}/1)`"
:key="item.Id" :key="item.Id"
> >
</el-option> </el-option>

171
src/pages/RobotSec/Account.vue

@ -12,7 +12,7 @@
<card> <card>
<el-table <el-table
size="mini" size="mini"
:data="props.row.subTable" :data="props.row.APIKeyList"
class="customer-no-border-table" class="customer-no-border-table"
> >
<el-table-column <el-table-column
@ -34,6 +34,14 @@
:prop="i.props" :prop="i.props"
:key="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>
<el-table-column> <el-table-column>
<template slot-scope="scope"> <template slot-scope="scope">
@ -62,7 +70,7 @@
<!-- 添加账户 --> <!-- 添加账户 -->
<modal <modal
:show.sync="modal.apiKeyVisible" :show.sync="modal.accountAddVisible"
body-classes="p-0" body-classes="p-0"
modal-classes="modal-dialog-centered modal-sm" modal-classes="modal-dialog-centered modal-sm"
> >
@ -74,9 +82,15 @@
> >
<template> <template>
<div class="text-muted text-center mb-3"> <div class="text-muted text-center mb-3">
<small>添加API Key</small> <small>添加账号</small>
</div> </div>
<form role="form"> <form role="form">
<base-input
label="登陆名"
placeholder="请填写登陆名"
v-model="apiKeyform.LoginName"
>
</base-input>
<base-input <base-input
label="账号AccessKey" label="账号AccessKey"
placeholder="请填写账号AccessKey" placeholder="请填写账号AccessKey"
@ -114,7 +128,7 @@
<base-button <base-button
type="primary" type="primary"
class="my-4" class="my-4"
@click="createRobot" @click="addAccount"
:loading="createLoading" :loading="createLoading"
>添加</base-button >添加</base-button
> >
@ -126,7 +140,7 @@
<!-- 添加账户 --> <!-- 添加账户 -->
<modal <modal
:show.sync="modal.accountAddVisible" :show.sync="modal.apiKeyVisible"
body-classes="p-0" body-classes="p-0"
modal-classes="modal-dialog-centered modal-sm" modal-classes="modal-dialog-centered modal-sm"
> >
@ -138,7 +152,7 @@
> >
<template> <template>
<div class="text-muted text-center mb-3"> <div class="text-muted text-center mb-3">
<small>添加账户</small> <small>添加ApiKey</small>
</div> </div>
<form role="form"> <form role="form">
<base-input <base-input
@ -159,7 +173,7 @@
<base-button <base-button
type="primary" type="primary"
class="my-4" class="my-4"
@click="createRobot" @click="addRobot"
:loading="createLoading" :loading="createLoading"
>添加</base-button >添加</base-button
> >
@ -249,7 +263,7 @@
<base-button <base-button
type="primary" type="primary"
class="my-4" class="my-4"
@click="createRobot" @click="transferMoney"
:loading="createLoading" :loading="createLoading"
>确定</base-button >确定</base-button
> >
@ -278,19 +292,19 @@
<script> <script>
const MainColumns = [ const MainColumns = [
{ label: "登录名", props: "account" }, { label: "登录名", props: "LoginName" },
{ label: "UID", props: "account1" }, { label: "UID", props: "UID" },
{ label: "账户类型", props: "account2" }, { label: "账户类型", props: "AccountType" },
{ label: "账户余额", props: "account3" }, { label: "账户余额", props: "Balance" },
{ label: "保底运营资金", props: "account4" },
{ label: "可转资金", props: "account5" } { label: "可转资金", props: "account5" }
]; ];
const SubColumns = [ const SubColumns = [
{ label: "API Key", props: "Apikey1" }, { label: "API Key", props: "AccessKey" },
{ label: "交易对", props: "Apikey2" }, { label: "交易对", props: "Symbol" },
{ label: "保底运营资金", props: "Apikey3" }, { label: "保底运营资金", props: "MinimumWorkingCapital" },
{ label: "机器人ID", props: "Apikey4" } { label: "机器人ID", props: "RobotId" }
]; ];
import { Modal } from "@/components"; import { Modal } from "@/components";
@ -312,93 +326,62 @@ export default {
apiKeyform: {}, apiKeyform: {},
accountForm: {}, accountForm: {},
moneyForm: {}, moneyForm: {},
tableData: [ createLoading: false,
{ account: "1", subTable: [{ Apikey1: "01" }] }, tableData: []
{ account: "2", subTable: [{ Apikey1: "2" }] },
{ account: "3", subTable: [{ Apikey1: "3" }] }
]
}; };
}, },
created() {
this.getAccounts();
},
methods: { methods: {
getAccounts() {
this.$http
.get("/Api/StockExchangeAccount/GetListByGroup?policyType=2")
.then(res => {
if (res.Code == 200) {
this.tableData = res.Data;
}
});
},
handleCommand(command) { handleCommand(command) {
this.modal[command] = true; 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> </script>
<style> <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> </style>

22
src/pages/prePages/js/columns.js

@ -158,14 +158,24 @@ export const tradeColumns = [
{ {
name: "ID", name: "ID",
prop: "Id", prop: "Id",
width: 150,
key: "Id" key: "Id"
}, },
{ {
name: "类型", name: "类型",
prop: "OrderType", prop: "OrderType",
key: "OrderType", key: "OrderType",
width: 80,
customSlot: "OrderType" customSlot: "OrderType"
}, },
{
name: "手持资金",
prop: "CapitalAfter",
key: "CapitalAfter",
customSlot: "CapitalAfter"
},
{ {
name: "时间", name: "时间",
prop: "purchaseKLineId", prop: "purchaseKLineId",
@ -184,6 +194,17 @@ export const tradeColumns = [
key: "Count", key: "Count",
customSlot: "Count" customSlot: "Count"
}, },
{
name: "订单投入本金",
prop: "RealCost",
key: "RealCost"
},
{
name: "成交总价",
prop: "Total",
key: "Total",
customSlot: "Total"
},
{ {
name: "历史周转资金", name: "历史周转资金",
prop: "HistoryRealCost", prop: "HistoryRealCost",
@ -205,6 +226,7 @@ export const tradeColumns = [
{ {
name: "累计盈亏", name: "累计盈亏",
prop: "TotalProfit", prop: "TotalProfit",
fixed: true,
key: "TotalProfit", key: "TotalProfit",
customSlot: "TotalProfit" customSlot: "TotalProfit"
} }

4
src/utils/plugin/axios-plugin.js

@ -1,7 +1,9 @@
/* eslint-disable */ /* eslint-disable */
import axios from "axios"; import axios from "axios";
const rootUrl = "http://54.249.164.224/"; // const rootUrl = "http://54.249.164.224/"; //formal
const rootUrl = "http://58.23.153.12:88/"; //test
const Axios = axios.create({ const Axios = axios.create({
baseURL: rootUrl, baseURL: rootUrl,

Loading…
Cancel
Save