|
|
@@ -2,8 +2,9 @@
|
|
|
<template>
|
|
|
<app-tabs class="app-tabs--primary" :data-list="dataList" prop-label="marketsectionname" @change="onTabChange">
|
|
|
<app-tabs class="app-tabs--primary" :data-list="marketList" v-model:data-index="marketIndex" direction="bottom"
|
|
|
- prop-label="marketname" @change="onMarketChange">
|
|
|
- <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
|
|
|
+ prop-label="displayname" @change="onMarketChange">
|
|
|
+ <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ marketids }"
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
</app-tabs>
|
|
|
</app-tabs>
|
|
|
</template>
|
|
|
@@ -12,7 +13,7 @@
|
|
|
import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
-import { queryTjmdMarketSection } from '@/services/api/swap'
|
|
|
+import { getMarketSections } from '@/services/api/market'
|
|
|
import AppTabs from '@/components/base/tabs/index.vue'
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
|
@@ -21,13 +22,14 @@ const componentMap = new Map<string, unknown>([
|
|
|
])
|
|
|
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
-const marketList = shallowRef<Model.TjmdMarketSectionRsp['mlist']>([])
|
|
|
+const marketList = shallowRef<Model.GetMarketSectionsRsp['marketsectionconfignews']>([])
|
|
|
const marketIndex = shallowRef(-1)
|
|
|
+const marketids = shallowRef<number[]>([])
|
|
|
|
|
|
-const { dataList } = useRequest(queryTjmdMarketSection, {
|
|
|
+const { dataList } = useRequest(getMarketSections, {
|
|
|
onSuccess: (res) => {
|
|
|
const [firstTab] = res.data
|
|
|
- const [firstMarket] = firstTab?.mlist ?? []
|
|
|
+ const [firstMarket] = firstTab?.marketsectionconfignews ?? []
|
|
|
if (firstMarket) {
|
|
|
onTabChange(0)
|
|
|
}
|
|
|
@@ -36,7 +38,7 @@ const { dataList } = useRequest(queryTjmdMarketSection, {
|
|
|
|
|
|
const onTabChange = (index: number) => {
|
|
|
const item = dataList.value[index]
|
|
|
- marketList.value = item.mlist
|
|
|
+ marketList.value = item.marketsectionconfignews
|
|
|
componentId.value = undefined
|
|
|
|
|
|
if (marketList.value.length) {
|
|
|
@@ -48,10 +50,15 @@ const onTabChange = (index: number) => {
|
|
|
const onMarketChange = (index: number) => {
|
|
|
const item = marketList.value[index]
|
|
|
if (item) {
|
|
|
- if ([50101, 50102, 50103, 50104, 16201].includes(item.marketid)) {
|
|
|
- openComponent('orderList')
|
|
|
- } else {
|
|
|
- openComponent(item.marketid.toString())
|
|
|
+ marketids.value = item.marketids.split(',').map((val) => Number(val))
|
|
|
+ switch (true) {
|
|
|
+ case [50, 16].includes(item.trademode): {
|
|
|
+ openComponent('orderList')
|
|
|
+ break
|
|
|
+ }
|
|
|
+ default: {
|
|
|
+ openComponent(item.marketids)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|