Browse Source

缺陷一对多

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

+ 2 - 2
src/html/qcScore.html

@@ -550,9 +550,9 @@
         <div class="flaw-item" code="${modelName.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g,'')}">
             <div class="title">
                 {{if info}}
-                <a {{if pageKeyList[0]}} href="#anchor${pageKeyList[0]}" {{/if}}>${msg}(${info})</a>
+                <a {{if pageKeyList[0]}} anchors="${pageKeyList}" href="#anchor${pageKeyList[0]}" {{/if}}>${msg}(${info})</a>
                 {{else}}
-                <a {{if pageKeyList[0]}} href="#anchor${pageKeyList[0]}" {{/if}}>${msg}</a>
+                <a {{if pageKeyList[0]}} anchors="${pageKeyList}" href="#anchor${pageKeyList[0]}" {{/if}}>${msg}</a>
                 {{/if}}
             </div>
             <div class="opers">

+ 5 - 1
src/js/qcScore.js

@@ -201,8 +201,12 @@ function initScoreItem(data){
   $(".del-flaw").css({"opacity":hasAu2?"1":"0.5",cursor:hasAu2?"pointer":"unset"});
   $(".flaw-item .title a[href]").click(function(){
     const id = $(this).attr("href");
+    const anchors=$(this).attr("anchors").split(",");
+    let ans = anchors.map((it)=>{
+      return "#anchor"+it;
+    });
     $(".info-item .cont,.flaw-item .title").removeClass("active");
-    $(id).addClass("active");
+    $(ans.join(",")).addClass("active");
     $(this).parent().addClass("active");
   });
 }