From 5154221658f586cd62e9e5c9ddbe400bfa32f2fa Mon Sep 17 00:00:00 2001
From: qinbo <qinbo@shsening.com>
Date: 星期一, 27 十二月 2021 12:31:55 +0800
Subject: [PATCH] 遮罩 bug fix

---
 js/function.js                   |   17 +++++++----------
 js/changable_params.js           |    2 +-
 widgetsTS/widget_summary/view.js |    2 +-
 js/index.js                      |    6 ++++--
 4 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/js/changable_params.js b/js/changable_params.js
index f894e37..4b36281 100644
--- a/js/changable_params.js
+++ b/js/changable_params.js
@@ -49,7 +49,7 @@
   , 3003: ['#00EE00', '#FF9F7F', '#FFD700', '#ff6600', '#ff0066', '#ff6666']
 }
 
-var default_system_params = { geoserver_url_predix: 'http://223.167.111.168:7001/', nodejs_url_predix: 'http://223.167.111.168:7012/', userid: 2, queryDataType: 'hour', weathercitycode: '101020100', wind360: 0, windSpeed: 10, is_single_taxi_replaying: false,summary_topN_count :50, un_authorization_url: 'http://www.sohu.com'};
+var default_system_params = { geoserver_url_predix: 'http://58.246.27.194:7011/', nodejs_url_predix: 'http://58.246.27.194:7012/', userid: 2, queryDataType: 'hour', weathercitycode: '101020100', wind360: 0, windSpeed: 10, is_single_taxi_replaying: false,summary_topN_count :50, un_authorization_url: 'http://223.167.111.168:8016/PollutionData/loginpage.aspx?returnurl=http://223.167.111.168:8004/shanghai/index.html',regionCode:0};
 var default_grid_camerview = {grid5000:{"lat":30.306622,"lng":121.251151,"alt":180451,"heading":2,"pitch":-61},grid3000:{"lat":31.076898,"lng":121.418675,"alt":36483,"heading":2,"pitch":-61},grid1000:{"lat":31.216173,"lng":121.350382,"alt":8883,"heading":2,"pitch":-60}};
 
 function bindPopupFunction(event) {
diff --git a/js/function.js b/js/function.js
index 5424962..4e65edd 100644
--- a/js/function.js
+++ b/js/function.js
@@ -183,30 +183,27 @@
   }
 }
 
-function mask_selection(userid){
-
+function mask_selection(regionCode){
+    if(regionCode == 0){
+      return
+    }
     //geojson 鍚勮鏀垮尯杈圭晫绾�
-    if(userid != null || userid != undefined){
       geoJsonLayer = new mars3d.layer.GeoJsonLayer({
-        url: "./data/"+userid+".geojson",
+        url: "./data/"+regionCode+".geojson",
         mask: true, //鏍囪瘑涓洪伄缃╁眰銆愰噸鐐瑰弬鏁般��
         symbol: {
           styleOptions: {
             fill: true,
             color: "rgb(2,26,79)",
-            opacity: 0.9,
             outline: true,
             outlineColor: "#39E09B",
-            outlineWidth: 8,
-            outlineOpacity: 0.8,
+            outlineWidth: 3,
+            outlineOpacity: 0.5,
             arcType: Cesium.ArcType.GEODESIC,
             clampToGround: true,
           },
         },
       });
       map.addLayer(geoJsonLayer);
-    }else{
-      return
-    }
 }
 
diff --git a/js/index.js b/js/index.js
index 3e66010..fae3128 100644
--- a/js/index.js
+++ b/js/index.js
@@ -17,7 +17,7 @@
     //鏈夌埗绾�
     request = $.extend(request, haoutil.system.getRequest(window.top));
   }
-  // debugger;
+
   try {
     var jwtstr = request.JWT;
     var strs_ = jwtstr.split('.');
@@ -25,6 +25,7 @@
     var jwt_payload_ = new buffer.Buffer(strs_[1].toString('base64'), 'base64').toString();
     var payload_ = JSON.parse(jwt_payload_);
     mars3d.global_variables.userid = payload_.userid;
+    mars3d.global_variables.regionCode = payload_.divcode;
     var hash = CryptoJS.HmacSHA256(strs_[0] + '.' + strs_[1], "sxyd");
     var hashInBase64 = base64UrlEncode(hash);
 
@@ -50,6 +51,7 @@
   }
 
   // mars3d.global_variables.userid = request?.userid || 2;
+  regionCode = mars3d.global_variables.regionCode
 
   var configfile = "config/config.json"; //榛樿鍦板潃
   if (request.config) {
@@ -105,7 +107,7 @@
 
   initLayersByUserid();
 
-  mask_selection(mars3d.global_variables.userid)
+  mask_selection(regionCode)
 
   //濡傛灉鏈墄yz浼犲弬锛岃繘琛屽畾浣�
   if (haoutil.isutil.isNotNull(request.x) && haoutil.isutil.isNotNull(request.y)) {
diff --git a/widgetsTS/widget_summary/view.js b/widgetsTS/widget_summary/view.js
index 454f9c0..81a32b9 100644
--- a/widgetsTS/widget_summary/view.js
+++ b/widgetsTS/widget_summary/view.js
@@ -101,7 +101,7 @@
 
 function reloadData() {
     $("#top10Tb").empty();
-    var backend_url = thisWidget.nodejs_url_predix + "dataapi/Bdata?bid=get_" + current_selected_monitor_type + "_list&datatype=" + thisWidget.datatype + "&datatime=" + thisWidget.datatime + "&qindex=" + current_selected_monitor_qindex + "&pageno=1&pagesize=" + default_system_params.summary_topN_count;
+    var backend_url = thisWidget.nodejs_url_predix + "dataapi/Bdata?bid=get_" + current_selected_monitor_type + "_list&datatype=" + thisWidget.datatype + "&datatime=" + thisWidget.datatime+ "&userid=" + thisWidget.userid + "&qindex=" + current_selected_monitor_qindex + "&pageno=1&pagesize=" + default_system_params.summary_topN_count;
     //鍔犲叆cntId
     $.ajax({
         type: 'get',

--
Gitblit v1.9.1