From 20049bd5cb147595e4749c18f9b10b8540d3484e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 13 Dec 2021 17:05:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AD=9B=E9=80=89=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新筛选菜单组件的交互 --- src/components/filterSelect/main.js | 17 ++++++++++++++--- src/components/filterbar/main.js | 3 +++ src/components/menu/main.js | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/components/filterSelect/main.js b/src/components/filterSelect/main.js index a669716d..44eea430 100644 --- a/src/components/filterSelect/main.js +++ b/src/components/filterSelect/main.js @@ -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 (
@@ -55,7 +66,7 @@ import Menu from "../menu/main.js" : {this.state.text } - {this.props.onClose(e,this.state.id)}} /> + {this.onClose(e,this.state.id)}} />
diff --git a/src/components/filterbar/main.js b/src/components/filterbar/main.js index 9fa54b10..c554f0dd 100644 --- a/src/components/filterbar/main.js +++ b/src/components/filterbar/main.js @@ -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){ diff --git a/src/components/menu/main.js b/src/components/menu/main.js index 89102318..3a5cc7cb 100644 --- a/src/components/menu/main.js +++ b/src/components/menu/main.js @@ -16,7 +16,7 @@ import React from 'react' } } clearAllCheck(){ - + } //清除指定选项 clearIndexCheck(id){