|
@@ -177,6 +177,24 @@ export const confirm = (state,action) =>{
|
|
|
if(forwardId){
|
|
|
text = saveText.slice(forwardId,labelIndx);
|
|
|
let index = text.indexOf('伴');
|
|
|
+ /*let sliceArr = arr.slice(forwardId,labelIndx);
|
|
|
+ let newSliceArr = JSON.parse(JSON.stringify(sliceArr));
|
|
|
+ let banIndex;
|
|
|
+ console.log(55,sliceArr);
|
|
|
+ for(let k=0; k<sliceArr.length;k++){
|
|
|
+ if(sliceArr[k].value&&sliceArr[k].value.indexOf('伴')>-1){
|
|
|
+ banIndex = k;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(66,banIndex);
|
|
|
+ if(banIndex){//有伴
|
|
|
+ if(exists.length > 0){
|
|
|
+ Array.prototype.splice.apply(arr, [banIndex-1,0,...exists]);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }*/
|
|
|
+
|
|
|
if(index==-1){//没有伴,直接插入ikey前
|
|
|
if(exists.length > 0){
|
|
|
let withsAddP = addPoint(exists,1);
|
|
@@ -384,19 +402,22 @@ export const insertSearch = (state,action)=>{
|
|
|
if(index < 1){//前
|
|
|
if(data[focusIndex].value==searchStr){//为空标签则替换
|
|
|
res.data.splice(focusIndex,1,nText);
|
|
|
+ res.saveText.splice(focusIndex,1,searchData);
|
|
|
}else{
|
|
|
res.data.splice(focusIndex,0,nText);
|
|
|
+ res.saveText.splice(focusIndex,0,searchData);
|
|
|
res.data[focusIndex+1].value = value;
|
|
|
res.saveText[focusIndex+1] = value;
|
|
|
}
|
|
|
}else{
|
|
|
res.data.splice(focusIndex+1,0,nText);
|
|
|
+ res.saveText.splice(focusIndex+1,0,searchData);
|
|
|
res.data[focusIndex].value = value;
|
|
|
}
|
|
|
span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value);
|
|
|
res.mainIds.push(id);
|
|
|
}
|
|
|
- res.saveText = fullfillText(res.data).saveText;
|
|
|
+ // console.log(456,res,action);
|
|
|
res.update=Math.random();
|
|
|
return res;
|
|
|
}
|