Prechádzať zdrojové kódy

Squashed commit of the following:

commit 352b054332f99885a6cd4ef5c504407aa93152b2
Author: liucf <liucf@zjlantone.com>
Date:   Tue May 7 17:35:12 2019 +0800

    现病史部分代码优化

commit bc08d0b0d32fbcabf3f26c07a1554a9d08099cf8
Merge: e70ce0c 3538f81
Author: liucf <liucf@zjlantone.com>
Date:   Tue May 7 17:29:05 2019 +0800

    Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

commit e70ce0c810e879eb84c6819f7737210d31a563db
Author: liucf <liucf@zjlantone.com>
Date:   Tue May 7 17:28:55 2019 +0800

    现病史无模板时saveText处理

commit 3538f81446252e2cbe5e50f6eb1265404089384b
Merge: f78ecc6 16f4a9b
Author: zhouna <zhouna@zjlantone.com>
Date:   Tue May 7 16:31:19 2019 +0800

    Merge remote-tracking branch 'origin/ChronicMag' into ChronicMag

commit f78ecc64897377c4c8e5a3a65b55f4981d905334
Author: zhouna <zhouna@zjlantone.com>
Date:   Tue May 7 16:30:34 2019 +0800

    现病史双击编辑数字键盘阻止冒泡1234

commit 762a35f36ed8a2d5e7a361c8a0a5455c872ea263
Author: zhouna <zhouna@zjlantone.com>
Date:   Tue May 7 16:26:49 2019 +0800

    现病史双击编辑阻止冒泡1225

commit 7512723af99610e9fe3de469ad9532ed3ce788d0
Author: zhouna <zhouna@zjlantone.com>
Date:   Tue May 7 16:16:49 2019 +0800

    容错

commit 16f4a9bd92d379e2115e7d10001df91309a8b9c3
Merge: c1bf7dc 6f8fde5
Author: liucf <liucf@zjlantone.com>
Date:   Tue May 7 15:04:15 2019 +0800

    Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

commit c1bf7dc19fab28d1699cfad6473142352209d4f8
Author: liucf <liucf@zjlantone.com>
Date:   Tue May 7 15:04:08 2019 +0800

    计算结果text为null处理

commit 6f8fde5f1de4a2fd1ed9eeb19d4771abd46299b7
Author: zhouna <zhouna@zjlantone.com>
Date:   Tue May 7 14:40:55 2019 +0800

    查体收起个数bug修改1176

commit bb5f042e0b42cb38c6bdca1164b00b4479ad00e1
Author: zhouna <zhouna@zjlantone.com>
Date:   Tue May 7 13:15:35 2019 +0800

    查体收起遮挡加背景

commit fada0ec114385c5664c515f4f86ba2618a096f9d
Author: zhouna <zhouna@zjlantone.com>
Date:   Tue May 7 12:23:58 2019 +0800

    其他史无数据显示模板,评估参数不写死

commit 347443f14bf0902edbd8ca3cd1bbc943ec17d8af
Merge: d4cb47b 6e43e19
Author: zhouna <zhouna@zjlantone.com>
Date:   Tue May 7 11:10:20 2019 +0800

    Merge remote-tracking branch 'origin/ChronicMag' into ChronicMag

commit d4cb47b6f2aee8d8134751c6b7262993d29c599f
Author: zhouna <zhouna@zjlantone.com>
Date:   Tue May 7 11:10:07 2019 +0800

    历史病例量表显示

commit 6e43e1966c9f376c46f83af92da50021186977d5
Author: liucf <liucf@zjlantone.com>
Date:   Tue May 7 10:54:02 2019 +0800

    可能结果添加推荐项

commit 2ee6ba8b86b835e759429f811ca4d7ee7c073f26
Author: liucf <liucf@zjlantone.com>
Date:   Mon May 6 17:07:34 2019 +0800

    右侧推送放开

commit 65f81b639d8581348d50885584197e18f643536f
Merge: 4011f28 a2f09ac
Author: liucf <liucf@zjlantone.com>
Date:   Mon May 6 17:05:06 2019 +0800

    Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

commit 4011f28c7f66f79d14ace47ce32e459bb7edde64
Author: liucf <liucf@zjlantone.com>
Date:   Mon May 6 17:04:57 2019 +0800

    计算按钮显示字段修改

commit a2f09ac4de68c23433a43db3dda66e489f7b555c
Merge: 74e4f37 50a207d
Author: Luolei <16657115156@163.com>
Date:   Mon May 6 17:03:14 2019 +0800

    Merge branch 'Chronic-ll' into ChronicMag

commit 50a207dc27beb237197ca553421b4f44e377ee68
Author: Luolei <16657115156@163.com>
Date:   Mon May 6 17:02:36 2019 +0800

    保存日期修改

commit 74e4f373155c043eccd0b142a1c1039a38e2a254
Merge: 4d13996 af6ea4c
Author: zhangxc <zhangxc@zjlantone.com>
Date:   Mon May 6 16:49:28 2019 +0800

    Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

commit 4d13996993605eea3f5e7638c58acf9085645293
Author: zhangxc <zhangxc@zjlantone.com>
Date:   Mon May 6 16:49:09 2019 +0800

    修改慢病用药和普通病用药顺序
liucf 6 rokov pred
rodič
commit
e5d2667aa0

+ 9 - 9
src/components/CurrentIll/index.jsx

@@ -142,15 +142,15 @@ class CurrentIll extends Component{
     return list;
   }
   handleBlur(e){
-    const {freeText} = this.props;
-    const ev = e || window.event;
-    const data = ev.target.innerText || e.target.innerHTML;
-    if(!isIE()){
-      e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
-      freeText && freeText(data.trim());
-    }else{
-      if(datas.length==0){
-        freeText && freeText(data);
+    const {freeText,data} = this.props;
+    if(data&&data.length==0){//无模板纯手动输入时存值
+      const ev = e || window.event;
+      const innerData = ev.target.innerText || e.target.innerHTML;
+      if(!isIE()){
+        e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
+        freeText && freeText(innerData.trim());
+      }else{
+          freeText && freeText(innerData);
       }
     }
   }

+ 2 - 1
src/components/NumberDrop/index.jsx

@@ -262,7 +262,8 @@ class NumberDrop extends Component{
                 onClick={allClick?this.handleNumClick:null}
                 contentEditable={editable}
                 onBlur={this.handleBlur}
-                onkeydown={handleEnter}>
+                onkeydown={handleEnter}
+                onFocus={(e)=>{e.stopPropagation()}}>
       <span ref = {this.$pre}>&nbsp;{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={allClick?null:this.handleNumClick}

+ 1 - 0
src/components/RadioDrop/index.jsx

@@ -152,6 +152,7 @@ class RadioDrop extends Component{
            onBlur={this.handleEditLabel}
            contentEditable={this.state.editable}
            onDoubleClick={this.handledbClick}
+           onFocus={(e)=>{e.stopPropagation()}}
            onClick={(e)=>this.handleShow(e,true)}
            onkeydown={handleEnter}>
         {value||placeholder}

+ 51 - 63
src/store/actions/currentIll.js

@@ -97,7 +97,7 @@ export const fillChronicModule = (state,action)=>{
   let res = Object.assign({},state);
   let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
   res.data = fullfillText(moduleData).newArr;
-  res.saveText = fullfillText(res.data).saveText;
+  res.saveText = fullfillText(res.data).saveText;console.log(111,"慢病",res)
   res.update=Math.random();
   return res;
 }
@@ -156,50 +156,41 @@ export const setData = (state,action) =>{
       let main = [];//主症状
       let withs = [];//伴随
       let firstT = 0;
-      for(let i=0; i<mainData.length; i++){
-          if(mainData[i].id==config.tongYId && !mainData[i].pos){//第一个通用特征描述
-            if(mainData[i].value){
-              tongYong = mainData[i].value;
-            }
-          }       
-          else if(mainData[i].exist){
-            mainData[i].exist==1?main.push(mainData[i]):withs.push(mainData[i])
-          }
-          
-          // 处理时间和主诉通用症状--现病史模板无“主诉通用症状” 1-7
-          for(let j=0; j<current.length; j++){
-            if(mainData[i].id==current[j].id && mainData[i].controlType==5){//处理时间,避免手动输入的值
-              firstT++
-              if(mainData[i].value && firstT==1){
-                current[j] = {id:mainData[i].id,name:mainData[i].value,value:mainData[i].value,tagType:config.tagType}
-              }
-            }  
-          }
-        }
+      mainData.map((v,i)=>{
+        // 主诉通用症状描述
+        if(v.id==config.tongYId && v.value && !v.pos){tongYong = v.value;}
+        if(v.exist){v.exist==1?main.push(v):withs.push(v)}
+        // 时间单位
+        if(v.controlType==5&&v.value){
+          firstT++;
+          current.map((it,ii)=>{
+            if(it.id==v.id&& firstT==1){it.value=v.value}
+          })
+        } 
+      })
       
       // 主症状添加tongYong标签选中文字
-      let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
       let mainCopy = JSON.parse(JSON.stringify(main));
       let manInput = [];
       // 去掉主诉添加的顿号 
-      for(let j=0; j<mainCopy.length; j++){
-        if(tongYText){
-          mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
-          mainCopy[j].value = tongYong + (mainCopy[j].value).replace('、',"");
+      mainCopy.map((ele,ind)=>{
+        if(tongYong){
+          ele.name = tongYong + (ele.name).replace('、',"");
+          ele.value = tongYong + (ele.value).replace('、',"");
         }else{
-          mainCopy[j].name = (mainCopy[j].name).replace('、',"");
-          mainCopy[j].value = (mainCopy[j].value).replace('、',"");
-        }  
+          ele.name = (ele.name).replace('、',"");
+          ele.value = (ele.value).replace('、',"");
+        }
         //查询是否有手动输入--输入的内容放到最后(3-27)
-        if(mainCopy[j].name != mainCopy[j].value){
-          const inputText = mainCopy[j].value.replace(mainCopy[j].name,"");
+        if(ele.name != ele.value){
+          const inputText = ele.value.replace(ele.name,"");
           const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
           if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
              manInput.push(textObj);
           }
-          mainCopy[j].value = mainCopy[j].name;
+          ele.value = ele.name;
         }
-      }
+      })
 
        // 将ids接口获取到的模板匹配到对应主症状后面
       // 主症状
@@ -220,16 +211,10 @@ export const setData = (state,action) =>{
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
                 for(let j=0; j<newMainCopy.length; j++){
                   if(newMainCopy[j].id==mainCopy[k].id){
-                    // newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value+',';
-                    newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value||mainCopy[k].name+',';
+                    newMainCopy[j].value = newMainCopy[j].name = (mainCopy[k].value||mainCopy[k].name)+',';
                   }
                 }
-              }       
-              /*if(ind==1){
-                preLength = items.length;
-              }else{
-                insertInd += preLength;
-              }*/
+              } 
               if(ind>1){
                 insertInd += lengArr[k-1];
               }
@@ -265,17 +250,11 @@ export const setData = (state,action) =>{
               let items = v.questionMapping.filter((item)=>{
                               return item.symptomType==0||item.symptomType==2;
                             })
-              /*if(withInd==1){
-                withPreLength = items.length;
-              }else{
-                withInsertInd += withPreLength;
-              }*/
               withLengArr[d] = items.length;
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
                 for(let j=0; j<newWiths.length; j++){
                   if(newWiths[j].id==withs[d].id){
-                    // newWiths[j].value = newWiths[j].name = withs[d].value+',';
-                    newWiths[j].value = newWiths[j].name = withs[d].value||withs[d].name+',';
+                    newWiths[j].value = newWiths[j].name = (withs[d].value||withs[d].name)+',';
                   }
                 }
               }
@@ -289,18 +268,21 @@ export const setData = (state,action) =>{
       }
       
       let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
-      let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr)));   //过来连续标点
-      //组装好的主症状和伴随症状插入现病史模板(flag=4前)
-      let insertIdx = null;
-      for(let j=0; j<current.length; j++){
+      let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr)));   //过滤连续标点
+      //组装好的主症状和伴随症状插入现病史模板(flag=4前)--现病史是否有模板
+      if(moduleData&&moduleData.length>0){
+        let insertIdx = null;
+        for(let j=0; j<current.length; j++){
           if(current[j].flag && current[j].flag==4){
             insertIdx = j;  
           }
         }
-   
-      for(let k=0; k<newSymptomArr.length; k++){
-        let pos = insertIdx+k;
-        current.splice(pos,0,newSymptomArr[k]);
+        for(let k=0; k<newSymptomArr.length; k++){
+          let pos = insertIdx+k;
+          current.splice(pos,0,newSymptomArr[k]);
+        }
+      }else{//现病史没有模板
+        current = newSymptomArr;
       }
       let currentData = JSON.parse(JSON.stringify(current));
       res.data = fullfillText(currentData).newArr;
@@ -335,16 +317,19 @@ export const setData = (state,action) =>{
         }
         //组装好的主症状和伴随症状插入现病史模板(flag=4前)
         let endFeatureData = JSON.parse(JSON.stringify(featureData));
-        let insertIdx = null;
-        for(let j=0; j<current.length; j++){
+        if(moduleData&&moduleData.length>0){
+          let insertIdx = null;
+          for(let j=0; j<current.length; j++){
             if(current[j].flag && current[j].flag==4){
               insertIdx = j;  
             }
           }
-     
-        for(let k=0; k<endFeatureData.length; k++){
-          let pos = insertIdx+k;
-          current.splice(pos,0,endFeatureData[k]);
+          for(let k=0; k<endFeatureData.length; k++){
+            let pos = insertIdx+k;
+            current.splice(pos,0,endFeatureData[k]);
+          }
+        }else{//现病史没有模板
+          current = endFeatureData;
         }
         let currentData = JSON.parse(JSON.stringify(current));
         res.data = fullfillText(currentData).newArr;
@@ -623,7 +608,10 @@ export const changeLabelVal = (state,action)=>{
           localStorage.setItem('radio'+item.id,JSON.stringify([li]));
         }
         //取消原选中状态
-        item.questionDetailList.find((it)=>it.selected==true).selected=false;
+        const seld = item.questionDetailList.find((it)=>it.selected==true);
+        if(seld){
+          seld.selected=false;
+        }
       }
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';