|
@@ -65,9 +65,12 @@ export const strTrim = (str) =>{
|
|
|
return str.replace(/ |<div>|<\/div>|<br>|\s/g,'');
|
|
|
};
|
|
|
|
|
|
-//获取已填文字填入saveText
|
|
|
-function getSaveText(arr){
|
|
|
-
|
|
|
+//获取组合组件已填文字填入saveText
|
|
|
+function getSaveText(data){console.log(data)
|
|
|
+ const arr = data.questionMapping.map((it)=>{
|
|
|
+ return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
|
|
|
+ });
|
|
|
+ return arr.join('');
|
|
|
}
|
|
|
|
|
|
//添加自由文本标签
|
|
@@ -102,8 +105,12 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
saveText.push('');
|
|
|
}
|
|
|
newArr.push(it);
|
|
|
- tempText = value?it.labelPrefix+value+it.labelSuffix:'';
|
|
|
- tempText = notText?tempText:it.value||it.name;
|
|
|
+ if(it.tagType != 3){
|
|
|
+ tempText = value?it.labelPrefix+value+it.labelSuffix:'';
|
|
|
+ tempText = notText?tempText:it.value||it.name;
|
|
|
+ }else{
|
|
|
+ tempText = getSaveText(it);
|
|
|
+ }
|
|
|
saveText.push(tempText);
|
|
|
}else{
|
|
|
pre = arr[i-1];
|
|
@@ -111,7 +118,11 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
if(notTextLabel(pre)&¬Text){
|
|
|
// newArr.push(textLabel,it);
|
|
|
ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,it);
|
|
|
- tempText = value?it.labelPrefix+value+it.labelSuffix:'';
|
|
|
+ if(it.tagType != 3) {
|
|
|
+ tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
|
|
|
+ }else{
|
|
|
+ tempText = getSaveText(it);
|
|
|
+ }
|
|
|
saveText.push("",tempText);
|
|
|
//最后一个非文本标签,后面添加一个文本标签
|
|
|
/*if(!noEnd&&i===arr.length-1){
|
|
@@ -120,9 +131,13 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
}*/
|
|
|
}else{ //本身是或者前面是文本标签时,前面不添加文本标签
|
|
|
newArr.push(it);
|
|
|
- tempText = value?it.labelPrefix+value+it.labelSuffix:'';
|
|
|
- // tempText = notText?tempText:it.value||it.name;
|
|
|
- tempText = notText?tempText:(it.value||it.value==""?it.value:it.name);
|
|
|
+ if(it.tagType != 3) {
|
|
|
+ tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
|
|
|
+ // tempText = notText?tempText:it.value||it.name;
|
|
|
+ tempText = notText ? tempText : (it.value || it.value == "" ? it.value : it.name);
|
|
|
+ }else{
|
|
|
+ tempText = getSaveText(it);
|
|
|
+ }
|
|
|
saveText.push(tempText);
|
|
|
}
|
|
|
if(notText&&!noEnd&&i===arr.length-1){//最后一个非文本标签,后面添加一个文本标签
|