change - 告警详情、设备监测图像信息点击放大处理

main
wenjy 3 years ago
parent 031a937242
commit 68704a67b6

@ -63,12 +63,12 @@ const createDeviceModule = function (sensor,params) {
break; break;
case "image": case "image":
html += '<div onclick="imgOnclick(this)" style="position: absolute;width: 100%;height: 100%;border: 0px solid red">'; html += '<div style="position: absolute;width: 100%;height: 100%;border: 0px solid red">';
/*&nbsp;&nbsp;<span id=${sensor.sensorId+"sensorStatus"}>${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}</span>*/ /*&nbsp;&nbsp;<span id=${sensor.sensorId+"sensorStatus"}>${sensor['sensorStatus'] == null ? "-" : sensorStatus(sensor['sensorStatus'])}</span>*/
html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;border:0px solid #00f9ff;height: 15%;display: flex;align-items: center;">${sensor.sensorName}</div>` html += `<div style="padding-left: 20px;padding-top: 10px;font-size: 105%;color: #00f9ff;width: 100%;border:0px solid #00f9ff;height: 15%;display: flex;align-items: center;">${sensor.sensorName}</div>`
html += '<div class="example" style="position: absolute;height: 80%;width: 52%;border-right: 1px dashed #1CA2E7;left: 1%;display: flex;align-items: center;justify-content: center;">'; html += '<div class="example" style="position: absolute;height: 80%;width: 52%;border-right: 1px dashed #1CA2E7;left: 1%;display: flex;align-items: center;justify-content: center;">';
let imgurl = sensor.imgstr.replace("D:/ruoyi/uploadPath","/profile"); let imgurl = sensor.imgstr.replace("D:/ruoyi/uploadPath","/profile");
html += '<img id="'+sensor.sensorId+"imgstr"+'" src="'+imgurl+'" display="inline-block" vertical-align="middle" width="100%" height="80%">' html += '<img id="'+sensor.sensorId+"imgstr"+'" src="'+imgurl+'" onclick="imgOnclick(this)" display="inline-block" vertical-align="middle" width="100%" height="80%">'
html += '</div>' html += '</div>'
html += '<div style="position: absolute;width: 45%;height: 80%;border: 0px dashed #1CA2E7;right:0%;overflow-x: hidden; overflow-y: auto;">'; html += '<div style="position: absolute;width: 45%;height: 80%;border: 0px dashed #1CA2E7;right:0%;overflow-x: hidden; overflow-y: auto;">';
html += `<p style="padding-top: 1px;font-size: 105%;color: #00f9ff;width: 100%;" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`; html += `<p style="padding-top: 1px;font-size: 105%;color: #00f9ff;width: 100%;" id=${sensor.sensorId+"collectTime"}>${sensor['collectTime'] == null ? "-" : collectTime(sensor['collectTime'])}</p>`;
@ -124,7 +124,17 @@ const createDeviceModule = function (sensor,params) {
} }
const imgOnclick = function (com) { const imgOnclick = function (com) {
/*$("#imgWindow").append(com)*/ Dialog({
title: '图像详情',
width: 600,
imageContent: {
src: com.src,
height: 480
},
showButton: false,
showTitle: true,
maskClose: true
});
} }
const collectTime = function (time){ const collectTime = function (time){

@ -307,7 +307,7 @@
width: ['10%', '10%', '10%', '30%', '10%', '10%', '10%'], width: ['10%', '10%', '10%', '30%', '10%', '10%', '10%'],
}) })
//获取告警信息 //获取告警单元模块信息
const alarmInfo = function () { const alarmInfo = function () {
$.ajax({ $.ajax({
url: "/iot/wisdomScenario/getAlarmInfo?monitorUnitId=" + getParams("id"), url: "/iot/wisdomScenario/getAlarmInfo?monitorUnitId=" + getParams("id"),
@ -316,7 +316,7 @@
success: (res) => { success: (res) => {
console.log("告警信息:" + res); console.log("告警信息:" + res);
alertList.loadData(res.map(value => [value.alarmModuleId.substring(0, 2) + "...", value.alarmModuleText, value.sensorLocation, `${"无线检测 相对检测值为:" + value.minValue + "-" + value.maxValue + ",其值为:" + value.alarmValue}`, "超限", value.collectTime, `${value.disposeFlag == 1 ? '<button class="text-success">已处理</button>' : '<button id="' + value.alarmuid + '" onclick="alarmDispose(this.id)" class="text-danger">未处理</button>'}`]), Object.keys(alertListColumns)) alertList.loadData(res.map(value => [value.alarmModuleId.substring(0, 2) + "...", value.alarmModuleText, value.sensorLocation, `${"无线检测 相对检测值为:" + value.minValue + "-" + value.maxValue + ",其值为:" + value.alarmValue}`, "超限", value.collectTime, `${value.disposeFlag == 1 ? '<button class="text-success" id="' + value.alarmuid + '" onclick="disposeInfo(this.id)">已处理</button>' : '<button id="' + value.alarmuid + '" onclick="alarmDispose(this.id)" class="text-danger">未处理</button>'}`]), Object.keys(alertListColumns))
}, },
error: () => { error: () => {
@ -341,6 +341,37 @@
}) })
} }
const disposeInfo = function (res) {
$.getJSON('/iot/wisdomScenario/getAlarmByUid?alarmuid=' + res, function (result) {
let html = `<div>
<p style="margin-top: 13px;">
<label>告警编号:${result.alarmuid}</label>
</p>
<p style="margin-top: 13px;">
<label>告警信息:${"无线检测相对检测值为:" + result.minValue + "-" + result.maxValue + ",实际值为:" + result.alarmValue}</label>
</p>
<p style="margin-top: 13px;">
<label>告警原因</label>
<input type="text" name="alarmReason" id="alarmReason" style="width: 70%;" readonly value=${result.alarmReason} >
</p>
<p style="margin-top: 13px;">
<label>处理方式</label>
<input type="text" name="disposeMode" id="disposeMode" style="width: 70%;" readonly value=${result.disposeMode} >
</p>
</div>`
Dialog({
title: "处理详情",
width: 600,
content: html,
ok: {
callback: function () {
}
}
});
})
}
const alarmDisposeInfo = function (res) { const alarmDisposeInfo = function (res) {
let html = `<div> let html = `<div>
<p style="margin-top: 13px;"> <p style="margin-top: 13px;">
@ -384,7 +415,6 @@
} }
}); });
} }
</script> </script>
<script type="text/javascript"> <script type="text/javascript">

@ -396,6 +396,7 @@
<script th:src="@{/ajax/libs/bootstrap-table/extensions/treeview/bootstrap-treeview.min.js}" <script th:src="@{/ajax/libs/bootstrap-table/extensions/treeview/bootstrap-treeview.min.js}"
src="../../static/ajax/libs/bootstrap-table/extensions/treeview/bootstrap-treeview.min.js"></script> src="../../static/ajax/libs/bootstrap-table/extensions/treeview/bootstrap-treeview.min.js"></script>
<script th:src="@{/js/Iot-ui/deviceMonitor.js}"></script> <script th:src="@{/js/Iot-ui/deviceMonitor.js}"></script>
<script th:src="@{/js/Iot-ui/MiniDialog-es5.min.js}"></script>
</head> </head>
<body class="body-transformer-detail1"> <body class="body-transformer-detail1">
<div id="company-name" style="left: 0.7%;width:12.6%;top: 1%;height:5.6%;"> <div id="company-name" style="left: 0.7%;width:12.6%;top: 1%;height:5.6%;">

Loading…
Cancel
Save