| | |
| | | var cameraIndex = 0; //监控下标 |
| | | var cameraTimer; // 库区定时 |
| | | var windowsNum = 1; // |
| | | var gundongTimer; //监控列表滚动定时器 |
| | | var gundongTimer; //AI事件滚动其 |
| | | var gundongTimer1; //监控列表滚动定时器 |
| | | |
| | | |
| | | var eventDeptList = null; |
| | | |
| | | $(function () { |
| | | // 初始化页面 |
| | |
| | | initDicSlogan(); |
| | | |
| | | //监控点信息适应滚动 |
| | | initScrollbar(60); |
| | | initScrollbar1(60); |
| | | |
| | | |
| | | //库区信息 |
| | | renderDeptArea(); |
| | | |
| | | //请求监管库区信息 |
| | | ajaxDeptList(); |
| | | initScrollbar(60); |
| | | } |
| | | |
| | | // socket信息返回處理 |
| | |
| | | dicSlogan = data; |
| | | initDicSlogan(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 请求获取库区相关信息 |
| | | */ |
| | | function ajaxDeptList() { |
| | | deptList = null; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/group/index-dept-list", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify({ |
| | | "companyId": companyId |
| | | }), |
| | | success: function (result) { |
| | | if (result.code == "0000") { |
| | | eventDeptList = result.data; |
| | | renderMsg(); |
| | | } |
| | | }, |
| | | error: function (error) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 更新AI动态分析 |
| | | * @param data |
| | | */ |
| | | function renderMsg() { |
| | | var html = ''; |
| | | var num1 = ''; |
| | | var num7 = ''; |
| | | var flag = false; |
| | | if (eventDeptList != null && eventDeptList.length > 0) { |
| | | $.each(eventDeptList, function (index, item) { |
| | | if (item.dailyTotal === 0) { |
| | | num1 = '当日一切正常'; |
| | | } else if (item.dailyTotal < 0) { |
| | | num1 = '未检测到网关'; |
| | | } else { |
| | | num1 = '当日数量' + item.dailyTotal + '个'; |
| | | } |
| | | if (item.warnNum7 === 0) { |
| | | num7 = '近七天一切正常'; |
| | | } else { |
| | | num7 = '近七天数量' + item.warnNum7 + '个'; |
| | | } |
| | | html += '<div class="panel-content-body-tr">'; |
| | | if (item.dailyTotal > 0) { |
| | | flag = true; |
| | | } |
| | | // if (item.warnNum7 > 10) { |
| | | // flag = true; |
| | | // html += '<span class="body-item sp" style="color: #bc2032;flex: 1.5;">' + item.deptName + '</span>'; |
| | | // html += '<span class="body-item sp" style="color: #bc2032;">' + num1 + '</span>'; |
| | | // html += '<span class="body-item sp" style="color: #bc2032;">' + num7 + '</span>'; |
| | | // } else if (item.warnNum7 > 1 && item.warnNum7 < 10) { |
| | | // flag = true; |
| | | // html += '<span class="body-item sp" style="color: #f37b3d;flex: 1.5;">' + item.deptName + '</span>'; |
| | | // html += '<span class="body-item sp" style="color: #f37b3d;">' + num1+ '</span>'; |
| | | // html += '<span class="body-item sp" style="color: #f37b3d;">' + num7 + '</span>'; |
| | | // }else { |
| | | html += '<span class="body-item sp" style="flex: 1.5;">' + item.deptName + '</span>'; |
| | | html += '<span class="body-item sp">' + num1 + '</span>'; |
| | | html += '<span class="body-item sp">' + num7 + '</span>'; |
| | | // } |
| | | html += '</div>'; |
| | | }) |
| | | } |
| | | if (flag) { |
| | | $("#panel-title").html('库区AI事件信息 <i class="dot"></i>'); |
| | | } |
| | | $("#inventoryInfo").html(html); |
| | | } |
| | | |
| | | // 渲染库区信息 |
| | |
| | | $("#deptName").css("font-size", "18px"); |
| | | $("#deptName").html(deptCur.kqmc); |
| | | $("#deptAddress").html(deptCur.xzqhmc == null ? "---" : deptCur.xzqhmc); |
| | | $("#yxcr").html(deptCur.yxcr == null ? "---" : deptCur.yxcr); |
| | | $("#cfs").html(deptCur.cfs == null ? "---" : deptCur.cfs); |
| | | $("#yxcr").html(deptCur.contact == null ? "---" : deptCur.contact); |
| | | $("#cfs").html(deptCur.contactTel == null ? "---" : deptCur.contactTel); |
| | | ajaxCamera(); |
| | | } |
| | | |
| | |
| | | html += '<span class="body-item" style="flex: 0.6"></span>'; |
| | | html += '</div>'; |
| | | } |
| | | $("#inventoryInfo").html(html); |
| | | $("#inventoryInfo1").html(html); |
| | | |
| | | cameraSwitch1(); |
| | | } |
| | |
| | | return document.getElementById('inventoryInfo').clientHeight > document.getElementById('inventoryInfoBox').clientHeight; |
| | | } |
| | | |
| | | //监控点信息滚动 |
| | | function initScrollbar1(num) { |
| | | gundongTimer1 = setInterval(function () { |
| | | if (!hasScrollbar1()) { |
| | | document.getElementById('inventoryInfoBox1').scrollTop = 0; |
| | | } else { |
| | | if (document.getElementById('inventoryInfoBox1').scrollTop >= (document.getElementById('inventoryInfo1').clientHeight - document.getElementById('inventoryInfoBox1').clientHeight)) { |
| | | document.getElementById('inventoryInfoBox1').scrollTop = 0; |
| | | } else { |
| | | document.getElementById('inventoryInfoBox1').scrollTop++; |
| | | } |
| | | } |
| | | }, num); |
| | | } |
| | | |
| | | //判断底部是否出现滚动条 |
| | | function hasScrollbar1() { |
| | | return document.getElementById('inventoryInfo1').clientHeight > document.getElementById('inventoryInfoBox1').clientHeight; |
| | | } |
| | | |
| | | // 右下角提醒信息 |
| | | function showTip(msg) { |
| | | layer.msg(msg); |