Explorar el Código

3dDisplayEngine map.js 袁明明 commit at 2021-04-13

袁明明 hace 4 años
padre
commit
b49e59b279
Se han modificado 1 ficheros con 176 adiciones y 0 borrados
  1. 176 0
      3dDisplayEngine/buildingJs/map.js

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

@@ -1850,3 +1850,179 @@ var draw_all = function() {
                 (AlarmStore[i].dwtype == 7) ? 'show_all_efireAlarm()' : '#');
             tab.style.top = (120 * i) + 'px';
             if (($(document).innerHeight() - 205) > (120 * (i + 1)))
+                $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
+            else
+                $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
+            area.appendChild(tab);
+            var title = document.createElement('div');
+            title.id = 'alarm_tab_title_' + (i + 1);
+            title.setAttribute('class', 'alarm_tab_title');
+            title.innerHTML = (AlarmStore[i].dwtype == 1) ? '火警监测报告' :
+                (AlarmStore[i].dwtype == 2) ? '水系统监测报告' :
+                (AlarmStore[i].dwtype == 5) ? '水系统监测报告' :
+                (AlarmStore[i].dwtype == 6) ? 'RTU监测报告' :
+                (AlarmStore[i].dwtype == 7) ? '电气火灾监测报告' : '其他报告';
+            tab.appendChild(title);
+            var time_label = document.createElement('div');
+            time_label.id = 'alarm_tab_time_' + (i + 1);
+            time_label.setAttribute('class', 'alarm_tab_time');
+            time_label.innerHTML = AlarmStore[i].time;
+            tab.appendChild(time_label);
+            var data = document.createElement('div');
+            data.id = "alarm_tab_data_" + (i + 1);
+            data.setAttribute('class', 'alarm_tab_data');
+            data.innerHTML = AlarmStore[i].company_name + ' ' + AlarmStore[i].data;
+            tab.appendChild(data);
+            var icon = document.createElement('img');
+            icon.setAttribute('class', 'alarm_tab_icon');
+            icon.height = '66';
+            icon.width = '66';
+            icon.src = baseUrl + 'res/img/icons/' + ((AlarmStore[i].dwtype == 1) ? 'alarm_tab_01.gif' :
+                (AlarmStore[i].dwtype == 2) ? 'alarm_tab_03.gif' :
+                (AlarmStore[i].dwtype == 5) ? 'alarm_tab_03.gif' :
+                (AlarmStore[i].dwtype == 6) ? 'alarm_tab_04.gif' :
+                (AlarmStore[i].dwtype == 7) ? 'alarm_tab_02.gif' : 'alarm_tab_04.gif') + '?t=' + (new Date());
+            tab.appendChild(icon);
+        }
+    }
+}
+
+var getCurrentData = function() {
+    if (((new Date()).getTime() - synctime) < storeTime)
+        return;
+    $("#fp_backbtn").css("display", "none");
+    synctime = (new Date()).getTime();
+    var query = new Object();
+    query.V_LOGINNAME = V_LOGINNAME;
+    query.V_PASSWORD = V_PASSWORD;
+    query.V_COMMAND = 'FRONTPAGE';
+    query.COMMSTATUS = "NO";
+    if ($("#company_code").val().length > 0)
+        query.company_code = $("#company_code").val();
+    var qdata = JSON.stringify(query);
+    var qurl = baseUrl + '/cgi-bin/WebAction.cgi';
+    if ((baseUrl.indexOf('localhost') >= 0) || (baseUrl.indexOf('127.0.0.1') >= 0))
+        qurl = 'http://47.103.74.123:8080/YtIoT/cgi-bin/WebAction.cgi';
+    $.ajax({
+        type: 'POST',
+        url: qurl,
+        data: qdata,
+        success: function(result) {
+            if ((result == undefined) || (result.length == 0)) {
+                Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
+                    window.parent.document.location = baseUrl;
+                });
+            } else {
+                var json = eval('(' + result + ')');
+                if (json.check == 'false') {
+                    Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
+                        window.parent.document.location = baseUrl;
+                    });
+                }
+                if (json.action == 'getFrontpageQuery') {
+                    if (json.check == 'true') {
+                        if (json.LIST != undefined)
+                            StatusStore = json.LIST;
+                        if (json.ALARM != undefined)
+                            AlarmStore = json.ALARM;
+                        draw_all();
+
+                    }
+                }
+            }
+            myMask.hide();
+        }
+    });
+    setTimeout(getCurrentData, storeTime);
+}
+
+var chk_company_cur = function(idx) {
+    var nrow = 0;
+    while (1) {
+        idx++;
+        if (idx >= StatusStore.length)
+            idx = 0;
+        var obj = StatusStore[idx];
+        if ((obj.lat > 30) && (obj.lat < 33) && (obj.lng > 120) && (obj.lng < 125))
+            return idx;
+        nrow++;
+        if (nrow >= StatusStore.length)
+            return -1;
+    }
+}
+
+var show_cur_comany = function() {
+    var current_t = Date.parse(new Date());
+    if ((current_t - last_move) > 30000) {
+        last_move = current_t;
+        if ((StatusStore != null) && (StatusStore.length > 0)) {
+            company_cur = chk_company_cur(company_cur);
+            if (company_cur >= 0) {
+                var obj = StatusStore[company_cur];
+                showBuilding(obj.company_code);
+                LabelShow = false;
+                shower_click();
+            }
+        }
+    }
+    setTimeout(show_cur_comany, 5000);
+}
+
+var body_resize = function() {
+    $("#mask_l").css('height', $(window).innerHeight() + 'px');
+    $("#mask_r").css('height', $(window).innerHeight() + 'px');
+    $("#mask_b").css('top', ($(window).innerHeight() - 100) + 'px');
+    $("#mask_b").css('width', $(window).innerWidth() + 'px');
+    $("#mask_t").css('width', $(window).innerWidth() + 'px');
+    $("#map_header").css('left', ($(window).innerWidth() - 740) / 2 + 'px');
+    $("#map_header").css('height', '82px');
+    $("#container").css('width', $(window).innerWidth() + 'px');
+    $("#container").css('height', $(window).innerHeight() + 'px');
+    var area_height = $(window).innerHeight() - 129;
+    $("#data_bar_area").css('height', area_height + 'px');
+    $("#alarm_tab_area").css('height', ($(window).innerHeight() - 205) + 'px');
+    draw_all();
+}
+
+var show_all_fireAlarm = function() {
+    if ($("#V_LOGINNAME").val() == 'guest')
+        return;
+    parent.window.keep_menu();
+    if ($("#company_code").val() != undefined)
+        location.href = baseUrl + 'view/fireAlarm/subFireAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
+    else
+        location.href = baseUrl + 'view/fireAlarm/subFireAlarm.jsp?theme=' + theme;
+}
+
+var show_all_waterAlarm = function() {
+    if ($("#V_LOGINNAME").val() == 'guest')
+        return;
+    parent.window.keep_menu();
+    if ($("#company_code").val() != undefined)
+        location.href = baseUrl + 'view/waterAlarm/subWaterAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
+    else
+        location.href = baseUrl + 'view/waterAlarm/subWaterAlarm.jsp?theme=' + theme;
+}
+
+var show_all_rtuAlarm = function() {
+    if ($("#V_LOGINNAME").val() == 'guest')
+        return;
+    parent.window.keep_menu();
+    if ($("#company_code").val() != undefined)
+        location.href = baseUrl + 'view/rtuAlarm/subRtuAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
+    else
+        location.href = baseUrl + 'view/rtuAlarm/subRtuAlarm.jsp?theme=' + theme;
+}
+
+var show_all_efireAlarm = function() {
+    if ($("#V_LOGINNAME").val() == 'guest')
+        return;
+    parent.window.keep_menu();
+    if ($("#company_code").val() != undefined)
+        location.href = baseUrl + 'view/efireAlarm/subeFireAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
+    else
+        location.href = baseUrl + 'view/efireAlarm/subeFireAlarm.jsp?theme=' + theme;
+}
+
+var show_all_fireDevice = function() {
+    if ($("#V_LOGINNAME").val() == 'guest')