ソースを参照

1378已改bug被覆盖找回

zhouna 6 年 前
コミット
9647a6f0eb
1 ファイル変更4 行追加2 行削除
  1. 4 2
      src/common/js/func.js

+ 4 - 2
src/common/js/func.js

@@ -102,6 +102,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
     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){
       //第一个标签不是文本标签时在前面添加文本标签
@@ -119,7 +120,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       }
       saveText.push(tempText);
       // 模板只有一个标签时第一项后面也要加空标签
-      if(arr.length==1){
+      if(arr.length==1&&notText){
         newArr.push(textLabel);
         saveText.push('');
       }
@@ -155,7 +156,8 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       }
       if(notText&&!noEnd&&i===arr.length-1){//最后一个非文本标签,后面添加一个文本标签
         //不能用上面的变量textLabel,因为上一个if可能也进了,这样就是同一个对象,值改变时会同步
-        newArr.push(ifEmpty?textLabel:_textLabel);
+        const _text = arr.length>config.showCheckNum?JSON.parse(config._textLabel):_textLabel;
+        newArr.push(ifEmpty?textLabel:_text);
         saveText.push("");
       }
     }