liyongli 3 gadi atpakaļ
vecāks
revīzija
316c7a3e82
1 mainītis faili ar 11 papildinājumiem un 8 dzēšanām
  1. 11 8
      item.html

+ 11 - 8
item.html

@@ -77,9 +77,9 @@
                         <div class="col-xs-6" style="padding-left: 0;">部门传播量排行</div>
                         <div class="col-xs-6" style="text-align: right;">
                             <div class="btn-group btn-group-xs " role="group">
-                                <div class="btn btn-default typeclick">全部</div>
-                                <div class="btn btn-default typeclick">月</div>
-                                <div class="btn btn-default typeclick">周</div>
+                                <div class="btn btn-default typeclick ALL">全部</div>
+                                <div class="btn btn-default typeclick MONTH">月</div>
+                                <div class="btn btn-default typeclick WEEK">周</div>
                             </div>
                         </div>
                     </div>
@@ -231,7 +231,7 @@
 
         barchart.interval()
             .position('depName*readCount')
-            .color('l(90) 0:#1890ff 1:#70cdd0'); // 定义柱状图渐变色
+            .color('l(180) 0:#1890ff 1:#70cdd0'); // 定义柱状图渐变色
         barchart.render();
     }
 
@@ -330,15 +330,18 @@
     function init() {
         let h = $('.panel-body').width() * 9 / 16;
         $('.panel-body').height(h);
-
         $('.typeclick').click(function (e) {
             let t = $(e.target).text();
-            if(t === '全部') type = "ALL";
-            if(t === '周') type = "WEEK";
-            if(t === '月') type = "MONTH";
+            if (t === '全部') type = "ALL";
+            if (t === '周') type = "WEEK";
+            if (t === '月') type = "MONTH";
+            $('.btn-primary').removeClass("btn-primary");
+            $('.' + type).addClass("btn-primary")
             getread();
         })
 
+        $('.' + type).addClass("btn-primary")
+
         gethistory();
         getoverview();
         getread();