114 lines
3.4 KiB
HTML
114 lines
3.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>能耗异常详细分析</title>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/layui@2.8.18/dist/css/layui.css">
|
|
<script src="https://cdn.jsdelivr.net/npm/layui@2.8.18/dist/layui.js"></script>
|
|
<style>
|
|
body {
|
|
background-color: transparent;
|
|
color: #FFFFFF;
|
|
padding: 30px;
|
|
font-family: "Microsoft YaHei", sans-serif;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.card {
|
|
border-radius: 12px;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.card-title {
|
|
font-size: 24px;
|
|
font-weight: bold;
|
|
margin-bottom: 20px;
|
|
border-left: 6px solid #16baaa;
|
|
padding-left: 12px;
|
|
}
|
|
|
|
.info-item {
|
|
display: flex;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.info-label {
|
|
width: 100px;
|
|
font-weight: bold;
|
|
color: #cccccc;
|
|
}
|
|
|
|
.info-value {
|
|
flex: 1;
|
|
color: #ffffff;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="card">
|
|
|
|
<div class="info-item">
|
|
<div class="info-label">设备名称</div>
|
|
<div class="info-value" id="device-name">加载中...</div>
|
|
</div>
|
|
|
|
<div class="info-item">
|
|
<div class="info-label">异常日期</div>
|
|
<div class="info-value" id="abnormal-date">加载中...</div>
|
|
</div>
|
|
|
|
<div class="info-item">
|
|
<div class="info-label">异常描述</div>
|
|
<div class="info-value" id="anomalyDesc">加载中...</div>
|
|
</div>
|
|
|
|
<div class="info-item">
|
|
<div class="info-label">异常时段</div>
|
|
<div class="info-value" id="time-range">13:00 - 14:30</div>
|
|
</div>
|
|
|
|
<div class="info-item">
|
|
<div class="info-label">建议措施</div>
|
|
<div class="info-value" id="advice">加载中...</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
const adviceMap = {
|
|
'设备过载能耗': '检查设备运行负荷,适当分配工作任务,避免长时间高负荷运行。',
|
|
'能耗异常': '立即核查相关设备运行状态,排查是否存在故障或人为干预因素。',
|
|
'轻微异常': '持续观察能耗变化,记录趋势并安排定期巡检。',
|
|
};
|
|
|
|
// 从 URL 获取参数
|
|
function getQueryParam(param) {
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
return urlParams.get(param);
|
|
}
|
|
|
|
function setParams(data) {
|
|
let item = JSON.parse(data);
|
|
document.getElementById('device-name').innerText = item.deviceName;
|
|
document.getElementById('abnormal-date').innerText = item.statDate.split(' ')[0];
|
|
document.getElementById('anomalyDesc').innerText = item.anomalyDesc;
|
|
document.getElementById('time-range').innerText = `${item.lastRecordDate.split(' ')[1]} - ${item.statDate.split(' ')[1]}`;
|
|
|
|
|
|
// 根据异常类型填充建议措施
|
|
const advice = adviceMap[item.anomalyDesc] || '建议进一步检查设备状态或联系技术人员。';
|
|
document.getElementById('advice').innerText = advice;
|
|
}
|
|
|
|
// 示例调用(正式使用时替换 data 参数)
|
|
// setParams(JSON.stringify({
|
|
// deviceName: "空调1号",
|
|
// statDate: "2025-07-24",
|
|
// anomalyDesc: "设备过载能耗"
|
|
// }));
|
|
</script>
|
|
</body>
|
|
</html>
|