diff --git a/css/operEnvironment/operEnvironment.css b/css/operEnvironment/operEnvironment.css index 7b10590..8d8202d 100644 --- a/css/operEnvironment/operEnvironment.css +++ b/css/operEnvironment/operEnvironment.css @@ -378,6 +378,10 @@ th { } +.layui-layer-dialog .layui-layer-content { + color: #000; +} + .environments{ overflow: auto; width: 100%; diff --git a/css/personnelControl/personnelControl.css b/css/personnelControl/personnelControl.css index 3c2e9ca..c6e9fd6 100644 --- a/css/personnelControl/personnelControl.css +++ b/css/personnelControl/personnelControl.css @@ -237,19 +237,11 @@ th { justify-content: space-around; } -.monitor-icon { - width: 100%; - height: 60%; - background: url("../../img/consQuality/质量检测设备-正常.png") no-repeat 0 0 / 100% 100%; - background-position: center center !important; - background-size: initial; -} .environment{ overflow: auto; width: 100%; height: 80%; - } #map { @@ -279,4 +271,38 @@ th { .left-down-down{ width: 100%; height: 85%; +} + +.layui-layer-dialog .layui-layer-content { + color: #000; +} + +ul li { + list-style: none; +} +.drawing-panel { + position: fixed; + bottom: 41.5rem; + margin-left: -49rem; + padding: 1rem 1rem; + border-radius: .25rem; + /*background-color: #fff;*/ + /*box-shadow: 0 2px 6px 0 rgba(27, 142, 236, 0.5);*/ +} +.btn { + width: 105px; + height: 30px; + float: left; + background-color: #fff; + color: rgba(27, 142, 236, 1); + font-size: 14px; + border:1px solid rgba(27, 142, 236, 1); + border-radius: 5px; + margin: 0 5px; + text-align: center; + line-height: 30px; +} +.btn:hover { + background-color: rgba(27, 142, 236, 0.8); + color: #fff; } \ No newline at end of file diff --git a/css/personnelControl/personnelControlList.css b/css/personnelControl/personnelControlList.css new file mode 100644 index 0000000..e72b31d --- /dev/null +++ b/css/personnelControl/personnelControlList.css @@ -0,0 +1,308 @@ +html, +body { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + color: #fff; + font-family: 'Alibaba PuHuiTi R', serif; +} + +::-webkit-scrollbar +{ + width: 6px; + height: 6px; +} +::-webkit-scrollbar-track-piece +{ + background-color: #0d2225; + -webkit-border-radius: 6px; +} +::-webkit-scrollbar-thumb:vertical +{ + height: 5px; + background-color: #0d2225; + -webkit-border-radius: 6px; +} +::-webkit-scrollbar-thumb:horizontal +{ + width: 5px; + background-color: #0d2225; + -webkit-border-radius: 6px; +} + +.layui-table td, .layui-table th, .layui-table-col-set, .layui-table-fixed-r, .layui-table-grid-down, .layui-table-header, .layui-table-mend, .layui-table-page, .layui-table-tips-main, .layui-table-tool, .layui-table-total, .layui-table-view, .layui-table[lay-skin=line], .layui-table[lay-skin=row] { + border-width: 1px; + border-style: solid; + border-color: transparent; +} + +.layui-table { + width: 100%; + margin: 10px 0; + background-color: transparent; + color: white; +} + + +/* 表格头部背景色 */ +th { + background-color: #184B49; /* MediumSeaGreen */ + color: #fff; + font-weight: bold +} + +/*鼠标指向表格时,奇数行背景颜色*/ +.layui-table tbody tr:hover, .layui-table-hover { + background-color: #19b0b9; +} + +.layui-laypage .layui-laypage-curr .layui-laypage-em { + background-color: #184B49; +} + +.layui-laypage a:hover { + color: #184B49; +} + +.layui-laypage .layui-laypage-skip { + color: #16534c; +} + +.layui-laypage-count{ + color:#184B49; +} + +.layui-laypage button, .layui-laypage input { + background-color: transparent; + border: #184B49 1px solid; + color: #184B49; +} + +.layui-table-view select[lay-ignore] { + background-color: transparent; + border: #184B49 1px solid; + color: #184B49; +} + +.layui-table-page .layui-laypage span { + color: #184B49; +} + +.layui-table-page .layui-laypage a, .layui-table-page .layui-laypage span.layui-laypage-curr { + color: #184B49; +} + +/**公共类**/ +.layout{ + display: flex; + align-items: center; + justify-content: space-between; +} + +.layout-vertical{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; +} + +.background-img{ + width: 100%; + height: 100%; + padding: 9% 2% 2% 2%; + box-sizing: border-box; + background-position: center center !important; + flex-direction: column; + justify-content: space-between; + background-repeat: no-repeat; + background-size: 100% 100%; +} + +.right-down .background-img:nth-child(1){ + padding: 4% 2% 2% 2%; +} + +/*.right .background-img:nth-child(2){*/ +/* padding: 3% 1% 1% 1%;*/ +/*}*/ + +.Weather-img{ + width: 100%; + height: 100%; + box-sizing: border-box; + background-position: center center !important; + flex-direction: column; + justify-content: space-between; + background-repeat: no-repeat; + background-size: 100% 100%; +} + +/**主体部分**/ + +.large-frame{ + width: 100%; + height: 100%; + justify-content: space-evenly; + +} + +.left{ + width: 40%; + height: 99%; +} + +.middle{ + width: 58%; + height: 99%; + flex-direction: column; + justify-content: space-between; + +} + +.right{ + width: 24%; + height: 99%; + flex-direction: column; + justify-content: space-between; + +} +.left-down{ + width: 100%; + height: 50%; +} + +.right-down{ + width: 100%; + height: 100%; +} + +.left-under{ + width: 100%; + height: 100%; +} + +.button-style{ + color: #298B83; + border: #184B49 1px solid; + padding: 4px 9px; + margin-left: 10px; +} + +.left-under .layout:nth-child(1){ + justify-content: flex-start; +} + +.state-box{ + width: 100%; + height: 20%; + display: flex; + align-items: center; + justify-content: flex-end; +} + +.state{ + display: flex; + width: 4.5%; + height: 25%; + align-items: center; + margin-left: 3%; + background-position: center center !important; + flex-direction: column; + justify-content: space-between; + background-repeat: no-repeat; + background-size: 100% 100%; + +} + +.state-box .state:nth-child(1) { + background-image: url("../../img/consQuality/QualityInspection2.png"); +} +.state-box .state:nth-child(3) { + background-image: url("../../img/consQuality/QualityInspection1.png"); +} +.state-box .state:nth-child(5) { + background-image: url("../../img/consQuality/QualityInspection3.png"); +} + +.state-box .state:nth-child(2) { + border: #e24e3b 1px solid; + color: #e24e3b; +} + +.monitor-data { + width: 28%; + height: 83%; + flex-direction: column; + justify-content: space-around; +} + + +.environment{ + overflow: auto; + width: 100%; + height: 80%; +} + +#map { + width: 100%; + height: 100%; +} +/* 弹出框样式 */ +#popup { + display: none; + position: absolute; + top: 50px; + left: 50px; + background-color: #fff; + padding: 20px; + border: 1px solid #000; +} + +#popup { + display: none; +} + +.left-down-left{ + width: 100%; + height: 15%; +} + +.left-down-down{ + width: 100%; + height: 85%; +} + +.layui-layer-dialog .layui-layer-content { + color: #000; +} + +ul li { + list-style: none; +} +.drawing-panel { + position: fixed; + bottom: 41.5rem; + margin-left: -49rem; + padding: 1rem 1rem; + border-radius: .25rem; + /*background-color: #fff;*/ + /*box-shadow: 0 2px 6px 0 rgba(27, 142, 236, 0.5);*/ +} +.btn { + width: 105px; + height: 30px; + float: left; + background-color: #fff; + color: rgba(27, 142, 236, 1); + font-size: 14px; + border:1px solid rgba(27, 142, 236, 1); + border-radius: 5px; + margin: 0 5px; + text-align: center; + line-height: 30px; +} +.btn:hover { + background-color: rgba(27, 142, 236, 0.8); + color: #fff; +} \ No newline at end of file diff --git a/js/consQuality/consQuality.js b/js/consQuality/consQuality.js index 7b0f10b..3e8fe7b 100644 --- a/js/consQuality/consQuality.js +++ b/js/consQuality/consQuality.js @@ -276,7 +276,7 @@ function detectionRecord(){ } }, function (xhr) { // error(xhr) - }, "application/json"); + }, "application/json",aqEnnable); } //检测记录对比echarts图表 diff --git a/js/operEnvironment/operEnvironment.js b/js/operEnvironment/operEnvironment.js index d156a75..86747ca 100644 --- a/js/operEnvironment/operEnvironment.js +++ b/js/operEnvironment/operEnvironment.js @@ -10,44 +10,59 @@ layui.use(['layer', 'element', 'table'], function () { layer = layui.layer; table = layui.table; - //边坡位移监测列表 DaylightDisplacementList(''); DaylightDisplacementApi(); - //和风天气API调用 zephyrineWeather(); //有限空间 LimitedSpaceApi(); - //GPS安装检测 GPSInstallationApi(); - + //实时监测 + realTimeMonitoring(); }); //实时监测 function realTimeMonitoring(){ - - const url = commonUrl + "screen/largeScreen/xcIndex/getProJcData"; - const params = { - "roleCode": roleCode, - "orgId": orgId, - "userId": userId, - "bidCode": bidCode - } - let encryptStr = encryptCBC(JSON.stringify(params)); - ajaxRequest(url, "POST", encryptStr, true, function () { + const paramData = 'bidCode=' + bidCode + '&roleCode=' + roleCode + '&orgId=' + orgId + '&userId=' + userId; + let montageParam = aqEnnable ? encryptCBC(paramData) : ' &' + encryptCBC(paramData); + const url = commonUrl + 'screen/largeScreen/xcIndex/getProJcData?params=' + montageParam; + ajaxRequestGet(url, "GET", true, function () { }, function (result) { - console.log(result); if (result.code === 200) { + setData(result.data); } else if (result.code === 500) { - layer.msg(result.msg, { icon: 2 }); - }else if(result.code === 401){ - loginout(1) + console.error('实时监测' + result.msg); + setData(null); + } else if (result.code === 401) { + loginout(1); } }, function (xhr, status, error) { - error(xhr, status, error) - }, "application/json",aqEnnable); + error(xhr, status, error) + setData(null); + }, aqEnnable); + + /* 实时检测赋值 */ + function setData(data) { + if (data && data.length > 0) { + $.each(data, function (index, item) { + if (item.modelName === '温度') { + $('#wd').html(item.val ? item.val : 0); + } else if (item.modelName === '湿度') { + $('#sd').html(item.val ? item.val : 0); + } else if (item.modelName === '噪声') { + $('#zs').html(item.val ? item.val : 0); + } else if (item.modelName === '光照') { + $('#gz').html(item.val ? item.val : 0); + } else if (item.modelName === 'pm2') { + $('#pm2').html(item.val ? item.val : 0); + } else if (item.modelName === 'pm10') { + $('#pm10').html(item.val ? item.val : 0); + } + }) + } + } } //边坡位移监测列表 diff --git a/js/personnelControl/personnelControl.js b/js/personnelControl/personnelControl.js index ceeae38..d264917 100644 --- a/js/personnelControl/personnelControl.js +++ b/js/personnelControl/personnelControl.js @@ -1,6 +1,6 @@ let element, layer, table, tree; const bidCode = parent.$('#bidPro').val(); -var map; +let map; layui.use(['layer', 'element', 'table', 'tree'], function () { element = layui.element; @@ -8,6 +8,12 @@ layui.use(['layer', 'element', 'table', 'tree'], function () { table = layui.table; tree = layui.tree; + document.getElementById("myButton").addEventListener("click", function() { + window.location.href = "../personnelControl/personnelControlList.html"; + }); + + mapInit(); + //人员列表 PersonnelList(); @@ -17,6 +23,7 @@ layui.use(['layer', 'element', 'table', 'tree'], function () { //穿戴装备 wearGarList(); + }); // 人员列表 @@ -44,9 +51,7 @@ function PersonnelList(){ } }, function (xhr) { // error(xhr) - }, function (xhr, status, error) { - error(xhr, status, error) - }, "application/json",aqEnnable); + } , "application/json",aqEnnable); } @@ -172,65 +177,75 @@ function wearGarList(){ } -document.addEventListener('DOMContentLoaded', function() { - // 获取经纬度 - var lat,lon; - if (navigator.geolocation) { - navigator.geolocation.getCurrentPosition(function (position) { - lat = position.coords.latitude; - lon = position.coords.longitude; - console.log(lon,lat) - map= new BMap.Map("map"); - map.centerAndZoom(new BMap.Point(lon,lat), 11); - map.enableScrollWheelZoom(true); + function mapInit(){ + var lat,lon; + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition(function (position) { + lat = position.coords.latitude; + lon = position.coords.longitude; + console.log(lon,lat) + map= new BMapGL.Map("map"); + map.centerAndZoom(new BMapGL.Point(lon,lat), 11); + map.enableScrollWheelZoom(true); - - var marker = new BMap.Marker(new BMap.Point(lon,lat)); // 创建标注 - map.addOverlay(marker); - - var overlays = []; - var overlaycomplete = function (e) { - overlays.push(e.overlay); - }; - - var styleOptions = { - strokeColor: "red", //边线颜色。 - fillColor: "red", //填充颜色。当参数为空时,圆形将没有填充效果。 - strokeWeight: 3, //边线的宽度,以像素为单位。 - strokeOpacity: 0.8, //边线透明度,取值范围0 - 1。 - fillOpacity: 0.6, //填充的透明度,取值范围0 - 1。 - strokeStyle: 'solid' //边线的样式,solid或dashed。 - } - //实例化鼠标绘制工具 - var drawingManager = new BMapLib.DrawingManager(map, { - isOpen: false, //是否开启绘制模式 - enableDrawingTool: true, //是否显示工具栏 - drawingToolOptions: { - anchor: BMAP_ANCHOR_TOP_RIGHT, //位置 - offset: new BMap.Size(5, 5), //偏离值 - }, - circleOptions: styleOptions, //圆的样式 - polylineOptions: styleOptions, //线的样式 - polygonOptions: styleOptions, //多边形的样式 - rectangleOptions: styleOptions //矩形的样式 - }); - //添加鼠标绘制工具监听事件,用于获取绘制结果 - drawingManager.addEventListener('overlaycomplete', overlaycomplete); - console.log(overlays) - - function clearAll() { - for (var i = 0; i < overlays.length; i++) { - map.removeOverlay(overlays[i]); + // 创建点标记 + let marker = new BMapGL.Marker(new BMapGL.Point(lon,lat)); + map.addOverlay(marker); + // 创建信息窗口 + var opts = { + width: 200, + height: 100, + title: '人员信息' + }; + var content = createInfoWindowContent(); + var infoWindow = new BMapGL.InfoWindow(content, opts); + // 点标记添加点击事件 + marker.addEventListener('click', function () { + map.openInfoWindow(infoWindow, new BMapGL.Point(lon,lat)); // 开启信息窗口 + }); + // 创建信息窗口内容 + function createInfoWindowContent() { + return '
45℃
+45℃
温度
45%
+45%
湿度
45分贝
+45分贝
噪声
45kwh
+45kwh
光照
45μg/m³
+45μg/m³
PM2.5
45μg/m³
+45μg/m³
PM10