From 73a5124745890650d0fc91234bdbaa66d9bcbc6a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 09 六月 2021 17:52:01 +0800 Subject: [PATCH] 2021-06-09 --- src/menu/components/chart/antv-scatter/index.jsx | 27 +++++++++++++++++---------- 1 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/menu/components/chart/antv-scatter/index.jsx b/src/menu/components/chart/antv-scatter/index.jsx index 46abf2f..41a896b 100644 --- a/src/menu/components/chart/antv-scatter/index.jsx +++ b/src/menu/components/chart/antv-scatter/index.jsx @@ -110,9 +110,11 @@ } componentDidMount () { - this.ponitrender() MKEmitter.addListener('submitStyle', this.getStyle) MKEmitter.addListener('tabsChange', this.handleTabsChange) + setTimeout(() => { + this.ponitrender() + }, 1000) } shouldComponentUpdate (nextProps, nextState) { @@ -185,11 +187,16 @@ const { card } = this.state const plot = card.plot const data = this.getdata() + let height = plot.height - 25 + + if (card.plot.title || card.search.length > 0) { + height = plot.height - 70 + } const chart = new Chart({ container: card.uuid + 'canvas', autoFit: true, - height: plot.height - 70 + height: height }) chart.data(data); @@ -368,27 +375,27 @@ let _style = resetStyle(card.style) return ( - <div className="menu-line-chart-edit-box" style={{..._style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}> - <NormalHeader config={card} updateComponent={this.updateComponent}/> + <div className="menu-scatter-chart-edit-box" style={{..._style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - {!ismob ? <Icon className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch} type="plus-circle" /> : null} + {!ismob ? <Icon className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch} type="plus-circle"/> : null} <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> <CopyComponent type="line" card={card}/> - <PasteComponent config={card} options={['action', 'search', 'form']} updateConfig={this.updateComponent} /> - <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> - <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> + <PasteComponent config={card} options={['action', 'search', 'form']} updateConfig={this.updateComponent}/> + <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors"/> + <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog}/> <ClockComponent config={card} updateConfig={this.updateComponent}/> <UserComponent config={card}/> - <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> + <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(card.uuid)}/> <SettingComponent config={card} updateConfig={this.updateComponent}/> </div> } trigger="hover"> <Icon type="tool" /> </Popover> - <ActionComponent type="chart" config={card} updateaction={this.updateComponent} /> + {card.plot.title || card.search.length > 0 ? <NormalHeader config={card} updateComponent={this.updateComponent}/> : null} <div className="canvas" id={card.uuid + 'canvas'}></div> + <ActionComponent type="chart" config={card} updateaction={this.updateComponent}/> </div> ) } -- Gitblit v1.8.0