From b6ccd63b80fc7017bfabc446787732a98c7cbab7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 06 一月 2021 19:10:28 +0800 Subject: [PATCH] 2021-01-06 --- src/menu/components/chart/antv-bar/index.jsx | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx index 95f9131..9be6de7 100644 --- a/src/menu/components/chart/antv-bar/index.jsx +++ b/src/menu/components/chart/antv-bar/index.jsx @@ -126,7 +126,7 @@ const { card } = this.state if (parentId === card.parentId) { - let _element = document.getElementById(card.uuid) + let _element = document.getElementById(card.uuid + 'canvas') if (_element) { _element.innerHTML = '' } @@ -209,7 +209,7 @@ } const chart = new Chart({ - container: card.uuid, + container: card.uuid + 'canvas', autoFit: true, height: plot.height || 400 }) @@ -408,7 +408,7 @@ }) const chart = new Chart({ - container: card.uuid, + container: card.uuid + 'canvas', autoFit: true, height: plot.height || 400 }) @@ -571,7 +571,7 @@ } const chart = new Chart({ - container: card.uuid, + container: card.uuid + 'canvas', autoFit: true, height: plot.height || 400 }) @@ -734,7 +734,7 @@ const card = fromJS(this.state.card).toJS() let refresh = false if (!is(fromJS(component.plot), fromJS(card.plot))) { - let _element = document.getElementById(card.uuid) + let _element = document.getElementById(card.uuid + 'canvas') if (_element) { _element.innerHTML = '' } @@ -852,11 +852,18 @@ } } + clickComponent = (e) => { + if (sessionStorage.getItem('style-control') === 'true') { + e.stopPropagation() + MKEmitter.emit('clickComponent', this.state.card) + } + } + render() { const { card } = this.state return ( - <div className="menu-line-chart-edit-box" style={{...card.style, height: card.plot.height || 400}}> + <div className="menu-line-chart-edit-box" style={{...card.style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}> <NormalHeader config={card} updateComponent={this.updateComponent}/> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> @@ -878,7 +885,7 @@ config={card} updateaction={this.updateComponent} /> - <div className="canvas" id={card.uuid}></div> + <div className="canvas" id={card.uuid + 'canvas'}></div> </div> ) } -- Gitblit v1.8.0