From fd71440db47f3205cccab84ddd77026cf1df579a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 20 十一月 2022 22:35:17 +0800
Subject: [PATCH] 2022-11-20

---
 src/tabviews/custom/components/chart/antv-bar-line/index.jsx |   47 +++++++++++++++++++++++++++++++----------------
 1 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
index 6f036d7..e9e806e 100644
--- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -108,7 +108,13 @@
       })
     }
 
-    _config.style.height = config.plot.height || 400
+    _config.plot.height = Utils.getHeight(_config.plot.height)
+    _config.style.height = 'auto'
+    _config.style.minHeight = _config.plot.height + 30
+
+    if (_config.plot.title) {
+      _config.style.minHeight = _config.style.minHeight + 45
+    }
 
     let transfield = {}
     _config.columns.forEach(col => {
@@ -557,7 +563,9 @@
     if (_element) {
       _element.innerHTML = ''
     }
-    this.viewrender()
+    setTimeout(() => {
+      this.viewrender()
+    }, 100)
   }
 
   /**
@@ -903,7 +911,7 @@
     const chart = new Chart({
       container: this.state.chartId,
       autoFit: true,
-      height: this.wrap.offsetHeight - 25
+      height: plot.height
     })
 
     chart.data(_data)
@@ -1087,7 +1095,7 @@
     const chart = new Chart({
       container: this.state.chartId,
       autoFit: true,
-      height: this.wrap.offsetHeight - 25
+      height: plot.height
     })
     
     // 鍧愭爣杞存牸寮忓寲
@@ -1497,7 +1505,7 @@
     const chart = new Chart({
       container: this.state.chartId,
       autoFit: true,
-      height: this.wrap.offsetHeight - 25
+      height: plot.height
     })
 
     chart.data(_data)
@@ -1717,8 +1725,6 @@
     chart.on('element:click', (ev) => {
       let data = ev.data.data
 
-      MKEmitter.emit('resetSelectLine', config.uuid, (data ? data.$$uuid : ''), data)
-
       if (plot.click === 'menus') {
         let menu = null
         
@@ -1747,16 +1753,23 @@
         } else {
           MKEmitter.emit('modifyTabs', newtab, 'plus', true)
         }
-      } else if (plot.click === 'menu' && plot.MenuID) {
-        let menu = {
-          MenuID: plot.MenuID,
-          MenuName: plot.MenuName,
-          MenuNo: plot.MenuNo,
-          type: plot.tabType
+      } else if (plot.click === 'menu') {
+        let menuId = plot.menu.slice(-1)[0]
+        let newtab = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0]
+
+        if (!newtab && plot.MenuID) {
+          newtab = {
+            MenuID: plot.MenuID,
+            MenuName: plot.MenuName,
+            MenuNo: plot.MenuNo,
+            type: plot.tabType
+          }
+        } else if (!newtab) {
+          return
         }
   
-        let newtab = {
-          ...menu,
+        newtab = {
+          ...newtab,
           param: {}
         }
   
@@ -1769,6 +1782,8 @@
         } else {
           MKEmitter.emit('modifyTabs', newtab, 'plus', true)
         }
+      } else {
+        MKEmitter.emit('resetSelectLine', config.uuid, (data ? data.$$uuid : ''), data)
       }
     })
 
@@ -1846,7 +1861,7 @@
           </div> : null
         }
         <NormalHeader config={config} BID={BID} refresh={this.refreshSearch} />
-        <div className="canvas-wrap" ref={ref => this.wrap = ref}>
+        <div className="canvas-wrap">
           {config.plot.download === 'enable' && this.state.chart && !empty ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null}
           <div className={'chart-action' + (config.plot.download === 'enable' ? ' downable' : '')}>
             {config.action.map(item => {

--
Gitblit v1.8.0