|
@@ -3,7 +3,7 @@
|
|
|
<template #header>
|
|
<template #header>
|
|
|
<app-navbar :title="titleName" :show-back-button="showBackButton" />
|
|
<app-navbar :title="titleName" :show-back-button="showBackButton" />
|
|
|
</template>
|
|
</template>
|
|
|
- <app-list :columns="columns" :data-list="tableList" @row-click="rowClick">
|
|
|
|
|
|
|
+ <app-list :columns="columns" :data-list="dataList" @row-click="rowClick">
|
|
|
<!-- 当前价 -->
|
|
<!-- 当前价 -->
|
|
|
<template #last="{ row }">
|
|
<template #last="{ row }">
|
|
|
<span :class="row.lastColor">{{ row.last }}</span>
|
|
<span :class="row.lastColor">{{ row.last }}</span>
|
|
@@ -42,7 +42,7 @@
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
|
|
|
|
|
-import { computed, onUnmounted, PropType } from 'vue'
|
|
|
|
|
|
|
+import { computed, onUnmounted,onActivated, PropType } from 'vue'
|
|
|
import { parsePercent, handleNumberValue, formatDecimal } from '@/filters'
|
|
import { parsePercent, handleNumberValue, formatDecimal } from '@/filters'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { useFuturesStore, i18n } from '@/stores'
|
|
import { useFuturesStore, i18n } from '@/stores'
|
|
@@ -64,15 +64,13 @@ const props = defineProps({
|
|
|
const { global: { t } } = i18n
|
|
const { global: { t } } = i18n
|
|
|
const { router, getQueryString } = useNavigation()
|
|
const { router, getQueryString } = useNavigation()
|
|
|
const futuresStore = useFuturesStore()
|
|
const futuresStore = useFuturesStore()
|
|
|
-const subscribe = quoteSocket.createSubscribe()
|
|
|
|
|
-
|
|
|
|
|
-const dataList = computed(() => futuresStore.getGoodsListByTradeMode(ETradeMode.TRADEMODE_MARKETMAKE))
|
|
|
|
|
|
|
|
|
|
const title = getQueryString('title')
|
|
const title = getQueryString('title')
|
|
|
const titleName = computed(() => title ? decodeURIComponent(title) : props.marketSection?.displayname ?? '订单点价')
|
|
const titleName = computed(() => title ? decodeURIComponent(title) : props.marketSection?.displayname ?? '订单点价')
|
|
|
|
|
|
|
|
-const tableList = computed(() => {
|
|
|
|
|
- return dataList.value.map((item) => {
|
|
|
|
|
|
|
+const dataList = computed(() => {
|
|
|
|
|
+ const list = futuresStore.getGoodsListByTradeMode(ETradeMode.TRADEMODE_MARKETMAKE)
|
|
|
|
|
+ return list.map((item) => {
|
|
|
const quote = futuresStore.getGoodsQuote(item.goodscode)
|
|
const quote = futuresStore.getGoodsQuote(item.goodscode)
|
|
|
const { lastColor, openedColor, lowestColor, highestColor, last = 0, presettle = 0, rise = 0, change, amplitude, highest = 0, lowest = 0, opened = 0, ask = 0, bid = 0, bidColor, askColor, decimalplace } = quote.value ?? {}
|
|
const { lastColor, openedColor, lowestColor, highestColor, last = 0, presettle = 0, rise = 0, change, amplitude, highest = 0, lowest = 0, opened = 0, ask = 0, bid = 0, bidColor, askColor, decimalplace } = quote.value ?? {}
|
|
|
return {
|
|
return {
|
|
@@ -97,6 +95,9 @@ const tableList = computed(() => {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const goodsCodes = dataList.value.map((e) => e.goodscode.toUpperCase())
|
|
|
|
|
+const subscribe = quoteSocket.createSubscribe()
|
|
|
|
|
+
|
|
|
const columns: Model.TableColumn[] = [
|
|
const columns: Model.TableColumn[] = [
|
|
|
{ field: 'goodsname', label: t('quote.goodsname') },
|
|
{ field: 'goodsname', label: t('quote.goodsname') },
|
|
|
{ field: 'last', label: t('quote.last') },
|
|
{ field: 'last', label: t('quote.last') },
|
|
@@ -123,5 +124,6 @@ const rowClick = (row: Model.GoodsQuote) => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+onActivated(() => subscribe.start(...goodsCodes))
|
|
|
onUnmounted(() => subscribe.stop())
|
|
onUnmounted(() => subscribe.stop())
|
|
|
</script>
|
|
</script>
|