parent
76b07a2974
commit
20049bd5cb
|
@ -11,7 +11,7 @@ import Menu from "../menu/main.js"
|
|||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
|
||||
props.data.menuList[0].check = true;
|
||||
this.state = {
|
||||
|
||||
id:props.data.id,
|
||||
|
@ -19,9 +19,10 @@ import Menu from "../menu/main.js"
|
|||
selectedMenu: props.data.menuList[0],
|
||||
menuList:props.data.menuList,
|
||||
visible:true,
|
||||
menuShow:false,
|
||||
menuShow:true,
|
||||
}
|
||||
this.state.text = props.data.menuList[0].name;
|
||||
|
||||
}
|
||||
onHandlerClick(){
|
||||
let isShow = !this.state.menuShow;
|
||||
|
@ -46,6 +47,16 @@ import Menu from "../menu/main.js"
|
|||
onselectFn(e){
|
||||
|
||||
}
|
||||
onClose(e,id){
|
||||
|
||||
this.props.onClose(e,this.state.id)
|
||||
let menuList = _.map(this.state.menuList,(item)=>{
|
||||
item.check = false;
|
||||
return item
|
||||
})
|
||||
this.setState({menuList:menuList})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className = "filterComponent">
|
||||
|
@ -55,7 +66,7 @@ import Menu from "../menu/main.js"
|
|||
<span className="filter-maohao">:</span>
|
||||
<span className="filter-placeholder">{this.state.text }</span>
|
||||
<Icon type="down" className="icon-down-arrow"/>
|
||||
<Icon type="close" className="icon-del" onClick={(e)=>{this.props.onClose(e,this.state.id)}} />
|
||||
<Icon type="close" className="icon-del" onClick={(e)=>{this.onClose(e,this.state.id)}} />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ import FilterSelect from "../filterSelect/main.js"
|
|||
onCloseSelect(e,id){
|
||||
this.removeItem(e,id);
|
||||
this.refs.menu.clearIndexCheck(id);
|
||||
|
||||
|
||||
this.props.onClose()
|
||||
}
|
||||
//移除筛选项
|
||||
|
@ -58,6 +60,7 @@ import FilterSelect from "../filterSelect/main.js"
|
|||
this.removeItem(e,id)
|
||||
}
|
||||
this.setState({showItemList:this.state.showItemList})
|
||||
this.setState({menuShow:false})
|
||||
}
|
||||
|
||||
onSelect(e){
|
||||
|
|
|
@ -16,7 +16,7 @@ import React from 'react'
|
|||
}
|
||||
}
|
||||
clearAllCheck(){
|
||||
|
||||
|
||||
}
|
||||
//清除指定选项
|
||||
clearIndexCheck(id){
|
||||
|
|
Loading…
Reference in New Issue