|
@@ -94,7 +94,8 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
saveText=[],
|
|
|
tempText = '',
|
|
|
value = '',
|
|
|
- item={};
|
|
|
+ item={},
|
|
|
+ checkHiddenDefault=false;
|
|
|
arr.map((it,i)=>{
|
|
|
notText = notTextLabel(it);
|
|
|
value = it.value||'';
|
|
@@ -118,6 +119,12 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
}else{
|
|
|
pre = arr[i-1];
|
|
|
item = !ifEmpty&&i<config.showCheckNum?Object.assign({},it,{showInCheck:true}):it;
|
|
|
+ //判断单选项是否有默认选中,位置在隐藏区域时,查体所有标签展示
|
|
|
+ if(!ifEmpty&&!checkHiddenDefault&&i>config.showCheckNum&&+it.tagType===1&&(+it.controlType===0||+it.controlType===1)){
|
|
|
+ if(it.questionDetailList.find((it)=>it.defaultSelect=='1')){
|
|
|
+ checkHiddenDefault=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
//如果本身不是文本标签且前面一个也不是文本标签,该标签前面添加文本标签
|
|
|
if(notTextLabel(pre)&¬Text){
|
|
|
// newArr.push(textLabel,it);
|
|
@@ -127,12 +134,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
}else{
|
|
|
tempText = getSaveText(it);
|
|
|
}
|
|
|
- saveText.push("",tempText);
|
|
|
- //最后一个非文本标签,后面添加一个文本标签
|
|
|
- /*if(!noEnd&&i===arr.length-1){
|
|
|
- newArr.push(textLabel);
|
|
|
- saveText.push("");
|
|
|
- }*/
|
|
|
+ saveText.push("",tempText);
|
|
|
}else{ //本身是或者前面是文本标签时,前面不添加文本标签
|
|
|
newArr.push(item);
|
|
|
if(it.tagType != 3) {
|
|
@@ -151,7 +153,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- return {newArr,saveText};
|
|
|
+ return {newArr,saveText,checkHiddenDefault};
|
|
|
};
|
|
|
|
|
|
|