From 106263ec10e60ce6c406e4fd5eb76d195772d0f0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 18 十二月 2020 18:07:05 +0800 Subject: [PATCH] 2020-12-18 --- src/tabviews/custom/components/chart/antv-pie/index.jsx | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 14e691d..44bbdda 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -6,14 +6,16 @@ import DataSet from '@antv/data-set' import { Spin, Empty, notification } from 'antd' -// import searchLine from '../../share/searchLine' import Api from '@/api' import Utils from '@/utils/utils.js' import { modifyTabview } from '@/store/action' import { chartColors } from '@/utils/option.js' +import asyncComponent from '@/utils/asyncComponent' import UtilsDM from '@/utils/utils-datamanage.js' import MKEmitter from '@/utils/events.js' import './index.scss' + +const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) class PieChart extends Component { static propTpyes = { @@ -35,7 +37,6 @@ plot: null, // 鍥捐〃璁剧疆 data: null, // 鏁版嵁 search: null, // 鎼滅储鏉′欢 - showHeader: false // 瀛樺湪鏍囬銆佹悳绱€�佹垨缁熻鏁版嵁鏃舵樉绀� } UNSAFE_componentWillMount () { @@ -53,9 +54,7 @@ _sync = false } - let showHeader = false if (config.plot.title || config.search.length > 0) { - showHeader = true _config.plot.height = _config.plot.height - 80 } else { _config.plot.height = _config.plot.height - 30 @@ -75,8 +74,7 @@ plot: _config.plot, sync: _sync, title: config.plot.title, - search: Utils.initMainSearch(config.search), - showHeader + search: Utils.initMainSearch(config.search) }, () => { if (config.setting.sync !== 'true' && config.setting.onload === 'true') { this.loadData() @@ -556,8 +554,14 @@ chart.render() } + refreshSearch = (list) => { + this.setState({search: list}, () => { + this.loadData() + }) + } + render() { - const { showHeader, config, loading, title, empty } = this.state + const { config, loading, empty, BID } = this.state return ( <div className="custom-pie-chart-plot-box" style={config.style}> @@ -567,10 +571,7 @@ <Spin /> </div> : null } - {showHeader ? <div className="chart-header" style={config.headerStyle}> - <span className="chart-title">{title}</span> - {/* <searchLine /> */} - </div> : null} + <NormalHeader config={config} BID={BID} menuType={this.props.menuType} refresh={this.refreshSearch} /> <div className="canvas-wrap"> <div className={'canvas' + (empty ? ' empty' : '')} id={this.state.chartId}></div> </div> -- Gitblit v1.8.0