|
@@ -187,12 +187,23 @@ export function insertLabelData(state,action){
|
|
|
if(!isReplace){
|
|
|
span.current.innerText = newText;
|
|
|
const pText = Object.assign({},text,{value:newText});
|
|
|
- res.data.splice(index,1,pText,spreadLabels,text);
|
|
|
- res.saveText.splice(index,1,newText,'','');
|
|
|
+ if(toEnd){
|
|
|
+ res.data.splice(index,1,pText,spreadLabels,text);
|
|
|
+ res.saveText.splice(index,1,newText,'','');
|
|
|
+ }else{
|
|
|
+ res.data.splice(index,1,spreadLabels,pText,text);
|
|
|
+ res.saveText.splice(index,1,'',newText,'');
|
|
|
+ }
|
|
|
}else{
|
|
|
span.current.innerText = ' ';
|
|
|
- res.data.splice(index+1,0,spreadLabels,text);
|
|
|
- res.saveText.splice(index+1,0,'','');
|
|
|
+ if(toEnd){
|
|
|
+ res.data.splice(index+1,0,spreadLabels,text);
|
|
|
+ res.saveText.splice(index+1,0,'','');
|
|
|
+ }else{
|
|
|
+ res.data.splice(index,0,text,spreadLabels);
|
|
|
+ res.saveText.splice(index,0,'','');
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
res.searchData = []; //选中清空搜索内容(即关闭搜索弹窗)
|
|
|
res.update = Math.random();
|