瀏覽代碼

清除搜索条件2755

zhouna 5 年之前
父節點
當前提交
f013d181ff

+ 1 - 1
src/components/MedicalInfo/Filters/index.jsx

@@ -19,7 +19,7 @@ class Filters extends Component {
     })
   }
   render() {
-    return <div className={style["filters"]}>
+    return <div className={style["filters"]} id='medicalInfoFilter'>
               {this.drawItem()}
             </div>
 

+ 1 - 1
src/components/MedicalInfo/index.jsx

@@ -142,7 +142,7 @@ class MedicalInfo extends Component {
               <div className={style['search-box']}>
                 <p className={style['cont']}>
                   <input placeholder="医学知识搜索" type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
-                  {val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
+                  {val?<img src={delIcon} id='clearMedicalInfoSearch' alt="清空" onClick={this.clear}/>:''}
                   <button onClick={this.search}>搜索</button>
                 </p>
                 <Filters data ={filterList} checkeds={typeChecks} handleCheck={this.handleTypeCheck}></Filters>

+ 3 - 1
src/components/Operation/index.jsx

@@ -96,7 +96,9 @@ class Operation extends Component {
     let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
     let flg = isAllPartClear(jsonData,jsonStr,baseList);
-    if(flg){
+    const tpVal = $("#clearTemplateSearch").prev().val();   //模板是否有搜索条件未清空
+    const mdVal = $("#clearMedicalInfoSearch").prev().val();    //知识是否有搜索条件未清空
+    if(flg||tpVal||mdVal){
       this.setState({
         type: type,
         okText: '清除',

+ 1 - 1
src/components/TemplateItems/index.jsx

@@ -125,7 +125,7 @@ class TemplateItems extends React.Component {
                         <div className={style.wrapperTop}>
                             <div className={style.templateSearch}>
                                 <input placeholder="模板搜索" maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
-                                {this.state.val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
+                                {this.state.val?<img src={delIcon} id='clearTemplateSearch' alt="清空" onClick={this.clear}/>:''}
                                 <div className={style.search} onClick={this.templateSearch}>搜索</div>
                             </div>
                             {

+ 4 - 0
src/utils/tools.js

@@ -165,6 +165,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         store.dispatch({type:SETREADDITEMS});     //清空已存的血压加号项
         store.dispatch(clearAssistData([],'',[]));
         store.dispatch(clearAllLabel([],[],''));
+        //右侧搜索条件清空
+        $("#clearTemplateSearch,#clearMedicalInfoSearch,#medicalInfoFilter:first-child").click();
+        //tab跳回辅助信息
+        store.dispatch(tabChange('0'));
         store.dispatch({
             type: SET_TIPS,
             tips: {}