From e9c48bd7356462ba9257540b130a47a65ad1861d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 26 八月 2021 17:17:11 +0800 Subject: [PATCH] 2021-08-26 --- src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 34 ++++++++++------------------------ 1 files changed, 10 insertions(+), 24 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 f279ed3..9f522fb 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -12,9 +12,10 @@ import Utils from '@/utils/utils.js' import UtilsDM from '@/utils/utils-datamanage.js' import MKEmitter from '@/utils/events.js' +import NormalHeader from '@/tabviews/custom/components/share/normalheader' import './index.scss' -const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) +// const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) const ExcelOutButton = asyncComponent(() => import('@/tabviews/zshare/actionList/exceloutbutton')) const ExcelInButton = asyncComponent(() => import('@/tabviews/zshare/actionList/excelInbutton')) @@ -94,22 +95,7 @@ }) } - let padding = 0 - if (_config.style.paddingTop && !isNaN(parseInt(_config.style.paddingTop))) { - padding += parseInt(_config.style.paddingTop) - } - if (_config.style.paddingBottom && !isNaN(parseInt(_config.style.paddingBottom))) { - padding += parseInt(_config.style.paddingBottom) - } - - let height = config.plot.height || 400 - if (config.plot.title || config.search.length > 0) { - _config.plot.height = height - 70 - padding - } else { - _config.plot.height = height - 25 - padding - } - - _config.style.height = height + _config.style.height = config.plot.height || 400 let transfield = {} _config.columns.forEach(col => { @@ -906,11 +892,11 @@ _data = dv.rows } - + const chart = new Chart({ container: this.state.chartId, autoFit: true, - height: plot.height + height: this.wrap.offsetHeight - 25 }) chart.data(_data) @@ -1089,7 +1075,7 @@ const chart = new Chart({ container: this.state.chartId, autoFit: true, - height: plot.height + height: this.wrap.offsetHeight - 25 }) // 鍧愭爣杞存牸寮忓寲 @@ -1477,7 +1463,7 @@ const chart = new Chart({ container: this.state.chartId, autoFit: true, - height: plot.height + height: this.wrap.offsetHeight - 25 }) chart.data(_data) @@ -1688,7 +1674,7 @@ chart.on('element:click', (ev) => { let data = ev.data.data - MKEmitter.emit('resetSelectLine', config.uuid, (data ? data.$$uuid : ''), null) + MKEmitter.emit('resetSelectLine', config.uuid, (data ? data.$$uuid : ''), data) }) if (plot.interaction && plot.interaction.length) { @@ -1718,7 +1704,7 @@ </div> : null } <NormalHeader config={config} BID={BID} menuType={this.props.menuType} refresh={this.refreshSearch} /> - <div className="canvas-wrap"> + <div className="canvas-wrap" ref={ref => this.wrap = ref}> <div className="chart-action"> {config.action.map(item => { if (item.OpenType === 'excelOut') { @@ -1744,7 +1730,7 @@ } })} </div> - <div className={'canvas' + (empty ? ' empty' : '')} style={{height: config.plot.height + 25}} id={this.state.chartId}></div> + <div className={'canvas' + (empty ? ' empty' : '')} id={this.state.chartId}></div> </div> {empty ? <Empty description={false}/> : null} </div> -- Gitblit v1.8.0