From 50e3246e95ac79485679cbe83903c2b22fd048fc Mon Sep 17 00:00:00 2001 From: lSun <15893999301@qq.com> Date: Thu, 24 Jul 2025 14:41:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E5=AE=89=E5=85=A8=E5=88=86?= =?UTF-8?q?=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engineeringSafetyAnalysis.js | 24 +++++-- .../newDataAnalysis/environmentalReadings.js | 62 +++++++++++++++++++ js/pages/newDataAnalysis/hiddenDanger.js | 60 ++++++++++++++++++ .../environmentalReadings.html | 57 +++++++++++++++++ pages/newDataAnalysis/hiddenDanger.html | 57 +++++++++++++++++ 5 files changed, 255 insertions(+), 5 deletions(-) create mode 100644 js/pages/newDataAnalysis/environmentalReadings.js create mode 100644 js/pages/newDataAnalysis/hiddenDanger.js create mode 100644 pages/newDataAnalysis/environmentalReadings.html create mode 100644 pages/newDataAnalysis/hiddenDanger.html diff --git a/js/pages/newDataAnalysis/engineeringSafetyAnalysis.js b/js/pages/newDataAnalysis/engineeringSafetyAnalysis.js index f458ce7..4eaf339 100644 --- a/js/pages/newDataAnalysis/engineeringSafetyAnalysis.js +++ b/js/pages/newDataAnalysis/engineeringSafetyAnalysis.js @@ -39,12 +39,12 @@ function initTable(bidCode,name) { { field: 'workLocation', title: '作业地点', align: 'center', width: '10%' }, { field: 'monitoringPointId', title: '监测点编号', align: 'center', width: '10%' }, { field: 'name', title: '监测点名称', align: 'center', width: '10%' }, - { field: 'temperature', title: '当前温度', align: 'center', width: '8%' }, - { field: 'humidity', title: '当前湿度', align: 'center', width: '8%' }, - { field: 'windSpeed', title: '当前风速', align: 'center', width: '8%' }, - { field: 'gasValue', title: '当前气体值', align: 'center', width: '8%' }, + { field: 'temperature', title: '当前平均温度', align: 'center', width: '8%' }, + { field: 'humidity', title: '当前平均湿度', align: 'center', width: '8%' }, + { field: 'windSpeed', title: '当前平均风速', align: 'center', width: '8%' }, + { field: 'gasValue', title: '当前平均气体值', align: 'center', width: '10%' }, { - field: 'rateLevel', title: '最高隐患等级', align: 'center', width: '10%', + field: 'rateLevel', title: '最高隐患等级', align: 'center', width: '8%', templet: function (d) { let color = ''; if (d.level == "一般隐患") { @@ -161,6 +161,7 @@ function initEchartsOne(data) { data: dates, axisLabel: { color: "#fff", // X轴标签白色 + fontSize: 10, }, axisLine: { lineStyle: { @@ -260,11 +261,24 @@ function initEchartsOne(data) { ] }; myChart.setOption(environmentOption, true); + + // 添加点击事件监听器 + myChart.on('click', function (params) { + if (params.componentType === 'series') { + environmentalReadings() + } + }); + + window.addEventListener("resize", function () { myChart.resize(); }); } +function environmentalReadings() { + layer.open() +} + function initEchartsTwo(data) { diff --git a/js/pages/newDataAnalysis/environmentalReadings.js b/js/pages/newDataAnalysis/environmentalReadings.js new file mode 100644 index 0000000..70db927 --- /dev/null +++ b/js/pages/newDataAnalysis/environmentalReadings.js @@ -0,0 +1,62 @@ +let table, layer, form; +let myChart = null, myChart2 = null; +layui.use(['layer', 'table', 'form'], function () { + layer = layui.layer; + table = layui.table; + form = layui.form; + let bidCode = parent.parent.parent.$('#bidPro').val() + initTable(bidCode,""); +}); + + +function initTable(bidCode,name) { + const url = commonUrl + "screen/largeScreen/engineeringSafetyAnalysis/getEnvironmentalList"; + table.render({ + elem: '#demo2', + url: url, + id: 'demo2', + skin: 'line', + page: true, + height: 'full-400', + headers: { + "decrypt": "decrypt", + "Authorization": token + }, + where: { + bidCode: bidCode, + name:name + }, + response: { + statusName: "code", + statusCode: 200, + countName: "count", + dataName: "rows", + }, + cols: [[ + { type: 'numbers', title: '序号', width: '10%' }, // 添加序号列 + { field: 'id', title: '监测点编号', align: 'center' }, + { field: 'date', title: '环境数据记录日期', align: 'center' }, + { field: 'temperature', title: '当前温度', align: 'center' }, + { field: 'humidity', title: '当前湿度', align: 'center'}, + { field: 'windSpeed', title: '当前风速', align: 'center'}, + { field: 'gasValue', 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 query(type) { + let name = $('#name').val(); + let bidCode = parent.parent.$('#bidPro').val() + initTable(bidCode,name); +} diff --git a/js/pages/newDataAnalysis/hiddenDanger.js b/js/pages/newDataAnalysis/hiddenDanger.js new file mode 100644 index 0000000..0c245c2 --- /dev/null +++ b/js/pages/newDataAnalysis/hiddenDanger.js @@ -0,0 +1,60 @@ +let table, layer, form; +let myChart = null, myChart2 = null; +layui.use(['layer', 'table', 'form'], function () { + layer = layui.layer; + table = layui.table; + form = layui.form; + let bidCode = parent.parent.parent.$('#bidPro').val() + initTable(bidCode,""); +}); + + +function initTable(bidCode,name) { + const url = commonUrl + "screen/largeScreen/engineeringSafetyAnalysis/getHazardsList"; + table.render({ + elem: '#demo2', + url: url, + id: 'demo2', + skin: 'line', + page: true, + height: 'full-400', + headers: { + "decrypt": "decrypt", + "Authorization": token + }, + where: { + bidCode: bidCode, + name:name + }, + response: { + statusName: "code", + statusCode: 200, + countName: "count", + dataName: "rows", + }, + cols: [[ + { type: 'numbers', title: '序号', width: '10%' }, // 添加序号列 + { field: 'id', title: '隐患编号', align: 'center',}, + { field: 'type', title: '隐患类型', align: 'center', }, + { field: 'level', title: '隐患等级', align: 'center', }, + { field: 'timestamp', 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 query(type) { + let name = $('#name').val(); + let bidCode = parent.parent.$('#bidPro').val() + initTable(bidCode,name); +} diff --git a/pages/newDataAnalysis/environmentalReadings.html b/pages/newDataAnalysis/environmentalReadings.html new file mode 100644 index 0000000..1415c95 --- /dev/null +++ b/pages/newDataAnalysis/environmentalReadings.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + 工程安全分析-左边echarts + + + +
+
+ +
+
+
+ + + + + diff --git a/pages/newDataAnalysis/hiddenDanger.html b/pages/newDataAnalysis/hiddenDanger.html new file mode 100644 index 0000000..38b068f --- /dev/null +++ b/pages/newDataAnalysis/hiddenDanger.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + 工程安全分析-左边echarts + + + +
+
+ +
+
+
+ + + + +