king
2020-12-03 753ac5f57b10588e225c1d82203b13a81bc9c9a7
src/tabviews/custom/components/chart/antv-pie/index.jsx
@@ -25,6 +25,7 @@
  }
  state = {
    BID: '',                   // 上级ID
    config: null,              // 图表配置信息
    empty: true,               // 图表数据为空
    loading: false,            // 数据加载状态
@@ -38,7 +39,7 @@
  }
  UNSAFE_componentWillMount () {
    const { config, data, initdata } = this.props
    const { config, data, initdata, BID } = this.props
    let _config = fromJS(config).toJS()
    let _data = null
@@ -66,9 +67,16 @@
      _config.style = {minHeight: (config.plot.height || 400)}
    }
    let _BID = BID || ''
    if (config.setting.supModule && config.setting.supModule[0] !== 'empty') {
      _BID = ''
    }
    sessionStorage.setItem(config.uuid, 'bid')
    this.setState({
      config: _config,
      data: _data,
      BID: _BID,
      arr_field: _config.columns.map(col => col.field).join(','),
      plot: _config.plot,
      sync: _sync,
@@ -85,10 +93,11 @@
  }
  /**
   * @description 校验图表的按钮组,如果为统计图表,计算图表字段
   * @description 组件销毁
   */
  componentDidMount () {
  componentWillUnmount () {
    const { config } = this.state
    sessionStorage.removeItem(config.uuid)
  }
  /**
@@ -128,8 +137,8 @@
  }
  async loadData () {
    const { mainSearch, BID, menuType, dataManager } = this.props
    const { config, arr_field, search } = this.state
    const { mainSearch, menuType, dataManager } = this.props
    const { config, arr_field, search, BID } = this.state
    let searches = fromJS(search).toJS()
    if (mainSearch && mainSearch.length > 0) { // 主表搜索条件
@@ -476,7 +485,7 @@
    }
    
    if (plot.linkmenu && plot.linkmenu.length > 0) {
      let menu_id = plot.linkmenu[plot.linkmenu.length - 1]
      let menu_id = plot.linkmenu.slice(-1)[0]
      let menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || ''
      chart.on('element:dblclick', (ev) => {