Quellcode durchsuchen

Merge remote-tracking branch 'origin/maindropSearch' into dev/new1

zhouna vor 5 Jahren
Ursprung
Commit
0a2a822370
2 geänderte Dateien mit 9 neuen und 6 gelöschten Zeilen
  1. 5 4
      src/common/components/SearchBox/index.jsx
  2. 4 2
      src/components/SpreadDrop/index.jsx

+ 5 - 4
src/common/components/SearchBox/index.jsx

@@ -48,14 +48,15 @@ class SearchBox extends React.Component {
     handleInput(e){
       e.stopPropagation();
       e.preventDefault();
-      const { getSearchData ,mainIds} = this.props;
+      const { getSearchData ,mainIds,clearSearch} = this.props;
         clearTimeout(this.state.timer);
         let timer = setTimeout(()=>{
             clearTimeout(this.state.timer);
             if(e.target.value.trim() == ''){
               this.setState({
                 showClear:false
-              })
+              });
+              clearSearch();
               return
             }
             this.setState({
@@ -120,8 +121,8 @@ class SearchBox extends React.Component {
           background:'#f1f1f1'};
         const barStyle={background:'#777',width:'100%'};
         return (
-            <div className={classNames(styles['search'])} onClick={(e)=>{e.stopPropagation();}} onBlur={(e)=>{e.stopPropagation();}}>
-                <img className={styles.searchVal} src={search} alt="搜索" onClick={this.clickIcon}/>
+            <div className={classNames(styles['search'])} onClick={this.clickIcon} onBlur={(e)=>{e.stopPropagation();}}>
+                <img className={styles.searchVal} src={search} alt="搜索"/>
                 <img style={{display:showClear?'block':'none'}} className={styles.clearVal} src={clear} onClick={this.handleClearVal} alt="清空" />
                 <input
                     className={classNames(isShow,borderCor,showBd)}

+ 4 - 2
src/components/SpreadDrop/index.jsx

@@ -210,7 +210,7 @@ class SpreadDrop extends Component{
     //点确定后隐藏弹窗
     this.props.handleHide();
   }
-  handleSelect(item,isExclu,joint,listIndex,selected){//console.log(item,selected)
+  handleSelect(item,isExclu,joint,listIndex,selected){
     let {withOn,withs,noneOn,exclusion,exists,nowOn,nones,noneIds,ban} = this.state;
     /*if(this.props.selecteds)
     console.log(exists,this.props.selecteds.exists,exists===this.props.selecteds.exists)*/
@@ -435,7 +435,9 @@ class ListItems extends Component{
   }
   searchSelect(item){
     const {handleSelect,handleConfirm} = this.props;
-    handleSelect&&handleSelect(item);     //添加到大数据推送一起选中
+    //添加id字段,用于调尾巴
+    const it = Object.assign({id:item.questionId},item);
+    handleSelect&&handleSelect(it);     //添加到大数据推送一起选中
     handleConfirm&&handleConfirm();       //确定事件
   }
   render (){