Browse Source

新加账户止损比例

DESKTOP-NE65RNK\Citrus_limon 6 months ago
parent
commit
661521c317
2 changed files with 16 additions and 5 deletions
  1. 5 0
      src/views/bot/cta/components/Update.vue
  2. 11 5
      src/views/bot/cta/index.vue

+ 5 - 0
src/views/bot/cta/components/Update.vue

@@ -39,6 +39,11 @@
               <lay-input v-model="modelParams.fundRatio" placeholder="资金比例" />
             </lay-form-item>
           </lay-col>
+          <lay-col md="12" sm="12" xs="24">
+            <lay-form-item label="止损比例" prop="stopLoss">
+              <lay-input v-model="modelParams.stopLoss" placeholder="账户止损比例" />
+            </lay-form-item>
+          </lay-col>
           <lay-col md="24" sm="24" xs="24">
             <lay-form-item label="平仓方式" prop="closeType">
               <lay-radio-group name="action" v-model="modelParams.closeType">

+ 11 - 5
src/views/bot/cta/index.vue

@@ -46,10 +46,16 @@
               {{ (((row.nowAmount - row.startAmount) / (row.startAmount || 1)) * 100).toFixed(2) || 0 }}%
             </span>
           </template>
+          <template v-slot:startAmount="{ row }">
+            {{ row.startAmount.toFixed(2) || 0 }}
+          </template>
+          <template v-slot:nowAmount="{ row }">
+            {{ row.nowAmount.toFixed(2) || 0 }}
+          </template>
           <template v-slot:configs="{ row }">
-            <lay-tooltip :content="`资金比例:${row.fundRatio * 100}%;`">
+            <lay-tooltip :content="`资金比例:${row.fundRatio * 100}%;账户止损比例:${row.stopLoss * 100}%`">
               <div class="ellipsis-2" @click="handleUpdate(row)">
-                {{ `资金比例:${row.fundRatio * 100}%;` }}
+                {{ `资金比例:${row.fundRatio * 100}%;账户止损比例:${row.stopLoss * 100}%` }}
               </div>
             </lay-tooltip>
           </template>
@@ -139,10 +145,10 @@ const columns = ref([
   { title: "名称", key: "name", customSlot: "name", ellipsisTooltip: true },
   { title: "账户", key: "accountName", ellipsisTooltip: true },
   { title: "币对", key: "symbol", align: "center", ellipsisTooltip: true },
-  { title: "初始余额", width: "100px", key: "startAmount", align: "center" },
-  { title: "当前余额", width: "100px", key: "nowAmount", align: "center" },
+  { title: "初始余额", width: "100px", key: "startAmount", customSlot: "startAmount",align: "center" },
+  { title: "当前余额", width: "100px", key: "nowAmount", customSlot: "nowAmount",align: "center" },
   { title: "收益", width: "80px", key: "earningRate", customSlot: "earningRate", align: "center" },
-  { title: "配置信息", width: "200px", key: "configs", customSlot: "configs" },
+  { title: "配置信息", width: "240px", key: "configs", customSlot: "configs" },
   { title: "状态", width: "90px", key: "status", customSlot: "status", align: "center" },
   { title: "IP", width: "120px", key: "serverName", ellipsisTooltip: true },
   // { title: "持仓信息", width: "80px", key: "posNum", customSlot: "posNum", align: "center", ellipsisTooltip: true },