From 5650de66bb2b28d1da1273629c3c5c948a6a2aad Mon Sep 17 00:00:00 2001 From: sliang <1589399930@qq.com> Date: Wed, 27 Mar 2024 20:57:39 +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 --- api/commonRequest.js | 10 +- css/alarmMge/alarmMge.css | 2 + js/pages/alarmMge/alarmMge.js | 108 ++++++-- js/pages/towerAssInspect/towerAssInspect.js | 271 ++++++++++++++++++++ pages/alarmMge/alarmMge.html | 34 +-- pages/towerAssInspect/towerAssInspect.html | 147 ++++++++++- 6 files changed, 526 insertions(+), 46 deletions(-) diff --git a/api/commonRequest.js b/api/commonRequest.js index bfee75c..fd1e49a 100644 --- a/api/commonRequest.js +++ b/api/commonRequest.js @@ -1,13 +1,13 @@ let aqEnnable = false;// 参数加密开关 -const commonUrl = "http://10.40.92.33:18080/zhgd/"; +const commonUrl = "http://10.40.92.106:18080/zhgd/"; /* 登录相关 */ const login_url = commonUrl + "auth/login"; // 登录url const login_out = commonUrl + "auth/logout"; // 登出url const page_jump = commonUrl + "auth/pageJump"; // 登出url -const login_sg_page = "http://10.40.92.33:8101/sg_login.html" // 施工大屏登录页面 -const login_sc_page = "http://10.40.92.33:8100/sc_login.html" // 省侧大屏登录页面 -const login_sg_index = "http://10.40.92.33:8101/pages/home/navigation.html" // 施工大屏首页 -const login_sc_index = "http://10.40.92.33:8100/pages/web/index.html" // 省侧大屏首页 +const login_sg_page = "http://10.40.92.106:8101/sg_login.html" // 施工大屏登录页面 +const login_sc_page = "http://10.40.92.106:8100/sc_login.html" // 省侧大屏登录页面 +const login_sg_index = "http://10.40.92.106:8101/pages/home/navigation.html" // 施工大屏首页 +const login_sc_index = "http://10.40.92.106:8100/pages/web/index.html" // 省侧大屏首页 // ajax 请求封装 function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType) { diff --git a/css/alarmMge/alarmMge.css b/css/alarmMge/alarmMge.css index d1ca437..abc5d27 100644 --- a/css/alarmMge/alarmMge.css +++ b/css/alarmMge/alarmMge.css @@ -64,6 +64,7 @@ body { justify-content: center; align-items: center; margin-top: 4%; + cursor: pointer; } .bright{ @@ -77,4 +78,5 @@ body { justify-content: center; align-items: center; margin-top: 4%; + cursor: pointer; } \ No newline at end of file diff --git a/js/pages/alarmMge/alarmMge.js b/js/pages/alarmMge/alarmMge.js index ad2f4af..bea2c98 100644 --- a/js/pages/alarmMge/alarmMge.js +++ b/js/pages/alarmMge/alarmMge.js @@ -1,36 +1,112 @@ -let layer; -layui.use(['layer'], function () { +let layer,table; +const bidCode = parent.$('#bidPro').val(); +layui.use(['layer','table'], function () { layer = layui.layer; - - getSelect(); + table = layui.table; + //选择单位下拉选 + getSelectLists(); updateSelection(); + //建管单位下拉选 + getBuildLists(); + }); -function getSelect(){ +function getBuildLists(){ + const url = commonUrl + "system/sys/select/getBuildLists"; // 建管单位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 += '' + }) + } + $('#build').empty().append(html); + layui.form.render(); + } else if (result.code === 500) { + layer.msg(result.msg, { icon: 2 }); + } + }, function (xhr) { + error(xhr) + }); +} + +function getSelectLists(){ + const url = commonUrl + "system/sys/select/getSelectLists"; // 建管单位url + ajaxRequest(url, "get", null , true, function () { + }, function (result) { + if (result.code === 200) { + getSelect(result.data) + } else if (result.code === 500) { + layer.msg(result.msg, { icon: 2 }); + } + }, function (xhr) { + error(xhr) + }); +} + +function getSelect(data){ $("#selection").empty(); - var data = [ - { a: 1, b: 2,c:1 }, - { a: 2, b: 2,c:2 }, - { a: 2, b: 2,c:3 } - ]; var html =""; - data = JSON.parse(JSON.stringify(data)); // 创建一个新的变量存储 JSON 化后的数据 for (var i = 0; i < data.length; i++) { - if(data[i].a == 1){ - html += '
'+data[i].b+'
' ; + if(i == 0){ + html += '
'+data[i].name+'
' ; }else{ - html += '
'+data[i].b+'
' ; + html += '
'+data[i].name+'
' ; } } - console.log(html) + init(data[0].id); $("#selection").append(html); } function updateSelection() { - $(".item").on("click", function() { + $("#selection").on("click", ".item", function() { $(".item").removeClass("bright").addClass("dark"); // 点击时将所有元素设置为 dark 类 $(this).removeClass("dark").addClass("bright"); // 点击的元素设置为 bright 类 var clickedId = $(this).attr('id'); // 获取被点击的 div 元素的 id 值 console.log("选中的值为: " + clickedId); + init(clickedId); }); +} + +function init(warnType){ + const url = commonUrl + "screen/largeScreen/alarmMge/getAlarmMgeList"; // 建管单位url + table.render({ + elem: '#demo', + url: url, + skin: 'line', + page: true, + headers:{ + decrypt:"decrypt", + "Authorization":token + }, + where: { + warnType:warnType, + orgId:$('#build').val(), + proName:$('#proName').val(), + teamLeader:$('#teamLeader').val() + }, + cols: [[ + {type: 'numbers', title: '序号'}, // 添加序号列 + {field: 'orgName', title: '建管单位',align:'center'}, + {field: 'proName', title: '工程名称',align:'center'}, + {field: 'warnContent', title: '告警内容',align:'center'}, + {field: 'teamLeader', title: '班组长',align:'center'}, + {field: '', title: '操作',align:'center',templet:function(d){ + + }}, + ]], + 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); + } + }) } \ No newline at end of file diff --git a/js/pages/towerAssInspect/towerAssInspect.js b/js/pages/towerAssInspect/towerAssInspect.js index e69de29..19f280d 100644 --- a/js/pages/towerAssInspect/towerAssInspect.js +++ b/js/pages/towerAssInspect/towerAssInspect.js @@ -0,0 +1,271 @@ +let layer,table; +let myChart = echarts.init(document.getElementById('tendency')); +layui.use(['layer','table'], function () { + layer = layui.layer; + table = layui.table; + init(); + inits(); + initEchartsOne(); +}); + + +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: '起飞'} + ]; + table.render({ + elem: '#demo1', + 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 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 initEchartsOne() { + 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]; + const tooltip = { + show: true, + trigger: 'axis', + axisPointer: { + type: 'shadow' + }, + backgroundColor: 'rgba(75, 79, 82, 0.80)', //设置背景颜色 + textStyle: { + color: fontColor, + fontFamily: fontFamily + }, + borderColor: "rgba(255,255,255, .5)", + }; + let option = { + backgroundColor: 'transparent', + tooltip, + legend: { + show: false, + }, + grid: { + top: '25%', + left: '5%', + right: '5%', + bottom: '15%', + }, + xAxis: [ + { + type: 'category', + boundaryGap: true, + axisLine: { + //坐标轴轴线相关设置。数学上的x轴 + show: true, + lineStyle: { + color: '#5A6E71', + }, + }, + axisLabel: { + //坐标轴刻度标签的相关设置 + textStyle: { + color: fontColor, + fontSize: fontSize, + fontFamily: fontFamily + }, + }, + splitLine: { + show: false, + lineStyle: { + color: '#233653', + }, + }, + axisTick: { + show: false, + }, + data: xLabel, + }, + ], + yAxis: [ + { + name: "", + nameTextStyle: { + color: fontColor, + fontSize: fontSize, + padding: [0, 60, 0, 0], + fontFamily: fontFamily + }, + // minInterval: 1, + type: 'value', + splitLine: { + show: true, + lineStyle: { + color: '#25393B', + type: 'dashed' + }, + }, + axisLine: { + show: false, + lineStyle: { + color: '#008de7', + }, + }, + axisLabel: { + show: true, + textStyle: { + color: fontColor, + fontSize: fontSize, + fontFamily: fontFamily + } + }, + axisTick: { + show: false, + }, + }, + ], + series: [ + { + name: '周计划数', + type: 'line', + symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆 + smooth: true, + lineStyle: { + normal: { + width: 3, + // color: '#1ED6FF', // 线条颜色 + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 0, + color: '#0DF0FD', + }, + { + offset: 0.6, + color: '#00F1D4', + }, + { + offset: 1, + color: '#0EEEFC', + }, + ], + false + ), + }, + }, + itemStyle: { + normal: { + color: '#1ED6FF',//拐点颜色 + // borderColor: '#fff600',//拐点边框颜色 + // borderWidth: 13//拐点边框大小 + label: { + show: true, //开启显示 + color: fontColor, + fontFamily: fontFamily, + position: 'top', //在上方显示 + formatter: function (res) { + if (res.value) { + return res.value + } else { + return 0 + } + }, + }, + }, + + }, + symbolSize: 8, //设定实心点的大小 + areaStyle: { + normal: { + //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。 + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 0, + color: '#01DDE9', + }, + { + offset: 0.6, + color: '#086A79', + }, + { + offset: 1, + color: '#0D3134', + }, + ], + false + ), + }, + }, + data: dataValue, + } + ] + } + myChart.setOption(option, true); + window.addEventListener("resize", function () { + myChart.resize(); + }); +} \ No newline at end of file diff --git a/pages/alarmMge/alarmMge.html b/pages/alarmMge/alarmMge.html index 791847d..72425e9 100644 --- a/pages/alarmMge/alarmMge.html +++ b/pages/alarmMge/alarmMge.html @@ -3,35 +3,23 @@ - + - - - - + + + 告警管理 -
-
@@ -42,11 +30,7 @@
-
@@ -54,7 +38,7 @@
-
@@ -62,7 +46,7 @@
-
@@ -74,6 +58,10 @@
+ +
+
+
diff --git a/pages/towerAssInspect/towerAssInspect.html b/pages/towerAssInspect/towerAssInspect.html index e940892..8ff949f 100644 --- a/pages/towerAssInspect/towerAssInspect.html +++ b/pages/towerAssInspect/towerAssInspect.html @@ -2,10 +2,153 @@ - + + + + + + + + + + + + + 组塔检测 - 组塔检测 +
+
+ +
+
+ +
+ +
+ +
+
+ + +
+ +
+
+
+
告警 +
正常 +
掉线 +
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
设备1
+
+
+
+
+ +
+
+
+
+
倾斜检测
+
倾角30°
+
+
+
+
+
张力检测
+
张力30N
+
+
+
+
+
碰撞检测
+
碰撞正常
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ \ No newline at end of file