li.shaoyi před 2 roky
rodič
revize
f1cc0701e3

+ 2 - 2
app/package.json

@@ -1,6 +1,6 @@
 {
-  "name": "trading-beta",
-  "version": "1.0.12",
+  "name": "trading",
+  "version": "1.0.16",
   "main": "main.js",
   "dependencies": {
     "electron-updater": "^6.1.4",

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

@@ -1,8 +1,8 @@
 {
   "appId": "com.muchinfo.zrwyt",
   "appName": "中融文遗通",
-  "version": "1.0.15",
-  "versionCode": "100015",
+  "version": "1.0.16",
+  "versionCode": "100016",
   "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
   "tradeChannel": "ws",
   "modules": [

+ 15 - 72
oem/zrwyt/config/router.json

@@ -31,14 +31,14 @@
                                 "title": "交收",
                                 "code": "bottom_goods_position_delivery16",
                                 "component": "views/footer/goods/position/components/delivery16/index.vue",
-                                "className": "el-button--primary"                                
+                                "className": "el-button--primary"
                             },
                             {
                                 "authType": 3,
                                 "title": "交收",
                                 "code": "bottom_goods_position_delivery50",
                                 "component": "views/footer/goods/position/components/delivery50/index.vue",
-                                "className": "el-button--primary"                                
+                                "className": "el-button--primary"
                             }
                         ]
                     },
@@ -78,6 +78,7 @@
                 "title": "预售转让",
                 "code": "bottom_presell",
                 "component": "views/footer/index.vue",
+                "hidden": true,
                 "children": [
                     {
                         "authType": 2,
@@ -265,6 +266,7 @@
                                 "sort": 1,
                                 "title": "订单挂牌",
                                 "code": "market_trade_goods_50101",
+                                "hidden": true,
                                 "component": "views/market/trade/goods/list/index.vue"
                             },
                             {
@@ -290,6 +292,13 @@
                                 "code": "market_trade_goods_50104",
                                 "hidden": true,
                                 "component": "views/market/trade/goods/list/index.vue"
+                            },
+                            {
+                                "authType": 2,
+                                "sort": 1,
+                                "title": "全款挂牌",
+                                "code": "market_trade_goods_16201",
+                                "component": "views/market/trade/goods/list/index.vue"
                             }
                         ]
                     },
@@ -299,41 +308,25 @@
                         "title": "预售转让",
                         "code": "market_trade_presell",
                         "url": "presell",
+                        "hidden": true,
                         "urlType": 1,
                         "component": "views/market/trade/presell/index.vue",
                         "children": [
                             {
                                 "authType": 2,
                                 "sort": 1,
-                                "title": "全款挂牌",
-                                "code": "market_trade_goods_16201",
-                                "component": "views/market/trade/goods/list/index.vue"
-                            },
-                            {
-                                "authType": 2,
-                                "sort": 2,
                                 "title": "预售中签",
                                 "code": "market_trade_presell_ballot",
                                 "component": "views/market/trade/presell/ballot/index.vue"
                             },
                             {
                                 "authType": 2,
-                                "sort": 3,
+                                "sort": 2,
                                 "title": "定金转让",
                                 "code": "market_trade_presell_49201",
                                 "component": "views/market/trade/presell/transfer/index.vue"
                             }
                         ]
-                    },
-                    {
-                        "authType": 1,
-                        "sort": 3,
-                        "title": "仓单交易",
-                        "code": "market_trade_spot",
-                        "url": "spot",
-                        "urlType": 1,
-                        "hidden": true,
-                        "component": "views/market/trade/spot/index.vue"
                     }
                 ]
             }
@@ -390,6 +383,7 @@
                         "code": "query_order_presell",
                         "url": "spot",
                         "urlType": 1,
+                        "hidden": true,
                         "component": "views/query/order/presell/index.vue",
                         "children": [
                             {
@@ -421,32 +415,6 @@
                                 "component": "views/query/order/presell/transferhistory/index.vue"
                             }
                         ]
-                    },
-                    {
-                        "authType": 1,
-                        "sort": 2,
-                        "title": "现货仓单",
-                        "code": "query_order_spot",
-                        "url": "spot",
-                        "urlType": 1,
-                        "hidden": true,
-                        "component": "views/query/order/spot/index.vue",
-                        "children": [
-                            {
-                                "authType": 2,
-                                "sort": 1,
-                                "title": "当前记录",
-                                "code": "query_order_spot_list",
-                                "component": "views/query/order/spot/list/index.vue"
-                            },
-                            {
-                                "authType": 2,
-                                "sort": 2,
-                                "title": "历史记录",
-                                "code": "query_order_spot_history",
-                                "component": "views/query/order/spot/history/index.vue"
-                            }
-                        ]
                     }
                 ]
             },
@@ -491,6 +459,7 @@
                         "code": "query_trade_presell",
                         "url": "spot",
                         "urlType": 1,
+                        "hidden": true,
                         "component": "views/query/trade/presell/index.vue",
                         "children": [
                             {
@@ -508,32 +477,6 @@
                                 "component": "views/query/trade/presell/history/index.vue"
                             }
                         ]
-                    },
-                    {
-                        "authType": 1,
-                        "sort": 3,
-                        "title": "现货仓单",
-                        "code": "query_trade_spot",
-                        "url": "spot",
-                        "urlType": 1,
-                        "hidden": true,
-                        "component": "views/query/trade/spot/index.vue",
-                        "children": [
-                            {
-                                "authType": 2,
-                                "sort": 1,
-                                "title": "当前记录",
-                                "code": "query_trade_spot_list",
-                                "component": "views/query/trade/spot/list/index.vue"
-                            },
-                            {
-                                "authType": 2,
-                                "sort": 2,
-                                "title": "历史记录",
-                                "code": "query_trade_spot_history",
-                                "component": "views/query/trade/spot/history/index.vue"
-                            }
-                        ]
                     }
                 ]
             },

+ 1 - 1
public/config/router.json

@@ -278,7 +278,7 @@
                 "code": "market_trade",
                 "url": "trade",
                 "urlType": 1,
-                "component": "Main",
+                "component": "views/market/trade/index.vue",
                 "children": [
                     {
                         "authType": 1,

+ 20 - 1
src/components/base/hqchart/index.less

@@ -8,6 +8,24 @@
         height: 100%;
     }
 
+    &-tooltip {
+        width: 120px;
+        font-size: 12px;
+        color: #333;
+
+        dt {
+            span+span {
+                margin-left: 5px;
+            }
+        }
+
+        dd {
+            display: flex;
+            justify-content: space-between;
+            margin-top: 15px;
+        }
+    }
+
     a {
         transition-duration: 0.4s, 0.5s;
         transition-property: background-color, color;
@@ -1225,7 +1243,8 @@
     .jschart-tooltip {
         box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.23);
         border: solid 1px rgba(200, 210, 219, 0.92);
-        padding: 7px 20px 15px 13px;
+        border-radius: 3px;
+        padding: 10px;
         box-sizing: border-box;
         position: relative;
         display: none;

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

@@ -8,7 +8,7 @@
 <script lang="ts" setup>
 import { shallowRef, shallowReactive, watch, computed } from 'vue'
 import { Chart } from 'hqchart'
-import { changeUnit, handleNumberValue } from '@/filters'
+import { changeUnit, handleNumberValue, handlePriceColor } from '@/filters'
 import { ChartCycleType } from '@/constants/chart'
 import { useFuturesStore } from '@/stores'
 import { useDataset } from '@/hooks/hqchart/candlestick/dataset'
@@ -162,6 +162,42 @@ const chartOption = {
     }
 }
 
+// 自定义Tooltip
+// https://blog.csdn.net/jones2000/article/details/104443471
+const customHistoryDataStringFormat = () => {
+    return {
+        Value: {
+            Data: {
+                Date: 0,
+                Time: 0,
+                Open: 0,
+                High: 0,
+                Low: 0,
+                Close: 0,
+                YClose: 0,
+                Vol: 0
+            }
+        },
+        Text: '',
+        Operator: function () {
+            const { FormatDateString, FormatTimeString } = Chart.IFrameSplitOperator
+            const { Data } = this.Value
+            this.Text = `<dl class="app-hqchart-tooltip">`
+            this.Text += `<dt><span>${FormatDateString(Data.Date)}</span>${Data.Time ? '<span>' + FormatTimeString(Data.Time) + '</span>' : ''}</dt>`
+            this.Text += `<dd><span>开盘:</span><span class="${handlePriceColor(Data.Open, Data.YClose)}">${handleNumberValue(Data.Open)}</span></dd>`
+            this.Text += `<dd><span>最高:</span><span class="${handlePriceColor(Data.High, Data.YClose)}">${handleNumberValue(Data.High)}</span></dd>`
+            this.Text += `<dd><span>最低:</span><span class="${handlePriceColor(Data.Low, Data.YClose)}">${handleNumberValue(Data.Low)}</span></dd>`
+            this.Text += `<dd><span>收盘:</span><span class="${handlePriceColor(Data.Close, Data.YClose)}">${handleNumberValue(Data.Close)}</span></dd>`
+            if (goods.value?.trademode !== 99) {
+                this.Text += `<dd><span>数量:</span><span>${changeUnit(Data.Vol)}</span></dd>`
+            }
+            this.Text += `</dd>`
+            this.Text += `</dl>`
+            return true
+        }
+    }
+}
+
 // 切换指标
 const changeIndex = (index: number) => {
     // ChangeIndex(windowIndex, indexName, option)
@@ -177,6 +213,9 @@ const onReady = (chart: unknown) => {
             chartOption.Windows.push({ Index: 'VOL', Change: true, Close: false })
         }
     }
+    Chart.JSChart.GetDivTooltipDataFormat().DataMap.set('HistoryDataStringFormat', {
+        Create: () => customHistoryDataStringFormat()
+    })
     chartInstance.value = chart
     chartInstance.value.SetOption(chartOption)
 }