Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
event-analysis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
崔义雄
event-analysis
Commits
fcc523a1
Commit
fcc523a1
authored
May 31, 2020
by
cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预警统计逻辑修改
parent
30c76b98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
19 deletions
+40
-19
event_analysis/views.py
event_analysis/views.py
+38
-17
templates/event_analysis/alarm_count.html
templates/event_analysis/alarm_count.html
+2
-2
No files found.
event_analysis/views.py
View file @
fcc523a1
...
@@ -2611,7 +2611,8 @@ def alarm_count_info(request):
...
@@ -2611,7 +2611,8 @@ def alarm_count_info(request):
for
sys
in
sysList
:
for
sys
in
sysList
:
for
i
in
alarm_list_all
:
for
i
in
alarm_list_all
:
if
sys
in
eval
(
i
.
alarm_system
):
if
sys
in
eval
(
i
.
alarm_system
):
new_list
.
append
(
i
)
if
i
not
in
new_list
:
new_list
.
append
(
i
)
alarm_list
=
new_list
alarm_list
=
new_list
else
:
else
:
alarm_list
=
alarm_list_all
alarm_list
=
alarm_list_all
...
@@ -2620,23 +2621,43 @@ def alarm_count_info(request):
...
@@ -2620,23 +2621,43 @@ def alarm_count_info(request):
sys_list
=
eval
(
alarm
.
alarm_system
)
sys_list
=
eval
(
alarm
.
alarm_system
)
for
sys
in
sys_list
:
for
sys
in
sys_list
:
sys
=
sys
.
decode
(
'utf-8'
)
sys
=
sys
.
decode
(
'utf-8'
)
if
result
.
has_key
(
sys
):
if
sysList
:
pass
if
sys
in
sysList
:
else
:
if
result
.
has_key
(
sys
):
result
[
sys
]
=
{
'bad_work'
:
0
,
'main_work'
:
0
,
'normal_work'
:
0
,
pass
else
:
result
[
sys
]
=
{
'bad_work'
:
0
,
'main_work'
:
0
,
'normal_work'
:
0
,
'bad_weekend'
:
0
,
'main_weekend'
:
0
,
'normal_weekend'
:
0
}
'bad_weekend'
:
0
,
'main_weekend'
:
0
,
'normal_weekend'
:
0
}
if
alarm
.
alarm_level
==
u'严重'
and
alarm
.
if_workday
==
u'3'
:
if
alarm
.
alarm_level
==
u'严重'
and
alarm
.
if_workday
==
u'3'
:
result
[
sys
][
'bad_work'
]
+=
1
result
[
sys
][
'bad_work'
]
+=
1
elif
alarm
.
alarm_level
==
u'主要'
and
alarm
.
if_workday
==
u'3'
:
elif
alarm
.
alarm_level
==
u'主要'
and
alarm
.
if_workday
==
u'3'
:
result
[
sys
][
'main_work'
]
+=
1
result
[
sys
][
'main_work'
]
+=
1
elif
alarm
.
alarm_level
==
u'次要'
and
alarm
.
if_workday
==
u'3'
:
elif
alarm
.
alarm_level
==
u'次要'
and
alarm
.
if_workday
==
u'3'
:
result
[
sys
][
'normal_work'
]
+=
1
result
[
sys
][
'normal_work'
]
+=
1
elif
alarm
.
alarm_level
==
u'严重'
and
alarm
.
if_workday
==
u'4'
:
elif
alarm
.
alarm_level
==
u'严重'
and
alarm
.
if_workday
==
u'4'
:
result
[
sys
][
'bad_weekend'
]
+=
1
result
[
sys
][
'bad_weekend'
]
+=
1
elif
alarm
.
alarm_level
==
u'主要'
and
alarm
.
if_workday
==
u'4'
:
elif
alarm
.
alarm_level
==
u'主要'
and
alarm
.
if_workday
==
u'4'
:
result
[
sys
][
'main_weekend'
]
+=
1
result
[
sys
][
'main_weekend'
]
+=
1
elif
alarm
.
alarm_level
==
u'次要'
and
alarm
.
if_workday
==
u'4'
:
elif
alarm
.
alarm_level
==
u'次要'
and
alarm
.
if_workday
==
u'4'
:
result
[
sys
][
'normal_weekend'
]
+=
1
result
[
sys
][
'normal_weekend'
]
+=
1
else
:
if
result
.
has_key
(
sys
):
pass
else
:
result
[
sys
]
=
{
'bad_work'
:
0
,
'main_work'
:
0
,
'normal_work'
:
0
,
'bad_weekend'
:
0
,
'main_weekend'
:
0
,
'normal_weekend'
:
0
}
if
alarm
.
alarm_level
==
u'严重'
and
alarm
.
if_workday
==
u'3'
:
result
[
sys
][
'bad_work'
]
+=
1
elif
alarm
.
alarm_level
==
u'主要'
and
alarm
.
if_workday
==
u'3'
:
result
[
sys
][
'main_work'
]
+=
1
elif
alarm
.
alarm_level
==
u'次要'
and
alarm
.
if_workday
==
u'3'
:
result
[
sys
][
'normal_work'
]
+=
1
elif
alarm
.
alarm_level
==
u'严重'
and
alarm
.
if_workday
==
u'4'
:
result
[
sys
][
'bad_weekend'
]
+=
1
elif
alarm
.
alarm_level
==
u'主要'
and
alarm
.
if_workday
==
u'4'
:
result
[
sys
][
'main_weekend'
]
+=
1
elif
alarm
.
alarm_level
==
u'次要'
and
alarm
.
if_workday
==
u'4'
:
result
[
sys
][
'normal_weekend'
]
+=
1
data_list
=
[]
data_list
=
[]
for
key
,
value
in
result
.
items
():
for
key
,
value
in
result
.
items
():
total
=
0
total
=
0
...
...
templates/event_analysis/alarm_count.html
View file @
fcc523a1
...
@@ -96,7 +96,6 @@
...
@@ -96,7 +96,6 @@
}
}
}
}
}
}
console
.
log
(
finallist
)
let
newdata
=
{
let
newdata
=
{
currentPage
:
this
.
currentPage
,
currentPage
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
,
pageSize
:
this
.
pageSize
,
...
@@ -105,7 +104,8 @@
...
@@ -105,7 +104,8 @@
axios
.
post
(
'
${SITE_URL}alarm_count_info/
'
,
newdata
).
then
(
res
=>
{
axios
.
post
(
'
${SITE_URL}alarm_count_info/
'
,
newdata
).
then
(
res
=>
{
this
.
AlarmCountData
=
res
.
data
.
results
;
this
.
AlarmCountData
=
res
.
data
.
results
;
this
.
total
=
res
.
data
.
count
this
.
total
=
res
.
data
.
count
})
});
console
.
log
(
this
.
AlarmCountData
)
},
},
async
listOut
(){
async
listOut
(){
console
.
log
(
!
this
.
AlarmCountData
.
length
)
console
.
log
(
!
this
.
AlarmCountData
.
length
)
...
...
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