From 5ec0f02101cb4255c6398856bbf17a2a0b2c9a7e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 14 十一月 2022 17:33:55 +0800
Subject: [PATCH] 2022-11-14

---
 src/menu/components/chart/antv-dashboard/index.jsx |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/menu/components/chart/antv-dashboard/index.jsx b/src/menu/components/chart/antv-dashboard/index.jsx
index 47c6d44..33c7c2e 100644
--- a/src/menu/components/chart/antv-dashboard/index.jsx
+++ b/src/menu/components/chart/antv-dashboard/index.jsx
@@ -8,7 +8,7 @@
 import MKEmitter from '@/utils/events.js'
 import asyncComponent from '@/utils/asyncComponent'
 import asyncIconComponent from '@/utils/asyncIconComponent'
-import { resetStyle, getTables } from '@/utils/utils-custom.js'
+import { resetStyle, getTables, getHeight } from '@/utils/utils-custom.js'
 import './index.scss'
 
 const SettingComponent = asyncIconComponent(() => import('@/menu/datasource'))
@@ -227,7 +227,7 @@
     const chart = new Chart({
       container: card.uuid + 'dashboard',
       autoFit: true,
-      height: this.wrap.offsetHeight - 30,
+      height: getHeight(plot.height)
     })
     
     chart.data(data)
@@ -326,7 +326,7 @@
     const chart = new Chart({
       container: card.uuid + 'dashboard',
       autoFit: true,
-      height: this.wrap.offsetHeight - 30,
+      height: getHeight(plot.height),
       padding: [0, 0, 0, 0],
     })
     chart.data(data)
@@ -532,9 +532,10 @@
   render() {
     const { card } = this.state
     let _style = resetStyle(card.style)
+    _style.height = 'auto'
 
     return (
-      <div className="menu-dashboard-edit-box" style={{..._style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}>
+      <div className="menu-dashboard-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}>
         <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
           <div className="mk-popover-control">
             <ChartCompileForm config={card} plotchange={this.updateComponent}/>
@@ -549,7 +550,7 @@
           <ToolOutlined/>
         </Popover>
         <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/>
-        <div className="canvas" id={card.uuid + 'dashboard'} ref={ref => this.wrap = ref}></div>
+        <div className="canvas" id={card.uuid + 'dashboard'}></div>
         <div className="component-name">
           <div className="center">
             <div className="title">{card.name}</div>

--
Gitblit v1.8.0