Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bi
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
张苑
bi
Commits
b9116814
Commit
b9116814
authored
Sep 24, 2021
by
莫坚培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 圆形状态灯渲染完成
parent
d6c350d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
dashboard.js
js/dashboard.js
+12
-10
No files found.
js/dashboard.js
View file @
b9116814
...
@@ -976,7 +976,9 @@ function renderRequestLoopData(poolData, resData) {
...
@@ -976,7 +976,9 @@ function renderRequestLoopData(poolData, resData) {
// 读写框
// 读写框
rwtextbox
:
()
=>
loopRenderDatatextblock
(
poolData
,
resData
,
'rwtextbox'
),
rwtextbox
:
()
=>
loopRenderDatatextblock
(
poolData
,
resData
,
'rwtextbox'
),
// 矩形状态灯
// 矩形状态灯
commonlamp
:
()
=>
loopRenderCommonlamp
(
poolData
,
resData
),
commonlamp
:
()
=>
loopRenderLamp
(
poolData
,
resData
,
'commonlamp'
),
// 圆形状态灯
ellipselamp
:
()
=>
loopRenderLamp
(
poolData
,
resData
,
'ellipselamp'
),
}
}
ControlTypeMap
[
poolData
.
ControlType
]
&&
ControlTypeMap
[
poolData
.
ControlType
]()
ControlTypeMap
[
poolData
.
ControlType
]
&&
ControlTypeMap
[
poolData
.
ControlType
]()
}
}
...
@@ -1021,15 +1023,15 @@ function loopRenderDatatextblock(poolData, resData, label) {
...
@@ -1021,15 +1023,15 @@ function loopRenderDatatextblock(poolData, resData, label) {
}
}
}
}
// 渲染矩形状态灯
// 渲染矩形
、圆形状态灯 label: commonlamp矩形状态灯 ellipselamp圆形
状态灯
function
loopRender
Commonlamp
(
poolData
,
resData
)
{
function
loopRender
Lamp
(
poolData
,
resData
,
label
)
{
console
.
log
(
'矩形灯'
,
poolData
,
resData
)
console
.
log
(
`
${
label
===
'ellipselamp'
?
'圆形状态灯'
:
'矩形状态灯'
}
`
,
poolData
,
resData
)
// 给默认颜色、闪烁
// 给默认颜色、闪烁
$
(
`#
commonlamp
${
poolData
.
dataPoolMapIndex
}
`
).
css
(
'background-color'
,
poolData
.
DefaultColor
)
$
(
`#
${
label
}
${
poolData
.
dataPoolMapIndex
}
`
).
css
(
'background-color'
,
poolData
.
DefaultColor
)
if
(
poolData
.
DefaultFlashing
)
{
// 默认闪烁
if
(
poolData
.
DefaultFlashing
)
{
// 默认闪烁
$
(
`#
commonlamp
${
poolData
.
dataPoolMapIndex
}
`
).
addClass
(
'animated-flash'
)
$
(
`#
${
label
}
${
poolData
.
dataPoolMapIndex
}
`
).
addClass
(
'animated-flash'
)
}
else
{
}
else
{
$
(
`#
commonlamp
${
poolData
.
dataPoolMapIndex
}
`
).
removeClass
(
'animated-flash'
)
$
(
`#
${
label
}
${
poolData
.
dataPoolMapIndex
}
`
).
removeClass
(
'animated-flash'
)
}
}
let
flagItem
=
poolData
.
DataList
.
find
((
item
,
index
)
=>
{
let
flagItem
=
poolData
.
DataList
.
find
((
item
,
index
)
=>
{
...
@@ -1056,11 +1058,11 @@ function loopRenderCommonlamp(poolData, resData) {
...
@@ -1056,11 +1058,11 @@ function loopRenderCommonlamp(poolData, resData) {
return
return
}
}
// 只要有一个满足条件,则渲染该条件的颜色
// 只要有一个满足条件,则渲染该条件的颜色
$
(
`#
commonlamp
${
poolData
.
dataPoolMapIndex
}
`
).
css
(
'background-color'
,
flagItem
.
backColor
)
$
(
`#
${
label
}
${
poolData
.
dataPoolMapIndex
}
`
).
css
(
'background-color'
,
flagItem
.
backColor
)
if
(
flagItem
.
flashing
)
{
if
(
flagItem
.
flashing
)
{
$
(
`#
commonlamp
${
poolData
.
dataPoolMapIndex
}
`
).
addClass
(
'animated-flash'
)
$
(
`#
${
label
}
${
poolData
.
dataPoolMapIndex
}
`
).
addClass
(
'animated-flash'
)
}
else
{
}
else
{
$
(
`#
commonlamp
${
poolData
.
dataPoolMapIndex
}
`
).
removeClass
(
'animated-flash'
)
$
(
`#
${
label
}
${
poolData
.
dataPoolMapIndex
}
`
).
removeClass
(
'animated-flash'
)
}
}
}
}
...
...
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