king
2020-12-18 106263ec10e60ce6c406e4fd5eb76d195772d0f0
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>