Преглед на файлове

3dDisplayEngine map.js 袁明明 commit at 2021-01-18

袁明明 преди 4 години
родител
ревизия
a5aa78b5a2
променени са 1 файла, в които са добавени 151 реда и са изтрити 0 реда
  1. 151 0
      3dDisplayEngine/buildingJs/map.js

+ 151 - 0
3dDisplayEngine/buildingJs/map.js

@@ -1211,3 +1211,154 @@ var showInfo = function(e) {
                     }
                 }
 
+            });
+            detail_info = document.createElement('div');
+            detail_info.id = 'detail_info';
+            detail_info.style.position = 'absolute';
+            detail_info.style.top = (pixel.getY() - 270) + 'px';
+            detail_info.style.left = (pixel.getX() - 101) + 'px';
+            detail_info.style.width = '203px';
+            detail_info.style.height = '270px';
+            detail_info.style.backgroundImage = 'url(../../res/img/icons/detail_info.png)';
+            detail_info.style.zIndex = '500';
+            detail_info.onmouseleave = clear_detail_info;
+            parent.appendChild(detail_info);
+            var info_title = document.createElement('div');
+            info_title.id = 'info_title';
+            info_title.setAttribute('class', 'info_title');
+            info_title.innerHTML = '<div style="display:inline-block;vertical-align:middle;align-self:center;">' + StatusStore[i].company_name + '</div>';
+            detail_info.appendChild(info_title);
+            var info_body0 = document.createElement('div');
+            info_body0.id = 'info_body0';
+            info_body0.setAttribute('class', 'info_body0');
+            info_body0.innerHTML = '地址:' + StatusStore[i].address;
+            detail_info.appendChild(info_body0);
+            var info_body1 = document.createElement('div');
+            info_body1.id = 'info_body1';
+            info_body1.setAttribute('class', 'info_body1');
+            info_body1.innerHTML = '联系人:' + StatusStore[i].username;
+            detail_info.appendChild(info_body1);
+            var info_body2 = document.createElement('div');
+            info_body2.id = 'info_body2';
+            info_body2.setAttribute('class', 'info_body2');
+            info_body2.innerHTML = '联系电话:' + StatusStore[i].phone;
+            detail_info.appendChild(info_body2);
+            var info_btn = document.createElement('div');
+            info_btn.id = 'info_btn';
+            info_btn.setAttribute('class', 'info_btn');
+            info_btn.innerHTML = '查看详情';
+            info_btn.company_code = company_code;
+            info_btn.onclick = function(e) {
+                var event = e;
+                location.href = baseUrl + 'view/frontpage/company.jsp?company_code=' + event.currentTarget.company_code;
+            }
+            detail_info.appendChild(info_btn);
+
+            //			var info_btn1 = document.createElement('div');
+            //			info_btn1.id = 'info_btn1';
+            //			info_btn1.setAttribute('class','info_btn');
+            //			info_btn1.innerHTML='历史数据';
+            //			info_btn1.company_code=company_code;
+            //			info_btn1.onclick=function(e){
+            //				var event = e;
+            //				location.href = baseUrl+'view/frontpage/company.jsp?company_code='+event.currentTarget.company_code;
+            //			}
+            //			detail_info.appendChild(info_btn1);
+
+            $("#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);
+
+                                        $("#dev4_count").html(3);
+                                        $("#device_count_num_42").html(ConfirmStore[i].sum);
+                                        $("#dev4-label-hidden").html(ConfirmStore[i].count - ConfirmStore[i].sum);
+                                        $("#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', (300 * ConfirmStore[i].sum / ConfirmStore[i].count) + 'px');
+                                        else
+                                            $("#device_confirm_44").css('width', '300px');
+                                        $("#data_number_51").html(0);
+                                        $("#data_number_52").html(0);
+                                        draw_pie('data_pie_5', 0, 0);
+                                        $("#dev5_count").html(3);
+                                        $("#device_count_num_52").html(0);
+                                        $("#dev5-label-hidden").html(0);
+                                        $("#device_count_num_53").html(0);
+                                        $("#device_count_num_54").html('100%');
+                                        $("#device_confirm_54").css('width', '300px');
+                                    }
+                                }
+                            } 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);
+                $("#dev4_count").html(StatusStore[i].d6);
+                $("#device_count_num_42").html(StatusStore[i].d6oc);
+                $("#dev4-label-hidden").html(StatusStore[i].d6o - 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', (300 * StatusStore[i].d6oc / StatusStore[i].d6o) + 'px');
+                else
+                    $("#device_confirm_44").css('width', '300px');
+            }
+
+
+            draw_pie('data_pie_1', StatusStore[i].d1a, StatusStore[i].d1ac);
+            draw_pie('data_pie_2', StatusStore[i].d7a, StatusStore[i].d7ac);
+            draw_pie('data_pie_3', StatusStore[i].d2a, StatusStore[i].d2ac);
+
+            $("#dev1_count").html(StatusStore[i].d1);
+            $("#device_count_num_12").html(StatusStore[i].d1oc);
+            $("#dev1-label-hidden").html(StatusStore[i].d1o - StatusStore[i].d1oc);
+            $("#device_count_num_13").html(StatusStore[i].d1o - StatusStore[i].d1oc);
+            if (StatusStore[i].d1o == 0)
+                $("#device_count_num_14").html('100%');
+            else