li.shaoyi há 1 ano atrás
pai
commit
e5fa57b86b

+ 2 - 2
oem/tss/config/appconfig.json

@@ -1,8 +1,8 @@
 {
   "appId": "com.muchinfo.tss",
   "appName": "TCE",
-  "version": "1.0.6",
-  "versionCode": "100006",
+  "version": "1.0.7",
+  "versionCode": "100007",
   "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
   "tradeChannel": "ws",
   "modules": [

+ 9 - 7
src/packages/mobile/views/pricing/list/Index.vue

@@ -3,7 +3,7 @@
         <template #header>
             <app-navbar :title="titleName" :show-back-button="showBackButton" />
         </template>
-        <app-list :columns="columns" :data-list="tableList" @row-click="rowClick">
+        <app-list :columns="columns" :data-list="dataList" @row-click="rowClick">
             <!-- 当前价 -->
             <template #last="{ row }">
                 <span :class="row.lastColor">{{ row.last }}</span>
@@ -42,7 +42,7 @@
 
 <script lang="ts" setup>
 
-import { computed, onUnmounted, PropType } from 'vue'
+import { computed, onUnmounted,onActivated, PropType } from 'vue'
 import { parsePercent, handleNumberValue, formatDecimal } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
 import { useFuturesStore, i18n } from '@/stores'
@@ -64,15 +64,13 @@ const props = defineProps({
 const { global: { t } } = i18n
 const { router, getQueryString } = useNavigation()
 const futuresStore = useFuturesStore()
-const subscribe = quoteSocket.createSubscribe()
-
-const dataList = computed(() => futuresStore.getGoodsListByTradeMode(ETradeMode.TRADEMODE_MARKETMAKE))
 
 const title = getQueryString('title')
 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 { 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 {
@@ -97,6 +95,9 @@ const tableList = computed(() => {
     })
 })
 
+const goodsCodes = dataList.value.map((e) => e.goodscode.toUpperCase())
+const subscribe = quoteSocket.createSubscribe()
+
 const columns: Model.TableColumn[] = [
     { field: 'goodsname', label: t('quote.goodsname') },
     { field: 'last', label: t('quote.last') },
@@ -123,5 +124,6 @@ const rowClick = (row: Model.GoodsQuote) => {
     })
 }
 
+onActivated(() => subscribe.start(...goodsCodes))
 onUnmounted(() => subscribe.stop())
 </script>