Selaa lähdekoodia

诊断慢病入口清除主诉模板;主诉框删除搜索内容后显示常见;现病史将模板删除后落光标

liucf 6 vuotta sitten
vanhempi
commit
b664c781bd

+ 15 - 5
src/components/MainSuit/index.jsx

@@ -144,7 +144,7 @@ class MainSuit extends Component{
   handleChange(e){
     const ev = e || window.event;
     const data = ev.target.innerText || ev.target.innerHTML;
-    const {getSearchData,searchData,datas,pushMessage,reTotalHide,saveText} = this.props;
+    const {getSearchData,searchData,datas,pushMessage,reTotalHide,saveText,clearSearch} = this.props;
     const {overFlag,inpText} = this.state;
     reTotalHide && reTotalHide();//重置homePage中的控制项
     const that = this;
@@ -172,16 +172,26 @@ class MainSuit extends Component{
       return false;
     }
     // 有输入内容或搜索结果时关闭,否则显示
-    if(data && data.trim()||searchData.length>0){
+    // if(data && data.trim()||searchData.length>0){
+    if(data && data.trim()){
+      clearTimeout(this.state.timer);
+      const timer = setTimeout(function(){
+        pushMessage && pushMessage(data);
+        //调搜索接口 使用模板走EditableSpan里的搜索方法
+        getSearchData && getSearchData({inpStr:data,boxMark:1,itemType:0});
+      },config.delayTime);
       this.setState({
-        symptom:false
+        symptom:false,
+        timer
       })
     }else{
+      // 内容为空-清空搜索数据-显示常见
+      clearSearch();
       this.setState({
         symptom:true
       })
     }
-    clearTimeout(this.state.timer);
+    /*clearTimeout(this.state.timer);
     const timer = setTimeout(function(){
       pushMessage && pushMessage(data);
       //调搜索接口 使用模板走EditableSpan里的搜索方法
@@ -189,7 +199,7 @@ class MainSuit extends Component{
     },config.delayTime);
     this.setState({
       timer
-    });
+    });*/
 
   }
   //除主诉外 其他是否为空

+ 2 - 2
src/containers/eleType.js

@@ -165,8 +165,8 @@ export default function(params){
       return multCheckLabels(params,data.tagType);
     case 8:
       let isLast = false;
-      if(+params.boxMark===3||+params.boxMark === 4){
-        //其他史查体删到只剩最后一个自由文本标签时,该标签宽度100%,解决落关标文本
+      if(+params.boxMark===2||+params.boxMark===3||+params.boxMark === 4){
+        //现病史其他史查体删到只剩最后一个自由文本标签时,该标签宽度100%,解决落关标文本
         if(params.saveText.length==1&&+data.tagType===8){
           isLast = true;
         }

+ 5 - 1
src/store/async-actions/diagnosticList.js

@@ -3,7 +3,7 @@ import {getAllDataList,getAllDataStringList,isAllClear,filterDataArr} from '@uti
 import {getChronic,getInitModules} from '@store/async-actions/homePage.js';
 import { SET_READ_MODE } from "@store/types/typeConfig";
 import {storageLocal} from '@utils/tools'
-import { SAVE_FREE } from '@store/types/mainSuit';
+import { SAVE_FREE ,SAVE_CHRONIC} from '@store/types/mainSuit';
 import {ISREAD,MODI_LOADING} from "../types/homePage";
 export const isAddMainSuit = () =>{
     return (dispatch, getState) => {
@@ -53,6 +53,8 @@ export const isChronicMag = (item) => {
                                 type: SET_CHRONIC_MAG_ITEM,
                                 chronicMagItem: item
                             })
+                            // 慢病流程清空主诉模板
+                            dispatch({type:SAVE_CHRONIC})
                             // loading
                             // dispatch({type:MODI_LOADING,flag:true}); //全局
                             dispatch({type:SHOW_LOADING,flag:true}); //私有
@@ -78,6 +80,8 @@ export const isChronicMag = (item) => {
                             type: SET_CHRONIC_MAG_ITEM,
                             chronicMagItem: item
                         })
+                        // 慢病流程清空主诉模板
+                        dispatch({type:SAVE_CHRONIC})
                         // loading
                         // dispatch({type:MODI_LOADING,flag:true});
                         dispatch({type:SHOW_LOADING,flag:true});