增加按方向平仓
This commit is contained in:
		| @ -151,7 +151,7 @@ | ||||
|  | ||||
|         <!-- 添加或修改对话框 --> | ||||
|         <el-dialog :title="title" :visible.sync="open" width="1200px" :close-on-click-modal="false"> | ||||
|           <el-form ref="form" :model="form" :rules="rules" label-width="180px"> | ||||
|           <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | ||||
|             <el-form-item label="模板名称" prop="name"> | ||||
|               <el-input v-model="form.name" placeholder="模板名称" /> | ||||
|             </el-form-item> | ||||
| @ -265,9 +265,7 @@ | ||||
|                 </el-radio-group> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="购买金额(U)" prop="buy_price"> | ||||
|                 <el-input v-model="inForm.buy_price" placeholder="购买金额(U)"> | ||||
|                   <template slot="append">USDT</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model="inForm.buy_price" placeholder="购买金额(U)" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="价格模式" prop="price_pattern"> | ||||
|                 <el-radio-group v-model="inForm.price_pattern" @change="onchangePattern"> | ||||
| @ -277,9 +275,7 @@ | ||||
|                 </el-radio-group> | ||||
|               </el-form-item> | ||||
|               <el-form-item v-if="inForm.price_pattern === 'percentage'" label="下单百分比" prop="price"> | ||||
|                 <el-input v-model="inForm.price" placeholder="下单百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model="inForm.price" placeholder="下单百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-row v-else type="flex"> | ||||
|                 <el-col :span="14"> | ||||
| @ -312,9 +308,7 @@ | ||||
|                 </el-col> | ||||
|                 <el-col :span="5"> | ||||
|                   <el-form-item label="计算百分比"> | ||||
|                     <el-inputNumber v-model="percenter" controls-position="right" :min="0" style="width: 100px;"> | ||||
|                       <template slot="append">%</template> | ||||
|                     </el-inputNumber> | ||||
|                     <el-inputNumber v-model="percenter" controls-position="right" :min="0" style="width: 100px;" /> | ||||
|                   </el-form-item> | ||||
|                 </el-col> | ||||
|                 <el-col :span="5"> | ||||
| @ -322,9 +316,16 @@ | ||||
|                 </el-col> | ||||
|               </el-row> | ||||
|               <el-form-item label="止盈百分比" prop="profit"> | ||||
|                 <el-input v-model="inForm.profit" placeholder="止盈百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model="inForm.profit" placeholder="止盈百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="止盈数量百分比" prop="profit_num_ratio"> | ||||
|                 <el-input v-model="inForm.profit_num_ratio" placeholder="止盈数量百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="第二止盈价百分比" prop="profit_tp_tp_price_ratio"> | ||||
|                 <el-input v-model="inForm.profit_tp_tp_price_ratio" placeholder="第二止盈价百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="第二止损价百分比" prop="profit_tp_sl_price_ratio"> | ||||
|                 <el-input v-model="inForm.profit_tp_sl_price_ratio" placeholder="第二止损价百分比" /> | ||||
|               </el-form-item> | ||||
|               <!--<el-form-item label="亏损百分比" prop="stop_price"> | ||||
|                 <el-input | ||||
| @ -403,24 +404,18 @@ | ||||
|                 </el-radio-group> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="主单亏损百分比" prop="reduce_price"> | ||||
|                 <el-input v-model.number="inForm.reduce_price" type="number" placeholder="主单亏损百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model.number="inForm.reduce_price" type="number" placeholder="主单亏损百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="主单减仓数量百分比" prop="reduce_num"> | ||||
|                 <el-input v-model.number="inForm.reduce_num" type="number" placeholder="主单减仓数量百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model.number="inForm.reduce_num" type="number" placeholder="主单减仓数量百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="主单减仓后止盈价百分比" prop="reduce_take_profit"> | ||||
|                 <el-input v-model.number="inForm.reduce_take_profit" type="number" placeholder="主单减仓后止盈价百分比"> | ||||
|                   <template v-if="form.type === 1" #append>回本百分比:{{ re_take_profit_ratio }}%</template> | ||||
|                   <template v-if="form.type === 1" #append>{{ re_take_profit_ratio }}</template> | ||||
|                 </el-input> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="主单减仓后止损价百分比" prop="reduce_stop_price"> | ||||
|                 <el-input v-model.number="inForm.reduce_stop_price" type="number" placeholder="主单减仓后止损价百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model.number="inForm.reduce_stop_price" type="number" placeholder="主单减仓后止损价百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-row> | ||||
|                 <el-col :span="4"><el-form-item label="主单加仓配置" /></el-col> | ||||
| @ -434,16 +429,15 @@ | ||||
|                 >计算</el-button></el-col> | ||||
|               </el-row> | ||||
|               <div v-for="(item, index) in inForm.ext" :key="index" class="exts"> | ||||
|                 <h3 style="margin-bottom: 8px;">{{ item.addType===1?'加仓:':'减仓:' }}</h3> | ||||
|                 <el-row v-if="item.addType === 1" :gutter="20" style="margin-bottom: 20px;"> | ||||
|                   <el-col :span="6"> | ||||
|                   <el-col :span="5"> | ||||
|                     <div style="margin-bottom: 8px;">{{ item.addType === 1 ? '加仓类型' : '减仓类型' }}</div> | ||||
|                     <el-radio-group v-model="item.orderType" size="mini"> | ||||
|                       <el-radio label="LIMIT">限价</el-radio> | ||||
|                       <el-radio label="MARKET">市价</el-radio> | ||||
|                     </el-radio-group> | ||||
|                   </el-col> | ||||
|                   <el-col :span="6"> | ||||
|                   <el-col :span="5"> | ||||
|                     <div style="margin-bottom: 8px;">{{ item.addType === 1 ? '加仓方式' : '减仓方式' }}</div> | ||||
|                     <el-radio-group v-model="item.addPositionType" size="mini"> | ||||
|                       <el-radio :label="1">百分比</el-radio> | ||||
| @ -453,55 +447,87 @@ | ||||
|  | ||||
|                 </el-row> | ||||
|                 <el-row :gutter="20"> | ||||
|                   <el-col style="margin-bottom: 14px;" :span="6">{{ item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比' }} | ||||
|                     <el-input v-model.number="item.priceRatio" min="0" size="mini" type="number" :placeholder="item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比'"> | ||||
|                       <template slot="append">%</template> | ||||
|                     </el-input> | ||||
|                   <el-col :span="3">{{ item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比' }} | ||||
|                     <el-input | ||||
|                       v-model.number="item.priceRatio" | ||||
|                       min="0" | ||||
|                       size="mini" | ||||
|                       type="number" | ||||
|                       :placeholder="item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比'" | ||||
|                     /></el-col> | ||||
|                   <el-col :span="3">{{ item.addType === 1 ? '加仓数值' : '减仓百分比' }} | ||||
|                     <el-input | ||||
|                       v-model.number="item.addPositionVal" | ||||
|                       min="0" | ||||
|                       size="mini" | ||||
|                       type="number" | ||||
|                       :placeholder="item.addType === 1 ? '加仓数值' : '减仓百分比'" | ||||
|                     /> | ||||
|                   </el-col> | ||||
|  | ||||
|                   <el-col style="margin-bottom: 14px;" :span="6">{{ item.addType === 1 ? '加仓数值' : '减仓数值' }} | ||||
|                     <el-input v-model.number="item.addPositionVal" min="0" size="mini" type="number" :placeholder="item.addType === 1 ? '加仓数值' : '减仓数值'"> | ||||
|                       <template slot="append">{{ item.addPositionType == 1 ? '%' : 'USDT' }}</template> | ||||
|                     </el-input> | ||||
|                   </el-col> | ||||
|                   <el-col style="margin-bottom: 14px;" :span="12"> | ||||
|                   <el-col :span="6"> | ||||
|                     <span>止盈/止损百分比</span> | ||||
|                     <div> | ||||
|                       <el-input v-model="item.takeProfitRatio" min="0" style="width:50%;" size="mini" type="number" placeholder="止盈百分比"> | ||||
|                       <el-input | ||||
|                         v-model="item.takeProfitRatio" | ||||
|                         min="0" | ||||
|                         style="width:50%;" | ||||
|                         size="mini" | ||||
|                         type="number" | ||||
|                         placeholder="止盈百分比" | ||||
|                       > | ||||
|                         <template v-if="form.type === 1" #append>{{ ext[index] ? ext[index].reTakeProfitRatio : 0 | ||||
|                         }}</template> | ||||
|                       </el-input> | ||||
|                       — | ||||
|                       <el-input v-model.number="item.stopLossRatio" style="width:42%;" size="mini" type="number" placeholder="止损百分比"> | ||||
|                         <template slot="append">%</template> | ||||
|                       </el-input> | ||||
|                       <el-input | ||||
|                         v-model.number="item.stopLossRatio" | ||||
|                         style="width:42%;" | ||||
|                         size="mini" | ||||
|                         type="number" | ||||
|                         placeholder="止损百分比" | ||||
|                       /> | ||||
|                     </div> | ||||
|                   </el-col> | ||||
|                   <!-- <el-col :span="3">止损百分比<el-input v-model.number="item.stopLossRatio" size="mini" type="number" placeholder="止损百分比" /></el-col> --> | ||||
|  | ||||
|                   <template v-if="item.addType === 1"> | ||||
|                     <el-col style="margin-bottom: 14px;" :span="6"> | ||||
|                       <span>止盈数量百分比</span> | ||||
|                       <el-input v-model.number="item.takeProfitNumRatio" size="mini" type="number" placeholder="止盈数量百分比"> | ||||
|                         <template slot="append">%</template> | ||||
|                       </el-input> | ||||
|                     <el-col :span="3"> | ||||
|                       止盈数量百分比<el-input | ||||
|                         v-model.number="item.takeProfitNumRatio" | ||||
|                         size="mini" | ||||
|                         type="number" | ||||
|                         placeholder="止盈数量百分比" | ||||
|                       /> | ||||
|                     </el-col> | ||||
|                     <el-col style="margin-bottom: 14px;" :span="12"> | ||||
|                     <el-col :span="6"> | ||||
|                       <span>第二止盈/止损百分比</span> | ||||
|                       <div> | ||||
|                         <el-input v-model.number="item.tpTpPriceRatio" min="0" style="width:42%" size="mini" type="number" placeholder="止盈后止盈价百分比"> | ||||
|                           <template slot="append">%</template> | ||||
|                         </el-input> | ||||
|                         <el-input | ||||
|                           v-model.number="item.tpTpPriceRatio" | ||||
|                           min="0" | ||||
|                           style="width:42%" | ||||
|                           size="mini" | ||||
|                           type="number" | ||||
|                           placeholder="第二止盈价百分比" | ||||
|                         /> | ||||
|                         — | ||||
|                         <el-input v-model.number="item.tpSlPriceRatio" min="0" style="width:42%" size="mini" type="number" placeholder="止盈后止损价百分比"> | ||||
|                           <template slot="append">%</template> | ||||
|                         </el-input> | ||||
|                         <el-input | ||||
|                           v-model.number="item.tpSlPriceRatio" | ||||
|                           min="0" | ||||
|                           style="width:42%" | ||||
|                           size="mini" | ||||
|                           type="number" | ||||
|                           placeholder="第二止损价百分比" | ||||
|                         /> | ||||
|                       </div> | ||||
|                     </el-col> | ||||
|                   </template> | ||||
|                   <el-col :span="12"> | ||||
|                     <div style="margin-bottom: 14px;" /> | ||||
|                     <el-button size="mini" type="danger" @click="onAddExt(1, index)">删除</el-button> | ||||
|                   <el-col :span="3"> | ||||
|                     <div style="margin-bottom: 14px;" /><el-button | ||||
|                       size="mini" | ||||
|                       type="danger" | ||||
|                       @click="onAddExt(1, index)" | ||||
|                     >删除</el-button> | ||||
|                   </el-col> | ||||
|                 </el-row> | ||||
|               </div> | ||||
| @ -909,13 +935,23 @@ export default { | ||||
|                 reduce_take_profit: this.inForm.reduce_take_profit || 0, | ||||
|                 reduce_stop_price: this.inForm.reduce_stop_price || 0, | ||||
|                 symbol_group_id: String(this.inForm.symbol_group_id), | ||||
|                 profit_num_ratio: this.form.profit_num_ratio || 100, | ||||
|                 profit_tp_tp_price_ratio: this.form.profit_tp_tp_price_ratio || 0, | ||||
|                 profit_tp_sl_price_ratio: this.form.profit_tp_sl_price_ratio || 0, | ||||
|                 profit_num_ratio: this.inForm.profit_num_ratio || 100, | ||||
|                 profit_tp_tp_price_ratio: this.inForm.profit_tp_tp_price_ratio || 0, | ||||
|                 profit_tp_sl_price_ratio: this.inForm.profit_tp_sl_price_ratio || 0, | ||||
|                 api_id: this.inForm.api_id.toString(), | ||||
|                 hedge_trigger_percent: Number(this.inForm.hedge_trigger_percent), | ||||
|                 hedge_trigger_percent_max: Number(this.inForm.hedge_trigger_percent_max) | ||||
|                 hedge_trigger_percent_max: Number(this.inForm.hedge_trigger_percent_max), | ||||
|                 ext: Array.isArray(this.inForm.ext) | ||||
|                   ? this.inForm.ext.map(item => ({ | ||||
|                     ...item, | ||||
|                     stopLossRatio: item.stopLossRatio || 0, | ||||
|                     takeProfitNumRatio: item.takeProfitNumRatio || 0, | ||||
|                     tpTpPriceRatio: item.tpTpPriceRatio || 0, | ||||
|                     tpSlPriceRatio: item.tpSlPriceRatio || 0 | ||||
|                   })) | ||||
|                   : [] | ||||
|               }) | ||||
|  | ||||
|               updateLineOrderTemplateLogs({ ...this.form, params }).then(response => { | ||||
|                 if (response.code === 200) { | ||||
|                   this.msgSuccess(response.msg) | ||||
|  | ||||
| @ -1,4 +1,3 @@ | ||||
|  | ||||
| <template> | ||||
|   <BasicLayout> | ||||
|     <template #wrapper> | ||||
| @ -10,12 +9,7 @@ | ||||
|             clearable | ||||
|             size="small" | ||||
|           > | ||||
|             <el-option | ||||
|               v-for="dict in lineUsersAll" | ||||
|               :key="dict.id" | ||||
|               :label="dict.apiName" | ||||
|               :value="dict.id" | ||||
|             /> | ||||
|             <el-option v-for="dict in lineUsersAll" :key="dict.id" :label="dict.apiName" :value="dict.id" /> | ||||
|           </el-select> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="交易对" prop="symbol"><el-input | ||||
| @ -54,12 +48,7 @@ | ||||
|             clearable | ||||
|             size="small" | ||||
|           > | ||||
|             <el-option | ||||
|               v-for="dict in buyer" | ||||
|               :key="dict.k" | ||||
|               :label="dict.l" | ||||
|               :value="dict.v" | ||||
|             /> | ||||
|             <el-option v-for="dict in buyer" :key="dict.k" :label="dict.l" :value="dict.v" /> | ||||
|           </el-select> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="订单号" prop="orderSn"><el-input | ||||
| @ -76,12 +65,7 @@ | ||||
|             clearable | ||||
|             size="small" | ||||
|           > | ||||
|             <el-option | ||||
|               v-for="dict in [{l:'现货',v:1},{l:'合约',v:2}]" | ||||
|               :key="dict.k" | ||||
|               :label="dict.l" | ||||
|               :value="dict.v" | ||||
|             /> | ||||
|             <el-option v-for="dict in [{ l: '现货', v: 1 }, { l: '合约', v: 2 }]" :key="dict.k" :label="dict.l" :value="dict.v" /> | ||||
|           </el-select> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="减仓状态" prop="hedgeStatus"><el-select | ||||
| @ -90,7 +74,7 @@ | ||||
|             size="small" | ||||
|           > | ||||
|             <el-option | ||||
|               v-for="dict in [{l:'全部',v:-1},{l:'未减仓',v:0},{l:'已减仓',v:1}]" | ||||
|               v-for="dict in [{ l: '全部', v: -1 }, { l: '未减仓', v: 0 }, { l: '已减仓', v: 1 }]" | ||||
|               :key="dict.k" | ||||
|               :label="dict.l" | ||||
|               :value="dict.v" | ||||
| @ -103,7 +87,7 @@ | ||||
|             size="small" | ||||
|           > | ||||
|             <el-option | ||||
|               v-for="dict in [{l:'全部',v:-1},{l:'未加仓',v:0},{l:'已加仓',v:1}]" | ||||
|               v-for="dict in [{ l: '全部', v: -1 }, { l: '未加仓', v: 0 }, { l: '已加仓', v: 1 }]" | ||||
|               :key="dict.k" | ||||
|               :label="dict.l" | ||||
|               :value="dict.v" | ||||
| @ -115,12 +99,7 @@ | ||||
|             placeholder="请选择状态" | ||||
|             size="small" | ||||
|           > | ||||
|             <el-option | ||||
|               v-for="dict in statuss" | ||||
|               :key="dict.k" | ||||
|               :label="dict.l" | ||||
|               :value="dict.v" | ||||
|             /> | ||||
|             <el-option v-for="dict in statuss" :key="dict.k" :label="dict.l" :value="dict.v" /> | ||||
|           </el-select> | ||||
|           </el-form-item> | ||||
|           <el-form-item> | ||||
| @ -217,7 +196,7 @@ | ||||
|           row-key="id" | ||||
|           lazy | ||||
|           :load="onLoadChild" | ||||
|           :tree-props="{children: 'children', hasChildren: 'hasChildren'}" | ||||
|           :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" | ||||
|           height="650" | ||||
|           @selection-change="handleSelectionChange" | ||||
|           @expand-change="onExpand" | ||||
| @ -226,7 +205,7 @@ | ||||
|             <template slot-scope="scope"> | ||||
|               {{ apiIdFormat(scope.row) }} | ||||
|             </template> | ||||
|           </el-table-column> --> | ||||
| </el-table-column> --> | ||||
|           <!-- <el-table-column type="expand" /> --> | ||||
|           <el-table-column | ||||
|             label="交易对" | ||||
| @ -236,18 +215,13 @@ | ||||
|             :show-overflow-tooltip="true" | ||||
|             fixed="left" | ||||
|           > | ||||
|             <template #default="{row}"> | ||||
|               <span v-if="row.pid===0">({{ row.child_num }})</span> | ||||
|             <template #default="{ row }"> | ||||
|               <span v-if="row.pid === 0">({{ row.child_num }})</span> | ||||
|               <span v-else-if="row.child_num">({{ row.child_num }})</span> | ||||
|               <span>{{ row.symbol }}</span> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|           <el-table-column | ||||
|             label="api用户名" | ||||
|             align="center" | ||||
|             prop="api_name" | ||||
|             :show-overflow-tooltip="true" | ||||
|           /> | ||||
|           <el-table-column label="api用户名" align="center" prop="api_name" :show-overflow-tooltip="true" /> | ||||
|           <el-table-column | ||||
|             label="对标价" | ||||
|             align="center" | ||||
| @ -262,7 +236,7 @@ | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{ row }"> | ||||
|               {{ {new:'最新价',mixture:'标记价'}[row.signPriceType] }} | ||||
|               {{ { new: '最新价', mixture: '标记价' }[row.signPriceType] }} | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|           <el-table-column | ||||
| @ -295,29 +269,19 @@ | ||||
|             prop="site" | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{row}"> | ||||
|               <el-tag size="mini" :type="row.site==='BUY'?'success':'danger'">{{ {BUY:'买(多)',SELL:'卖(空)'}[row.site] }}</el-tag> | ||||
|             <template #default="{ row }"> | ||||
|               <el-tag size="mini" :type="row.site === 'BUY' ? 'success' : 'danger'">{{ { BUY: '买(多)', SELL: '卖(空)' }[row.site] | ||||
|               }}</el-tag> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|           <el-table-column | ||||
|             label="订单类型" | ||||
|             align="center" | ||||
|             prop="orderType" | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{row}"> | ||||
|               {{ orderTypes[row.orderType] ? orderTypes[row.orderType].l : '' }} | ||||
|           <el-table-column label="订单类型" align="center" prop="orderType" :show-overflow-tooltip="true"> | ||||
|             <template #default="{ row }"> | ||||
|               {{ orderTypeFormat(row) }} | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|           <el-table-column | ||||
|             label="交易对类型" | ||||
|             align="center" | ||||
|             prop="symbolType" | ||||
|             min-width="90" | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{row}"> | ||||
|               {{ ['现货','合约'][row.symbolType-1] }} | ||||
|           <el-table-column label="交易对类型" align="center" prop="symbolType" min-width="90" :show-overflow-tooltip="true"> | ||||
|             <template #default="{ row }"> | ||||
|               {{ ['现货', '合约'][row.symbolType - 1] }} | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|           <!-- <el-table-column | ||||
| @ -327,26 +291,15 @@ | ||||
|             width="100" | ||||
|             :show-overflow-tooltip="true" | ||||
|           /> --> | ||||
|           <el-table-column | ||||
|             label="状态" | ||||
|             align="center" | ||||
|             prop="status" | ||||
|             width="100" | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{row}"> | ||||
|           <el-table-column label="状态" align="center" prop="status" width="100" :show-overflow-tooltip="true"> | ||||
|             <template #default="{ row }"> | ||||
|               <span :style="comStatusStyle(row)">{{ status[row.status] ? status[row.status].l : '' }}</span> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|           <el-table-column | ||||
|             label="减仓状态" | ||||
|             align="center" | ||||
|             prop="reduce_status" | ||||
|             width="100" | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{row}"> | ||||
|               <el-tag v-if="row.pid===0" size="mini" :type="['danger','success'][row.reduce_status]">{{ ['未减仓','已减仓'][row.reduce_status] }}</el-tag> | ||||
|           <el-table-column label="减仓状态" align="center" prop="reduce_status" width="100" :show-overflow-tooltip="true"> | ||||
|             <template #default="{ row }"> | ||||
|               <el-tag v-if="row.pid === 0" size="mini" :type="['danger', 'success'][row.reduce_status]">{{ | ||||
|                 ['未减仓', '已减仓'][row.reduce_status] }}</el-tag> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|           <el-table-column | ||||
| @ -356,16 +309,12 @@ | ||||
|             width="100" | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{row}"> | ||||
|               <el-tag v-if="row.pid===0" size="mini" :type="['danger','success'][row.add_position_status]">{{ ['未加仓','已加仓'][row.add_position_status] }}</el-tag> | ||||
|             <template #default="{ row }"> | ||||
|               <el-tag v-if="row.pid === 0" size="mini" :type="['danger', 'success'][row.add_position_status]">{{ | ||||
|                 ['未加仓', '已加仓'][row.add_position_status] }}</el-tag> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|           <el-table-column | ||||
|             label="订单描述" | ||||
|             align="center" | ||||
|             prop="desc" | ||||
|             :show-overflow-tooltip="true" | ||||
|           /> | ||||
|           <el-table-column label="订单描述" align="center" prop="desc" :show-overflow-tooltip="true" /> | ||||
|           <!-- <el-table-column | ||||
|             label="对冲状态" | ||||
|             align="center" | ||||
| @ -388,51 +337,17 @@ | ||||
|               <el-tag v-if="row.pid===0" size="mini" :type="row.addPositionStatus===1?'success':'danger'">{{ ['未加仓','已加仓'][row.addPositionStatus] }}</el-tag> | ||||
|             </template> | ||||
|           </el-table-column> --> | ||||
|           <el-table-column | ||||
|             label="计价货币" | ||||
|             align="center" | ||||
|             prop="quoteSymbol" | ||||
|             :show-overflow-tooltip="true" | ||||
|           /> | ||||
|           <el-table-column | ||||
|             label="预估方向" | ||||
|             align="center" | ||||
|             prop="direction" | ||||
|             :show-overflow-tooltip="true" | ||||
|           /> | ||||
|           <el-table-column | ||||
|             label="订单号" | ||||
|             align="center" | ||||
|             prop="orderSn" | ||||
|             width="200" | ||||
|             :show-overflow-tooltip="true" | ||||
|           /> | ||||
|           <el-table-column | ||||
|             label="触发时间" | ||||
|             align="center" | ||||
|             prop="triggerTime" | ||||
|             width="150" | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{row}">{{ row.triggerTime && parseTime(row.triggerTime) }}</template> | ||||
|           <el-table-column label="计价货币" align="center" prop="quoteSymbol" :show-overflow-tooltip="true" /> | ||||
|           <el-table-column label="预估方向" align="center" prop="direction" :show-overflow-tooltip="true" /> | ||||
|           <el-table-column label="订单号" align="center" prop="orderSn" width="200" :show-overflow-tooltip="true" /> | ||||
|           <el-table-column label="触发时间" align="center" prop="triggerTime" width="150" :show-overflow-tooltip="true"> | ||||
|             <template #default="{ row }">{{ row.triggerTime && parseTime(row.triggerTime) }}</template> | ||||
|           </el-table-column> | ||||
|           <el-table-column | ||||
|             label="过期时间" | ||||
|             align="center" | ||||
|             prop="expireTime" | ||||
|             width="150" | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{row}">{{ parseTime(row.expireTime) }}</template> | ||||
|           <el-table-column label="过期时间" align="center" prop="expireTime" width="150" :show-overflow-tooltip="true"> | ||||
|             <template #default="{ row }">{{ parseTime(row.expireTime) }}</template> | ||||
|           </el-table-column> | ||||
|           <el-table-column | ||||
|             label="创建时间" | ||||
|             align="center" | ||||
|             prop="createdAt" | ||||
|             width="150" | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{row}">{{ parseTime(row.createdAt) }}</template> | ||||
|           <el-table-column label="创建时间" align="center" prop="createdAt" width="150" :show-overflow-tooltip="true"> | ||||
|             <template #default="{ row }">{{ parseTime(row.createdAt) }}</template> | ||||
|           </el-table-column> | ||||
|           <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150" fixed="right"> | ||||
|             <template v-if="scope.row.pid===0" slot-scope="scope"> | ||||
| @ -471,7 +386,7 @@ | ||||
|         </el-table> | ||||
|  | ||||
|         <pagination | ||||
|           v-show="total>0" | ||||
|           v-show="total > 0" | ||||
|           :total="total" | ||||
|           :page.sync="queryParams.pageIndex" | ||||
|           :limit.sync="queryParams.pageSize" | ||||
| @ -480,7 +395,13 @@ | ||||
|  | ||||
|         <!-- 添加或修改对话框 --> | ||||
|         <el-dialog :title="title" :visible.sync="open" width="700px" :close-on-click-modal="false"> | ||||
|           <el-form ref="form" :model="form" :rules="rules" label-width="120px" style="height: 600px;overflow: hidden auto;"> | ||||
|           <el-form | ||||
|             ref="form" | ||||
|             :model="form" | ||||
|             :rules="rules" | ||||
|             label-width="120px" | ||||
|             style="height: 600px;overflow: hidden auto;" | ||||
|           > | ||||
|             <el-form-item label="订单类型" prop="order_type"> | ||||
|               <el-radio-group v-model="form.order_type"> | ||||
|                 <el-radio label="1">现货</el-radio> | ||||
| @ -489,9 +410,9 @@ | ||||
|             </el-form-item> | ||||
|             <el-form-item label="对冲类型" prop="cover_type"> | ||||
|               <el-radio-group v-model="form.cover_type"> | ||||
|                 <el-radio :label="1" :disabled="form.order_type==2">现货对合约</el-radio> | ||||
|                 <el-radio :label="2" :disabled="form.order_type==1">合约对合约</el-radio> | ||||
|                 <el-radio :label="3" :disabled="form.order_type==1">合约对现货</el-radio> | ||||
|                 <el-radio :label="1" :disabled="form.order_type == 2">现货对合约</el-radio> | ||||
|                 <el-radio :label="2" :disabled="form.order_type == 1">合约对合约</el-radio> | ||||
|                 <el-radio :label="3" :disabled="form.order_type == 1">合约对现货</el-radio> | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="api用户" prop="api_id"> | ||||
| @ -506,12 +427,7 @@ | ||||
|                     filterable | ||||
|                     size="small" | ||||
|                   > | ||||
|                     <el-option | ||||
|                       v-for="dict in apiIdOptions" | ||||
|                       :key="dict.id" | ||||
|                       :label="dict.apiName" | ||||
|                       :value="dict.id" | ||||
|                     /> | ||||
|                     <el-option v-for="dict in apiIdOptions" :key="dict.id" :label="dict.apiName" :value="dict.id" /> | ||||
|                   </el-select> | ||||
|                 </el-col> | ||||
|                 <el-col :span="3"> | ||||
| @ -525,9 +441,9 @@ | ||||
|                 placeholder="交易对组id" | ||||
|               /> | ||||
|             </el-form-item> --> | ||||
|             <el-form-item v-if="title==='批量添加'" label="交易对组" prop="symbol_group_id"> | ||||
|             <el-form-item v-if="title === '批量添加'" label="交易对组" prop="symbol_group_id"> | ||||
|               <el-select | ||||
|                 v-if="title==='批量添加'" | ||||
|                 v-if="title === '批量添加'" | ||||
|                 v-model="form.symbol_group_id" | ||||
|                 style="width: 100%;" | ||||
|                 placeholder="请选择交易对组" | ||||
| @ -535,12 +451,7 @@ | ||||
|                 size="small" | ||||
|                 filterable | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="dict in comSymbols" | ||||
|                   :key="dict.id" | ||||
|                   :label="dict.groupName" | ||||
|                   :value="dict.id" | ||||
|                 /> | ||||
|                 <el-option v-for="dict in comSymbols" :key="dict.id" :label="dict.groupName" :value="dict.id" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-else label="交易对" prop="symbol"> | ||||
| @ -555,15 +466,10 @@ | ||||
|                 remote | ||||
|                 size="small" | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="dict in comSymbols" | ||||
|                   :key="dict.id" | ||||
|                   :label="dict.symbol" | ||||
|                   :value="dict.symbol" | ||||
|                 /> | ||||
|                 <el-option v-for="dict in comSymbols" :key="dict.id" :label="dict.symbol" :value="dict.symbol" /> | ||||
|                 <div class="page"> | ||||
|                   <pagination | ||||
|                     v-show="symbol.total>0" | ||||
|                     v-show="symbol.total > 0" | ||||
|                     :background="false" | ||||
|                     :total="symbol.total" | ||||
|                     layout="prev, pager, next" | ||||
| @ -577,34 +483,25 @@ | ||||
|             <el-form-item label="购买方向" prop="site"> | ||||
|               <el-radio-group v-model="form.site"> | ||||
|                 <el-radio label="BUY">买(多)</el-radio> | ||||
|                 <el-radio label="SELL" :disabled="form.order_type==1">卖(空)</el-radio> | ||||
|                 <el-radio label="SELL" :disabled="form.order_type == 1">卖(空)</el-radio> | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="购买金额(U)" prop="buy_price"> | ||||
|               <el-input | ||||
|                 v-model="form.buy_price" | ||||
|                 placeholder="购买金额(U)" | ||||
|               /> | ||||
|               <el-input v-model="form.buy_price" placeholder="购买金额(U)" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="价格模式" prop="price_pattern"> | ||||
|               <el-radio-group v-model="form.price_pattern"> | ||||
|                 <el-radio label="percentage">百分比</el-radio> | ||||
|                 <el-radio label="mixture" :disabled="title==='批量添加'">主单实价委托百分比</el-radio> | ||||
|                 <el-radio label="mixture" :disabled="title === '批量添加'">主单实价委托百分比</el-radio> | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-if="form.price_pattern === 'percentage'" label="下单百分比" prop="price"> | ||||
|               <el-input | ||||
|                 v-model="form.price" | ||||
|                 placeholder="下单百分比" | ||||
|               /> | ||||
|               <el-input v-model="form.price" placeholder="下单百分比" /> | ||||
|             </el-form-item> | ||||
|             <el-row v-else type="flex"> | ||||
|               <el-col :span="12"> | ||||
|                 <el-form-item label="下单价(实际价格)" prop="price"> | ||||
|                   <el-input | ||||
|                     v-model="form.price" | ||||
|                     placeholder="下单价(实际价格)" | ||||
|                   /> | ||||
|                   <el-input v-model="form.price" placeholder="下单价(实际价格)" /> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|               <el-col :span="7"> | ||||
| @ -617,40 +514,32 @@ | ||||
|               </el-col> | ||||
|             </el-row> | ||||
|             <el-form-item label="止盈百分比" prop="profit"> | ||||
|               <el-input | ||||
|                 v-model="form.profit" | ||||
|                 placeholder="止盈百分比" | ||||
|               /> | ||||
|               <el-input v-model="form.profit" placeholder="止盈百分比" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="亏损百分比" prop="stop_price"> | ||||
|               <el-input | ||||
|                 v-model="form.stop_price" | ||||
|                 placeholder="亏损百分比" | ||||
|               /> | ||||
|               <el-input v-model="form.stop_price" placeholder="亏损百分比" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="对冲百分比" prop="cover_rate"> | ||||
|               <el-input | ||||
|                 v-model="form.cover_rate" | ||||
|                 placeholder="对冲百分比" | ||||
|               /> | ||||
|               <el-input v-model="form.cover_rate" placeholder="对冲百分比" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="对冲后盈利比例" prop="profit_rate"> | ||||
|               <el-input | ||||
|                 v-model="form.profit_rate" | ||||
|                 placeholder="对冲后盈利比例" | ||||
|               /> | ||||
|               <el-input v-model="form.profit_rate" placeholder="对冲后盈利比例" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="对冲平仓最大次数" prop="hedge_close_count"> | ||||
|               <el-input | ||||
|                 v-model.number="form.hedge_close_count" | ||||
|                 type="number" | ||||
|                 placeholder="对冲平仓最大次数" | ||||
|               /> | ||||
|               <el-input v-model.number="form.hedge_close_count" type="number" placeholder="对冲平仓最大次数" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="随机累加百分比" prop="hedge_trigger_percent"> | ||||
|               <el-row :gutter="20"> | ||||
|                 <el-col :span="11"><el-input v-model.number="form.hedge_trigger_percent" type="number" placeholder="最小值"><template #append>最小值</template></el-input></el-col> | ||||
|                 <el-col :span="11"><el-input v-model.number="form.hedge_trigger_percent_max" type="number" placeholder="最大值"><template #append>最大值</template></el-input></el-col> | ||||
|                 <el-col :span="11"><el-input | ||||
|                   v-model.number="form.hedge_trigger_percent" | ||||
|                   type="number" | ||||
|                   placeholder="最小值" | ||||
|                 ><template #append>最小值</template></el-input></el-col> | ||||
|                 <el-col :span="11"><el-input | ||||
|                   v-model.number="form.hedge_trigger_percent_max" | ||||
|                   type="number" | ||||
|                   placeholder="最大值" | ||||
|                 ><template #append>最大值</template></el-input></el-col> | ||||
|               </el-row> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="主单类型" prop="main_order_type"> | ||||
| @ -684,24 +573,14 @@ | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="订单过期时间" prop="profit_rate"> | ||||
|               <el-input | ||||
|                 v-model.number="form.expire_hour" | ||||
|                 class="hour" | ||||
|                 type="number" | ||||
|                 placeholder="订单过期时间" | ||||
|               > | ||||
|               <el-input v-model.number="form.expire_hour" class="hour" type="number" placeholder="订单过期时间"> | ||||
|                 <template slot="append">小时</template> | ||||
|               </el-input> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-if="title==='批量添加'" label="批量下单次数" prop="order_num"> | ||||
|               <el-input | ||||
|                 v-model.number="form.order_num" | ||||
|                 min="1" | ||||
|                 type="number" | ||||
|                 placeholder="批量下单次数" | ||||
|               /> | ||||
|             <el-form-item v-if="title === '批量添加'" label="批量下单次数" prop="order_num"> | ||||
|               <el-input v-model.number="form.order_num" min="1" type="number" placeholder="批量下单次数" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-if="title==='批量添加'" label="执行类型" prop="script"> | ||||
|             <el-form-item v-if="title === '批量添加'" label="执行类型" prop="script"> | ||||
|               <el-radio-group v-model="form.script"> | ||||
|                 <el-radio label="1"><span>脚本执行</span></el-radio> | ||||
|                 <el-radio label="0">直接执行</el-radio> | ||||
| @ -715,10 +594,7 @@ | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="模板名称" prop="template_name"> | ||||
|               <el-input | ||||
|                 v-model="form.template_name" | ||||
|                 placeholder="模板名称" | ||||
|               /> | ||||
|               <el-input v-model="form.template_name" placeholder="模板名称" /> | ||||
|             </el-form-item> | ||||
|  | ||||
|           </el-form> | ||||
| @ -742,12 +618,7 @@ | ||||
|                     filterable | ||||
|                     size="small" | ||||
|                   > | ||||
|                     <el-option | ||||
|                       v-for="dict in lineUsers" | ||||
|                       :key="dict.id" | ||||
|                       :label="dict.apiName" | ||||
|                       :value="dict.id" | ||||
|                     /> | ||||
|                     <el-option v-for="dict in lineUsers" :key="dict.id" :label="dict.apiName" :value="dict.id" /> | ||||
|                   </el-select> | ||||
|                 </el-col> | ||||
|                 <el-col :span="3"> | ||||
| @ -763,26 +634,21 @@ | ||||
|                 clearable | ||||
|                 multiple | ||||
|                 filterable | ||||
|                 :remote-method="(e)=>getSymbol(e,2)" | ||||
|                 :remote-method="(e) => getSymbol(e, 2)" | ||||
|                 :loading="searchLoding" | ||||
|                 remote | ||||
|                 size="small" | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="dict in symbol.symbolList" | ||||
|                   :key="dict.id" | ||||
|                   :label="dict.symbol" | ||||
|                   :value="dict.symbol" | ||||
|                 /> | ||||
|                 <el-option v-for="dict in symbol.symbolList" :key="dict.id" :label="dict.symbol" :value="dict.symbol" /> | ||||
|                 <div class="page"> | ||||
|                   <pagination | ||||
|                     v-show="symbol.total>0" | ||||
|                     v-show="symbol.total > 0" | ||||
|                     :background="false" | ||||
|                     :total="symbol.total" | ||||
|                     layout="prev, pager, next" | ||||
|                     :page.sync="symbol.pageIndex" | ||||
|                     :limit.sync="symbol.pageSize" | ||||
|                     @pagination="getSymbol($event,2)" | ||||
|                     @pagination="getSymbol($event, 2)" | ||||
|                   /> | ||||
|                 </div> | ||||
|               </el-select> | ||||
| @ -796,22 +662,11 @@ | ||||
|                 filterable | ||||
|                 size="small" | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="dict in symbolGroups" | ||||
|                   :key="dict.id" | ||||
|                   :label="dict.groupName" | ||||
|                   :value="dict.id" | ||||
|                 /> | ||||
|                 <el-option v-for="dict in symbolGroups" :key="dict.id" :label="dict.groupName" :value="dict.id" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-if="mode.modeTitle==='设置杠杆'" label="杠杆倍数" prop="leverage"> | ||||
|               <el-inputNumber | ||||
|                 v-model.number="modeForm.leverage" | ||||
|                 :min="1" | ||||
|                 :max="125" | ||||
|                 step-strictly | ||||
|                 placeholder="杠杆倍数" | ||||
|               /> | ||||
|             <el-form-item v-if="mode.modeTitle === '设置杠杆'" label="杠杆倍数" prop="leverage"> | ||||
|               <el-inputNumber v-model.number="modeForm.leverage" :min="1" :max="125" step-strictly placeholder="杠杆倍数" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-else label="保证金模式" prop="margin_type"> | ||||
|               <el-radio-group v-model="modeForm.margin_type"> | ||||
| @ -820,14 +675,20 @@ | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="全部交易对" prop="is_all"> | ||||
|               <el-radio-group v-model="modeForm.is_all" :disabled="!!modeForm.group_id || !!(modeForm.symbol && modeForm.symbol.length)"> | ||||
|               <el-radio-group | ||||
|                 v-model="modeForm.is_all" | ||||
|                 :disabled="!!modeForm.group_id || !!(modeForm.symbol && modeForm.symbol.length)" | ||||
|               > | ||||
|                 <el-radio :label="0">否</el-radio> | ||||
|                 <el-radio :label="1"> 是</el-radio> | ||||
|               </el-radio-group> | ||||
|               <span v-if="modeForm.is_all===1" style="color: red;margin-left: 20px;">耗时比较久,请耐心等待</span> | ||||
|               <span v-if="modeForm.is_all === 1" style="color: red;margin-left: 20px;">耗时比较久,请耐心等待</span> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|           <div style="color: red;"><i class="el-icon-warning-outline" style="margin-right: 4px;" />请保证该操作下的交易对无仓位,否则会直接失败</div> | ||||
|           <div style="color: red;"><i | ||||
|             class="el-icon-warning-outline" | ||||
|             style="margin-right: 4px;" | ||||
|           />请保证该操作下的交易对无仓位,否则会直接失败</div> | ||||
|           <div slot="footer" class="dialog-footer"> | ||||
|             <el-button type="primary" :loading="btnLoading" @click="modeConfirm">确 定</el-button> | ||||
|             <el-button @click="modeCancel">取 消</el-button> | ||||
| @ -845,12 +706,7 @@ | ||||
|                 filterable | ||||
|                 size="small" | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="dict in apiIdOptions" | ||||
|                   :key="dict.id" | ||||
|                   :label="dict.apiName" | ||||
|                   :value="dict.id" | ||||
|                 /> | ||||
|                 <el-option v-for="dict in apiIdOptions" :key="dict.id" :label="dict.apiName" :value="dict.id" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="加仓账户" prop="cover_account"> | ||||
| @ -874,26 +730,21 @@ | ||||
|                 clearable | ||||
|                 multiple | ||||
|                 filterable | ||||
|                 :remote-method="(e)=>getSymbol(e,storeForm.symbol_type)" | ||||
|                 :remote-method="(e) => getSymbol(e, storeForm.symbol_type)" | ||||
|                 :loading="searchLoding" | ||||
|                 remote | ||||
|                 size="small" | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="dict in symbol.symbolList" | ||||
|                   :key="dict.id" | ||||
|                   :label="dict.symbol" | ||||
|                   :value="dict.symbol" | ||||
|                 /> | ||||
|                 <el-option v-for="dict in symbol.symbolList" :key="dict.id" :label="dict.symbol" :value="dict.symbol" /> | ||||
|                 <div class="page"> | ||||
|                   <pagination | ||||
|                     v-show="symbol.total>0" | ||||
|                     v-show="symbol.total > 0" | ||||
|                     :background="false" | ||||
|                     :total="symbol.total" | ||||
|                     layout="prev, pager, next" | ||||
|                     :page.sync="symbol.pageIndex" | ||||
|                     :limit.sync="symbol.pageSize" | ||||
|                     @pagination="getSymbol($event,2)" | ||||
|                     @pagination="getSymbol($event, 2)" | ||||
|                   /> | ||||
|                 </div> | ||||
|               </el-select> | ||||
| @ -904,11 +755,8 @@ | ||||
|                 <el-radio label="LIMIT">限价</el-radio> | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-if="storeForm.cover_account_a_type==='LIMIT'" label="加仓主账号溢价比例" prop="cover_account_a_rate"> | ||||
|               <el-input | ||||
|                 v-model="storeForm.cover_account_a_rate" | ||||
|                 placeholder="加仓主账号溢价比例" | ||||
|               /> | ||||
|             <el-form-item v-if="storeForm.cover_account_a_type === 'LIMIT'" label="加仓主账号溢价比例" prop="cover_account_a_rate"> | ||||
|               <el-input v-model="storeForm.cover_account_a_rate" placeholder="加仓主账号溢价比例" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="加仓副账号类型" prop="cover_account_b_type"> | ||||
|               <el-radio-group v-model="storeForm.cover_account_b_type"> | ||||
| @ -916,11 +764,8 @@ | ||||
|                 <el-radio label="LIMIT">限价</el-radio> | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-if="storeForm.cover_account_b_type==='LIMIT'" label="加仓副账号溢价比例" prop="cover_account_b_rate"> | ||||
|               <el-input | ||||
|                 v-model="storeForm.cover_account_b_rate" | ||||
|                 placeholder="加仓副账号溢价比例" | ||||
|               /> | ||||
|             <el-form-item v-if="storeForm.cover_account_b_type === 'LIMIT'" label="加仓副账号溢价比例" prop="cover_account_b_rate"> | ||||
|               <el-input v-model="storeForm.cover_account_b_rate" placeholder="加仓副账号溢价比例" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="加仓类型" prop="cover_type"> | ||||
|               <el-radio-group v-model="storeForm.cover_type"> | ||||
| @ -928,11 +773,8 @@ | ||||
|                 <el-radio :label="2">金额</el-radio> | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item :label="`加仓数值${storeForm.cover_type===2?'(U)':''}`" prop="value"> | ||||
|               <el-input | ||||
|                 v-model="storeForm.value" | ||||
|                 :placeholder="`加仓数值${storeForm.cover_type===2?'(U)':''}`" | ||||
|               /> | ||||
|             <el-form-item :label="`加仓数值${storeForm.cover_type === 2 ? '(U)' : ''}`" prop="value"> | ||||
|               <el-input v-model="storeForm.value" :placeholder="`加仓数值${storeForm.cover_type === 2 ? '(U)' : ''}`" /> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|           <div slot="footer" class="dialog-footer"> | ||||
| @ -958,12 +800,7 @@ | ||||
|                 filterable | ||||
|                 size="small" | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="dict in apiIdOptions" | ||||
|                   :key="dict.id" | ||||
|                   :label="dict.apiName" | ||||
|                   :value="dict.id" | ||||
|                 /> | ||||
|                 <el-option v-for="dict in apiIdOptions" :key="dict.id" :label="dict.apiName" :value="dict.id" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="交易对" prop="symbol"> | ||||
| @ -973,26 +810,21 @@ | ||||
|                 placeholder="请选择交易对" | ||||
|                 clearable | ||||
|                 filterable | ||||
|                 :remote-method="(e)=>getSymbol(e,positionForm.close_type)" | ||||
|                 :remote-method="(e) => getSymbol(e, positionForm.close_type)" | ||||
|                 :loading="searchLoding" | ||||
|                 remote | ||||
|                 size="small" | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="dict in symbol.symbolList" | ||||
|                   :key="dict.id" | ||||
|                   :label="dict.symbol" | ||||
|                   :value="dict.symbol" | ||||
|                 /> | ||||
|                 <el-option v-for="dict in symbol.symbolList" :key="dict.id" :label="dict.symbol" :value="dict.symbol" /> | ||||
|                 <div class="page"> | ||||
|                   <pagination | ||||
|                     v-show="symbol.total>0" | ||||
|                     v-show="symbol.total > 0" | ||||
|                     :background="false" | ||||
|                     :total="symbol.total" | ||||
|                     layout="prev, pager, next" | ||||
|                     :page.sync="symbol.pageIndex" | ||||
|                     :limit.sync="symbol.pageSize" | ||||
|                     @pagination="getSymbol($event,2)" | ||||
|                     @pagination="getSymbol($event, 2)" | ||||
|                   /> | ||||
|                 </div> | ||||
|               </el-select> | ||||
| @ -1001,7 +833,8 @@ | ||||
|               <el-input v-model="positionForm.rate" placeholder="平仓行情百分比" /> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|           <div style="color: red;"><i class="el-icon-warning-outline" style="margin-right: 4px;" />该功能仅适用于本系统内的下单数据</div> | ||||
|           <div style="color: red;"><i class="el-icon-warning-outline" style="margin-right: 4px;" />该功能仅适用于本系统内的下单数据 | ||||
|           </div> | ||||
|           <div slot="footer" class="dialog-footer"> | ||||
|             <el-button type="primary" @click="positionConfirm">确 定</el-button> | ||||
|             <el-button @click="positionCancel">取 消</el-button> | ||||
| @ -1011,7 +844,7 @@ | ||||
|         <!-- 取消委托 --> | ||||
|         <el-dialog title="取消委托" :visible.sync="cancelOpen" width="700px" :close-on-click-modal="false"> | ||||
|           <el-form ref="formCancel" :model="cancelForm" label-width="80px"> | ||||
|             <el-form-item label="api用户" prop="api_id" :rules="[{required: true,message: 'api用户不能为空', trigger: 'blur'}]"> | ||||
|             <el-form-item label="api用户" prop="api_id" :rules="[{ required: true, message: 'api用户不能为空', trigger: 'blur' }]"> | ||||
|               <el-select | ||||
|                 v-model="cancelForm.api_id" | ||||
|                 style="width: 100%;" | ||||
| @ -1020,12 +853,7 @@ | ||||
|                 filterable | ||||
|                 size="small" | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="dict in apiIdOptions" | ||||
|                   :key="dict.id" | ||||
|                   :label="dict.apiName" | ||||
|                   :value="Number(dict.id)" | ||||
|                 /> | ||||
|                 <el-option v-for="dict in apiIdOptions" :key="dict.id" :label="dict.apiName" :value="Number(dict.id)" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="订单类型" prop="close_type"> | ||||
| @ -1035,7 +863,8 @@ | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|           <div style="color: red;"><i class="el-icon-warning-outline" style="margin-right: 4px;" />该功能仅适用于本系统内的下单数据</div> | ||||
|           <div style="color: red;"><i class="el-icon-warning-outline" style="margin-right: 4px;" />该功能仅适用于本系统内的下单数据 | ||||
|           </div> | ||||
|           <div slot="footer" class="dialog-footer"> | ||||
|             <el-button type="primary" @click="handleCancel('formCancel')">确 定</el-button> | ||||
|             <el-button @click="cancelOpen = false">取 消</el-button> | ||||
| @ -1326,7 +1155,7 @@ export default { | ||||
|             if (expanded && curr.expandCount > 1 && !curr.prevStatus) { | ||||
|               getChildOrder({ id }).then(res => { | ||||
|                 curr.resolve(res.data) | ||||
|               }).finally(() => {}) | ||||
|               }).finally(() => { }) | ||||
|             } | ||||
|             curr.expandCount = 1 | ||||
|             curr.prevStatus = expanded | ||||
| @ -1354,7 +1183,7 @@ export default { | ||||
|       getChildOrder({ id }).then(res => { | ||||
|         const r = res.data.map((item) => ({ ...item, hasChildren: item.child_num > 0 })) | ||||
|         resolve(r) | ||||
|       }).finally(() => {}) | ||||
|       }).finally(() => { }) | ||||
|     }, | ||||
|     /** 查询参数列表 */ | ||||
|     getList() { | ||||
| @ -1619,7 +1448,7 @@ export default { | ||||
|       this.title = '修改委托管理' | ||||
|       this.reset() | ||||
|       const id = | ||||
|                 row.id || this.ids | ||||
|         row.id || this.ids | ||||
|       getLinePreOrder(id).then(response => { | ||||
|         this.form = response.data | ||||
|         this.open = true | ||||
| @ -1704,7 +1533,7 @@ export default { | ||||
|         } else { | ||||
|           this.msgError(response.msg) | ||||
|         } | ||||
|       }).catch(function() {}) | ||||
|       }).catch(function() { }) | ||||
|     }, | ||||
|     /** 删除按钮操作 */ | ||||
|     handleDelete(row) { | ||||
| @ -1761,18 +1590,26 @@ export default { | ||||
|         } | ||||
|       }).catch(function() { | ||||
|       }) | ||||
|     }, | ||||
|     orderTypeFormat(row) { | ||||
|       if (row.orderCategory === 3 && row.orderType === 0) { | ||||
|         return '加仓' | ||||
|       } else { | ||||
|         return this.orderTypes[row.orderType] ? this.orderTypes[row.orderType].l : '' | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| <style lang="scss" scoped> | ||||
| .hour{ | ||||
|   ::v-deep.el-input__inner{ | ||||
| .hour { | ||||
|   ::v-deep.el-input__inner { | ||||
|     line-height: 1; | ||||
|   } | ||||
| } | ||||
| .page{ | ||||
|   .pagination-container{ | ||||
|  | ||||
| .page { | ||||
|   .pagination-container { | ||||
|     padding: 0 !important; | ||||
|     margin-top: 0; | ||||
|     margin-bottom: 0; | ||||
| @ -1781,12 +1618,14 @@ export default { | ||||
|     justify-content: center; | ||||
|     align-items: center; | ||||
|   } | ||||
|   ::v-deep.el-pagination{ | ||||
|  | ||||
|   ::v-deep.el-pagination { | ||||
|     width: 100%; | ||||
|   } | ||||
| } | ||||
| ::v-deep.el-table{ | ||||
|   .el-table__row--level-0{ | ||||
|  | ||||
| ::v-deep.el-table { | ||||
|   .el-table__row--level-0 { | ||||
|     background: #f5f5f5; | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -61,7 +61,12 @@ | ||||
|             clearable | ||||
|             size="small" | ||||
|           > | ||||
|             <el-option v-for="dict in [{ l: '现货', v: 1 }, { l: '合约', v: 2 }]" :key="dict.k" :label="dict.l" :value="dict.v" /> | ||||
|             <el-option | ||||
|               v-for="dict in [{ l: '现货', v: 1 }, { l: '合约', v: 2 }]" | ||||
|               :key="dict.k" | ||||
|               :label="dict.l" | ||||
|               :value="dict.v" | ||||
|             /> | ||||
|           </el-select> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="状态" prop="status"><el-select | ||||
| @ -248,13 +253,15 @@ | ||||
|             :show-overflow-tooltip="true" | ||||
|           > | ||||
|             <template #default="{ row }"> | ||||
|               <el-tag size="mini" :type="row.site === 'BUY' ? 'success' : 'danger'">{{ { BUY: '买(多)', SELL: '卖(空)' }[row.site] | ||||
|               <el-tag size="mini" :type="row.site === 'BUY' ? 'success' : 'danger'">{{ { | ||||
|                 BUY: '买(多)', SELL: '卖(空)' | ||||
|               }[row.site] | ||||
|               }}</el-tag> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|           <el-table-column label="订单类型" align="center" prop="orderType" :show-overflow-tooltip="true"> | ||||
|             <template #default="{ row }"> | ||||
|               {{ orderTypes[row.orderType] ? orderTypes[row.orderType].l : '' }} | ||||
|               {{ orderTypeFormat(row) }} | ||||
|               <!-- {{ orderTypes[row.orderType-1] ? orderTypes[row.orderType-1].l : '' }} --> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
| @ -511,9 +518,7 @@ | ||||
|                 </el-radio-group> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="购买金额(U)" prop="buy_price"> | ||||
|                 <el-input v-model="form.buy_price" placeholder="购买金额(U)"> | ||||
|                   <template slot="append">USDT</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model="form.buy_price" placeholder="购买金额(U)" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="价格模式" prop="price_pattern"> | ||||
|                 <el-radio-group v-model="form.price_pattern"> | ||||
| @ -523,9 +528,7 @@ | ||||
|                 </el-radio-group> | ||||
|               </el-form-item> | ||||
|               <el-form-item v-if="form.price_pattern === 'percentage'" label="下单百分比" prop="price"> | ||||
|                 <el-input v-model="form.price" placeholder="下单百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model="form.price" placeholder="下单百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-row v-else type="flex"> | ||||
|                 <el-col :span="14"> | ||||
| @ -558,9 +561,7 @@ | ||||
|                 </el-col> | ||||
|                 <el-col :span="5"> | ||||
|                   <el-form-item label="计算百分比"> | ||||
|                     <el-inputNumber v-model="percenter" controls-position="right" :min="0" style="width: 100px;"> | ||||
|                       <template slot="append">%</template> | ||||
|                     </el-inputNumber> | ||||
|                     <el-inputNumber v-model="percenter" controls-position="right" :min="0" style="width: 100px;" /> | ||||
|                   </el-form-item> | ||||
|                 </el-col> | ||||
|                 <el-col :span="5"> | ||||
| @ -568,24 +569,16 @@ | ||||
|                 </el-col> | ||||
|               </el-row> | ||||
|               <el-form-item label="止盈百分比" prop="profit"> | ||||
|                 <el-input v-model="form.profit" placeholder="止盈百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model="form.profit" placeholder="止盈百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="止盈数量百分比" prop="profit_num_ratio"> | ||||
|                 <el-input v-model="form.profit_num_ratio" placeholder="止盈数量百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model="form.profit_num_ratio" placeholder="止盈数量百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="止盈后止盈价百分比" prop="profit_tp_tp_price_ratio"> | ||||
|                 <el-input v-model="form.profit_tp_tp_price_ratio" placeholder="止盈后止盈价百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|               <el-form-item label="第二止盈价百分比" prop="profit_tp_tp_price_ratio"> | ||||
|                 <el-input v-model="form.profit_tp_tp_price_ratio" placeholder="第二止盈价百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="止盈后止损价百分比" prop="profit_tp_sl_price_ratio"> | ||||
|                 <el-input v-model="form.profit_tp_sl_price_ratio" placeholder="止盈后止损价百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|               <el-form-item label="第二止损价百分比" prop="profit_tp_sl_price_ratio"> | ||||
|                 <el-input v-model="form.profit_tp_sl_price_ratio" placeholder="第二止损价百分比" /> | ||||
|               </el-form-item> | ||||
|               <!-- <el-form-item label="亏损百分比" prop="stop_price"> | ||||
|               <el-input | ||||
| @ -694,24 +687,18 @@ | ||||
|                 </el-radio-group> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="主单亏损百分比" prop="reduce_price"> | ||||
|                 <el-input v-model.number="form.reduce_price" min="0" max="99.9" type="number" placeholder="主单亏损百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model.number="form.reduce_price" min="0" max="99.9" type="number" placeholder="主单亏损百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="主单减仓数量百分比" prop="reduce_num"> | ||||
|                 <el-input v-model.number="form.reduce_num" type="number" placeholder="主单减仓数量百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model.number="form.reduce_num" type="number" placeholder="主单减仓数量百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="主单减仓后止盈价百分比" prop="reduce_take_profit"> | ||||
|                 <el-input v-model.number="form.reduce_take_profit" type="number" placeholder="主单减仓后止盈价百分比"> | ||||
|                   <template v-if="title !== '批量添加'" #append>回本百分比:{{ re_take_profit_ratio }}%</template> | ||||
|                   <template v-if="title !== '批量添加'" #append>{{ re_take_profit_ratio }}</template> | ||||
|                 </el-input> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="主单减仓后止损价百分比" prop="reduce_stop_price"> | ||||
|                 <el-input v-model.number="form.reduce_stop_price" type="number" placeholder="主单减仓后止损价百分比"> | ||||
|                   <template slot="append">%</template> | ||||
|                 </el-input> | ||||
|                 <el-input v-model.number="form.reduce_stop_price" type="number" placeholder="主单减仓后止损价百分比" /> | ||||
|               </el-form-item> | ||||
|               <el-row> | ||||
|                 <el-col :span="4"><el-form-item label="主单加仓配置" /></el-col> | ||||
| @ -725,16 +712,15 @@ | ||||
|                 >计算</el-button></el-col> | ||||
|               </el-row> | ||||
|               <div v-for="(item, index) in form.ext" :key="index" class="exts"> | ||||
|                 <h3 style="margin-bottom: 8px;">{{ item.addType===1?'加仓:':'减仓:' }}</h3> | ||||
|                 <el-row v-if="item.addType === 1" :gutter="20" style="margin-bottom: 20px;"> | ||||
|                   <el-col style="margin-bottom: 14px;" :span="6"> | ||||
|                   <el-col :span="4"> | ||||
|                     <div style="margin-bottom: 8px;">{{ item.addType === 1 ? '加仓类型' : '减仓类型' }}</div> | ||||
|                     <el-radio-group v-model="item.orderType" size="mini"> | ||||
|                       <el-radio label="LIMIT">限价</el-radio> | ||||
|                       <el-radio label="MARKET">市价</el-radio> | ||||
|                     </el-radio-group> | ||||
|                   </el-col> | ||||
|                   <el-col style="margin-bottom: 14px;" :span="6"> | ||||
|                   <el-col :span="4"> | ||||
|                     <div style="margin-bottom: 8px;">{{ item.addType === 1 ? '加仓方式' : '减仓方式' }}</div> | ||||
|                     <el-radio-group v-model="item.addPositionType" size="mini"> | ||||
|                       <el-radio :label="1">百分比</el-radio> | ||||
| @ -744,53 +730,87 @@ | ||||
|  | ||||
|                 </el-row> | ||||
|                 <el-row :gutter="20"> | ||||
|                   <el-col style="margin-bottom: 14px;" :span="6">{{ item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比' }} | ||||
|                     <el-input v-model.number="item.priceRatio" min="0" size="mini" type="number" :placeholder="item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比'"> | ||||
|                       <template slot="append">%</template> | ||||
|                     </el-input> | ||||
|                   <el-col :span="3">{{ item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比' }} | ||||
|                     <el-input | ||||
|                       v-model.number="item.priceRatio" | ||||
|                       min="0" | ||||
|                       size="mini" | ||||
|                       type="number" | ||||
|                       :placeholder="item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比'" | ||||
|                     /></el-col> | ||||
|                   <el-col :span="3">{{ item.addType === 1 ? '加仓数值' : '减仓百分比' }} | ||||
|                     <el-input | ||||
|                       v-model.number="item.addPositionVal" | ||||
|                       min="0" | ||||
|                       size="mini" | ||||
|                       type="number" | ||||
|                       :placeholder="item.addType === 1 ? '加仓数值' : '减仓百分比'" | ||||
|                     /> | ||||
|                   </el-col> | ||||
|                   <el-col style="margin-bottom: 14px;" :span="6">{{ item.addType === 1 ? '加仓数值' : '减仓数值' }} | ||||
|                     <el-input v-model.number="item.addPositionVal" min="0" size="mini" type="number" :placeholder="item.addType === 1 ? '加仓数值' : '减仓数值'"> | ||||
|                       <template slot="append">{{ item.addPositionType == 1 ? '%' : 'USDT' }}</template> | ||||
|                     </el-input> | ||||
|                   </el-col> | ||||
|                   <el-col style="margin-bottom: 14px;" :span="12"> | ||||
|                   <el-col :span="6"> | ||||
|                     <span>止盈/止损百分比</span> | ||||
|                     <div> | ||||
|                       <el-input v-model.number="item.takeProfitRatio" min="0" style="width:50%;" size="mini" type="number" placeholder="止盈百分比"> | ||||
|                       <el-input | ||||
|                         v-model.number="item.takeProfitRatio" | ||||
|                         min="0" | ||||
|                         style="width:50%;" | ||||
|                         size="mini" | ||||
|                         type="number" | ||||
|                         placeholder="止盈百分比" | ||||
|                       > | ||||
|                         <template v-if="title !== '批量添加'" #append>{{ ext[index] ? ext[index].reTakeProfitRatio : 0 | ||||
|                         }}</template> | ||||
|                       </el-input> | ||||
|                       — | ||||
|                       <el-input v-model.number="item.stopLossRatio" style="width:42%;" size="mini" type="number" placeholder="止损百分比"> | ||||
|                         <template slot="append">%</template> | ||||
|                       </el-input> | ||||
|                       <el-input | ||||
|                         v-model.number="item.stopLossRatio" | ||||
|                         style="width:42%;" | ||||
|                         size="mini" | ||||
|                         type="number" | ||||
|                         placeholder="止损百分比" | ||||
|                       /> | ||||
|                     </div> | ||||
|                   </el-col> | ||||
|                   <!-- <el-col :span="3">止损百分比<el-input v-model.number="item.stopLossRatio" size="mini" type="number" placeholder="止损百分比" /></el-col> --> | ||||
|  | ||||
|                   <template v-if="item.addType === 1"> | ||||
|                     <el-col style="margin-bottom: 14px;" :span="6"> | ||||
|                       止盈数量百分比<el-input v-model.number="item.takeProfitNumRatio" size="mini" type="number" placeholder="止盈数量百分比"> | ||||
|                         <template slot="append">%</template> | ||||
|                       </el-input> | ||||
|                     <el-col :span="3"> | ||||
|                       止盈数量百分比<el-input | ||||
|                         v-model.number="item.takeProfitNumRatio" | ||||
|                         size="mini" | ||||
|                         type="number" | ||||
|                         placeholder="止盈数量百分比" | ||||
|                       /> | ||||
|                     </el-col> | ||||
|                     <el-col style="margin-bottom: 14px;" :span="12"> | ||||
|                     <el-col :span="6"> | ||||
|                       <span>第二止盈/止损百分比</span> | ||||
|                       <div> | ||||
|                         <el-input v-model.number="item.tpTpPriceRatio" min="0" style="width:42%" size="mini" type="number" placeholder="止盈后止盈价百分比"> | ||||
|                           <template slot="append">%</template> | ||||
|                         </el-input> | ||||
|                         <el-input | ||||
|                           v-model.number="item.tpTpPriceRatio" | ||||
|                           min="0" | ||||
|                           style="width:42%" | ||||
|                           size="mini" | ||||
|                           type="number" | ||||
|                           placeholder="止盈后止盈价百分比" | ||||
|                         /> | ||||
|                         — | ||||
|                         <el-input v-model.number="item.tpSlPriceRatio" min="0" style="width:42%" size="mini" type="number" placeholder="止盈后止损价百分比"> | ||||
|                           <template slot="append">%</template> | ||||
|                         </el-input> | ||||
|                         <el-input | ||||
|                           v-model.number="item.tpSlPriceRatio" | ||||
|                           min="0" | ||||
|                           style="width:42%" | ||||
|                           size="mini" | ||||
|                           type="number" | ||||
|                           placeholder="止盈后止损价百分比" | ||||
|                         /> | ||||
|                       </div> | ||||
|                     </el-col> | ||||
|                   </template> | ||||
|                   <el-col :span="12"> | ||||
|                     <div style="margin-bottom: 14px;" /> | ||||
|                     <el-button size="mini" type="danger" @click="onAddExt(1, index)">删除</el-button> | ||||
|                   <el-col :span="3"> | ||||
|                     <div style="margin-bottom: 14px;" /><el-button | ||||
|                       size="mini" | ||||
|                       type="danger" | ||||
|                       @click="onAddExt(1, index)" | ||||
|                     >删除</el-button> | ||||
|                   </el-col> | ||||
|                 </el-row> | ||||
|               </div> | ||||
| @ -989,7 +1009,11 @@ | ||||
|                 <el-radio label="LIMIT">限价</el-radio> | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-if="storeForm.cover_account_a_type === 'LIMIT'" label="加仓主账号限价比例" prop="cover_account_a_rate"> | ||||
|             <el-form-item | ||||
|               v-if="storeForm.cover_account_a_type === 'LIMIT'" | ||||
|               label="加仓主账号限价比例" | ||||
|               prop="cover_account_a_rate" | ||||
|             > | ||||
|               <el-input v-model="storeForm.cover_account_a_rate" placeholder="加仓主账号限价比例" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="加仓副账号类型" prop="cover_account_b_type"> | ||||
| @ -998,7 +1022,11 @@ | ||||
|                 <el-radio label="LIMIT">限价</el-radio> | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item v-if="storeForm.cover_account_b_type === 'LIMIT'" label="加仓副账号限价比例" prop="cover_account_b_rate"> | ||||
|             <el-form-item | ||||
|               v-if="storeForm.cover_account_b_type === 'LIMIT'" | ||||
|               label="加仓副账号限价比例" | ||||
|               prop="cover_account_b_rate" | ||||
|             > | ||||
|               <el-input v-model="storeForm.cover_account_b_rate" placeholder="加仓副账号限价比例" /> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="加仓类型" prop="cover_type"> | ||||
| @ -1084,6 +1112,16 @@ | ||||
|                 </div> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="平仓方向" prop="side"> | ||||
|               <el-radio-group v-model="positionForm.side"> | ||||
|                 <el-radio | ||||
|                   v-for="(item, index) in sideList" | ||||
|                   :key="'position_side' + index" | ||||
|                   :label="item.value" | ||||
|                   :disabled="item.value=='SELL'&&positionForm.close_type==1" | ||||
|                 >{{ item.label }}</el-radio> | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="平仓行情百分比" prop="rate"> | ||||
|               <el-input v-model="positionForm.rate" placeholder="平仓行情百分比" /> | ||||
|             </el-form-item> | ||||
| @ -1118,7 +1156,11 @@ | ||||
|                 <el-option v-for="dict in exchangeTypes" :key="dict.value" :label="dict.label" :value="dict.value" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="api用户" prop="api_id" :rules="[{ required: true, message: 'api用户不能为空', trigger: 'blur' }]"> | ||||
|             <el-form-item | ||||
|               label="api用户" | ||||
|               prop="api_id" | ||||
|               :rules="[{ required: true, message: 'api用户不能为空', trigger: 'blur' }]" | ||||
|             > | ||||
|               <el-select | ||||
|                 v-model="cancelForm.api_id" | ||||
|                 style="width: 100%;" | ||||
| @ -1191,6 +1233,16 @@ export default { | ||||
|         { v: 'BUY', l: '买(多)' }, | ||||
|         { v: 'SELL', l: '卖(空)' } | ||||
|       ], | ||||
|       sideList: [{ | ||||
|         label: '全部', | ||||
|         value: 'ALL' | ||||
|       }, { | ||||
|         label: '买', | ||||
|         value: 'BUY' | ||||
|       }, { | ||||
|         label: '卖', | ||||
|         value: 'SELL' | ||||
|       }], | ||||
|       // :0=待触发;1=已触发;2=下单失败;3=已记录;4=已取消;5=委托中;6=已平仓;7=已补单;8=补单失败;9=现货已成交;10=合约已补单;11=合约补单失败;12=合约已成交;13=已开仓 | ||||
|       status: [ | ||||
|         { v: 0, l: '待触发' }, | ||||
| @ -1492,6 +1544,11 @@ export default { | ||||
|     }, | ||||
|     onChangePosition() { | ||||
|       // this.getLineApiUserItems(this.positionForm.exchange_type) | ||||
|  | ||||
|       if (this.positionForm.close_type === 1) { | ||||
|         this.positionForm.side = 'BUY' | ||||
|       } | ||||
|  | ||||
|       this.getListLineApiUser(this.positionForm.exchange_type) | ||||
|       this.$set(this.positionForm, 'symbol', undefined) | ||||
|       this.getSymbol({}, this.positionForm.close_type, this.positionForm.exchange_type) | ||||
| @ -1637,7 +1694,8 @@ export default { | ||||
|         api_id: undefined, | ||||
|         symbol: undefined, | ||||
|         rate: '0', | ||||
|         close_type: 1 | ||||
|         close_type: 1, | ||||
|         side: 'ALL' | ||||
|       } | ||||
|       this.getSymbol({}, 1) | ||||
|       // this.getLineApiUserItems(this.positionForm.exchange_type) | ||||
| @ -1651,7 +1709,8 @@ export default { | ||||
|         api_id: undefined, | ||||
|         symbol: undefined, | ||||
|         rate: '0', | ||||
|         close_type: 1 | ||||
|         close_type: 1, | ||||
|         side: 'ALL' | ||||
|       } | ||||
|       this.resetForm('formPosition') | ||||
|     }, | ||||
| @ -1935,7 +1994,9 @@ export default { | ||||
|           } else { | ||||
|             if (this.title === '批量添加') { | ||||
|               const params = JSON.parse(JSON.stringify({ | ||||
|                 ...this.form, symbol_group_id: String(this.form.symbol_group_id), api_id: this.form.api_id.toString(), | ||||
|                 ...this.form, | ||||
|                 symbol_group_id: String(this.form.symbol_group_id), | ||||
|                 api_id: this.form.api_id.toString(), | ||||
|                 profit_num_ratio: this.form.profit_num_ratio || 100, | ||||
|                 profit_tp_tp_price_ratio: this.form.profit_tp_tp_price_ratio || 0, | ||||
|                 profit_tp_sl_price_ratio: this.form.profit_tp_sl_price_ratio || 0 | ||||
| @ -2083,6 +2144,13 @@ export default { | ||||
|         this.ext = res?.data?.ext || [] | ||||
|         this.re_take_profit_ratio = res?.data?.re_take_profit_ratio || 0 | ||||
|       }) | ||||
|     }, | ||||
|     orderTypeFormat(row) { | ||||
|       if (row.orderCategory === 3 && row.orderType === 0) { | ||||
|         return '加仓' | ||||
|       } else { | ||||
|         return this.orderTypes[row.orderType] ? this.orderTypes[row.orderType].l : '' | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user