角色编辑更新接口

This commit is contained in:
red-deng-deng 2021-11-19 21:07:17 +08:00
parent 2288ae7b1c
commit 0b84d0f24a
2 changed files with 3 additions and 1 deletions

View File

@ -41,6 +41,7 @@ export default class addrole extends React.Component{
submit(){ submit(){
let roleFlag=this.refs.roleform.validator(); let roleFlag=this.refs.roleform.validator();
let self=this; let self=this;
if(this.refs.roletree.state.checkedKeys.length<1){ if(this.refs.roletree.state.checkedKeys.length<1){
Notify.error('请至少选中一个模块权限') Notify.error('请至少选中一个模块权限')
}else{ }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'}/> value={this.state.model.role} placeholder={"请输入角色"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'520px'} alignment={'left'}/>
</FormItem> </FormItem>
<FormItem labelname="设置权限" prop="setrole" id="setrole"> <FormItem labelname="设置权限" prop="setrole" id="setrole">
<Tree ref="roletree"/> <Tree ref="roletree" rules={this.state.menuList.rule_id}/>
</FormItem> </FormItem>
</Form> </Form>
</Card> </Card>

View File

@ -30,6 +30,7 @@ export default class tree extends React.Component{
} }
componentWillMount(){ componentWillMount(){
this.getMenuFn(); this.getMenuFn();
this.setState({checkedKeys:this.props.rules});
} }
render(){ render(){
const { checkedKeys, disabledCheckedKeys } = this.state; const { checkedKeys, disabledCheckedKeys } = this.state;