|
|
@@ -173,6 +173,7 @@ import { defineComponent, PropType, ref } from 'vue';
|
|
|
import { useUserType } from '../setup';
|
|
|
import { FormParam } from './interface';
|
|
|
import { handleForm, useBlocksPrice, useBlocksNumber } from './setup';
|
|
|
+import { useTodayMargin } from '@/hooks/margin';
|
|
|
|
|
|
export default defineComponent({
|
|
|
emits: ['cancel', 'update'],
|
|
|
@@ -193,6 +194,8 @@ export default defineComponent({
|
|
|
},
|
|
|
},
|
|
|
setup(props, context) {
|
|
|
+ // 获取保证金比例
|
|
|
+ const { getReckonMarginValueByTradeMode } = useTodayMargin();
|
|
|
// 控制弹窗
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
// 表单
|
|
|
@@ -219,11 +222,10 @@ export default defineComponent({
|
|
|
};
|
|
|
// 保证金
|
|
|
const getMargin = () => {
|
|
|
- const { buymarginvalue, sellmarginvalue } = useTradeRule();
|
|
|
- const marginvalue = isBuy() ? buymarginvalue : sellmarginvalue;
|
|
|
+ const marginvalue = getReckonMarginValueByTradeMode(TradeMode.DiaoQi);
|
|
|
let result = 0;
|
|
|
- if (formState.num) {
|
|
|
- result = (getMoney() + props.selectedRow.marketmaxsub) * formState.num * marginvalue;
|
|
|
+ if (formState.num && marginvalue) {
|
|
|
+ result = (getMoney() + props.selectedRow.marketmaxsub) * formState.num * (marginvalue / 100);
|
|
|
}
|
|
|
return result ? result.toFixed(2) : '--';
|
|
|
};
|