king
2020-09-22 5944c2832820a8bfa86e3efb5085f5a2463897f9
src/menu/datasource/index.jsx
@@ -1,5 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { Icon, Modal } from 'antd'
@@ -11,7 +12,6 @@
class DataSource extends Component {
  static propTpyes = {
    config: PropTypes.any,
    menu: PropTypes.object,
    updateConfig: PropTypes.func
  }
@@ -27,10 +27,11 @@
    const { config } = this.props
    this.setState({setting: fromJS(config.setting).toJS()})
    this.props.updateConfig(config) // 触发菜单信息更新
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
    return !is(fromJS(this.state), fromJS(nextState))
  }
  editDataSource = () => {
@@ -84,4 +85,14 @@
  }
}
export default DataSource
const mapStateToProps = (state) => {
  return {
    menu: state.customMenu
  }
}
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(DataSource)