From 7b08b44e307d05c18d60687f039aaa196f75a745 Mon Sep 17 00:00:00 2001
From: qinbo <qinbo@shsening.com>
Date: 星期二, 07 十二月 2021 16:00:31 +0800
Subject: [PATCH] bug fix
---
js/function.js | 11 +----
widgetsTS/widget_search/widget.js | 14 +++---
js/changable_params.js | 24 +++++++++---
widgetsTS/widget_detail/view.js | 24 ++++--------
js/function_1001.js | 11 +++++
widgetsTS/taxiRouteReplay/view.js | 1
widgetsTS/widget_summary/view.js | 10 +---
widgetsTS/taxiRouteReplay/widget.js | 1
widgetsTS/widget_search/view.js | 6 --
widgetsTS/widget_detail/view.html | 3 +
10 files changed, 53 insertions(+), 52 deletions(-)
diff --git a/js/changable_params.js b/js/changable_params.js
index 13004fe..aefe02d 100644
--- a/js/changable_params.js
+++ b/js/changable_params.js
@@ -7,6 +7,8 @@
var color_list_1002 = ['#0dd4f7', '#078901', '#FFFF00', '#fe7c23', '#F70F0D', '#88041E'];
var color_list_1003 = ['#0EE839', '#FEFE23', '#F70F0D'];
var color_list_1004_and_other = ['#0dd4f7', '#23fe9f', '#078901', '#d4fe23', '#FFFF00', '#febf23', '#fe7c23', '#F70F0D', '#8A0B73', '#88041E'];
+var array = ['1000','3000','5000']
+var grid;
var qindex_range_list_1001 = { 'pm25': [35, 75, 115, 150, 250], 'pm10': [50, 150, 250, 350, 420], 'no2': [100, 200, 700, 1200, 2340], 'co': [5, 10, 35, 60, 90] };
var qindex_range_list_1002 = { 'pm25': [10, 20, 50, 80, 100], 'pm10': [20, 50, 80, 150, 200], 'no2': [25, 50, 100, 150, 300], 'co': [0.5, 0.6, 0.8, 1, 1.5] };
@@ -73,7 +75,7 @@
"<tr><td>CO锛�</td><td align= right>" + item["co"] + ' ' + "</td><td>mg/m鲁</td></tr>" +
"<tr><td>SO<SUB>2</SUB>锛� </td><td align= right>" + item["so2"] + ' ' + "</td><td>渭g/m鲁</td></tr>" +
"</table>" +
- "<br/><p><a href='#' onclick='javascript:showDetail(1001,\"" + item["code"] + "\",\"" + qindex + "\")' >璇︾粏淇℃伅</a> <a href='#' onclick='javascript:addGraphictoHighlightLayer()' >淇濇寔楂樹寒鏄剧ず</a></p>";
+ "<br/><p><a href='#' onclick='javascript:showDetail(1001,\"" + item["code"] + "\",\"" + qindex + "\")' >璇︾粏淇℃伅</a></p>";
@@ -93,7 +95,7 @@
"<tr><td>SO<SUB>2</SUB>锛� </td><td align= right>" + item["so2"] + ' ' + "</td><td>渭g/m鲁</td></tr>" +
"<tr><td>O<SUB>3</SUB>锛� </td><td align= right>" + item["o3"] + ' ' + "</td><td>渭g/m鲁</td></tr>" +
"</table>" +
- "<br /><br /><p><a href='#' onclick='javascript:showDetail(1002,\"" + item["code"] + "\",\"" + qindex + "\")' >璇︾粏淇℃伅</a> <a href='#' onclick='javascript:addGraphictoHighlightLayer()' >淇濇寔楂樹寒鏄剧ず</a></p>";
+ "<br /><br /><p><a href='#' onclick='javascript:showDetail(1002,\"" + item["code"] + "\",\"" + qindex + "\")' >璇︾粏淇℃伅</a></p>";
@@ -105,9 +107,9 @@
item["name"] +
"<br />鏁版嵁鏃堕棿锛�" +
item["datatime"] +
- "<br />TSP锛�" +
+ "<br />鎬绘偓娴绮掔墿锛圱SP锛夛細" +
item["tsp"] + ' ' + "mg/m鲁" +
- "<br /><br /><p><a href='#' onclick='javascript:showDetail(1003,\"" + item["code"] + "\",\"" + qindex + "\")' >璇︾粏淇℃伅</a> <a href='#' onclick='javascript:addGraphictoHighlightLayer()' >淇濇寔楂樹寒鏄剧ず</a></p>";
+ "<br /><br /><p><a href='#' onclick='javascript:showDetail(1003,\"" + item["code"] + "\",\"" + qindex + "\")' >璇︾粏淇℃伅</a></p>";
} else if (layerid == 1004) {
@@ -130,9 +132,19 @@
}else if(layerid == 3001 || layerid == 3002 || layerid == 3003 ) {
+ for(i = 0;i<=array.length;i++){
+ if(layerid == 3001){
+ grid = array[0]
+ }else if(layerid == 3002){
+ grid = array[1]
+ }else{
+ grid = array[2]
+ }
+ }
- return "鏁版嵁鏃堕棿锛�" +
- item["datatime"] +
+ return grid + "绫崇綉鏍�"+
+ "<br /><br />鏁版嵁鏃堕棿锛�" +
+ item["datatime"] +
"<table>" +
"<tr><td>PM<SUB>2.5</SUB>锛�</td><td align= right>" + item["pm25"] + ' ' + "</td><td>渭g/m鲁</td></tr>" +
"<tr><td>PM<SUB>10</SUB>锛�</td><td align= right>" + item["pm10"] + ' ' + "</td><td>渭g/m鲁</td></tr>" +
diff --git a/js/function.js b/js/function.js
index d106f86..0d23460 100644
--- a/js/function.js
+++ b/js/function.js
@@ -106,7 +106,8 @@
layer.options.parameters.viewparams = "userid:" + mars3d.global_variables.userid + ";regiontype:" + layer.options.regiontype + ";datetime:" + mars3d.global_variables.queryDataTStartGeo
layer.options.getFeatureInfoParameters.viewparams = "userid:" + mars3d.global_variables.userid + ";regiontype:" + layer.options.regiontype + ";datetime:" + mars3d.global_variables.queryDataTStartGeo
layer.reload();
- } else if ([layer.id] == 1001 && layer.options.show) {
+ // } else if ([layer.id] == 1001 && layer.options.show) {
+ } else if ([layer.id] == 1001) {
var tmpguokong = map.getLayerById(1001);
tmpguokong.clear(true);
getGuokongPointFromServer(tmpguokong);
@@ -184,11 +185,3 @@
}
}
-function changeNullAndundefinedToEmpty(json_in) {
- for (var key in json_in) {
- if (json_in[key] == null || json_in[key] == 'null' || json_in[key] == undefined || json_in[key] == 'undefined') {
- json_in[key] = "/";
- }
- }
- return json_in;
-}
\ No newline at end of file
diff --git a/js/function_1001.js b/js/function_1001.js
index 2bbd476..356b98a 100644
--- a/js/function_1001.js
+++ b/js/function_1001.js
@@ -186,4 +186,13 @@
}
}
return colorList[0];
-}
\ No newline at end of file
+}
+
+function changeNullAndundefinedToEmpty(json_in) {
+ for (var key in json_in) {
+ if (json_in[key] == null || json_in[key] == 'null' || json_in[key] == undefined || json_in[key] == 'undefined') {
+ json_in[key] = "/";
+ }
+ }
+ return json_in;
+}
diff --git a/widgetsTS/taxiRouteReplay/view.js b/widgetsTS/taxiRouteReplay/view.js
index 05a2af7..36ebaa8 100644
--- a/widgetsTS/taxiRouteReplay/view.js
+++ b/widgetsTS/taxiRouteReplay/view.js
@@ -92,6 +92,7 @@
_tr = "<tr><td>3</td><td>datatime</td><td>" + tmpattr.datatime + "</td><td>/</td></tr>"
$("#indexTaxiContent").append(_tr);
var tmp_index = 3;
+ tmpattr = changeNullAndundefinedToEmpty(tmpattr);
for (var p in tmpattr) {//閬嶅巻json瀵硅薄鐨勬瘡涓猭ey/value瀵�,p涓簁ey
if (p !== 'code' && p !== 'datatime') {
_tr = "<tr><td>" + tmp_index + "</td><td>" + p + "</td><td>" + tmpattr[p] + "</td><td>" + getUnitByqindex(p) + "</td></tr>"
diff --git a/widgetsTS/taxiRouteReplay/widget.js b/widgetsTS/taxiRouteReplay/widget.js
index 0ec3a9c..8472b45 100644
--- a/widgetsTS/taxiRouteReplay/widget.js
+++ b/widgetsTS/taxiRouteReplay/widget.js
@@ -83,6 +83,7 @@
if (lng && lat) {
position = Cesium.Cartesian3.fromDegrees(lng, lat);
}
+ item = changeNullAndundefinedToEmpty(item)
var CircleEntity = new mars3d.graphic.CircleEntity({
position: position,
style: {
diff --git a/widgetsTS/widget_detail/view.html b/widgetsTS/widget_detail/view.html
index 978d3c0..6323c12 100644
--- a/widgetsTS/widget_detail/view.html
+++ b/widgetsTS/widget_detail/view.html
@@ -23,6 +23,7 @@
<link href="../../lib/bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.css" rel="stylesheet" />
<script src="../../lib/bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.js"></script>
<script src="../../lib/bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.zh-CN.js"></script>
+ <script src="../../js/function_1001.js"></script>
</head>
@@ -59,7 +60,7 @@
<thead id="headInfo">
<tr style="background-color: rgba(0, 0, 0, 0); color: #FF5722;">
<th style="font-weight: bold;">ID</th>
- <th style="font-weight: bold;">鎸囨爣缂栫爜</th>
+ <!-- <th style="font-weight: bold;">鎸囨爣缂栫爜</th> -->
<th style="font-weight: bold;">鎸囨爣鍚嶇О</th>
<th style="font-weight: bold;">鎸囨爣鏁板��</th>
<th style="font-weight: bold;">鎸囨爣鍗曚綅</th>
diff --git a/widgetsTS/widget_detail/view.js b/widgetsTS/widget_detail/view.js
index 9ca06cb..b0c7dbb 100644
--- a/widgetsTS/widget_detail/view.js
+++ b/widgetsTS/widget_detail/view.js
@@ -316,25 +316,21 @@
var tableData = data.data.result;
if (tableData != null && tableData.length > 0) {
var topObj = tableData[0];
- for (var key in topObj) {
- if (topObj[key] == null || topObj[key] == 'null' || topObj[key] == undefined || topObj[key] == 'undefined') {
- topObj[key] = "/";
- }
- }
- var _tr = "<tr onmouseover='over(this)' onmouseout='out(this)'><td>1</td><td>code</td><td>缂栫爜</td><td>" + topObj.code + "</td><td>/</td></tr>"
+ topObj = changeNullAndundefinedToEmpty(topObj);
+ var _tr = "<tr onmouseover='over(this)' onmouseout='out(this)'><td>1</td><td>缂栫爜</td><td>" + topObj.code + "</td><td>/</td></tr>"
$("#indexTb").append(_tr);
- _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>2</td><td>name</td><td>鍚嶇О</td><td>" + topObj.name + "</td><td>/</td></tr>"
+ _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>2</td><td>鍚嶇О</td><td>" + topObj.name + "</td><td>/</td></tr>"
$("#indexTb").append(_tr);
- _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>3</td><td>datatime</td><td>鏃堕棿</td><td>" + topObj.datatime + "</td><td>/</td></tr>"
+ _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>3</td><td>鏃堕棿</td><td>" + topObj.datatime + "</td><td>/</td></tr>"
$("#indexTb").append(_tr);
- _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>4</td><td>lon</td><td>缁忓害</td><td>" + topObj.lon + "</td><td>/</td></tr>"
+ _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>4</td><td>缁忓害</td><td>" + topObj.lon + "</td><td>/</td></tr>"
$("#indexTb").append(_tr);
- _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>5</td><td>lat</td><td>绾害</td><td>" + topObj.lat + "</td><td>/</td></tr>"
+ _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>5</td><td>绾害</td><td>" + topObj.lat + "</td><td>/</td></tr>"
$("#indexTb").append(_tr);
var tmp_index = 6;
for(var p in topObj){//閬嶅巻json瀵硅薄鐨勬瘡涓猭ey/value瀵�,p涓簁ey
if (p!=='code' && p!=='name' && p!=='datatime' && p!=='lon' && p!=='lat'){
- _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>"+tmp_index+"</td><td>"+p+"</td><td>"+p+"</td><td>" + topObj[p] + "</td><td>"+getUnitByqindex(p)+"</td></tr>"
+ _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>"+tmp_index+"</td><td>"+p+"</td><td>" + topObj[p] + "</td><td>"+getUnitByqindex(p)+"</td></tr>"
$("#indexTb").append(_tr);
tmp_index++;
}
@@ -369,11 +365,7 @@
for (var i = 0; length = tableData.length, i < length; i++) {
var j = i + 1;
var topObj = tableData[i];
- for (var key in topObj) {
- if (topObj[key] == null || topObj[key] == 'null' || topObj[key] == undefined || topObj[key] == 'undefined') {
- topObj[key] = "/";
- }
- }
+ topObj = changeNullAndundefinedToEmpty(topObj);
var _tr = "<tr onmouseover='over(this)' onmouseout='out(this)' ><td>" + j + "</td><td onclick='locateAndShowDetail(this)'>" + topObj.road_id + "</td><td>" + topObj.name + "</td><td>"+ topObj.pm25 + "</td><td>" + topObj.pm10 + "</td><td>" + topObj.no + "</td><td>" + topObj.nox + "</td><td>" + topObj.no2 + "</td><td>" + topObj.co +"</td></tr>"
$("#indexTb").append(_tr);
}
diff --git a/widgetsTS/widget_search/view.js b/widgetsTS/widget_search/view.js
index ad64fa2..c98adac 100644
--- a/widgetsTS/widget_search/view.js
+++ b/widgetsTS/widget_search/view.js
@@ -130,11 +130,7 @@
for(var i=((page-1)*10);i<(page*10)&&i<newsTotalNum;i++){
var j = i+1;
var topObj = tableData[i];
- for (var key in topObj) {
- if (topObj[key] == null || topObj[key] == 'null' || topObj[key] == undefined || topObj[key] == 'undefined') {
- topObj[key] = "/";
- }
- }
+ topObj = changeNullAndundefinedToEmpty(topObj);
var content = "<tr _siteid='" + topObj.code + "' _lon='" + topObj.lon + "' _lat='" + topObj.lat + "' onmouseover='over(this)' onmouseout='out(this)' ><td><input type='checkbox' name='selectedItem' value='" + j + "' /></td><td>" + j + "</td><td onclick='locateAndShowDetail(this)'>" + topObj.code + "</td><td onclick='locateAndShowDetail(this)'>" + topObj.name + "</td><td><font color='" + getLayerPointColorByQindexandValue(current_selected_monitor_type, current_selected_monitor_qindex, topObj[current_selected_monitor_qindex]) + "'>" + topObj[current_selected_monitor_qindex] + "</font></td></tr>"
$("#searchInfo").append(content);
}
diff --git a/widgetsTS/widget_search/widget.js b/widgetsTS/widget_search/widget.js
index df29082..f91e8e0 100644
--- a/widgetsTS/widget_search/widget.js
+++ b/widgetsTS/widget_search/widget.js
@@ -129,9 +129,9 @@
color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex]),
alphaPower: 1.5,
//楂樹寒鏃剁殑鏍峰紡锛堥粯璁や负榧犳爣绉诲叆锛屼篃鍙互鎸囧畾type:'click'鍗曞嚮楂樹寒锛夛紝鏋勯�犲悗涔熷彲浠penHighlight銆乧loseHighlight鏂规硶鏉ユ墜鍔ㄨ皟鐢�
- highlight: {
- color: "#ff0000",
- },
+ // highlight: {
+ // color: "#ff0000",
+ // },
},
attr: attr
});
@@ -143,9 +143,9 @@
var circleDiffuseWallGlow = new mars3d.graphic.DiffuseWall({
position: Cesium.Cartesian3.fromDegrees(attr["lon"], attr["lat"], 20), //鍦嗕腑蹇冪偣
style: {
- diffHeight: qindex == "co" ? 10 * attr[qindex] : attr[qindex], //楂樺害
+ diffHeight: qindex == "co" ? 10 * attr[qindex] : attr[qindex] || attr[qindex] == "/" ? 800 : attr[qindex], //楂樺害
radius: 200, //鍗婂緞
- color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex]),
+ color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex] || "#C0C0C0"),
speed: 10, //閫熷害
},
attr: attr
@@ -158,12 +158,12 @@
positions: positions,
style: {
closure: true,
- diffHeight: qindex == "co" ? 10 * attr[qindex] : attr[qindex], //楂樺害
+ diffHeight: qindex == "co" ? 10 * attr[qindex] : attr[qindex] || attr[qindex] == "/" ? 500 : attr[qindex], //楂樺害
material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
//鍔ㄧ敾绾挎潗璐�
image: "img/textures/fence.png",
axisY: true,
- color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex]),
+ color: this.winPage.getLayerPointColorByQindexandValue(layerid, qindex, attr[qindex] || "#C0C0C0"),
speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
}),
},
diff --git a/widgetsTS/widget_summary/view.js b/widgetsTS/widget_summary/view.js
index f3d03c2..454f9c0 100644
--- a/widgetsTS/widget_summary/view.js
+++ b/widgetsTS/widget_summary/view.js
@@ -116,13 +116,9 @@
for (var i = 0; length = tmpTopListQueryResult.length, i < length; i++) {
var j = i + 1;
var topObj = tmpTopListQueryResult[i];
- for (var key in topObj) {
- if (topObj[key] == null || topObj[key] == 'null' || topObj[key] == undefined || topObj[key] == 'undefined') {
- topObj[key] = "/";
- }
- }
- var _tr = "<tr _siteid='" + topObj.code + "' _lon='" + topObj.lon + "' _lat='" + topObj.lat + "' onmouseover='over(this)' onmouseout='out(this)' ><td><input type='checkbox' name='selectedItem' value='" + j + "' /></td><td>" + j + "</td><td onclick='locateAndShowDetail(this)'>" + topObj.code + "</td><td onclick='locateAndShowDetail(this)'>" + topObj.name + "</td><td><font color='" + getLayerPointColorByQindexandValue(current_selected_monitor_type, current_selected_monitor_qindex, topObj[current_selected_monitor_qindex]) + "'>" + topObj[current_selected_monitor_qindex] + "</font></td></tr>"
- $("#top10Tb").append(_tr);
+ topObj = changeNullAndundefinedToEmpty(topObj);
+ var _tr = "<tr _siteid='" + topObj.code + "' _lon='" + topObj.lon + "' _lat='" + topObj.lat + "' onmouseover='over(this)' onmouseout='out(this)' ><td><input type='checkbox' name='selectedItem' value='" + j + "' /></td><td>" + j + "</td><td onclick='locateAndShowDetail(this)'>" + topObj.code + "</td><td onclick='locateAndShowDetail(this)'>" + topObj.name + "</td><td><font color='" + getLayerPointColorByQindexandValue(current_selected_monitor_type, current_selected_monitor_qindex, topObj[current_selected_monitor_qindex]) + "'>" + topObj[current_selected_monitor_qindex] + "</font></td></tr>"
+ $("#top10Tb").append(_tr);
}
} else {
haoutil.msg("鏌ヨ鏃犳暟鎹紝璇锋洿鎹㈡煡璇㈡潯浠讹紒");
--
Gitblit v1.9.1