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;