li.shaoyi 3 vuotta sitten
vanhempi
commit
9c53f6f2e7
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      src/views/market/spot_trade/components/post_buying/setup.ts

+ 3 - 3
src/views/market/spot_trade/components/post_buying/setup.ts

@@ -3,7 +3,7 @@ import { EnumRouterName } from "@/common/constants/enumRouterName";
 import { validateCommon } from "@/common/setup/validate";
 import { useVerifyBeginDelistingNum, useVerifyListingBasis, useVerifyListingNum } from '@/hooks/form/verify';
 import { getAccountTypeList, getCanUseMoney } from "@/services/bus/account";
-import { getRules } from '@/services/bus/rules';
+import { getRulesByMarketid } from '@/services/bus/rules';
 import { AccountListItem } from "@/services/dataCenter/interafce/account";
 import { WrOrderQuote } from "@/services/go/wrtrade/interface";
 import { RuleObject } from "ant-design-vue/lib/form/interface";
@@ -56,8 +56,8 @@ export function handleNumAndPrice(enumName: EnumRouterName, selectedRow: WrOrder
     // 获取选中的资金账号
     const getSelectedAccount = () => accountList.find((e) => e.accountid === formState.accountid);
     // 交易规则
-    const rules = getRules()
-    const { buymarginvalue, buymarginalgorithm } = rules.length ? rules[0] : { buymarginvalue: 0, buymarginalgorithm: 1 }
+    const rules = getRulesByMarketid(formState.marketid ?? 0)
+    const { buymarginvalue, buymarginalgorithm } = rules ?? { buymarginvalue: 0, buymarginalgorithm: 1 }
     //保证金模式 1: 比率 2: 固定
     const marginMethod = () => buymarginalgorithm === 1
     // 挂牌最大数量