Commit 37f7c17c authored by 徐来柯's avatar 徐来柯

update 报警信息

parent 90c8d485
......@@ -160,13 +160,22 @@ body {
height: 26px;
line-height: 26px;
margin-top: 12px;
width: 100%;
width: 230px;
border-bottom: 1px dashed rgba(26, 202, 204, 0.4);
background: url('../imgs/灯@2x.png') no-repeat;
background-size: 8% 100%;
font-size: 12px;
padding-left: 50px;
white-space: nowrap;
cursor: pointer;
position: relative;
}
.list span {
display: inline-block;
box-sizing: border-box;
overflow: hidden;
text-overflow:ellipsis;
width: 100%;
}
.list_blue {
background: url('../imgs/Normal1@2x.png');
......
......@@ -84,7 +84,7 @@
</div>
<div class="item_wrap item_alarm_wrap" id="alarm" >
<!-- 渲染报警信息 -->
<div class="list">
<!-- <div class="list">
<span>2021-11-11 12:36:30 越限报警越限报警...</span>
</div>
<div class="list list_blue">
......@@ -93,7 +93,7 @@
<div class="list list_red">
<span>2021-11-11 12:36:30 越限报警越限报警...</span>
</div>
</div> -->
</div>
</div>
......
......@@ -545,24 +545,28 @@ function getRight2() {
/* 右侧第三个 */
getRight3()
setInterval(() => {
getRight3()
}, 1000)
function getRight3() {
let alarm = document.getElementById('alarm')
let alarmData = document.getElementById('alarmData')
let count = 0
let items = []
$.ajax({
type :"POST",
url : baseUrl + "/HMI/HMI_GstAlarms",
dataType :"json",
contentType: "application/json",
data: JSON.stringify({Lang: 'Main_Language_ZH', AlarmFormat: '报警时间 报警文本', Variables: ["ALARM1","ALARM2"] }),
// '【报警时间】【报警变量】【报警地址】【报警类别】【报警组】【报警设备】【报警文本】【报警值】'
data: JSON.stringify({Lang: 'Main_Language_ZH', AlarmFormat: '【报警时间】【报警变量】【报警地址】【报警类别】【报警组】【报警设备】【报警文本】', Variables: ["A1", "B1", "E1", "G1", "in_A1", "in_B1", "in_E1", "in_G1"] }),
success :function(res) {
console.log(res.data)
debugger
// let items = res.data.map(item => ({
// Date: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
// ...item
// }))
alarmData.innerText = res.data.length
let str = ``
res.data.forEach(item => {
str += `<div class="list list_red">
<span>${item.Info}</span>
</div>`
})
alarm.innerHTML = str
},
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment