From 76a4300654a18d228838c3f27455dc8e7a8cd616 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 15 一月 2021 17:04:42 +0800 Subject: [PATCH] Merge branch 'master' into bms --- src/tabviews/rolemanage/index.jsx | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/src/tabviews/rolemanage/index.jsx b/src/tabviews/rolemanage/index.jsx index 59eb71c..7730ca1 100644 --- a/src/tabviews/rolemanage/index.jsx +++ b/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) { -- Gitblit v1.8.0