Merge branch 'master' of http://192.168.0.75:3000/cwchen/ah_jjzhgd_webscreen
This commit is contained in:
commit
45182ab033
|
|
@ -182,6 +182,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 +305,7 @@
|
|||
|
||||
function insetLatest(data) {
|
||||
const container = document.getElementById('progress-container');
|
||||
container.innerHTML = ''; // 🔄 清空原有内容
|
||||
data.map(item => {
|
||||
const block = document.createElement('div');
|
||||
block.innerHTML = `
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -62,39 +62,53 @@
|
|||
|
||||
<div class="info-item">
|
||||
<div class="info-label">异常类型</div>
|
||||
<div class="info-value" id="anomalyDesc">设备过载能耗</div>
|
||||
<div class="info-value" id="anomalyDesc">加载中...</div>
|
||||
</div>
|
||||
|
||||
<div class="info-item">
|
||||
<div class="info-label">异常时段</div>
|
||||
<div class="info-value">13:00 - 14:30</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">检查设备运行负荷,适当分配工作任务。</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){
|
||||
function setParams(data) {
|
||||
let item = JSON.parse(data);
|
||||
console.log(data);
|
||||
document.getElementById('device-name').innerText = item.deviceName;
|
||||
document.getElementById('abnormal-date').innerText = item.statDate;
|
||||
document.getElementById('anomalyDesc').innerText = item.anomalyDesc;
|
||||
document.getElementById('time-range').innerText = `${item.lastRecordDate} - ${item.statDate}`;
|
||||
|
||||
|
||||
// 根据异常类型填充建议措施
|
||||
const advice = adviceMap[item.anomalyDesc] || '建议进一步检查设备状态或联系技术人员。';
|
||||
document.getElementById('advice').innerText = advice;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 示例调用(正式使用时替换 data 参数)
|
||||
// setParams(JSON.stringify({
|
||||
// deviceName: "空调1号",
|
||||
// statDate: "2025-07-24",
|
||||
// anomalyDesc: "设备过载能耗"
|
||||
// }));
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Reference in New Issue