king
2020-07-16 9a82bce9cf0ed4a51c1b0b0669eaa38cedbace07
src/templates/sharecomponent/chartgroupcomponent/index.jsx
@@ -22,7 +22,7 @@
  }
  state = {
    dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS,
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    chartlist: null,      // 图表集
    card: null,           // 编辑中元素
    formlist: null,       // 表单信息
@@ -130,10 +130,18 @@
      }
    }
    let actions = config.action.filter(item => item.OpenType === 'excelOut' || (item.OpenType === 'excelIn' && item.Ot === 'notRequired'))
    actions = actions.map(cell => ({value: cell.uuid, text: cell.label}))
    if (item.actions && item.actions.length > 0) {
      let keys = actions.map(cell => cell.value)
      item.actions = item.actions.filter(cell => keys.includes(cell))
    }
    this.setState({
      card: item,
      modaltype: _type,
      formlist: getChartViewForm(item, this.props.sysRoles, _columns)
      formlist: getChartViewForm(item, this.props.sysRoles, _columns, actions)
    })
  }
@@ -197,7 +205,7 @@
    confirm({
      content: dict['model.confirm'] + dict['model.delete'] + ` ${plot.title} ?`,
      okText: dict['model.confirm'],
      cancelText: dict['header.cancel'],
      cancelText: dict['model.cancel'],
      onOk() {
        let _chartlist = fromJS(_this.state.chartlist).toJS()
        let _chartview = _this.state.chartview
@@ -228,6 +236,10 @@
    this.props.updatechartgroup(config, id)
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
  /**
   * @description 组件销毁,清除state更新
   */