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-bar/index.jsx |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx
index 51de3eb..082b5fa 100644
--- a/src/menu/components/chart/antv-bar/index.jsx
+++ b/src/menu/components/chart/antv-bar/index.jsx
@@ -9,7 +9,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 Utils from '@/utils/utils.js'
 import { chartColors } from '@/utils/option.js'
 import './index.scss'
@@ -67,8 +67,6 @@
       let _card = {
         uuid: card.uuid,
         type: card.type,
-        tabId: card.tabId || '',
-        parentId: card.parentId || '',
         format: 'array',   // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡
         pageable: false,   // 缁勪欢灞炴�� - 鏄惁鍙垎椤�
         switchable: card.type === 'bar' ? true : false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹�
@@ -143,7 +141,7 @@
   handleTabsChange = (parentId) => {
     const { card } = this.state
 
-    if (parentId === card.parentId || parentId === 'all') {
+    if (parentId.indexOf(card.uuid) > -1 || parentId === 'all') {
       let _element = document.getElementById(card.uuid + 'canvas')
       if (_element) {
         _element.innerHTML = ''
@@ -230,7 +228,7 @@
       const chart = new Chart({
         container: card.uuid + 'canvas',
         autoFit: true,
-        height: this.wrap.offsetHeight - 25
+        height: getHeight(plot.height)
       })
   
       chart.data(dv.rows)
@@ -556,7 +554,7 @@
     const chart = new Chart({
       container: card.uuid + 'canvas',
       autoFit: true,
-      height: this.wrap.offsetHeight - 25,
+      height: getHeight(plot.height)
     })
 
     // chart.axis(plot.Xaxis, { label: { style: { fill: color } }, tickLine: {style: { stroke: color }}, line: { style: { stroke: color } } })
@@ -950,7 +948,7 @@
       const chart = new Chart({
         container: card.uuid + 'canvas',
         autoFit: true,
-        height: this.wrap.offsetHeight - 25
+        height: getHeight(plot.height)
       })
 
       chart.data(dv.rows)
@@ -1333,7 +1331,7 @@
   changeStyle = () => {
     const { card } = this.state
 
-    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle)
+    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
   }
 
   getStyle = (style) => {
@@ -1345,16 +1343,23 @@
   clickComponent = (e) => {
     if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
       e.stopPropagation()
-      MKEmitter.emit('clickComponent', this.state.card)
+      MKEmitter.emit('clickComponent', this.state.card.uuid, null, (style) => {
+        let _card = {...this.state.card}
+        _card.style = {..._card.style, ...style}
+
+        this.updateComponent(_card)
+      })
     }
   }
 
   render() {
     const { card, appType } = this.state
+
     let _style = resetStyle(card.style)
+    _style.height = 'auto'
 
     return (
-      <div className="menu-line-chart-edit-box" style={{..._style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}>
+      <div className="menu-line-chart-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">
             {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch}/> : null}
@@ -1372,7 +1377,7 @@
           <ToolOutlined/>
         </Popover>
         <NormalHeader config={card} updateComponent={this.updateComponent}/>
-        <div className="canvas" id={card.uuid + 'canvas'} ref={ref => this.wrap = ref}></div>
+        <div className="canvas" id={card.uuid + 'canvas'}></div>
         {appType !== 'mob' ? <ActionComponent
           config={card}
           updateaction={this.updateComponent}

--
Gitblit v1.8.0