Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
3
3DWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐来柯
3DWeb
Commits
37f7c17c
Commit
37f7c17c
authored
Jan 07, 2022
by
徐来柯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 报警信息
parent
90c8d485
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
12 deletions
+25
-12
index.css
css/index.css
+10
-1
index.html
index.html
+2
-2
index.js
js/index.js
+13
-9
No files found.
css/index.css
View file @
37f7c17c
...
...
@@ -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')
;
...
...
index.html
View file @
37f7c17c
...
...
@@ -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>
...
...
js/index.js
View file @
37f7c17c
...
...
@@ -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
},
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment