|
@@ -96,13 +96,12 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
value = '',
|
|
|
item={},
|
|
|
cNum = 0,
|
|
|
- checkHiddenDefault=false;
|
|
|
+ checkHiddenDefault=false;//console.log(arr)
|
|
|
arr&&arr.map((it,i)=>{
|
|
|
notText = notTextLabel(it);
|
|
|
cNum = i;
|
|
|
value = it.value||'';
|
|
|
textLabel = !ifEmpty&&i==0?Object.assign({},JSON.parse(config.textLabel),{showInCheck:true}):JSON.parse(config.textLabel);
|
|
|
- //n个显示的标签最后一个标签后面要落关标,所以+1
|
|
|
_textLabel = !ifEmpty&&cNum<config.showCheckNum+1?Object.assign({},JSON.parse(config._textLabel),{showInCheck:true}):JSON.parse(config._textLabel);
|
|
|
if(i===0){
|
|
|
//第一个标签不是文本标签时在前面添加文本标签
|
|
@@ -120,7 +119,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
}
|
|
|
saveText.push(tempText);
|
|
|
// 模板只有一个标签时第一项后面也要加空标签
|
|
|
- if(arr.length==1&¬Text){
|
|
|
+ if(arr.length==1){
|
|
|
newArr.push(textLabel);
|
|
|
saveText.push('');
|
|
|
}
|
|
@@ -156,8 +155,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
|
|
|
}
|
|
|
if(notText&&!noEnd&&i===arr.length-1){//最后一个非文本标签,后面添加一个文本标签
|
|
|
//不能用上面的变量textLabel,因为上一个if可能也进了,这样就是同一个对象,值改变时会同步
|
|
|
- const _text = arr.length>config.showCheckNum?JSON.parse(config._textLabel):_textLabel;
|
|
|
- newArr.push(ifEmpty?textLabel:_text);
|
|
|
+ newArr.push(ifEmpty?textLabel:_textLabel);
|
|
|
saveText.push("");
|
|
|
}
|
|
|
}
|