소스 검색

3dDisplayEngine company.js 唐峰 commit at 2020-12-23

唐峰 4 년 전
부모
커밋
7d4971a840
1개의 변경된 파일131개의 추가작업 그리고 0개의 파일을 삭제
  1. 131 0
      3dDisplayEngine/buildingJs/company.js

+ 131 - 0
3dDisplayEngine/buildingJs/company.js

@@ -1025,3 +1025,134 @@ var drawCurrentStatus = function() {
             var dev_time_info = document.createElement('div');
             dev_time_info.setAttribute('class', 'project_info');
             dev_time_info.style.marginTop = '12px';
+            dev_time_info.style.marginBottom = '12px';
+            dev_time_info.innerHTML = (devicesStore[i].status_time == '1970-01-01 08:00:00') ? '-' : devicesStore[i].status_time;
+            dev.appendChild(dev_time_info);
+        }
+    }
+    show_realtime_status(0);
+}
+
+var big_view_win = function(obj) {
+    Ext.create('Ext.window.Window', {
+        id: 'big_view_win',
+        title: '监控视频',
+        height: 680,
+        width: 800,
+        layout: 'fit',
+        modal: true,
+        maximizable: true,
+        buttons: [{
+            text: '关闭',
+            handler: function() {
+                Ext.getCmp('big_view_win').destroy();
+            }
+        }],
+        closeAction: 'destroy',
+        html: '<iframe width="99%" height="99%" frameborder=0 allowtransparency="true" scrolling=auto src="' + basePath + 'view/frontpage/video.jsp?videoId=' + obj.owner_code + '"></iframe>'
+    }).show();
+
+}
+
+var reset_video = function(obj) {
+    var query = {
+        CMD: 3,
+        BODY: {
+            DEVICE: obj.owner_code,
+            ACTION: 0,
+            IDX: 0
+        }
+    }
+    var status_list_bar = document.getElementById('status_list_bar');
+    status_list_bar.setAttribute('status', 'connecting');
+    status_list_bar.innerHTML = '<div style="margin-top:120px;">连接中,请稍候...</div>';
+    $.ajax({
+        type: 'POST',
+        url: 'https://fire.usky.cn:8443/YtIoT/cgi-bin/demo2.cgi',
+        data: 'queryJson:' + JSON.stringify(query),
+        success: function(result) {}
+    });
+    onair_video = false;
+    setTimeout(chk_cideo, 5000);
+}
+
+var open_video = function(obj) {
+    var query = {
+        CMD: 3,
+        BODY: {
+            DEVICE: obj.getAttribute('owner_code'),
+            ACTION: 1,
+            IDX: 7
+        }
+    }
+    var status_list_bar = document.getElementById('status_list_bar');
+    status_list_bar.setAttribute('status', 'connecting');
+    status_list_bar.innerHTML = '<div style="margin-top:120px;">连接中,请稍候...</div>';
+    $.ajax({
+        type: 'POST',
+        url: 'https://fire.usky.cn:8443/YtIoT/cgi-bin/demo2.cgi',
+        data: 'queryJson:' + JSON.stringify(query),
+        success: function(result) {}
+    });
+    onair_video = false;
+    //	setTimeout(chk_cideo,5000);
+}
+
+var chk_cideo = function() {
+    if (onair_video)
+        return;
+    var query = {
+        CMD: 1
+    }
+    $.ajax({
+        type: 'POST',
+        url: 'https://fire.usky.cn:8443/YtIoT/cgi-bin/demo2.cgi',
+        data: 'queryJson:' + JSON.stringify(query),
+        success: function(result) {
+            var json = eval('(' + result + ')');
+            var v_reset = document.getElementById('v_reset');
+            if (v_reset != undefined) {
+                var found = false;
+                if (json.RESULT.LIST != undefined) {
+                    if (json.RESULT.LIST.length > 0) {
+                        for (var i = 0; i < json.RESULT.LIST.length; i++) {
+                            if (json.RESULT.LIST[i].DEVICE == v_reset.owner_code) {
+                                found = true;
+                                online_video = json.RESULT.LIST[i].LIVEONLINE;
+                                if ((json.RESULT.LIST[i].ONAIR) && (!onair_video)) {
+                                    $("#v_reset").css('display', 'block');
+                                    $("#big_view").css('display', 'block');
+                                    onair_video = true;
+                                    var status_list_bar = document.getElementById('status_list_bar');
+                                    status_list_bar.setAttribute('status', '');
+                                    status_list_bar.innerHTML = '<iframe width="99%" height="99%" frameborder=0 allowtransparency="true" scrolling=auto src="' + basePath + 'view/frontpage/video.jsp?videoId=' + json.RESULT.LIST[i].DEVICE + '"></iframe>';
+                                } else if (!json.RESULT.LIST[i].ONAIR) {
+                                    if (json.RESULT.LIST[i].ALIVEVALUE == 3) {
+                                        onair_video = false;
+                                        var status_list_bar = document.getElementById('status_list_bar');
+                                        if (status_list_bar.getAttribute('status') == '')
+                                            status_list_bar.innerHTML = '<div style="margin-top:120px;cursor:pointer;" owner_code="' + json.RESULT.LIST[i].DEVICE + '" onclick="open_video(this)">设备在线,点击加载视频</div>';
+                                    } else if (json.RESULT.LIST[i].ALIVEVALUE == 2) {
+                                        onair_video = false;
+                                        var status_list_bar = document.getElementById('status_list_bar');
+                                        status_list_bar.setAttribute('status', '');
+                                        status_list_bar.innerHTML = '<div style="margin-top:120px;">设备重连中,请稍候...</div>';
+                                    } else {
+                                        onair_video = false;
+                                        var status_list_bar = document.getElementById('status_list_bar');
+                                        status_list_bar.setAttribute('status', '');
+                                        status_list_bar.innerHTML = '<div style="margin-top:120px;">设备未连线,尝试连接。请稍候...</div>';
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    });
+    setTimeout(chk_cideo, 5000);
+}
+
+var show_realtime_status = function(idx) {
+    $("#device_count_label").html('');