li.shaoyi 1 年之前
父节点
当前提交
ff1c31e20e

+ 1 - 1
oem/sbyj/config/appconfig.json

@@ -3,7 +3,7 @@
   "appName": "水贝亿爵",
   "version": "1.0.6",
   "versionCode": "100006",
-  "apiUrl": "http://192.168.31.171:8080/cfg?key=test_171",
+  "apiUrl": "http://112.74.182.230:8280/cfg?key=yjhj_sp",
   "tradeChannel": "ws",
   "modules": [
     "register",

+ 1 - 1
public/config/appconfig.json

@@ -3,7 +3,7 @@
   "appName": "多元世纪",
   "version": "1.0.5",
   "versionCode": "10005",
-  "apiUrl": "http://192.168.31.134:8080/cfg?key=test_134",
+  "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
   "tradeChannel": "ws",
   "modules": [
     "register",

+ 2 - 1
src/hooks/hqchart/timeline/dataset.ts

@@ -4,7 +4,7 @@ import { queryTSData } from '@/services/api/quote'
 import { NetworkFilterData, NetworkFilterCallback } from './types'
 import moment from 'moment'
 
-export function useDataset(goodsCode: string) {
+export function useDataset(goodsCode: string, makretId?: number) {
     // 缓存全量数据
     let cache: Model.TSDataRsp
 
@@ -17,6 +17,7 @@ export function useDataset(goodsCode: string) {
     const getTSDataAsync = queryTSData({
         data: {
             goodsCode,
+            makretId
         }
     })
 

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

@@ -49,8 +49,8 @@ const chartOption = {
     },
     DayCount: 1,
     Border: {
-        Left: 60,
-        Right: 60,
+        Left: 30,
+        Right: 30,
         Top: 36,
         Bottom: 25,
         AutoLeft: { Blank: 10, MinWidth: 30 },
@@ -74,9 +74,9 @@ const chartOption = {
             const decimalplace = goods.value?.decimalplace
             // 自定义标题栏,参考源码 DynamicMinuteTitlePainting.GetFormatTitle
             paint.GetFormatTitle = (data) => {
-                const { DateTime, Open, Close, Vol, Amount, YClose, Increase } = data.Data
+                const { DateTime, Open, Close, Vol, Amount, YClose, Increase = 0 } = data.Data
                 const AryText = [
-                    { Text: FormatDateTimeString(DateTime, paint.IsShowDate, paint.IsShowTime), Color: paint.DateTimeColor },
+                    { Text: FormatDateTimeString(DateTime, true, paint.IsShowTime), Color: paint.DateTimeColor },
                     { Text: '价:' + handleNumberValue(Close.toFixed(decimalplace)), Color: paint.GetColor(Open, YClose) },
                     { Text: '幅:' + Increase.toFixed(2) + '%', Color: paint.GetColor(Increase, 0) }
                 ]

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

@@ -1,7 +1,7 @@
 <template>
     <div class="app-goods-detail-chart">
         <div class="block-left">
-            <Chart v-bind="{ goodsCode }" />
+            <Chart v-bind="{ goodsCode, makretId }" />
         </div>
         <el-scrollbar class="block-right">
             <Price v-bind="{ goodsCode }" />
@@ -22,6 +22,7 @@ defineProps({
         type: String,
         required: true
     },
+    makretId: Number
 })
 </script>
 

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

@@ -94,7 +94,7 @@ const chartOption = {
     },
     Border: {
         Left: 25,
-        Right: 80,
+        Right: 25,
         Top: 30,
         Bottom: 25,
         AutoLeft: { Blank: 15, MinWidth: 30 },

+ 3 - 2
src/packages/pc/components/modules/hqchart/index.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="app-chart">
         <Tabs class="app-tabs--info" :data-list="dataList" @change="changePeriod" />
-        <MLine v-bind="{ symbol, goodsCode }" v-if="cycleType === ChartCycleType.Time" />
+        <MLine v-bind="{ symbol, goodsCode, makretId }" v-if="cycleType === ChartCycleType.Time" />
         <KLine v-bind="{ symbol, goodsCode, cycleType }" v-else />
     </div>
 </template>
@@ -17,7 +17,8 @@ defineProps({
     goodsCode: {
         type: String,
         required: true
-    }
+    },
+    makretId: Number
 })
 
 const symbol = '000000.et' // https://blog.csdn.net/jones2000/article/details/104457569

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

@@ -20,10 +20,11 @@ const props = defineProps({
     goodsCode: {
         type: String,
         required: true
-    }
+    },
+    makretId: Number
 })
 
-const { getTSDataAsync, timeSplit, handleXAxisScale, networkFilter, updateLastData } = useDataset(props.goodsCode)
+const { getTSDataAsync, timeSplit, handleXAxisScale, networkFilter, updateLastData } = useDataset(props.goodsCode, props.makretId)
 const { quoteWatch, getGoodsQuote } = useFuturesStore()
 const goods = getGoodsQuote(props.goodsCode)
 const chartInstance = shallowRef() // 图表实例
@@ -41,8 +42,8 @@ const chartOption = {
     IsShowCorssCursorInfo: true,
     DayCount: 1,
     Border: {
-        Left: 80,
-        Right: 80,
+        Left: 30,
+        Right: 30,
         Top: 30,
         Bottom: 25,
         AutoLeft: { Blank: 15, MinWidth: 30 },
@@ -56,7 +57,9 @@ const chartOption = {
         IsShowName: false, // 不显示股票名称
     },
     Frame: [
-        {}
+        {
+            IsShowRightText: !!goods.value?.presettle // 是否显示Y轴右侧刻度
+        }
     ],
     OnCreatedCallback: (chart: MinuteChartContainer) => {
         const paint = chart.TitlePaint[0]
@@ -65,9 +68,9 @@ const chartOption = {
             const decimalplace = goods.value?.decimalplace
             // 自定义标题栏,参考源码 DynamicMinuteTitlePainting.GetFormatTitle
             paint.GetFormatTitle = (data) => {
-                const { DateTime, Open, Close, Vol, Amount, YClose, Increase } = data.Data
+                const { DateTime, Open, Close, Vol, Amount, YClose, Increase = 0 } = data.Data
                 const AryText = [
-                    { Text: FormatDateTimeString(DateTime, paint.IsShowDate, paint.IsShowTime), Color: paint.DateTimeColor },
+                    { Text: FormatDateTimeString(DateTime, true, paint.IsShowTime), Color: paint.DateTimeColor },
                     { Text: '价:' + handleNumberValue(Close.toFixed(decimalplace)), Color: paint.GetColor(Open, YClose) },
                     { Text: '幅:' + Increase.toFixed(2) + '%', Color: paint.GetColor(Increase, 0) }
                 ]

+ 6 - 2
src/packages/pc/views/market/trade/market/index.vue

@@ -25,6 +25,10 @@
         <template #opened="{ row }">
             <span :class="row.openedColor">{{ handleNumberValue(formatDecimal(row.opened, row.decimalplace)) }}</span>
         </template>
+        <!-- 昨结 -->
+        <template #presettle="{ row }">
+            <span>{{ handleNumberValue(formatDecimal(row.presettle, row.decimalplace)) }}</span>
+        </template>
         <!-- 最低 -->
         <template #lowest="{ row }">
             <span :class="row.lowestColor">{{ handleNumberValue(formatDecimal(row.lowest, row.decimalplace)) }}</span>
@@ -38,8 +42,8 @@
             <span>{{ parsePercent(value) }}</span>
         </template>
         <template #footer>
-            <component ref="componentRef" v-bind="{ goodsId: futuresStore.selectedGoodsId }" :is="componentMap.get(componentId)"
-                @closed="closeComponent" v-if="componentId" />
+            <component ref="componentRef" v-bind="{ goodsId: futuresStore.selectedGoodsId }"
+                :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
         </template>
     </app-table>
 </template>

+ 7 - 5
src/packages/pc/views/market/trade/swap/detail/index.vue

@@ -19,17 +19,18 @@
                                 市场状态:{{ [2, 6].includes(market.runstatus) ? getRunStatusName(market.runstatus) : '未开市' }}
                             </span>
                         </template>
-                        <slot name="headerRight"></slot> 
+                        <slot name="headerRight"></slot>
                         <el-button type="primary" @click="active = false" v-if="active">买卖大厅</el-button>
                         <el-button type="primary" @click="active = true" v-else>图表</el-button>
-                        <el-button type="primary" v-if="userStore.userType != 5" @click="openComponent('listing')">挂牌</el-button>
+                        <el-button type="primary" v-if="userStore.userType != 5"
+                            @click="openComponent('listing')">挂牌</el-button>
                     </div>
                 </div>
             </template>
-            <Chart class="g-view-detail__container" v-bind="{ goodsCode }" v-if="active" />
+            <Chart class="g-view-detail__container" v-bind="{ goodsCode, makretId: swapQuote?.marketid }" v-if="active" />
             <Order class="g-view-detail__container" v-bind="{ goodsId, quoteGoods: selectedRow }" v-else />
             <component ref="componentRef" v-bind="{ quoteGoods: selectedRow, goodsId }" :is="componentMap.get(componentId)"
-                    @closed="closeComponent" v-if="componentId" />
+                @closed="closeComponent" v-if="componentId" />
         </app-view>
     </teleport>
 </template>
@@ -65,6 +66,7 @@ const props = defineProps({
 const emit = defineEmits(['closed'])
 const futuresStore = useFuturesStore()
 const quote = futuresStore.getGoodsQuote(props.goodsId)
+const swapQuote = futuresStore.getGoodsQuote(props.selectedRow?.goodsid ?? 0)
 const active = shallowRef(false)
 const goodsCode = computed(() => quote.value?.goodscode ?? '')
 const goodsId = computed(() => props.selectedRow?.goodsid ?? 0)
@@ -72,7 +74,7 @@ const userStore = useUserStore()
 
 const { data: market, run } = useRequest(queryMarketRun, {
     params: {
-        marketID: quote.value?.marketid
+        marketID: swapQuote.value?.marketid
     },
     onSuccess: (res) => {
         market.value = res.data[0]

+ 1 - 1
src/services/api/quote/index.ts

@@ -25,7 +25,7 @@ export function queryHistoryDatas(config: RequestConfig<Model.HistoryDatasReq> =
 /**
  * 分时图数据查询
  */
-export function queryTSData(config: RequestConfig<{ goodsCode: string }> = {}) {
+export function queryTSData(config: RequestConfig<Model.TSDataReq> = {}) {
     return http.commonRequest<Model.TSDataRsp>({
         url: '/Quote/QueryTSData',
         params: config.data,

+ 4 - 3
src/stores/modules/futures.ts

@@ -341,14 +341,15 @@ export const useFuturesStore = defineStore(() => {
             }
         }
 
+        const price = item.trademode === 52 ? Math.max(item.last, item.ask) : item.last // 任务 #5677
         item.opened = item.opened || item.last // 没有开盘价默认取最新价
-        item.highest = item.highest || item.last // 没有最高价默认取最新价
+        item.highest = item.highest || price // 没有最高价默认取最新价
         item.lowest = item.lowest || item.last // 没有最低价价默认取最新价
 
         // 处理最高最低价
         if (item.last) {
-            if (item.last > item.highest) {
-                item.highest = item.last
+            if (price > item.highest) {
+                item.highest = price
             }
             if (item.last < item.lowest) {
                 item.lowest = item.last

+ 6 - 0
src/types/model/quote.d.ts

@@ -163,6 +163,12 @@ declare namespace Model {
         f: boolean; // 是否补充数据
     }
 
+    /** 分时历史数据 请求 */
+    interface TSDataReq {
+        goodsCode: string; // 商品代码
+        makretId?: number; // 关联市场ID
+    }
+
     /** 分时历史数据 响应 */
     interface TSDataRsp {
         Count: number; // 交易日应有数据个数