diff --git a/src/components/filterSelect/main.js b/src/components/filterSelect/main.js index 44eea430..042b9e71 100644 --- a/src/components/filterSelect/main.js +++ b/src/components/filterSelect/main.js @@ -11,13 +11,26 @@ import Menu from "../menu/main.js" constructor(props) { super(props); - props.data.menuList[0].check = true; + console.log("数据777") + console.log(props.data.menuList) + + let menuList = _.map(props.data.menuList,(item)=>{ + item.check = false; + return item + }) + + + + menuList[0].check = true; + + console.log(menuList) + this.state = { id:props.data.id, label:props.data.label, selectedMenu: props.data.menuList[0], - menuList:props.data.menuList, + menuList:menuList, visible:true, menuShow:true, } diff --git a/src/components/filterbar/main.js b/src/components/filterbar/main.js index c554f0dd..2b961978 100644 --- a/src/components/filterbar/main.js +++ b/src/components/filterbar/main.js @@ -9,6 +9,7 @@ import FilterSelect from "../filterSelect/main.js" export default class filterbar extends React.Component { constructor(props) { super(props); + this.state = { //数据源结构后面可能会变 @@ -36,7 +37,15 @@ import FilterSelect from "../filterSelect/main.js" this.state.showItemList.forEach((item,index,arr) => { if(item.id === id){ + console.log("取消筛选") + console.log(this.state.filterList) + console.log() + + this.props.onClose(); + delete this.state.showItemList[index] + + } }); this.setState({showItemList:this.state.showItemList}) @@ -58,6 +67,7 @@ import FilterSelect from "../filterSelect/main.js" } else{ this.removeItem(e,id) + } this.setState({showItemList:this.state.showItemList}) this.setState({menuShow:false}) @@ -72,6 +82,20 @@ import FilterSelect from "../filterSelect/main.js" //隐藏菜单 hideMenu (e,id) { this.setState({menuShow:false}) + + + + } + onClose(){ + + console.log("取消") + + this.setState({menuShow:false}) + let menuList = _.map(this.state.menuList,(item)=>{ + item.check = false; + return item + }) + this.setState({menuList:menuList}) } render() { @@ -97,7 +121,7 @@ import FilterSelect from "../filterSelect/main.js" multiple={true} visible={this.state.menuShow} tt={3} - onClose = {(e,id)=>{this.hideMenu(e,id)}} + onClose = {(e,id)=>{this.onClose(e,id)}} > diff --git a/src/components/menu/main.js b/src/components/menu/main.js index 3a5cc7cb..59ea9950 100644 --- a/src/components/menu/main.js +++ b/src/components/menu/main.js @@ -39,6 +39,9 @@ import React from 'react' if(this.props.multiple) { arr = this.state.data; + console.log("多选") + + } else { diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 9f798aab..0975cd4a 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -671,6 +671,21 @@ onChangeCombinedDate(e){ + if(rowData.status >= 6 ) + { + str2 =