li.shaoyi 2 lat temu
rodzic
commit
4f23dce862

+ 3 - 3
oem/zrwyt/manifest.json

@@ -5,9 +5,9 @@
     "name" : "中融文遗通",
     /*应用名称,程序桌面图标名称*/
     "version" : {
-        "name" : "1.0.13",
+        "name" : "1.0.15",
         /*应用版本名称*/
-        "code" : 100013
+        "code" : 100015
     },
     "description" : "",
     /*应用描述信息*/
@@ -155,7 +155,7 @@
                 ],
                 "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
                 "autoSdkPermissions" : false,
-                "minSdkVersion" : 29
+                "minSdkVersion" : 26
             },
             /*使用Native.js调用原生安卓API需要使用到的系统权限*/
             "orientation" : [ "portrait-primary" ],

+ 4 - 5
src/hooks/hqchart/timeline/dataset.ts

@@ -1,4 +1,5 @@
 import { reactive, shallowRef, toRefs, computed } from 'vue'
+import { getRangeTime } from '@/utils/time'
 import { queryTSData } from '@/services/api/quote'
 import { NetworkFilterData, NetworkFilterCallback } from './types'
 import moment from 'moment'
@@ -22,11 +23,9 @@ export function useDataset(goodsCode: string) {
     // 交易时间段
     const timeSplit = computed(() => {
         const { runSteps = [] } = cache.value ?? {}
-        return runSteps.reduce<{ Start: number; End: number; }[]>((pre, cur) => {
-            pre.push({
-                Start: Number(moment(cur.start).format('HHmm')),
-                End: Number(moment(cur.end).format('HHmm'))
-            })
+        return runSteps.reduce<number[]>((pre, cur) => {
+            const rangeTime = getRangeTime(cur.start, cur.end, 'HHmm', 'm')
+            pre.push(...rangeTime.map((val) => Number(val)))
             return pre
         }, [])
     })

+ 1 - 1
src/packages/mobile/components/modules/hqchart/timeline/index.vue

@@ -84,7 +84,7 @@ const onReady = (chart: unknown) => {
         const minuteTimeStringData = Chart.JSChart.GetMinuteTimeStringData()
         const minuteCoordinateData = Chart.JSChart.GetMinuteCoordinateData()
         // 当天所有的交易时间点
-        minuteTimeStringData.GetET = () => minuteTimeStringData.CreateTimeData(timeSplit.value)
+        minuteTimeStringData.GetET = () => timeSplit.value
         // 替换交易时间段
         minuteTimeStringData.CreateETData = () => minuteTimeStringData.GetET()
         // 替换X轴刻度信息

+ 10 - 8
src/packages/mobile/components/modules/quote/tik/index.vue

@@ -13,7 +13,7 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, watch } from 'vue'
+import { ref } from 'vue'
 import { formatDate, handleNumberValue } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryHistoryTikDatas, queryMarketRun } from '@/services/api/market'
@@ -27,8 +27,8 @@ const props = defineProps({
     },
 })
 
-const futuresStore = useFuturesStore()
-const quote = futuresStore.getGoodsQuote(props.goodsCode)
+const { getGoodsQuote, quoteWatch } = useFuturesStore()
+const quote = getGoodsQuote(props.goodsCode)
 const dataList = ref<Model.HistoryTikDatasRsp[]>([])
 
 const columns: Model.TableColumn[] = [
@@ -63,8 +63,10 @@ useRequest(queryMarketRun, {
     }
 })
 
-watch(() => quote.value, (q) => {
-    if (q?.last && (q.lastvolume || quote.value?.trademode === 99)) {
+// 监听行情推送
+quoteWatch(props.goodsCode, (q) => {
+    const { last = 0, lasttime = '', lastvolume = 0 } = q
+    if (last && (lastvolume || quote.value?.trademode === 99)) {
         const list = dataList.value
         if (list.length > 9) {
             // 移除列表最后一条记录
@@ -78,12 +80,12 @@ watch(() => quote.value, (q) => {
             Bid: 0,
             HI: 0,
             HV: 0,
-            PE: q.last,
+            PE: last,
             TDR: 0,
             TK: 0,
-            TS: q.lasttime,
+            TS: lasttime,
             TT: 0,
-            Vol: q.lastvolume,
+            Vol: lastvolume,
         })
     }
 })

+ 1 - 1
src/packages/mobile/views/goods/detail/Index.vue

@@ -34,7 +34,7 @@ defineProps({
 })
 
 const Price = defineAsyncComponent(() => import('@mobile/components/modules/quote/price/index.vue'))
-const Chart = defineAsyncComponent(() => import('@mobile/components/modules/quote/chart/index.vue'))
+const Chart = defineAsyncComponent(() => import('@mobile/components/modules/hqchart/index.vue'))
 const Forex = defineAsyncComponent(() => import('@mobile/components/modules/quote/forex/index.vue'))
 const Tik = defineAsyncComponent(() => import('@mobile/components/modules/quote/tik/index.vue'))
 

+ 6 - 4
src/packages/mobile/views/goods/trade/index.vue

@@ -34,7 +34,7 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent, watch } from 'vue'
+import { shallowRef, defineAsyncComponent } from 'vue'
 import { showToast, Tabs, Tab, Button } from 'vant'
 import { useNavigation } from '@mobile/router/navigation'
 import { useComponent } from '@/hooks/component'
@@ -96,7 +96,9 @@ const onDelisting = (row: Model.WrTradeOrderDetailRsp) => {
 }
 
 // 监听行情变动
-watch(() => quote.value, () => {
-    onRefresh()
-})
+if (quote.value) {
+    futuresStore.quoteWatch(quote.value.goodscode, () => {
+        onRefresh()
+    })
+}
 </script>

+ 1 - 1
src/packages/mobile/views/market/detail/Index.vue

@@ -15,7 +15,7 @@ import { useNavigation } from '@mobile/router/navigation'
 import { useFuturesStore } from '@/stores'
 
 const Price = defineAsyncComponent(() => import('@mobile/components/modules/quote/price/index.vue'))
-const Chart = defineAsyncComponent(() => import('@mobile/components/modules/quote/chart/index.vue'))
+const Chart = defineAsyncComponent(() => import('@mobile/components/modules/hqchart/index.vue'))
 const Tik = defineAsyncComponent(() => import('@mobile/components/modules/quote/tik/index.vue'))
 
 const { getQueryString } = useNavigation()

+ 1 - 1
src/packages/pc/components/modules/goods-detail/chart/index.vue

@@ -13,7 +13,7 @@
 
 <script lang="ts" setup>
 import Price from '@pc/components/modules/quote/price/index.vue'
-import Chart from '@pc/components/modules/quote/chart/index.vue'
+import Chart from '@pc/components/modules/hqchart/index.vue'
 import Forex from '@pc/components/modules/quote/forex/index.vue'
 import Tik from '@pc/components/modules/quote/tik/index.vue'
 

+ 2 - 2
src/packages/pc/components/modules/goods-detail/order/delisting/index.vue

@@ -26,7 +26,7 @@
                 <el-button type="primary" :disabled="!formData.OrderQty || formData.OrderQty > selectedRow.orderqty"
                     @click="onSubmit(EBuildType.BUILDTYPE_OPEN)">订立卖出</el-button>
                 <el-button type="primary" :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
-                    @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)">
+                    @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)" v-if="quote?.tradeproperty === 1">
                     <span>转让卖出</span>
                     <span v-if="buyQty">(≤{{ buyQty }})</span>
                 </el-button>
@@ -35,7 +35,7 @@
                 <el-button type="primary" :disabled="!formData.OrderQty || formData.OrderQty > selectedRow.orderqty"
                     @click="onSubmit(EBuildType.BUILDTYPE_OPEN)">订立买入</el-button>
                 <el-button type="primary" :disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
-                    @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)">
+                    @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)" v-if="quote?.tradeproperty === 1">
                     <span>转让买入</span>
                     <span v-if="sellQty">(≤{{ sellQty }})</span>
                 </el-button>

+ 7 - 5
src/packages/pc/components/modules/goods-detail/order/index.vue

@@ -27,7 +27,7 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent, watch } from 'vue'
+import { shallowRef, defineAsyncComponent } from 'vue'
 import { useRequest } from '@/hooks/request'
 import { BuyOrSell } from '@/constants/order'
 import { useComponent } from '@/hooks/component'
@@ -88,10 +88,12 @@ const showComponent = (componentName: string, row: Model.WrTradeOrderDetailRsp)
 }
 
 // 监听行情变动
-watch(() => quote.value, () => {
-    getBuyList()
-    getSellList()
-})
+if (quote.value) {
+    futuresStore.quoteWatch(quote.value.goodscode, () => {
+        getBuyList()
+        getSellList()
+    })
+}
 </script>
 
 <style lang="less">

+ 1 - 1
src/packages/pc/components/modules/hqchart/timeline/index.vue

@@ -75,7 +75,7 @@ const onReady = (chart: unknown) => {
         const minuteTimeStringData = Chart.JSChart.GetMinuteTimeStringData()
         const minuteCoordinateData = Chart.JSChart.GetMinuteCoordinateData()
         // 当天所有的交易时间点
-        minuteTimeStringData.GetET = () => minuteTimeStringData.CreateTimeData(timeSplit.value)
+        minuteTimeStringData.GetET = () => timeSplit.value
         // 替换交易时间段
         minuteTimeStringData.CreateETData = () => minuteTimeStringData.GetET()
         // 替换X轴刻度信息

+ 18 - 11
src/packages/pc/views/market/trade/index.vue

@@ -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)
+            }
         }
     }
 }

+ 10 - 0
src/services/api/market/index.ts

@@ -59,4 +59,14 @@ export function queryHistoryTikDatas(config: RequestConfig<Model.HistoryTikDatas
         url: '/Quote/QueryHistoryTikDatas',
         params: config.data,
     })
+}
+
+/**
+ * 查询新板块设置
+ */
+export function getMarketSections(config: RequestConfig = {}) {
+    return http.commonRequest<Model.GetMarketSectionsRsp[]>({
+        url: '/Market/GetMarketSections',
+        params: config.data,
+    })
 }

+ 31 - 5
src/types/model/market.d.ts

@@ -41,11 +41,11 @@ declare namespace Model {
 
     /** 查询行情Tik数据 请求 */
     interface HistoryTikDatasReq {
-        goodsCode: string, // 商品代码
-        startTime?: string, // 开始时间,格式:yyyy-MM-dd HH:mm:ss
-        endTime?: string, // 结束时间,格式:yyyy-MM-dd HH:mm:ss
-        count?: number, // 条数
-        isAsc?: boolean, // 是否按时间顺序排序(默认为时间倒序排序)
+        goodsCode: string; // 商品代码
+        startTime?: string; // 开始时间,格式:yyyy-MM-dd HH:mm:ss
+        endTime?: string; // 结束时间,格式:yyyy-MM-dd HH:mm:ss
+        count?: number; // 条数
+        isAsc?: boolean; // 是否按时间顺序排序(默认为时间倒序排序)
     }
 
     /** 查询行情Tik数据 响应 */
@@ -139,4 +139,30 @@ declare namespace Model {
         goodsorder: string; // 商品显示顺序(99)
         tradeproperty: number; // 交易属性 - 1:收益权(可做空) 2:所有权(不可做空) 3:期权 4:现货 5:参考行情 6:通道交易 7:币交易 8:场外期权
     }
+
+    /** 查询新板块设置 响应 */
+    interface GetMarketSectionsRsp {
+        createtime: string; // 创建时间
+        creatorid: number; // 创建人ID
+        creatorsrc: number; // 创建人来源 - 1:管理端 2:终端 3:交易
+        isvalid: number; // 是否有效 - 0:无效 1:有效
+        marketsectionconfignews: Marketsectionconfignew[]
+        marketsectionid: number; // 市场版块ID(SEQ_MARKETSECTION)
+        marketsectionname: string; // 市场版块名称
+        modifierid: number; // 修改人
+        modifiersrc: number; // 修改人来源 - 1:管理端 2:终端
+        modifytime: string; // 修改时间
+        orderindex: number; // 排序
+        pictureurl: string; // 显示图片(90*90)
+        remark: string; // 备注
+    }
+
+    interface Marketsectionconfignew {
+        displayname: string; // 显示名称
+        marketids: string; // 市场IDs - 逗号分隔
+        marketsectionid: number; // 市场版块ID(SEQ_MARKETSECTION)
+        orderindex: number; // 排序
+        trademode: number; // 交易模式
+        updatetime: string; // 更新时间
+    }
 }