diff --git a/js/pages/newDataAnalysis/engineeringSafetyAnalysis.js b/js/pages/newDataAnalysis/engineeringSafetyAnalysis.js index f458ce7..b9acf27 100644 --- a/js/pages/newDataAnalysis/engineeringSafetyAnalysis.js +++ b/js/pages/newDataAnalysis/engineeringSafetyAnalysis.js @@ -18,7 +18,7 @@ function initTable(bidCode,name) { id: 'demo2', skin: 'line', page: true, - height: 'full-400', + height: 'full-410', headers: { "decrypt": "decrypt", "Authorization": token @@ -27,24 +27,18 @@ function initTable(bidCode,name) { bidCode: bidCode, name:name }, - response: { - statusName: "code", - statusCode: 200, - countName: "count", - dataName: "rows", - }, cols: [[ { type: 'numbers', title: '序号', width: '10%' }, // 添加序号列 { field: 'proName', title: '工程名称', align: 'center', width: '10%' }, { 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 +155,7 @@ function initEchartsOne(data) { data: dates, axisLabel: { color: "#fff", // X轴标签白色 + fontSize: 10, }, axisLine: { lineStyle: { @@ -260,11 +255,53 @@ 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({ + type: 2, + title: "监测点", + content: "environmentalReadings.html", + area: ["80%", "80%"], + shade: 0.3, // 遮罩透明度 + skin: "custom-layer-style", // 自定义皮肤 + success: function (layero, index) { + // 修改弹框背景颜色 + $(layero).css( + "background", + "rgba(13, 34, 37, 0.9)" + ); // 半透明黑色背景 + $(layero).find(".layui-layer-title").css({ + color: "#fff", // 标题文字颜色 + background: "transparent", // 标题背景透明 + "border-bottom": + "1px solid rgba(255, 255, 255, 0.2)", // 标题底部边框 + }); + $(layero).find(".layui-layer-content").css({ + background: "transparent", // 内容区域透明 + }); + + $(layero) + .find(".layui-layer-setwin .layui-layer-close") + .css({ + color: "#fff", // 文字颜色 + "border-color": "#fff", // 边框颜色(如果按钮有边框) + }); + }, + }); +} + function initEchartsTwo(data) { @@ -314,6 +351,51 @@ function initEchartsTwo(data) { ] } myChart2.setOption(riskOption, true) + + // 添加点击事件监听器 + myChart2.on('click', function (params) { + if (params.componentType === 'series') { + hiddenDanger() + } + }); +} + +function hiddenDanger() { + layer.open({ + type: 2, + title: "监测点", + content: "hiddenDanger.html", + area: ["80%", "80%"], + shade: 0.3, // 遮罩透明度 + skin: "custom-layer-style", // 自定义皮肤 + success: function (layero, index) { + // 修改弹框背景颜色 + $(layero).css( + "background", + "rgba(13, 34, 37, 0.9)" + ); // 半透明黑色背景 + $(layero).find(".layui-layer-title").css({ + color: "#fff", // 标题文字颜色 + background: "transparent", // 标题背景透明 + "border-bottom": + "1px solid rgba(255, 255, 255, 0.2)", // 标题底部边框 + }); + $(layero).find(".layui-layer-content").css({ + background: "transparent", // 内容区域透明 + }); + + $(layero) + .find(".layui-layer-setwin .layui-layer-close") + .css({ + color: "#fff", // 文字颜色 + "border-color": "#fff", // 边框颜色(如果按钮有边框) + }); + // 获取弹出层内容区域的高度 + var contentHeight = $(layero).find('.layui-layer-content').height(); + // 设置表格的高度 + $('#dangerTable').css('height', contentHeight + 'px'); + }, + }); } function handlDetails(analysisReason){ diff --git a/js/pages/newDataAnalysis/environmentalReadings.js b/js/pages/newDataAnalysis/environmentalReadings.js new file mode 100644 index 0000000..d14604f --- /dev/null +++ b/js/pages/newDataAnalysis/environmentalReadings.js @@ -0,0 +1,55 @@ +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, + headers: { + "decrypt": "decrypt", + "Authorization": token + }, + where: { + bidCode: bidCode, + name:name + }, + 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.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..474fc79 --- /dev/null +++ b/js/pages/newDataAnalysis/hiddenDanger.js @@ -0,0 +1,54 @@ +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 + }, + 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.parent.$('#bidPro').val() + initTable(bidCode,name); +} diff --git a/js/pages/newDataAnalysis/proQualityAnalysis.js b/js/pages/newDataAnalysis/proQualityAnalysis.js index 28e594d..c57e0d8 100644 --- a/js/pages/newDataAnalysis/proQualityAnalysis.js +++ b/js/pages/newDataAnalysis/proQualityAnalysis.js @@ -16,7 +16,7 @@ layui.use(["layer", "table", "form"], function () { }; }, }); - initTable(1, parent.$("#bidPro").val()); + initTable(1, parent.parent.$("#bidPro").val()); }); /* 切换数据 */ @@ -156,10 +156,6 @@ function initTable(type, bidCode) { return [ { type: "numbers", title: "序号", width: "10%" }, // 添加序号列 { field: "projectName", title: "工程名称", align: "center" }, - // { field: 'projectNumber', title: '工程编号', align: 'center'}, - // { field: 'projectAddress', title: '项目地址', align: 'center'}, - // { field: 'contractorName', title: '承包商名称', align: 'center',}, - // { field: 'qualityLevel', title: '质量等级', align: 'center'}, { field: "projectManager", title: "项目经理", align: "center" }, { field: "team", title: "施工队伍", align: "center" }, { field: "startTime", title: "开始时间", align: "center" }, @@ -206,7 +202,7 @@ layui.use('upload', function () { // 执行上传 upload.render({ elem: '#uploadBtn', // 绑定元素 - url: commonUrl + "screen/largeScreen/dataAnalysis/uploadProQuality", + url: commonUrl + "screen/largeScreen/dataAnalysis/uploadProQualityFile", accept: 'file', // 允许上传任意文件 exts: 'docx', // 允许的文件类型 size: 1024 * 10, // 限制文件大小,单位 KB(10MB) @@ -223,9 +219,7 @@ layui.use('upload', function () { layer.closeAll('loading'); layer.msg('上传成功'); console.log('服务器返回:', res); - - // 显示文件名或路径 - document.getElementById('fileName').innerText = '已上传文件:' + res.fileName; + parent.location.reload(); // 刷新父页面 }, error: function () { // 上传失败回调 diff --git a/js/pages/newDataAnalysis/projectProgress.js b/js/pages/newDataAnalysis/projectProgress.js index 16f68e1..2b57d8a 100644 --- a/js/pages/newDataAnalysis/projectProgress.js +++ b/js/pages/newDataAnalysis/projectProgress.js @@ -29,7 +29,7 @@ function setCols(type) { { title: "延误因素分析", align: "center", - templet: (d) => { + templet: (d, index) => { let text = ""; text += '查看'; @@ -144,8 +144,8 @@ function initTable(type, bidCode) { $(".layui-table-body table.layui-table tbody tr #viewBtn").on( "click", function () { - // 获取当前行的数据 - var index = $(this).index(); + const index = $(this).closest("tr").data("index"); + console.log(index, "index"); var rowData = res.rows[index]; // 获取对应行的数据 // 弹框配置 diff --git a/pages/newDataAnalysis/energySavingAnalysis.html b/pages/newDataAnalysis/energySavingAnalysis.html index 585c776..3778659 100644 --- a/pages/newDataAnalysis/energySavingAnalysis.html +++ b/pages/newDataAnalysis/energySavingAnalysis.html @@ -81,6 +81,10 @@ color: #FFFFFF; } + .layui-layer-title { + border-bottom: 1px solid #008781; + } + #alarm-container { overflow-x: auto; /* 或 overflow-y: auto,根据需要 */ @@ -182,6 +186,7 @@ laydate.render({ elem: '#ID-laydate-range', range: ['#ID-laydate-start-date', '#ID-laydate-end-date'], + btns: ['confirm'], value: range.startDate + ' - ' + range.endDate, done: function (value) { // value 是选择的字符串,比如 '2025-06-23 - 2025-07-23' @@ -304,6 +309,7 @@ function insetLatest(data) { const container = document.getElementById('progress-container'); + container.innerHTML = ''; // 🔄 清空原有内容 data.map(item => { const block = document.createElement('div'); block.innerHTML = ` diff --git a/pages/newDataAnalysis/environmentalReadings.html b/pages/newDataAnalysis/environmentalReadings.html new file mode 100644 index 0000000..1ef6a79 --- /dev/null +++ b/pages/newDataAnalysis/environmentalReadings.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + 工程安全分析-左边echarts + + + +
+
+ +
+
+
+
+
+ + + + + diff --git a/pages/newDataAnalysis/exception-detail.html b/pages/newDataAnalysis/exception-detail.html index cceeb53..23ad64a 100644 --- a/pages/newDataAnalysis/exception-detail.html +++ b/pages/newDataAnalysis/exception-detail.html @@ -16,7 +16,7 @@ .card { border-radius: 12px; - box-shadow: 0 2px 8px rgba(0,0,0,0.2); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); max-width: 600px; margin: 0 auto; } @@ -61,40 +61,54 @@
-
异常类型
-
设备过载能耗
+
异常描述
+
加载中...
异常时段
-
13:00 - 14:30
+
13:00 - 14:30
建议措施
-
检查设备运行负荷,适当分配工作任务。
+
加载中...
diff --git a/pages/newDataAnalysis/hiddenDanger.html b/pages/newDataAnalysis/hiddenDanger.html new file mode 100644 index 0000000..3235f59 --- /dev/null +++ b/pages/newDataAnalysis/hiddenDanger.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + 工程安全分析-左边echarts + + + +
+
+ +
+
+
+
+
+ + + + + diff --git a/pages/newDataAnalysis/proQualityAnalysis.html b/pages/newDataAnalysis/proQualityAnalysis.html index 8089f6a..3e8a3fb 100644 --- a/pages/newDataAnalysis/proQualityAnalysis.html +++ b/pages/newDataAnalysis/proQualityAnalysis.html @@ -33,7 +33,7 @@
- +