소스 검색

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

zhouna 5 년 전
부모
커밋
b14f74d51f
2개의 변경된 파일14개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 2
      src/common/components/SearchBox/index.jsx
  2. 11 4
      src/components/SpreadDrop/index.jsx

+ 3 - 2
src/common/components/SearchBox/index.jsx

@@ -48,7 +48,8 @@ class SearchBox extends React.Component {
     handleInput(e){
       e.stopPropagation();
       e.preventDefault();
-      const { getSearchData ,mainIds,clearSearch} = this.props;
+      const { getSearchData ,mainIds,clearSearch,pushIds} = this.props;
+      const ids = [...mainIds,...pushIds];
         clearTimeout(this.state.timer);
         let timer = setTimeout(()=>{
             clearTimeout(this.state.timer);
@@ -62,7 +63,7 @@ class SearchBox extends React.Component {
             this.setState({
               showClear:true
             })
-            getSearchData && getSearchData({inpStr:e.target.value.replace('<br>',''),boxMark:1,itemType:0,mainIds:mainIds});
+            getSearchData && getSearchData({inpStr:e.target.value.replace('<br>',''),boxMark:1,itemType:0,mainIds:ids});
         },config.delayTime);
         this.setState({
           timer

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

@@ -440,16 +440,23 @@ class ListItems extends Component{
     handleSelect&&handleSelect(it);     //添加到大数据推送一起选中
     handleConfirm&&handleConfirm();       //确定事件
   }
+  getPushItemIds(list){         //获取推送症状的id数组,去重用
+    return list&&list.map((it)=>{
+      return it.conceptId;
+    })||[];
+  }
   render (){
     const {handleClear,order,parDiv,boxMark,tagType,show,data,pos} = this.props;
-    //推送标签没有推送结果时不显示顺序说明
     const pushUl = data.find((it)=>it.controlType===99);
-    const noPush = tagType===11&&(pushUl&&(!pushUl.questionDetailList||pushUl.questionDetailList.length===0));
+    const pushList = pushUl&&pushUl.questionDetailList;
+    //推送标签没有推送结果时不显示顺序说明
+    const noPush = tagType===11&&(!pushList||pushList.length===0);
+    const noSearch = boxMark==1 && tagType==11 && !pos;       //非第一病程添加症状标签不显示搜索
     return <div className={style["drop-list"]} ref={parDiv} style={this.getStyle()} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
       {noPush?'':<p className={style['orderTips']}>按{order?'从左到右从上到下':'点击'}顺序成文</p>}
         {this.getLabels()}
-        {boxMark==1 && tagType==11 && !pos && <div className="search">
-          <SearchBox show={show} onSelect={this.searchSelect.bind(this)} onRef={(child)=>{this.child = child;}}/>
+        {noSearch && <div className="search">
+          <SearchBox show={show} pushIds={this.getPushItemIds(pushList)} onSelect={this.searchSelect.bind(this)} onRef={(child)=>{this.child = child;}}/>
         </div>}
         <div className="oper clearfix">
           <span className={style['clear']} onClick={handleClear}>清空选项</span>