Browse Source

各种改动

master
lizhixin 4 years ago
parent
commit
14032ee411
  1. 2
      public/index.html
  2. 74
      src/App.vue
  3. 160
      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://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> -->
<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>
<body>

74
src/App.vue

@ -41,4 +41,78 @@ export default {
.el-input {
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>

160
src/pages/ReCheck/OrderTable.vue

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

15
src/pages/ReCheck/index.vue

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

4
src/pages/Robot/index.vue

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

171
src/pages/RobotSec/Account.vue

@ -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>

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

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

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

@ -1,7 +1,9 @@
/* eslint-disable */
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({
baseURL: rootUrl,

Loading…
Cancel
Save