zhou.xiaoning 4 年 前
コミット
43dfb66759

+ 2 - 2
src/services/go/Tjmd/index.ts

@@ -40,8 +40,8 @@ export function queryTjmdTransferApply(req: type.QueryTjmdTransferApplyReq): Pro
 /**
  * /Tjmd/QueryTjmdMarketSection 查询市场板块
  */
-export function queryTjmdMarketSection(): Promise<type.QueryTjmdTransferApplyRsp[]> {
-    return commonSearch_go('/Tjmd/QueryTjmdTransferApply', {}).catch((err) => {
+export function queryTjmdMarketSection(): Promise<type.TjmdMarketSection[]> {
+    return commonSearch_go('/Tjmd/QueryTjmdMarketSection', {}).catch((err) => {
         throw new Error(`查询市场板块 : ${err}`);
     });
 }

+ 21 - 3
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/setup.ts

@@ -10,6 +10,9 @@ import { RuleObject } from 'ant-design-vue/lib/form/interface';
 import moment from 'moment';
 import { onBeforeUnmount, reactive, ref, UnwrapRef } from "vue";
 import { ListingForm } from "./interface";
+import { queryTjmdMarketSection } from "@/services/go/Tjmd"
+import { TjmdMarketSection, TjmdMarketSectionConfig } from '@/services/go/Tjmd/interface';
+import { getAllMarkets } from '@/services/bus/market';
 
 function initFormData(): ListingForm {
     return {
@@ -127,8 +130,23 @@ export function handleNumAndPrice() {
 }
 
 /**
- * 查询市场板块
+ * 查询市场板块,用于挂牌时挂牌方式选择,替代之前的“一口价、浮动价和贸易圈”
  */
-// export function queryTjmdMarketSection() {
+export function queryMarketSection(isPre: boolean) {
+    const spotMarkets = ref<TjmdMarketSection[]>([]); 
+    queryTjmdMarketSection().then(res => {
+        let resMarkets: TjmdMarketSectionConfig[] = []
+        res.forEach(item => { resMarkets.push(...item.mlist) })
+        // 根据有无仓单过滤出仓单市场
+        resMarkets = resMarkets.filter(item => {
+            item.auctionwrtype === (!isPre ? 2 : 1) && item.trademode === TradeMode.WarehouseReceiptTrade
+        })
+        // 过滤掉没有权限的市场
+        const markets = getAllMarkets()
+        resMarkets = resMarkets.filter(item => {
+            markets.findIndex(m => m.marketid == item.marketid) !== -1
+        })
 
-// }
+        spotMarkets.value = res
+    })
+}