Ver Fonte

bug:图表点击跳转

温红权 há 8 anos atrás
pai
commit
1f253e5f77

+ 6 - 2
VisualInspection/js/main.js

@@ -256,6 +256,8 @@ function getPageInfo(id) {
 
 var current_url; //当前显示页面url
 var current_mid; //当前显示页面id
+var isnew = true;
+
 function changePage(url, tableObj) {
     // var pre_param = $.zui.store.get('store_param_'+url);
     // console.log(pre_param);
@@ -273,17 +275,19 @@ function changePage(url, tableObj) {
         current_url = url;
         $("#main_content").load(base_ui_url + url);
 
+
         var name = $.zui.store.get(url);
         if (name) {
             // $("#breadcrumb_menu").html('<li murl="'+url+'" mname="'+name+'"><a href="#" onclick="changePage('+url+')">'+name+'</a></li>');
-            addBreadMenu(url, name, true);
+            addBreadMenu(url, name, isnew);
         } else {
             var t = url.split("?")[0];
             name = $.zui.store.get(t);
             if (name) {
-                addBreadMenu(url, name, false);
+                addBreadMenu(url, name, isnew);
             }
         }
+        isnew = true;
         if (ISCLIENT) {
             event = document.createEvent('MessageEvent');
             var origin = window.location.protocol + '//' + window.location.host;

+ 1 - 0
VisualInspection/js/statistics/assess_ranking.js

@@ -266,6 +266,7 @@ function jumpuser(userid, deptid) {
 
     url = "/view/statistics/personal_data_statistics.html?userid=" + userid + "&deptid=" + deptid
 
+    isnew = false;
     changePage(url);
 
 }

+ 77 - 2
VisualInspection/js/statistics/total_company_statistics.js

@@ -597,9 +597,11 @@ $(function() {
                 'echarts/theme/macarons',
                 'echarts/chart/line',
                 'echarts/chart/bar',
-                'echarts/chart/pie'
+                'echarts/chart/pie',
+                'echarts/config'
             ],
             function(ec, theme) {
+
                 // 基于准备好的dom,初始化echarts图表
                 if (flag) {
                     year_assess = ec.init(document.getElementById('company-year-assess'), theme);
@@ -610,6 +612,16 @@ $(function() {
                 check_type = ec.init(document.getElementById('server-check-type'), theme);
                 people_points = ec.init(document.getElementById('each-people-points'));
 
+                year_assess.on(ecConfig.EVENT.CLICK, year_c)
+                points_assess.on(ecConfig.EVENT.CLICK, point_c)
+                score_rank.on(ecConfig.EVENT.CLICK, score_c)
+                stationAll_rank.on(ecConfig.EVENT.CLICK, station_c)
+                check_type.on(ecConfig.EVENT.CLICK, check_c)
+                people_points.on(ecConfig.EVENT.CLICK, people_c)
+
+
+
+
             }
         );
     }
@@ -1287,4 +1299,67 @@ $(function() {
     }
 
 
-});
+});
+
+var ecConfig = require('echarts/config');
+
+function year_c(param) {
+    if (typeof param.seriesIndex == 'undefined') {
+        return;
+    }
+    if (param.type == 'click') {
+        // console.log(param)
+        // alert(param.name);
+    }
+}
+
+function point_c(param) {
+    if (typeof param.seriesIndex == 'undefined') {
+        return;
+    }
+    if (param.type == 'click') {
+        isnew = false;
+        changePage("/view/statistics/assess_situation.html");
+
+    }
+}
+
+function score_c(param) {
+    if (typeof param.seriesIndex == 'undefined') {
+        return;
+    }
+    if (param.type == 'click') {
+        // console.log(param)
+        // alert(param.name);
+    }
+}
+
+function station_c(param) {
+    if (typeof param.seriesIndex == 'undefined') {
+        return;
+    }
+    if (param.type == 'click') {
+        // console.log(param)
+        // alert(param.name);
+    }
+}
+
+function check_c(param) {
+    if (typeof param.seriesIndex == 'undefined') {
+        return;
+    }
+    if (param.type == 'click') {
+        // console.log(param)
+        // alert(param.name);
+    }
+}
+
+function people_c(param) {
+    if (typeof param.seriesIndex == 'undefined') {
+        return;
+    }
+    if (param.type == 'click') {
+        // console.log(param)
+        // alert(param.name);
+    }
+}