|
|
@@ -1,12 +1,24 @@
|
|
|
<template>
|
|
|
<lay-layer :title="modelConfig.title" v-model="modelConfig.visible" area="auto" :btn="operator">
|
|
|
<lay-loading class="custom-loading" :loading="modelConfig.loading">
|
|
|
- <div class="custom-layer" style="padding: 20px">
|
|
|
- <lay-form :model="modelParams" ref="modelFormRef" required>
|
|
|
- <lay-form-item label="导出时间" prop="rangeTime">
|
|
|
+ <div class="width-1000 custom-layer" style="padding: 20px">
|
|
|
+ <lay-form :model="modelParams" ref="modelFormRef" mode="inline" required>
|
|
|
+ <lay-form-item label="时间范围" prop="rangeTime">
|
|
|
<lay-date-picker v-model="modelParams.rangeTime" range type="datetime" :placeholder="['开始日期', '结束日期']" />
|
|
|
</lay-form-item>
|
|
|
+ <lay-form-item>
|
|
|
+ <lay-button @click="getCapitalAllCount">查询</lay-button>
|
|
|
+ </lay-form-item>
|
|
|
</lay-form>
|
|
|
+ <lay-loading class="custom-loading" :loading="modelConfig.infoLoading">
|
|
|
+ <div class="revenue-statistics" v-show="Object.keys(capitalAllCountData).length > 0">
|
|
|
+ {{
|
|
|
+ `${dayjs(modelParams.rangeTime[0]).format("YYYY-MM-DD HH:mm:ss")} 到 ${dayjs(modelParams.rangeTime[1]).format("YYYY-MM-DD HH:mm:ss")} 的交易量为:${
|
|
|
+ capitalAllCountData.transactionAmount
|
|
|
+ },总盈利为:${capitalAllCountData.totalProfit}%,最大回撤为:${capitalAllCountData.maxDrawdown}%,单个机器人最大回撤为:${capitalAllCountData.robotMaxDrawdownPercentage}%`
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ </lay-loading>
|
|
|
</div>
|
|
|
</lay-loading>
|
|
|
</lay-layer>
|
|
|
@@ -15,7 +27,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive, getCurrentInstance } from "vue";
|
|
|
import dayjs from "dayjs";
|
|
|
-import { export_robot_info } from "@/api";
|
|
|
+import { export_robot_info, get_capital_all_count } from "@/api";
|
|
|
|
|
|
const { proxy }: any = getCurrentInstance();
|
|
|
|
|
|
@@ -26,6 +38,7 @@ interface ModelConfig {
|
|
|
visible: boolean;
|
|
|
isUpdate: boolean;
|
|
|
loading: boolean;
|
|
|
+ infoLoading: boolean;
|
|
|
}
|
|
|
interface ModelParams {
|
|
|
rangeTime?: any;
|
|
|
@@ -34,9 +47,10 @@ interface ModelParams {
|
|
|
}
|
|
|
|
|
|
let modelParams = ref<ModelParams>({});
|
|
|
-let modelConfig: ModelConfig = reactive({ title: "", visible: false, isUpdate: false, loading: false });
|
|
|
+let modelConfig: ModelConfig = reactive({ title: "", visible: false, isUpdate: false, loading: false, infoLoading: false });
|
|
|
|
|
|
let handleResult = reactive<{ resolve?: any; reject?: any }>({});
|
|
|
+let capitalAllCountData = ref<any>({});
|
|
|
|
|
|
const show = async (params?: any) => {
|
|
|
modelConfig.visible = true;
|
|
|
@@ -45,12 +59,27 @@ const show = async (params?: any) => {
|
|
|
const endTime = dayjs().set("hour", 8).set("minute", 0).set("second", 0).set("millisecond", 0).format("YYYY-MM-DD HH:mm:ss");
|
|
|
modelParams.value = { rangeTime: [startTime, endTime] };
|
|
|
modelConfig.title = "导出机器人交易数据";
|
|
|
+ getCapitalAllCount();
|
|
|
return new Promise(async (resolve, reject) => {
|
|
|
handleResult.resolve = resolve;
|
|
|
handleResult.reject = reject;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+const getCapitalAllCount = () => {
|
|
|
+ const params = {
|
|
|
+ startTime: +dayjs(modelParams?.value.rangeTime[0]),
|
|
|
+ endTime: +dayjs(modelParams?.value.rangeTime[1]),
|
|
|
+ };
|
|
|
+ modelConfig.infoLoading = true
|
|
|
+ get_capital_all_count(params, (data: any) => {
|
|
|
+ modelConfig.infoLoading = false
|
|
|
+ if (data.code == 200) {
|
|
|
+ capitalAllCountData.value = data.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
const operator = reactive([
|
|
|
{
|
|
|
text: "导出",
|
|
|
@@ -96,7 +125,14 @@ defineExpose({ show });
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.custom-layer{
|
|
|
+ min-height: 100px;
|
|
|
+}
|
|
|
.operator-wp {
|
|
|
padding-left: 110px;
|
|
|
}
|
|
|
+
|
|
|
+.revenue-statistics {
|
|
|
+ padding: 20px;
|
|
|
+}
|
|
|
</style>
|