|
@@ -145,6 +145,12 @@ export function recoveTag(state,action) {
|
|
if(!isArr){
|
|
if(!isArr){
|
|
arr.splice(action.index,0,action.data);
|
|
arr.splice(action.index,0,action.data);
|
|
}else{
|
|
}else{
|
|
|
|
+ //恢复连续选中删除的标签,先判断需恢复的标签中是否有子模板,有则删除数据中的子模板标签,然后恢复被删除的标签(子模板只有一个)
|
|
|
|
+ const sonModuleInx = action.data.findIndex((it)=>it.flag=='3'); //是否有子模板
|
|
|
|
+ if(sonModuleInx!==-1){
|
|
|
|
+ const sonMInx = arr.findIndex((it)=>it.flag=='3');
|
|
|
|
+ arr.splice(sonMInx,1);
|
|
|
|
+ }
|
|
arr.splice(action.index,0,...action.data);
|
|
arr.splice(action.index,0,...action.data);
|
|
}
|
|
}
|
|
const dataArr = fullfillText(arr);
|
|
const dataArr = fullfillText(arr);
|
|
@@ -248,18 +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 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);
|
|
|
|
|
|
+ const temp = arr.splice(end,n,...sonModule);
|
|
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);
|
|
|
|
|
|
+ const temp = arr.splice(start,n,...sonModule);
|
|
handleLocalDelTag(boxMark,start,temp);
|
|
handleLocalDelTag(boxMark,start,temp);
|
|
}
|
|
}
|
|
const newObj = boxMark=='4'?checkFullfillText(arr):fullfillText(arr);
|
|
const newObj = boxMark=='4'?checkFullfillText(arr):fullfillText(arr);
|