Explorar o código

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

# Conflicts:
#	src/components/CheckBody/index.jsx
#	src/components/MainSuit/index.jsx
#	src/components/SpreadDrop/index.jsx
zhouna %!s(int64=6) %!d(string=hai) anos
pai
achega
d5b22a1659

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

@@ -214,7 +214,15 @@ class MainSuit extends Component{
     if(!isIE()){
       e.target.innerText="";
       freeText && freeText(data.trim());
-      // 延时关闭常见症状下拉,不延时会影响选中
+    }else{
+      if(datas.length==0){
+        const ev = e || window.event;
+        const data = ev.target.innerText;
+        // freeText && freeText(data.trim());
+        freeText && freeText(data);
+      }
+    }
+    // 延时关闭常见症状下拉,不延时会影响选中
       clearTimeout(this.state.clearTimer);
       const clearTimer = setTimeout(function(){
         that.setState({
@@ -224,14 +232,6 @@ class MainSuit extends Component{
       this.setState({
         clearTimer
       });
-    }else{
-      if(datas.length==0){
-        const ev = e || window.event;
-        const data = ev.target.innerText;
-        // freeText && freeText(data.trim());
-        freeText && freeText(data);
-      }
-    }
     
   }
 

+ 9 - 3
src/store/actions/checkBody.js

@@ -312,12 +312,18 @@ export function backspaceText(state,action){
   let res = Object.assign({},state);
   const {delIndex} = action;
   const data = res.data;
-  if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
+  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
+  // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
     // 前一个是文本标签或者子模板 不做处理
-  }else{
+  }else if(data[delIndex-1].tagType==8){
+    data.splice(delIndex,1);
+    res.saveText.splice(delIndex,1);
+  }
+  else{
     data.splice(delIndex-1,2);
+    res.saveText.splice(delIndex-1,2);
   }
-  res.saveText = fullfillText(data).saveText;
+  // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
 }

+ 7 - 4
src/store/actions/currentIll.js

@@ -532,8 +532,8 @@ export function insertLabelData(state,action){
       res.saveText.splice(focusIndex+1,0,searchData);
       res.data[focusIndex].value = value;
       resData = JSON.parse(JSON.stringify(res.data));
-      // +3是因为插入一个文本标签加一个符号标签  
-      resData.splice(focusIndex+3,0,...(data.questionMapping.filter((item)=>{
+      // +2是因为插入一个文本标签  
+      resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
                               return item.symptomType==0||item.symptomType==2;
                             })));
     }
@@ -597,11 +597,13 @@ export function backspaceText(state,action){
     // data[delIndex].value = text;
   }else if(data[delIndex-1].tagType==8){
     data.splice(delIndex,1);
+    res.saveText.splice(delIndex,1);
   }
   else{
     data.splice(delIndex-1,2);
+    res.saveText.splice(delIndex-1,2);
   }
-  res.saveText = fullfillText(data).saveText;
+  // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
 }
@@ -618,12 +620,13 @@ export function removeId(state,action){
   }
   if(!data[index].value && data[index-1].tagType==8){
     data.splice(index,1);
+    res.saveText.splice(index,1);
   }else{
     data[index].id = "";
     data[index].name = text;
     data[index].value = text;
   }
-  
+  //console.log(345,action,res);
   res.update = Math.random();
   return res;
 }

+ 4 - 1
src/store/actions/mainSuit.js

@@ -591,11 +591,13 @@ export function backspaceText(state,action){
     // 前一个是文本标签或者子模板 不做处理
   }else if(data[delIndex-1].tagType==8){
     data.splice(delIndex,1);
+    res.saveText.splice(delIndex,1);
   }
   else{
     data.splice(delIndex-1,2);
+    res.saveText.splice(delIndex-1,2);
   }
-  res.saveText = fullfillText(data).saveText;
+  // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
 }
@@ -612,6 +614,7 @@ export function removeId(state,action){
   }
   if(!data[index].value && data[index-1].tagType==8){
     data.splice(index,1);
+    res.saveText.splice(index,1);
   }else{
     data[index].id = "";
     data[index].name = text;

+ 10 - 3
src/store/actions/otherHistory.js

@@ -295,12 +295,18 @@ export function backspaceText(state,action){
   let res = Object.assign({},state);
   const {delIndex} = action;
   const data = res.data;
-  if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
+  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
+  // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
     // 前一个是文本标签或者子模板 不做处理
-  }else{
+  }else if(data[delIndex-1].tagType==8){
+    data.splice(delIndex,1);
+    res.saveText.splice(delIndex,1);
+  }
+  else{
     data.splice(delIndex-1,2);
+    res.saveText.splice(delIndex-1,2);
   }
-  res.saveText = fullfillText(data).saveText;
+  // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
 }
@@ -312,6 +318,7 @@ export function removeId(state,action){
   const data = res.data;
   if(!data[index].value && data[index-1].tagType==8){
     data.splice(index,1);
+    res.saveText.splice(index,1);
   } 
   res.update = Math.random();
   return res;