Kaynağa Gözat

修改其他史查体杂音类选中bug

zhouna 6 yıl önce
ebeveyn
işleme
7a306c9f20

+ 4 - 2
src/store/actions/checkBody.js

@@ -203,12 +203,12 @@ export function insertLabelData(state,action){
       res.data.splice(index,1,pText,...spreadLabels,text);
       res.saveText = fullfillText(res.data).saveText;
       //res.saveText.splice(index,1,newText,'','');
-      res.selecteds.splice(index,1,null,new Array(spreadLabels.length).fill(null),null);
+      res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null),null);
     }else{
       res.data.splice(index,1,text,...spreadLabels,pText);
       res.saveText = fullfillText(res.data).saveText;
       //res.saveText.splice(index,1,'','',newText);
-      res.selecteds.splice(index,1,null,new Array(spreadLabels.length).fill(null),null);
+      res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null),null);
     }
 
   }else{
@@ -251,6 +251,7 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
+    res.selecteds.splice(index,num);//杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
@@ -278,6 +279,7 @@ export const changeNumLabelVal = (state,action)=>{
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
+    res.selecteds.splice(index,num);      //杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
   }
 

+ 6 - 0
src/store/actions/otherHistory.js

@@ -192,19 +192,23 @@ export function insertLabelData(state,action){
     if(searchInEnd){
       res.data.splice(index,1,pText,...spreadLabels,text);
       res.saveText = fullfillText(res.data).saveText;
+      res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null),null);
       //res.saveText.splice(index,1,newText,'','');
     }else{
       res.data.splice(index,1,...spreadLabels,pText,text);
       res.saveText = fullfillText(res.data).saveText;//.splice(index,1,'',newText,'');
+      res.selecteds.splice(index,1,...new Array(spreadLabels.length).fill(null),null,null);
     }
   }else{
     span.current.innerText = ' ';
     if(searchInEnd){
       res.data.splice(index+1,0,spreadLabels,text);
       res.saveText.splice(index+1,0,'','');
+      res.selecteds.splice(index+1,0,...new Array(spreadLabels.length).fill(null),null);
     }else{
       res.data.splice(index,0,text,spreadLabels);
       res.saveText.splice(index,0,'','');
+      res.selecteds.splice(index,0,null,...new Array(spreadLabels.length).fill(null));
     }
 
   }
@@ -234,6 +238,7 @@ export function changeTextLabel(state,action) {
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
+    res.selecteds.splice(index,num);//杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
@@ -262,6 +267,7 @@ export const changeNumLabelVal = (state,action)=>{
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
+    res.selecteds.splice(index,num);//杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
   };
   res.update = Math.random();