king
2021-01-15 76a4300654a18d228838c3f27455dc8e7a8cd616
src/tabviews/rolemanage/index.jsx
@@ -5,6 +5,7 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import MKEmitter from '@/utils/events.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import './index.scss'
@@ -474,9 +475,38 @@
    })
  }
  reloadMenuView = (menuId) => {
    const { MenuID } = this.props
    if (MenuID !== menuId) return
    this.setState({
      loading: true,
      loadingTree: false,
      roleList: null,
      selectRoleId: '',
      mainMenus: null,
      menuTrees: null,
      checkedKeys: [],
      menuOpenKeys: [],
      selectMenuTrees: null,
      selectMenuOpenKeys: [],
      primarykey: '',
      tabKey: '',
      submitloading: false,
      initCheckKeys: null
    })
    this.getRoleList()
    this.getMainMenuList()
  }
  UNSAFE_componentWillMount () {
    this.getRoleList()
    this.getMainMenuList()
  }
  componentDidMount () {
    MKEmitter.addListener('reloadMenuView', this.reloadMenuView)
  }
  /**
@@ -486,6 +516,7 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('reloadMenuView', this.reloadMenuView)
  }
  shouldComponentUpdate (nextProps, nextState) {