@ -13,7 +13,28 @@
< link th:href = "@{/css/fontawesome/all.min.css}" rel = "stylesheet" / >
< link rel = "stylesheet" th:href = "@{/css/main.css}" / >
< link rel = "stylesheet" th:href = "@{/css/autoscroll-table.css}" / >
< link th:href = "@{/css/animate.css}" rel = "stylesheet" / >
< link th:href = "@{/css/style.css}" rel = "stylesheet" / >
< link th:href = "@{/css/skins.css}" rel = "stylesheet" / >
< link th:href = "@{/ruoyi/css/ry-ui.css?v=4.3.1}" rel = "stylesheet" / >
< style type = "text/css" >
* {
padding: 0px;
margin: 0px;
font-family: "微软雅黑";
}
.tipfloat {
display: none;
z-index: 999;
border: 0px #8e9cde solid;
position: absolute;
bottom: 0px;
right: 17px;
width: 268px;
height: auto;
}
< / style >
< style >
#tab-group {
position: absolute;
@ -28,14 +49,32 @@
height: 87%;
}
div::-webkit-scrollbar {
/*滚动条整体样式*/
width: 5px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 1px;
}
div::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 10px;
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #004EA1;
}
div::-webkit-scrollbar-track {
/*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 10px;
background: white;
}
< / style >
< / head >
< body class = "body-bg-1" >
< header >
< header >
< div class = "btn-group section-button-area" id = "section-buttons" >
<!-- <button class="btn section - button">监控主页</button>
< button class = "btn section-button" > 智慧线路< / button >
< button class = "btn section-button" > 分类监测< / button > -->
< / div >
< div class = "main-title" > 智慧物联监控平台< / div >
< div style = "position: absolute ;
@ -45,33 +84,57 @@
top: 3%;
right: 2.7%;">
< div style = "position: absolute;width: 10%;height:100%;right:15%;border: 0px solid yellow;" >
< img onclick = "userInfoOnclick()" th:src = "(${#strings.isEmpty(user.avatar)}) ? @{/img/userInfo.png} : @{${user.avatar}}" th:onerror = "this.src='img/userInfo.png'" alt = "User Image" title = "用户信息" style = "height:80%;width:80%;cursor: pointer;" >
< img onclick = "userInfoOnclick()"
th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/userInfo.png} : @{${user.avatar}}"
th:onerror="this.src='img/userInfo.png'" alt="User Image" title="用户信息"
style="height:80%;width:80%;cursor: pointer;">
< / div >
< div style = "position: absolute;width: 10%;height:100%;right:5%;border: 0px solid yellow;" >
< a th:href = "@{logout}" style = "padding-left:5px;" title = "注销" > < i class = "fa fa-sign-out text-danger" > < / i > < / a >
< / div >
< / div >
< / header >
< / header >
< div class = "nav nav-tabs tab-group" id = "tab-group" >
< div class = "nav nav-tabs tab-group" id = "tab-group" >
< button class = "btn tab-group-item" > 正在加载< i class = "fa-solid fa-times close-btn" > < / i > < / button >
< button class = "btn tab-group-item" > 正在加载< i class = "fa-solid fa-times close-btn" > < / i > < / button >
< button class = "btn tab-group-item" > 正在加载< i class = "fa-solid fa-times close-btn" > < / i > < / button >
< button class = "btn tab-group-item" > 正在加载< i class = "fa-solid fa-times close-btn" > < / i > < / button >
< button class = "btn tab-group-item" > 正在加载< i class = "fa-solid fa-times close-btn" > < / i > < / button >
< / div >
< iframe id = "main-display-frame" > < / iframe >
< div >
<!-- 弹出信息 右下角 -->
< div class = "tipfloat" data-num = "3" style = "background-color: #083E70;color:white" >
< div class = "modal-header" style = "border-color: #1FACF4" >
< h2 class = "modal-title" > 告警提示< / h2 >
< input type = "hidden" id = "alarmuid" name = "alarmuid" >
< / div >
< div class = "modal-body" id = "alarmWindow" style = "height:170px;overflow-y:auto;border-color: red" > < / div >
< div class = "modal-footer" style = "border-color: #1FACF4" >
< button type = "button" onclick = "closeButton()" data-dismiss = "modal"
style="color: black;height: 40px;width: 100px;border-radius: 5px">关闭
< / button >
< button type = "button" onclick = "alarmDispose()"
style="height: 40px;width: 100px;background-color: #1AB394;border-radius: 5px">处理
< / button >
< / div >
< / div >
< iframe id = "main-display-frame" > < / iframe >
<!-- 全局js -->
< script th:src = "@{/js/jquery.min.js}" > < / script >
< script th:src = "@{/js/bootstrap.bundle.min.js}" > < / script >
< script th:src = "@{/js/fontawesome/all.min.js}" > < / script >
< script th:src = "@{/js/autoscroll-table.js}" > < / script >
< script th:src = "@{/js/auto-update.js}" > < / script >
< script th:src = "@{/js/font-adjust.js}" > < / script >
< th:block th:include = "include :: echarts-js" / >
< script th:src = "@{/js/queuing-menu.js}" > < / script >
< script th:inline = "javascript" >
< / div >
<!-- 全局js -->
< script th:src = "@{/js/jquery.min.js}" > < / script >
< script th:src = "@{/js/bootstrap.bundle.min.js}" > < / script >
< script th:src = "@{/js/fontawesome/all.min.js}" > < / script >
< script th:src = "@{/js/autoscroll-table.js}" > < / script >
< script th:src = "@{/js/auto-update.js}" > < / script >
< script th:src = "@{/js/font-adjust.js}" > < / script >
< th:block th:include = "include :: echarts-js" / >
< script th:src = "@{/js/queuing-menu.js}" > < / script >
< script th:src = "@{/js/Iot-ui/MiniDialog-es5.min.js}" > < / script >
< script th:inline = "javascript" >
const pages = [[${menuInfo.url}]];
@ -82,6 +145,7 @@
function switchPage(index, subIndex) {
mainFrame.setAttribute("src", subIndex === -1 ? pages[index] : pages[index][subIndex])
}
function searchPageByPath(pathName) {
for (let entry1 of Object.entries(pages)) {
if (typeof entry1[1] === 'string') {
@ -108,7 +172,7 @@
onRenderMenuItem(parent, index, menuName, submenuNames) {
let html = ''
html += `< button class = "btn section-button ${submenuNames.length > 0 ? " dropdown-toggle " : " " } " id = "section-${index}" data-bs-toggle = "dropdown" aria-expanded = "false" $ { submenuNames . length = == 0 ? " onclick = \"queuingMenu.select(" + index + " , " + -1 + " ) \ " " : " " } > ${menuName}< / button > `
html += `< button class = "btn section-button ${submenuNames.length > 0 ? " dropdown-toggle " : " " } " id = "section-${index}" data-bs-toggle = "dropdown" aria-expanded = "false" $ { submenuNames . length = == 0 ? " onclick = \"queuingMenu.select(" + index + " , " + -1 + " ) \ " " : " " } > ${menuName}< / button > `
if (submenuNames.length > 0) {
html += `< ul class = "dropdown-menu" aria-labelledby = "section-${index}" > `
for (let entry of Object.entries(submenuNames)) {
@ -153,6 +217,7 @@
$(() => {
queuingMenu.select(0, -1)
// queuingMenu.select(1, 1)
})
function resize() {
@ -163,29 +228,109 @@
$(() => {
resize()
})
< / script >
< / script >
< script type = "text/javascript" >
< script type = "text/javascript" >
/*function myClick(hre) {
let num = new Object;
num.cp_keynum = "wisdmoScenario_Key";
num.cp_num_value = hre;
var str = JSON.stringify(num); // 将对象转换为字符串
localStorage.setItem(num.cp_keynum, str);
function userInfoOnclick() {
location.href = '/indexInfo/index';
}
function buttonClick(href) {
let num = new Object;
num.cp_keynum = "wisdmoScenario_Key";
num.cp_num_value = href.innerText;
var str = JSON.stringify(num); // 将对象转换为字符串
localStorage.setItem(num.cp_keynum, str);
}*/
const getAlarmWindow = function () {
$.ajax({
url: "/iot/wisdomScenario/getAlarmWindow",
type: "get",
dataType: 'JSON',
async: false,
success: (res) => {
if (res.length > 0) {
$("#alarmWindow").html("");
function userInfoOnclick() {
location.href = '/indexInfo/index';
let html = `< h3 > 告警位置: ${res[0].sensorLocation}< / h3 >
< h3 > 告警时间: ${res[0].collectTime}< / h3 >
< h3 > 告警信息: ${"无线检测 相对检测值为:" + res[0].minValue + "-" + res[0].maxValue + ",其值为:" + res[0].alarmValue}< / h3 > `
$("#alarmWindow").append(html);
$("#alarmuid").val(res[0].alarmuid);
showToggle();
}
},
error: () => {
console.log("失败");
}
})
}
setInterval(`getAlarmWindow()`, 1000 * 20);
const showToggle = function () {
$(".tipfloat").animate({height: "show"}, 800);
setTimeout(`$(".tipfloat").animate({height: "hide"}, 800)`, 8000);
}
function closeButton() {
$(".tipfloat").animate({height: "hide"}, 800);
}
function closeIcon() {
$(".tipfloat").animate({height: "hide"}, 800);
}
const alarmDispose = function () {
$.getJSON('/iot/wisdomScenario/getAlarmByUid?alarmuid=' + $("#alarmuid").val(), function (result) {
alarmDisposeInfo(result);
})
}
const alarmDisposeInfo = function (res) {
let html = `< div >
< p style = "margin-top: 13px;" >
< label > 告警编号:${res.alarmuid}< / label >
< / p >
< p style = "margin-top: 13px;" >
< label > 告警信息:${"无线检测相对检测值为:" + res.minValue + "-" + res.maxValue + ",实际值为:" + res.alarmValue}< / label >
< / p >
< p style = "margin-top: 13px;" >
< label > 告警原因< / label >
< input type = "text" name = "alarmReason" id = "alarmReason" style = "width: 70%;" >
< / p >
< p style = "margin-top: 13px;" >
< label > 处理方式< / label >
< input type = "text" name = "disposeMode" id = "disposeMode" style = "width: 70%;" >
< / p >
< / div > `
Dialog({
title: "告警处理",
width: 600,
content: html,
ok: {
callback: function () {
$.post("/iot/wisdomScenario/disposeAlarm",
{
alarmuid: res.alarmuid,
disposeMode: $("#disposeMode").val(),
alarmReason: $("#alarmReason").val()
},
function (data, status) {
// alert(+status.includes("succ") ? "告警处理成功" : "告警处理失败");
});
}
}
< / script >
});
}
< / script >
< / body >
< style type = "text/css" >
.mini-dialog-footer {
text-align: right;
height: 34px;
padding: 1px 0;
border-top: #e6e6e6 solid 1px;
}
< / style >
< / html >