|
|
@@ -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 {
|
|
|
@@ -125,3 +128,25 @@ export function handleNumAndPrice() {
|
|
|
}
|
|
|
return { getWrMoney, getWrMargin, isFloat, isFixed, isBlocs }
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 查询市场板块,用于挂牌时挂牌方式选择,替代之前的“一口价、浮动价和贸易圈”
|
|
|
+ */
|
|
|
+export function queryMarketSection(isPre: boolean) {
|
|
|
+ const spotMarkets = ref<TjmdMarketSectionConfig[]>([]);
|
|
|
+ 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 = resMarkets
|
|
|
+ })
|
|
|
+}
|