|
@@ -15,30 +15,31 @@ export const confirm = (state,action) =>{
|
|
|
return res;
|
|
|
}
|
|
|
//只有无的项目选中
|
|
|
+ if(+copyType===0) { //原标签保留
|
|
|
+ arr.splice(ikey,1);
|
|
|
+ }
|
|
|
if(arr[ikey].value) arr[ikey].value= '';
|
|
|
+ let newPreText = (arr[ikey-1].value||arr[ikey-1].name||'')+nones;//console.log(arr[ikey-1],newPreText)
|
|
|
if([...exists,...withs].length==0&&nones){
|
|
|
- const newPreText = arr[ikey-1].name+nones;//console.log(arr[ikey-1],newPreText)
|
|
|
arr[ikey-1].value = newPreText;
|
|
|
res.saveText[ikey-1] = newPreText;
|
|
|
res.update=Math.random();
|
|
|
return res;
|
|
|
}
|
|
|
- //有、伴项目有选中
|
|
|
- //const existDatas = fullfillText(exists).newArr;
|
|
|
- //let withDatas = fullfillText(withs).newArr;
|
|
|
- /*if(withDatas&&withDatas.length>0){
|
|
|
- withDatas[0].value=withs.length>0?"伴":'';
|
|
|
- }*/
|
|
|
- //const text = Object.assign({},JSON.parse(config.textLabel),{value:"伴"}):undefined;
|
|
|
- if(+copyType===1){ //原标签保留
|
|
|
+ //有,无,伴随配
|
|
|
+ arr.splice(ikey-1,1);
|
|
|
+ let flabel = [...exists,...withs][0]; //要插入的第一个标签
|
|
|
+ let text = newPreText;
|
|
|
+ //要插入的第一个标签为自由文本,则和前一个文本标签文字合并
|
|
|
+ if(flabel.tagType==8){
|
|
|
+ flabel.value = newPreText+(flabel.value||flabel.name);
|
|
|
+ text = flabel.value;
|
|
|
+ }
|
|
|
arr.splice(ikey-1,0,...exists,...withs);
|
|
|
- }else{ //替换原标签
|
|
|
- arr.splice(ikey,1);
|
|
|
- arr.splice(ikey-1,1,...exists,...withs);
|
|
|
- }
|
|
|
-
|
|
|
- res.update=Math.random(); //用于触发组件更新(data变化了因在对象中无法被组件检测到)
|
|
|
- return res;
|
|
|
+ arr[ikey-1].value = text;
|
|
|
+ res.saveText[ikey-1] = text;
|
|
|
+ res.update=Math.random(); //用于触发组件更新(data变化了因在对象中无法被组件检测到)
|
|
|
+ return res;
|
|
|
};
|
|
|
|
|
|
//单选下拉选中
|