工程安全分析

This commit is contained in:
lSun 2025-07-24 13:14:27 +08:00
parent a7811563df
commit 89051daf80
1 changed files with 72 additions and 6 deletions

View File

@ -35,14 +35,16 @@ function initTable(bidCode,name) {
},
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: '20%' },
{ field: 'temperature', title: '当前温度', align: 'center', width: '10%' },
{ field: 'humidity', title: '当前湿度', align: 'center', width: '10%' },
{ field: 'windSpeed', title: '当前风速', align: 'center', width: '10%' },
{ field: 'gasValue', 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: 'rateLevel', title: '最高隐患等级', align: 'center', width: '20%',
field: 'rateLevel', title: '最高隐患等级', align: 'center', width: '10%',
templet: function (d) {
let color = '';
if (d.level == "一般隐患") {
@ -54,6 +56,14 @@ function initTable(bidCode,name) {
}
return '<p style="color:' + color + '">' + d.level + '</p>';
}
},
{
title: "操作",
align: "center",
width: '8%',
templet: function (row) {
return `<span onclick="handlDetails('${row.analysisReason}')" style="background-color: #16BAAA;border: 2px solid #16BAAA;cursor:pointer; "> 分析与改进</span>`
},
}
]],
initComplete: function () {
@ -305,3 +315,59 @@ function initEchartsTwo(data) {
}
myChart2.setOption(riskOption, true)
}
function handlDetails(analysisReason){
// 分离原因分析和改进措施
const [reason, measure] = analysisReason.match(/原因分析:(.*)。改进措施:(.*)/).slice(1);
// 创建一个包含分析原因及改进措施的HTML结构
const content = `
<div style="width: 100%; height: 100%; display: flex; flex-direction: column;">
<div style="flex: 1; padding: 20px; background: transparent; border-radius: 8px; margin-bottom: 20px;">
<h3 style="margin-bottom: 10px; color: #fff;">分析原因及改进措施</h3>
<div style="display: flex; flex-direction: column;">
<div style="margin-bottom: 10px;">
<span style="font-weight: bold; color: #CFD3D4;">原因分析</span>
<span style="color: #fff;">${reason}</span>
</div>
<div>
<span style="font-weight: bold; color: #CFD3D4;">改进措施</span>
<span style="color: #fff;">${measure}</span>
</div>
</div>
</div>
<div id='oneEcharts' style='width: 100%; height: 400px;'></div>
</div>
`;
layer.open({
type: 1,
title: "分析原因及改进措施",
content: content,
area: ["400px", "300px"],
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", // 边框颜色(如果按钮有边框)
});
},
});
}