From 1459483053057f0121a10242616db78f84892917 Mon Sep 17 00:00:00 2001
From: qinbo <qinbo@shsening.com>
Date: 星期四, 28 十月 2021 17:38:09 +0800
Subject: [PATCH] null/undefined  bug fix

---
 widgetsTS/widget_summary/view.js |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/widgetsTS/widget_summary/view.js b/widgetsTS/widget_summary/view.js
index 037bca7..0b698cb 100644
--- a/widgetsTS/widget_summary/view.js
+++ b/widgetsTS/widget_summary/view.js
@@ -93,14 +93,18 @@
             var tableData = data.data.result;
             //console.log(tableData);
             if (tableData != null) {
-                for (var i = 0; i < tableData.length; i++) {
+                for (var i = 0; length = tableData.length, i < length ; i++) {
                     var j = i + 1;
                     var topObj = tableData[i];
-                    var _tr = "<tr _siteid='" + topObj.code + "' _lon='" + topObj.lon + "' _lat='" + topObj.lat + "' onclick='locateAndShowDetail(this)' onmouseover='over(this)' onmouseout='out(this)' ><td>" + j + "</td><td>" + topObj.code + "</td><td>" + 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);
-
-                }
-            }
+                    if(topObj[current_selected_monitor_qindex] == null){
+                        var _tr = "<tr _siteid='" + topObj.code + "' _lon='" + topObj.lon + "' _lat='" + topObj.lat + "' onclick='locateAndShowDetail(this)' onmouseover='over(this)' onmouseout='out(this)' ><td>" + j + "</td><td>" + topObj.code + "</td><td>" + topObj.name + "</td><td><font color='" + getLayerPointColorByQindexandValue(current_selected_monitor_type, current_selected_monitor_qindex, topObj[current_selected_monitor_qindex]) + "'>" + "/" + "</font></td></tr>"
+                        $("#top10Tb").append(_tr);
+                    } else{
+                        var _tr = "<tr _siteid='" + topObj.code + "' _lon='" + topObj.lon + "' _lat='" + topObj.lat + "' onclick='locateAndShowDetail(this)' onmouseover='over(this)' onmouseout='out(this)' ><td>" + j + "</td><td>" + topObj.code + "</td><td>" + 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);
+                    }
+                }      
+         }
 
         },
         error: function (request, textStatus) {

--
Gitblit v1.9.1