From 0b84d0f24ace7d1b62a7edaaa0210f2eb05a8d3a Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Fri, 19 Nov 2021 21:07:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=BC=96=E8=BE=91=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/system/role/add/add.js | 3 ++- src/pages/system/role/tree/tree.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/system/role/add/add.js b/src/pages/system/role/add/add.js index 01b2c4a5..02be9873 100644 --- a/src/pages/system/role/add/add.js +++ b/src/pages/system/role/add/add.js @@ -41,6 +41,7 @@ export default class addrole extends React.Component{ submit(){ let roleFlag=this.refs.roleform.validator(); let self=this; + if(this.refs.roletree.state.checkedKeys.length<1){ Notify.error('请至少选中一个模块权限') }else{ @@ -125,7 +126,7 @@ export default class addrole extends React.Component{ value={this.state.model.role} placeholder={"请输入角色"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'520px'} alignment={'left'}/> - + diff --git a/src/pages/system/role/tree/tree.js b/src/pages/system/role/tree/tree.js index f888207e..3a86fd08 100644 --- a/src/pages/system/role/tree/tree.js +++ b/src/pages/system/role/tree/tree.js @@ -30,6 +30,7 @@ export default class tree extends React.Component{ } componentWillMount(){ this.getMenuFn(); + this.setState({checkedKeys:this.props.rules}); } render(){ const { checkedKeys, disabledCheckedKeys } = this.state;