|
@@ -666,3 +666,177 @@ var update_companyList = function() {
|
|
|
$(this).css({ "border": "1px solid rgba(64,85,98,0.7)", "background": "rgba(64,85,98,0.7)", "color": "#ffff00", "cursor": "pointer", "font-size": "14px" });
|
|
|
$("#label_" + this.company_code).css('display', 'block');
|
|
|
show_list_cur = i + 1;
|
|
|
+ });
|
|
|
+ $("#company_code_list_" + list[i].V_COMPANY_CODE).mouseout(function() {
|
|
|
+ $(this).css({ "border": "1px solid rgba(255,255,255,0.0)", "background": "rgba(255,255,255,0.3)", "color": "#ffffff", "cursor": "pointer", "font-size": "14px" });
|
|
|
+ if (!LabelShow)
|
|
|
+ $("#label_" + this.company_code).css('display', 'none');
|
|
|
+ });
|
|
|
+ $("#company_code_list_" + list[i].V_COMPANY_CODE).click(function(e) {
|
|
|
+ showBuilding(this.company_code);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+var key_fun = function(event) {
|
|
|
+ var x = (navigator.appname == "Netscape") ? event.which : window.event.keyCode;
|
|
|
+ if (x == 38) {
|
|
|
+ if (SearchList != null) {
|
|
|
+ if ((show_list_cur > 0) && (show_list_cur <= SearchList.length)) {
|
|
|
+ show_list_cur--;
|
|
|
+ for (var i = 0; i < SearchList.length; i++) {
|
|
|
+ $("#company_code_list_" + SearchList[i].V_COMPANY_CODE).css({ "border": "1px solid rgba(255,255,255,0.0)", "background": "rgba(255,255,255,0.3)", "color": "#ffffff", "cursor": "pointer", "font-size": "14px" });
|
|
|
+ var div = document.getElementById("label_" + SearchList[i].V_COMPANY_CODE);
|
|
|
+ if (!LabelShow) {
|
|
|
+ if (div != undefined)
|
|
|
+ div.style.display = 'none';
|
|
|
+ }
|
|
|
+ if (i == (show_list_cur - 1)) {
|
|
|
+ $("#company_code_list_" + SearchList[i].V_COMPANY_CODE).css({ "border": "1px solid rgba(64,85,98,0.7)", "background": "rgba(64,85,98,0.7)", "color": "#ffff00", "cursor": "pointer", "font-size": "14px" });
|
|
|
+ if (div != undefined)
|
|
|
+ div.style.display = 'block';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (x == 40) {
|
|
|
+ if (SearchList != null) {
|
|
|
+ if ((show_list_cur >= 0) && (show_list_cur < SearchList.length)) {
|
|
|
+ show_list_cur++;
|
|
|
+ for (var i = 0; i < SearchList.length; i++) {
|
|
|
+ $("#company_code_list_" + SearchList[i].V_COMPANY_CODE).css({ "border": "1px solid rgba(255,255,255,0.0)", "background": "rgba(255,255,255,0.3)", "color": "#ffffff", "cursor": "pointer", "font-size": "14px" });
|
|
|
+ var div = document.getElementById("label_" + SearchList[i].V_COMPANY_CODE);
|
|
|
+ if (!LabelShow) {
|
|
|
+ if (div != undefined)
|
|
|
+ div.style.display = 'none';
|
|
|
+ }
|
|
|
+ if (i == (show_list_cur - 1)) {
|
|
|
+ $("#company_code_list_" + SearchList[i].V_COMPANY_CODE).css({ "border": "1px solid rgba(64,85,98,0.7)", "background": "rgba(64,85,98,0.7)", "color": "#ffff00", "cursor": "pointer", "font-size": "14px" });
|
|
|
+ if (div != undefined)
|
|
|
+ div.style.display = 'block';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (x == 13) {
|
|
|
+ if (SearchList != null) {
|
|
|
+ if ((show_list_cur >= 0) && (show_list_cur <= SearchList.length)) {
|
|
|
+ showBuilding(SearchList[show_list_cur - 1].V_COMPANY_CODE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (x == 27) {
|
|
|
+ clear_search();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+var chk_lat = function(lat) {
|
|
|
+ if (lat < 30)
|
|
|
+ return false;
|
|
|
+ if (lat > 32)
|
|
|
+ return false;
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+var chk_lng = function(lng) {
|
|
|
+ if (lng < 110)
|
|
|
+ return false;
|
|
|
+ if (lng > 135)
|
|
|
+ return false;
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+var showBuilding = function(company_code) {
|
|
|
+ if ((StatusStore != null) && (StatusStore.length > 0)) {
|
|
|
+ for (var i = 0; i < StatusStore.length; i++) {
|
|
|
+ if (StatusStore[i].company_code == company_code) {
|
|
|
+ map.setCenter(new AMap.LngLat(StatusStore[i].lng, StatusStore[i].lat, true));
|
|
|
+ map.setPitch(83);
|
|
|
+ map.setZoom(18);
|
|
|
+ $("#data_number_11").html(StatusStore[i].d1a);
|
|
|
+ $("#data_number_12").html(StatusStore[i].d1a - StatusStore[i].d1ac);
|
|
|
+ $("#data_number_21").html(StatusStore[i].d7a);
|
|
|
+ $("#data_number_22").html(StatusStore[i].d7a - StatusStore[i].d7ac);
|
|
|
+ $("#data_number_31").html(StatusStore[i].d2a);
|
|
|
+ $("#data_number_32").html(StatusStore[i].d2a - StatusStore[i].d2ac);
|
|
|
+
|
|
|
+ if (V_LOGINNAME == 'ypxy') {
|
|
|
+ var query = new Object();
|
|
|
+ query.V_LOGINNAME = V_LOGINNAME;
|
|
|
+ query.V_PASSWORD = V_PASSWORD;
|
|
|
+ query.dwtype = '2';
|
|
|
+ query.COMMSTATUS = 'NO';
|
|
|
+ if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
|
|
|
+ query.company_code = company_code;
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: baseUrl + "iot/alarm/view/getConfirmStatusByDays",
|
|
|
+ data: {
|
|
|
+ queryJson: Ext.JSON.encode(query)
|
|
|
+ },
|
|
|
+ success: function(result) {
|
|
|
+ var json = eval('(' + result + ')');
|
|
|
+ if (json.action == 'getConfirmStatusByDays') {
|
|
|
+ if (json.check == 'true') {
|
|
|
+ ConfirmStore = json.RESULT;
|
|
|
+ if (json.company_name != null)
|
|
|
+ companyName = json.company_name;
|
|
|
+ else
|
|
|
+ companyName = null;
|
|
|
+ for (var i = 0; i < ConfirmStore.length; i++) {
|
|
|
+ if (ConfirmStore[i].id == 'water_alarm') {
|
|
|
+ $("#data_number_41").html(ConfirmStore[i].count);
|
|
|
+ $("#data_number_42").html(ConfirmStore[i].count - ConfirmStore[i].sum);
|
|
|
+ draw_pie('data_pie_4', ConfirmStore[i].count, ConfirmStore[i].sum);
|
|
|
+
|
|
|
+ // $("#device_count_num_41").html(StatusStore[i].d6);
|
|
|
+ $("#device_count_num_42").html(ConfirmStore[i].count);
|
|
|
+ $("#device_count_num_43").html(ConfirmStore[i].count - ConfirmStore[i].sum);
|
|
|
+ if (ConfirmStore[i].count == 0)
|
|
|
+ $("#device_count_num_44").html('100%');
|
|
|
+ else
|
|
|
+ $("#device_count_num_44").html(toDecimal(ConfirmStore[i].sum * 100 / ConfirmStore[i].count) + '%');
|
|
|
+ if (ConfirmStore[i].count != 0)
|
|
|
+ $("#device_confirm_44").css('width', (280 * ConfirmStore[i].sum / ConfirmStore[i].count) + 'px');
|
|
|
+ else
|
|
|
+ $("#device_confirm_44").css('width', '280px');
|
|
|
+
|
|
|
+ $("#data_number_51").html(0);
|
|
|
+ $("#data_number_52").html(0);
|
|
|
+ draw_pie('data_pie_5', 0, 0);
|
|
|
+ $("#device_count_num_52").html(0);
|
|
|
+ $("#device_count_num_53").html(0);
|
|
|
+ $("#device_count_num_54").html('100%');
|
|
|
+ $("#device_confirm_54").css('width', '280px');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
|
|
|
+ window.parent.document.location = baseUrl;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $("#data_number_41").html(StatusStore[i].d6a);
|
|
|
+ $("#data_number_42").html(StatusStore[i].d6a - StatusStore[i].d6ac);
|
|
|
+ draw_pie('data_pie_4', StatusStore[i].d6a, StatusStore[i].d6ac);
|
|
|
+ $("#device_count_num_41").html(StatusStore[i].d6);
|
|
|
+ $("#device_count_num_42").html(StatusStore[i].d6oc);
|
|
|
+ $("#device_count_num_43").html(StatusStore[i].d6o - StatusStore[i].d6oc);
|
|
|
+ if (StatusStore[i].d6o == 0)
|
|
|
+ $("#device_count_num_44").html('100%');
|
|
|
+ else
|
|
|
+ $("#device_count_num_44").html(toDecimal(StatusStore[i].d6oc * 100 / StatusStore[i].d6o) + '%');
|
|
|
+ if (StatusStore[i].d6o != 0)
|
|
|
+ $("#device_confirm_44").css('width', (280 * StatusStore[i].d6oc / StatusStore[i].d6o) + 'px');
|
|
|
+ else
|
|
|
+ $("#device_confirm_44").css('width', '280px');
|
|
|
+ }
|
|
|
+
|
|
|
+
|