Browse Source

带标点菜单内容显示bug

zhouna 5 years ago
parent
commit
014bcc8a20
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/js/qcScore.js

+ 3 - 2
src/js/qcScore.js

@@ -130,12 +130,13 @@ function initContent(data){
       }else{
         const icon=require("../images/empty1.png");
         const sid=moduleId?"("+moduleId+")":"";
+        const code=k.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g,'');
         const emptyStr=`<div class="empty">
             <img src="${icon}" alt="空"/>
             <p>暂无信息~</p>
         </div>`;
-        if(!$(".content-item[code="+k+"] .empty").length){  //显示一条空提示即可
-          hml='<div class="content-item" code="'+k+'">' +
+        if(!$(".content-item[code="+code+"] .empty").length){  //显示一条空提示即可
+          hml='<div class="content-item" code="'+code+'">' +
             '<h2 class="title">'+k+sid+'</h2>'+emptyStr+'</div>';
           $.tmpl(hml,{}).appendTo("#contentInfo");
         }