From 3319400974b25ed78ffcf8cfff27c31ef4bf8afc Mon Sep 17 00:00:00 2001 From: sliang <1589399930@qq.com> Date: Fri, 29 Mar 2024 15:42:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/towerAssInspect/towerAssInspect.css | 10 + js/pages/alarmMge/alarmMge.js | 21 +- js/pages/towerAssInspect/towerAssInspect.js | 310 +++++++++++++++----- pages/alarmMge/alarmMge.html | 4 +- pages/towerAssInspect/towerAssInspect.html | 80 +---- 5 files changed, 282 insertions(+), 143 deletions(-) diff --git a/css/towerAssInspect/towerAssInspect.css b/css/towerAssInspect/towerAssInspect.css index 1cd1b68..b23e86b 100644 --- a/css/towerAssInspect/towerAssInspect.css +++ b/css/towerAssInspect/towerAssInspect.css @@ -164,6 +164,16 @@ body { background: url("../../img/towerAssInspect/alarm.png") no-repeat 0 0 / 100% 100%; } +.connection{ + padding: 5% 2% 2% 2%; + background: url("../../img/towerAssInspect/connection.png") no-repeat 0 0 / 100% 100%; +} + +.normal{ + padding: 5% 2% 2% 2%; + background: url("../../img/towerAssInspect/normal.png") no-repeat 0 0 / 100% 100%; +} + .detection{ padding: 5% 2% 2% 2%; diff --git a/js/pages/alarmMge/alarmMge.js b/js/pages/alarmMge/alarmMge.js index bea2c98..3cd7aa7 100644 --- a/js/pages/alarmMge/alarmMge.js +++ b/js/pages/alarmMge/alarmMge.js @@ -1,14 +1,11 @@ -let layer,table; +let layer,table,buildCheck; const bidCode = parent.$('#bidPro').val(); + layui.use(['layer','table'], function () { layer = layui.layer; table = layui.table; - //选择单位下拉选 - getSelectLists(); - updateSelection(); //建管单位下拉选 getBuildLists(); - }); function getBuildLists(){ @@ -24,6 +21,10 @@ function getBuildLists(){ } $('#build').empty().append(html); layui.form.render(); + + //选择单位下拉选 + getSelectLists(); + updateSelection(); } else if (result.code === 500) { layer.msg(result.msg, { icon: 2 }); } @@ -56,6 +57,7 @@ function getSelect(data){ html += '
'+data[i].name+'
' ; } } + buildCheck = data[0].id; init(data[0].id); $("#selection").append(html); } @@ -66,6 +68,7 @@ function updateSelection() { $(this).removeClass("dark").addClass("bright"); // 点击的元素设置为 bright 类 var clickedId = $(this).attr('id'); // 获取被点击的 div 元素的 id 值 console.log("选中的值为: " + clickedId); + buildCheck = clickedId; init(clickedId); }); } @@ -93,9 +96,9 @@ function init(warnType){ {field: 'proName', title: '工程名称',align:'center'}, {field: 'warnContent', title: '告警内容',align:'center'}, {field: 'teamLeader', title: '班组长',align:'center'}, - {field: '', title: '操作',align:'center',templet:function(d){ + // {field: '', title: '操作',align:'center',templet:function(d){ - }}, + // }}, ]], initComplete: function () { // 在表格渲染完成后,重新渲染序号列 @@ -109,4 +112,8 @@ function init(warnType){ console.log(res); } }) +} + +function getQueryList(){ + init(buildCheck) } \ No newline at end of file diff --git a/js/pages/towerAssInspect/towerAssInspect.js b/js/pages/towerAssInspect/towerAssInspect.js index 19f280d..00db87e 100644 --- a/js/pages/towerAssInspect/towerAssInspect.js +++ b/js/pages/towerAssInspect/towerAssInspect.js @@ -1,91 +1,261 @@ -let layer,table; +let layer,table,form; let myChart = echarts.init(document.getElementById('tendency')); -layui.use(['layer','table'], function () { +const bidCode = parent.$('#bidPro').val(); + +layui.use(['layer','table','form'], function () { layer = layui.layer; table = layui.table; - init(); - inits(); - initEchartsOne(); + form = layui.form; + // 标段工程下拉选监听 + form.on('select(gt)', function (data) { + getDeviceList(data.value); + }); + //杆塔下拉选 + getGtLists(); }); +function getGtLists(){ + const url = commonUrl + "system/sys/select/getGtLists?bidCode="+ bidCode; // 杆塔url + ajaxRequest(url, "get", null , true, function () { + }, function (result) { + if (result.code === 200) { + let html = ''; + if (result.data && result.data.length > 0) { + $.each(result.data, function (index, item) { + html += '' + }) + } + $('#gt').empty().append(html); + layui.form.render(); + // 设备列表 + getDeviceList(result.data[0].gtId); + // updateSelection(); + } else if (result.code === 500) { + layer.msg(result.msg, { icon: 2 }); + } + }, function (xhr) { + layer.msg(xhr, { icon: 2 }); + }); +} -function init(){ - var data = [ - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 2, proName: '李四', teamName: '666', teamLeader: '女', quality: 1, content: '起飞'} - ]; +function getDeviceList(gtId){ + const params = { + "roleCode": roleCode, + "orgId": orgId, + "userId": userId, + "bidCode":bidCode, + "gtId":gtId + } + const url = commonUrl + "screen/largeScreen/towerAssInspect/getDeviceList?roleCode="+roleCode+"&orgId="+orgId+"&userId="+userId+"&bidCode="+bidCode+">Id="+gtId; // 设备列表url + let encryptStr = encryptCBC(JSON.stringify(params)); + ajaxRequest(url, "get", null, true, function () { + }, function (result) { + let html = ''; + if (result.code === 200) { + if (result.data && result.data.length > 1) { + $.each(result.data, function (index, item) { + html += '
'; + html +=''; + if(item.type=="1"){ + html += '
'; + }else if(item.type=="2"){ + html += '
'; + }else if(item.type=="0"){ + html += '
'; + } + html += '
'+ item.deviceName +'
'; + html +='
'; + }) + getInfo(result.data[0].deviceId) + }else{ + html += '
未找到关联设备
' + } + } else if (result.code === 500) { + layer.msg(result.msg, { icon: 2 }); + } + $('#deviceList').empty().append(html); + }, function (xhr) { + layer.msg(xhr, { icon: 2 }); + }); +} + +//根据点击的设备去查询其他信息 +function getInfo(deviceId){ + //实时检测 + getRealTimeDetection(deviceId); + + //当日检测变化趋势 + // getTrend(deviceId) + + //实时告警 + getRealTimeAlarmList(deviceId) + + //历史记录 + getHistoryList(deviceId) +} + +function getRealTimeDetection(deviceId){ + const params = { + "roleCode": roleCode, + "orgId": orgId, + "userId": userId, + "bidCode":bidCode, + "deviceId":deviceId + } + const url = commonUrl + "screen/largeScreen/towerAssInspect/getRealTimeDetection?roleCode="+roleCode+"&orgId="+orgId+"&userId="+userId+"&bidCode="+bidCode+"&deviceId="+deviceId; // 设备列表url + let encryptStr = encryptCBC(JSON.stringify(params)); + ajaxRequest(url, "get", null, true, function () { + }, function (result) { + let html = ''; + if (result.code === 200) { + if (result.data && result.data.length > 1) { + $.each(result.data, function (index, item) { + if(item.dataType=="1"){ + html +='
'; + html +='
'; + html +='
倾斜检测
'; + html +='
倾角'+item.val +'
'; + html +='
'; + html +='
'; + }else if(item.dataType=="2"){ + html +='
'; + html +='
'; + html +='
张力检测
'; + html +='
张力'+item.val +'
'; + html +='
'; + html +='
'; + }else if(item.dataType=="3"){ + html +='
'; + html +='
'; + html +='
碰撞检测
'; + html +='
碰撞'+item.val +'
'; + html +='
'; + html +='
'; + } + }) + }else{ + html += '
未找到关联设备
' + } + } else if (result.code === 500) { + layer.msg(result.msg, { icon: 2 }); + } + $('#detection').empty().append(html); + }, function (xhr) { + layer.msg(xhr, { icon: 2 }); + }); +} + +function getTrend(deviceId){ + const params = { + "roleCode": roleCode, + "orgId": orgId, + "userId": userId, + "bidCode":bidCode, + "deviceId":deviceId + } + const url = commonUrl + "screen/largeScreen/towerAssInspect/getTrend?roleCode="+roleCode+"&orgId="+orgId+"&userId="+userId+"&bidCode="+bidCode+"&deviceId="+deviceId; // 设备列表url + let encryptStr = encryptCBC(JSON.stringify(params)); + ajaxRequest(url, "get", null, true, function () { + }, function (result) { + let html = ''; + if (result.code === 200) { + if (result.data && result.data.length > 1) { + let xLabel =[]; + let dataValue = []; + $.each(result.data, function (index, item) { + xLabel.push(item.time); + dataValue.push(item.changeVal); + }); + initEchartsOne(xLabel,dataValue); + }else{ + html += '
未找到关联设备
' + } + } else if (result.code === 500) { + layer.msg(result.msg, { icon: 2 }); + } + $('#deviceList').empty().append(html); + }, function (xhr) { + layer.msg(xhr, { icon: 2 }); + }); +} + + +function getRealTimeAlarmList(deviceId){ + const url = commonUrl + "screen/largeScreen/towerAssInspect/getRealTimeAlarmList"; // 建管单位url table.render({ elem: '#demo1', - data: data, + url: url, skin: 'line', page: true, + headers:{ + decrypt:"decrypt", + "Authorization":token + }, + where: { + deviceId:deviceId + }, cols: [[ - {field: 'id', title: '排名',align:'center'}, - {field: 'proName', title: '工程名称',align:'center'}, - {field: 'teamName', title: '班组名称',align:'center'}, - {field: 'teamLeader', title: '班组长',align:'center'}, - {field: 'quality', title: '施工质量',align:'center'}, - ]] + {type: 'numbers', title: '序号'}, // 添加序号列 + {field: 'warnContent', title: '告警内容',align:'center'}, + {field: 'warnTime', title: '预警时间',align:'center'} + ]], + initComplete: function () { + // 在表格渲染完成后,重新渲染序号列 + var that = this.elem.next(); + var tool = that.children('.layui-table-box').children('.layui-table-fixed').children('.layui-table-body').children('.layui-table'); + tool.find("tr").each(function (index, item) { + $(this).find('td[data-field="LAY_TABLE_INDEX"]').text(index + 1); + }); + }, + done:function(res, curr, count, origin){ + console.log(res); + } }) } -function inits(){ - var data = [ - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'}, - {id: 2, proName: '李四', teamName: '666', teamLeader: '女', quality: 1, content: '起飞'} - ]; - table.render({ - elem: '#demo2', - data: data, - skin: 'line', - page: true, - cols: [[ - {field: 'id', title: '排名',align:'center'}, - {field: 'proName', title: '工程名称',align:'center'}, - {field: 'teamName', title: '班组名称',align:'center'}, - {field: 'teamLeader', title: '班组长',align:'center'}, - {field: 'quality', title: '施工质量',align:'center'}, - ]] - }) +function getHistoryList(deviceId){ + const url = commonUrl + "screen/largeScreen/towerAssInspect/getHistoryList"; // 建管单位url + table.render({ + elem: '#demo2', + url: url, + skin: 'line', + page: true, + headers:{ + decrypt:"decrypt", + "Authorization":token + }, + where: { + deviceId:deviceId, + }, + cols: [[ + {type: 'numbers', title: '序号'}, // 添加序号列 + {field: 'areaName', title: '区域名称',align:'center'}, + {field: 'modeName', title: '检测点名称',align:'center'}, + {field: 'val', title: '检测值',align:'center'}, + {field: 'thisChangeVal', title: '本次变化值',align:'center'}, + {field: 'changeVal', title: '累计变化值',align:'center'}, + {field: 'updateTime', title: '检测时间',align:'center'}, + {field: 'isWarn', title: '状态',align:'center'} + ]], + initComplete: function () { + // 在表格渲染完成后,重新渲染序号列 + var that = this.elem.next(); + var tool = that.children('.layui-table-box').children('.layui-table-fixed').children('.layui-table-body').children('.layui-table'); + tool.find("tr").each(function (index, item) { + $(this).find('td[data-field="LAY_TABLE_INDEX"]').text(index + 1); + }); + }, + done:function(res, curr, count, origin){ + console.log(res); + } + }) } /* 变化趋势 */ -function initEchartsOne() { +function initEchartsOne(xLabel,dataValue) { let fontSize = '14', fontFamily = 'Alibaba PuHuiTi R', fontColor = '#fff'; - let xLabel = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']; - let dataValue = [20, 30, 40, 35, 34, 15, 56, 15, 12, 25, 34, 42]; + // let xLabel = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']; + // let dataValue = [20, 30, 40, 35, 34, 15, 56, 15, 12, 25, 34, 42]; const tooltip = { show: true, trigger: 'axis', diff --git a/pages/alarmMge/alarmMge.html b/pages/alarmMge/alarmMge.html index 72425e9..ee1c054 100644 --- a/pages/alarmMge/alarmMge.html +++ b/pages/alarmMge/alarmMge.html @@ -25,7 +25,7 @@
-
+
@@ -53,7 +53,7 @@
- +
diff --git a/pages/towerAssInspect/towerAssInspect.html b/pages/towerAssInspect/towerAssInspect.html index 8ff949f..245815e 100644 --- a/pages/towerAssInspect/towerAssInspect.html +++ b/pages/towerAssInspect/towerAssInspect.html @@ -9,11 +9,10 @@ - - - - + + + 组塔检测 @@ -22,16 +21,16 @@
-
- +
+
+ + + +
-
@@ -39,68 +38,21 @@
-
+
告警
正常
掉线
-
-
-
-
设备1
-
-
-
-
设备1
-
-
-
-
设备1
-
-
-
-
设备1
-
-
-
-
设备1
-
-
-
-
设备1
-
-
-
-
设备1
-
-
-
-
设备1
-
-
-
-
设备1
-
-
-
-
设备1
-
-
-
-
设备1
-
-
-
-
设备1
-
+
+
-
-
+
+