Selaa lähdekoodia

修改交易模式

huangbin 4 vuotta sitten
vanhempi
commit
20b419a976

+ 15 - 0
src/common/constants/index.ts → src/common/constants/enumCommon.ts

@@ -102,3 +102,18 @@ export enum CardType {
     OTHER_PERSON,    // 个人其他类证件
     OTHER_ORG,    // 非个人其他类证件
 }
+
+// 交易模式
+export enum TradeMode {
+    Market = 10,    // 做市
+    Bidding = 13,   // 竞价
+    ChannelTrading = 15, // 通道交易
+    ListingAndSelection = 16, // 挂牌点选
+    WarehouseReceiptTrade = 17, // 仓单贸易
+    Option = 18, // 期权
+    Bidding_down = 19, // 竞拍-降价式
+    Bidding_up = 20, // 竞拍-竞价式
+    Bidding_large = 21, // 受托竞价
+    EntrustedBidding = 21, // 受托竞价
+    Platinum = 69, // 铂金宝
+}

+ 7 - 0
src/services/bus/market.ts

@@ -0,0 +1,7 @@
+import { TradeMode } from "@/common/constants/enumCommon";
+import APP from '@/services';
+import { Market } from "../go/useInfo/interface";
+
+export function getMarketByTradeMode(trademode: TradeMode) {
+    return APP.get('markets').find((el: Market) => el.trademode === trademode)
+}

+ 1 - 1
src/services/socket/order/index.ts

@@ -1,5 +1,5 @@
 // 用户相关请求模块
-import { DelistingType, OperateType, OptionType, PriceType } from '@/common/constants/index';
+import { DelistingType, OperateType, OptionType, PriceType } from '@/common/constants/enumCommon';
 import APP from '@/services';
 import { getUserId } from '@/services/bus/account';
 import { getLongTypeLoginID } from '@/services/bus/login';

+ 4 - 2
src/services/socket/protobuf/protoHeader.ts

@@ -1,4 +1,6 @@
+import { TradeMode } from "@/common/constants/enumCommon";
 import { getSelectedAccountId, getUserId } from "@/services/bus/account";
+import { getMarketByTradeMode } from "@/services/bus/market";
 import { funCode } from "@/services/funcode";
 import { v4 as uuidv4 } from 'uuid';
 import { IMessageHead } from "./proto";
@@ -37,10 +39,10 @@ export function getProtoHeadParam(funCodeName: string, type: HeadEnum = 0): IMes
             })
             break
         case HeadEnum.MarketID15101:
-            result = Object.assign(result, {  MarketID: 15101,})
+            result = Object.assign(result, { MarketID: getMarketByTradeMode(TradeMode.ChannelTrading), })
             break;
         case HeadEnum.MarketID69201:
-            result = Object.assign(result, {  MarketID: 69201,})
+            result = Object.assign(result, { MarketID: getMarketByTradeMode(TradeMode.Platinum), })
             break;
     }
     return result