|
|
|
@ -89,111 +89,111 @@ |
|
|
|
</table> |
|
|
|
<!-- 平仓 --> |
|
|
|
<div |
|
|
|
class="modal fade" |
|
|
|
id="exampleModal" |
|
|
|
tabindex="-1" |
|
|
|
role="dialog" |
|
|
|
aria-labelledby="exampleModalLabel" |
|
|
|
aria-hidden="true" |
|
|
|
class="modal fade" |
|
|
|
id="exampleModal" |
|
|
|
tabindex="-1" |
|
|
|
role="dialog" |
|
|
|
aria-labelledby="exampleModalLabel" |
|
|
|
aria-hidden="true" |
|
|
|
> |
|
|
|
<div class="modal-dialog modal-dialog-centered"> |
|
|
|
<div class="modal-content"> |
|
|
|
<div class="modal-header"> |
|
|
|
<h5 class="modal-title" id="exampleModalLabel"> |
|
|
|
{{ $t("contract.d6") }} |
|
|
|
</h5> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
class="close" |
|
|
|
data-dismiss="modal" |
|
|
|
aria-label="Close" |
|
|
|
> |
|
|
|
<span aria-hidden="true">×</span> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<div class="modal-body"> |
|
|
|
<form> |
|
|
|
<div class="form-group"> |
|
|
|
<label for="recipient-name" class="col-form-label" |
|
|
|
>{{ $t("contract.d8") }}:</label |
|
|
|
<div class="modal-dialog modal-dialog-centered"> |
|
|
|
<div class="modal-content"> |
|
|
|
<div class="modal-header"> |
|
|
|
<h5 class="modal-title" id="exampleModalLabel"> |
|
|
|
{{ $t("contract.d6") }} |
|
|
|
</h5> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
class="close" |
|
|
|
data-dismiss="modal" |
|
|
|
aria-label="Close" |
|
|
|
> |
|
|
|
<div class="input-group"> |
|
|
|
<input |
|
|
|
type="text" |
|
|
|
v-model="form.entrust_price" |
|
|
|
class="form-control" |
|
|
|
id="recipient-name" |
|
|
|
v-if="activeItem.closeType == 1" |
|
|
|
/> |
|
|
|
<input |
|
|
|
type="text" |
|
|
|
disabled |
|
|
|
:value="$t('contract.d9')" |
|
|
|
class="form-control" |
|
|
|
id="recipient-name" |
|
|
|
v-if="activeItem.closeType == 2" |
|
|
|
/> |
|
|
|
<div class="input-group-append"> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
@click=" |
|
|
|
activeItem.closeType == 1 |
|
|
|
? (activeItem.closeType = 2) |
|
|
|
: (activeItem.closeType = 1) |
|
|
|
" |
|
|
|
class="btn btn-outline-primary" |
|
|
|
<span aria-hidden="true">×</span> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<div class="modal-body"> |
|
|
|
<form> |
|
|
|
<div class="form-group"> |
|
|
|
<label for="recipient-name" class="col-form-label" |
|
|
|
>{{ $t("contract.d8") }}:</label |
|
|
|
> |
|
|
|
{{ |
|
|
|
activeItem.closeType == 1 |
|
|
|
? $t("contract.e0") |
|
|
|
: $t("contract.d9") |
|
|
|
}} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<div class="input-group"> |
|
|
|
<input |
|
|
|
type="text" |
|
|
|
v-model="form.entrust_price" |
|
|
|
class="form-control" |
|
|
|
id="recipient-name" |
|
|
|
v-if="activeItem.closeType == 1" |
|
|
|
/> |
|
|
|
<input |
|
|
|
type="text" |
|
|
|
disabled |
|
|
|
:value="$t('contract.d9')" |
|
|
|
class="form-control" |
|
|
|
id="recipient-name" |
|
|
|
v-if="activeItem.closeType == 2" |
|
|
|
/> |
|
|
|
<div class="input-group-append"> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
@click=" |
|
|
|
activeItem.closeType == 1 |
|
|
|
? (activeItem.closeType = 2) |
|
|
|
: (activeItem.closeType = 1) |
|
|
|
" |
|
|
|
class="btn btn-outline-primary" |
|
|
|
> |
|
|
|
{{ |
|
|
|
activeItem.closeType == 1 |
|
|
|
? $t("contract.e0") |
|
|
|
: $t("contract.d9") |
|
|
|
}} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label for="message-text" class="col-form-label" |
|
|
|
>{{ $t("contract.e1") }}:</label |
|
|
|
<div class="form-group"> |
|
|
|
<label for="message-text" class="col-form-label" |
|
|
|
>{{ $t("contract.e1") }}:</label |
|
|
|
> |
|
|
|
<input |
|
|
|
type="number" |
|
|
|
v-model="form.amount" |
|
|
|
class="form-control" |
|
|
|
id="message-text" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
{{ $t("contract.e9") }} |
|
|
|
{{ activeItem.avail_position }} |
|
|
|
</div> |
|
|
|
<el-slider |
|
|
|
:value="activeStep" |
|
|
|
@input="sliderChange" |
|
|
|
:format-tooltip="tooltip" |
|
|
|
:step="25" |
|
|
|
show-stops |
|
|
|
></el-slider> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
<div class="modal-footer"> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
class="btn btn-secondary" |
|
|
|
data-dismiss="modal" |
|
|
|
> |
|
|
|
<input |
|
|
|
type="number" |
|
|
|
v-model="form.amount" |
|
|
|
class="form-control" |
|
|
|
id="message-text" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
{{ $t("contract.e9") }} |
|
|
|
{{ activeItem.avail_position }} |
|
|
|
</div> |
|
|
|
<el-slider |
|
|
|
:value="activeStep" |
|
|
|
@input="sliderChange" |
|
|
|
:format-tooltip="tooltip" |
|
|
|
:step="25" |
|
|
|
show-stops |
|
|
|
></el-slider> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
<div class="modal-footer"> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
class="btn btn-secondary" |
|
|
|
data-dismiss="modal" |
|
|
|
> |
|
|
|
{{ $t("contract.c4") }} |
|
|
|
</button> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
class="btn btn-primary" |
|
|
|
@click="closePosition" |
|
|
|
> |
|
|
|
{{ $t("contract.c5") }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
{{ $t("contract.c4") }} |
|
|
|
</button> |
|
|
|
<button |
|
|
|
type="button" |
|
|
|
class="btn btn-primary" |
|
|
|
@click="closePosition" |
|
|
|
> |
|
|
|
{{ $t("contract.c5") }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 市价平仓 --> |
|
|
|
<div |
|
|
|
@ -449,53 +449,54 @@ export default { |
|
|
|
name: "hold-position", |
|
|
|
props: { |
|
|
|
symbol: { |
|
|
|
default: "", |
|
|
|
type: String, |
|
|
|
required: false, |
|
|
|
default: "", |
|
|
|
type: String, |
|
|
|
required: false, |
|
|
|
}, |
|
|
|
holdPositionList: { |
|
|
|
default: () => [], |
|
|
|
type: Array, |
|
|
|
required: false, |
|
|
|
default: () => [], |
|
|
|
type: Array, |
|
|
|
required: false, |
|
|
|
}, |
|
|
|
newPrice: { |
|
|
|
default: 0, |
|
|
|
type: Number, |
|
|
|
required: false, |
|
|
|
default: 0, |
|
|
|
type: Number, |
|
|
|
required: false, |
|
|
|
}, |
|
|
|
holdPositionAll: { |
|
|
|
default: false, |
|
|
|
type: Boolean, |
|
|
|
default: false, |
|
|
|
type: Boolean, |
|
|
|
}, |
|
|
|
symbolDetail: { |
|
|
|
default: () => {}, |
|
|
|
type: Object, |
|
|
|
default: () => {}, |
|
|
|
type: Object, |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
showList() { |
|
|
|
return this.holdPositionList.filter((item) => item.hold_position); |
|
|
|
return this.holdPositionList.filter((item) => item.hold_position); |
|
|
|
}, |
|
|
|
activeStep() { |
|
|
|
if (!this.form.amount || !this.activeItem.avail_position) return 0; |
|
|
|
let num = (this.form.amount / this.activeItem.avail_position) * 100; |
|
|
|
return num; |
|
|
|
// return 0 |
|
|
|
if (!this.form.amount || !this.activeItem.avail_position) return 100; |
|
|
|
let num = (this.form.amount / this.activeItem.avail_position) * 100; |
|
|
|
return num; |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
list: [], |
|
|
|
activeItem: {}, |
|
|
|
form: { |
|
|
|
entrust_price: "", |
|
|
|
amount: "", |
|
|
|
}, |
|
|
|
strategyForm: { |
|
|
|
symbol: "", |
|
|
|
position_side: "", |
|
|
|
tp_trigger_price: "", |
|
|
|
sl_trigger_price: "", |
|
|
|
}, |
|
|
|
list: [], |
|
|
|
activeItem: {}, |
|
|
|
form: { |
|
|
|
entrust_price: "", |
|
|
|
amount: "", |
|
|
|
}, |
|
|
|
strategyForm: { |
|
|
|
symbol: "", |
|
|
|
position_side: "", |
|
|
|
tp_trigger_price: "", |
|
|
|
sl_trigger_price: "", |
|
|
|
}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
watch: {}, |
|
|
|
@ -530,10 +531,10 @@ export default { |
|
|
|
}, |
|
|
|
// 平仓弹窗 |
|
|
|
liquidation(item) { |
|
|
|
this.activeItem = item; |
|
|
|
this.form.entrust_price = this.newPrice; |
|
|
|
this.$set(this.activeItem, "closeType", 1); |
|
|
|
$("#exampleModal").modal("show"); |
|
|
|
this.activeItem = item; |
|
|
|
this.form.entrust_price = this.newPrice; |
|
|
|
this.$set(this.activeItem, "closeType", 1); |
|
|
|
$("#exampleModal").modal("show"); |
|
|
|
}, |
|
|
|
closePosition() { |
|
|
|
let data = { |
|
|
|
@ -619,4 +620,4 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|