更新菜单
This commit is contained in:
parent
b77b419425
commit
83573af738
|
@ -7,6 +7,7 @@ import FormItem from "../../../../components/form-item/main"
|
|||
import "../../../../assets/comm.css"
|
||||
import {Select,Button,ImageUpload ,onUpload,Radio,NumberInput } from "zent"
|
||||
import Bus from "../../../../assets/eventBus.js"
|
||||
import _ from "lodash"
|
||||
const RadioGroup = Radio.Group;
|
||||
const RadioButton = Radio.Button;
|
||||
export default class adduserinfo extends React.Component{
|
||||
|
@ -25,6 +26,7 @@ export default class adduserinfo extends React.Component{
|
|||
level:''
|
||||
},
|
||||
menutype:"",//菜单类型
|
||||
cancelInfo:{},//保存原来的值
|
||||
menumethods:''//请求方式
|
||||
}
|
||||
}
|
||||
|
@ -57,9 +59,11 @@ methodsonChange = e => {
|
|||
submit(){
|
||||
this.refs.form1.validator()
|
||||
}
|
||||
|
||||
|
||||
|
||||
//重置
|
||||
resetInfo(){
|
||||
console.log(888,this.state.cancelInfo);
|
||||
this.setState({model:this.state.cancelInfo});
|
||||
}
|
||||
cancel(){
|
||||
let model2 = { //数据模型不可少
|
||||
menuname:"",
|
||||
|
@ -70,6 +74,7 @@ methodsonChange = e => {
|
|||
}
|
||||
componentWillReceiveProps(nextProps){//接收
|
||||
this.setState({model:nextProps.menuList});
|
||||
this.setState({cancelInfo:_.cloneDeep(nextProps.menuList)});
|
||||
}
|
||||
render(){
|
||||
|
||||
|
@ -80,12 +85,11 @@ methodsonChange = e => {
|
|||
],
|
||||
|
||||
}
|
||||
console.log(11,this.state.model);
|
||||
return(
|
||||
<div id="menuright">
|
||||
<p className="btnlist">
|
||||
<Button type="primary" onClick={this.submit.bind(this)}>修改并保存</Button>
|
||||
<Button type="normal">重置</Button>
|
||||
<Button type="normal" onClick={this.resetInfo.bind(this)}>重置</Button>
|
||||
</p>
|
||||
<Form model={this.state.model} rules={rules} ref="form1" >
|
||||
<FormItem labelname="菜单名称" prop="menuname" id="menuname" >
|
||||
|
@ -111,22 +115,22 @@ methodsonChange = e => {
|
|||
|
||||
<FormItem required={false} labelname="请求方式">
|
||||
<RadioGroup onChange={this.methodsonChange} value={this.state.model.method}>
|
||||
<RadioButton value="1" >GET</RadioButton>
|
||||
<RadioButton value="5" >POST</RadioButton>
|
||||
<RadioButton value="10">PUT</RadioButton>
|
||||
<RadioButton value="15">DELETE</RadioButton>
|
||||
<RadioButton value={1} >GET</RadioButton>
|
||||
<RadioButton value={5} >POST</RadioButton>
|
||||
<RadioButton value={10}>PUT</RadioButton>
|
||||
<RadioButton value={15}>DELETE</RadioButton>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem required={false} labelname="是否显示">
|
||||
<RadioGroup onChange={this.statusChange} value={this.state.model.status}>
|
||||
<RadioButton value="1" >是</RadioButton>
|
||||
<RadioButton value="5" >否</RadioButton>
|
||||
<RadioButton value={1} >是</RadioButton>
|
||||
<RadioButton value={5} >否</RadioButton>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem required={false} labelname="是否验证登陆">
|
||||
<RadioGroup onChange={this.authChange} value={this.state.model.auth}>
|
||||
<RadioButton value="1" >是</RadioButton>
|
||||
<RadioButton value="5" >否</RadioButton>
|
||||
<RadioButton value={1} >是</RadioButton>
|
||||
<RadioButton value={5} >否</RadioButton>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem required={false} labelname="菜单图标">
|
||||
|
|
Loading…
Reference in New Issue