|
@@ -254,19 +254,19 @@ export function deleteSelectedLabels(state,action){
|
|
const {start,end,boxMark} = action;
|
|
const {start,end,boxMark} = action;
|
|
let n = Math.abs(end-start)+1;
|
|
let n = Math.abs(end-start)+1;
|
|
const arr = res.data;
|
|
const arr = res.data;
|
|
- const sonModule = arr.filter((it)=>it.flag=='3');
|
|
|
|
|
|
+ const sonModuleInx = arr.findIndex((it)=>it.flag=='3');
|
|
const startIsText = arr[start].tagType=='8';
|
|
const startIsText = arr[start].tagType=='8';
|
|
const endIsText = arr[end].tagType=='8';
|
|
const endIsText = arr[end].tagType=='8';
|
|
if(!startIsText&&!endIsText){
|
|
if(!startIsText&&!endIsText){
|
|
n=Math.abs(end-start)+2;
|
|
n=Math.abs(end-start)+2;
|
|
}
|
|
}
|
|
if(start>end){ //从后往前选中
|
|
if(start>end){ //从后往前选中
|
|
- const temp = arr.splice(end,n,...sonModule);
|
|
|
|
|
|
+ const temp = end<sonModuleInx&&sonModuleInx<start?arr.splice(end,n,arr[sonModuleInx]):arr.splice(end,n);
|
|
handleLocalDelTag(boxMark,end,temp);
|
|
handleLocalDelTag(boxMark,end,temp);
|
|
}else if(start===end){
|
|
}else if(start===end){
|
|
return res;
|
|
return res;
|
|
}else{
|
|
}else{
|
|
- const temp = arr.splice(start,n,...sonModule);
|
|
|
|
|
|
+ const temp = start<sonModuleInx&&sonModuleInx<end?arr.splice(start,n,arr[sonModuleInx]):arr.splice(start,n);
|
|
handleLocalDelTag(boxMark,start,temp);
|
|
handleLocalDelTag(boxMark,start,temp);
|
|
}
|
|
}
|
|
const newObj = boxMark=='4'?checkFullfillText(arr):fullfillText(arr);
|
|
const newObj = boxMark=='4'?checkFullfillText(arr):fullfillText(arr);
|