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
8cc061e9
Commit
8cc061e9
authored
Jun 01, 2020
by
Kerwin_Cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下载逻辑修改
parent
fcc523a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
19 deletions
+36
-19
event_analysis/views.py
event_analysis/views.py
+17
-9
templates/event_analysis/alarm_count.html
templates/event_analysis/alarm_count.html
+19
-10
No files found.
event_analysis/views.py
View file @
8cc061e9
...
...
@@ -2688,7 +2688,7 @@ def alarm_count_info(request):
"result"
:
True
,
"code"
:
0
,
"message"
:
u"查询成功!"
,
"data"
:
{
'results'
:
data
_list
,
'count'
:
event_page
.
count
,
'currentPage'
:
current_page
}
"data"
:
{
'results'
:
event
_list
,
'count'
:
event_page
.
count
,
'currentPage'
:
current_page
}
}
)
except
Exception
as
e
:
...
...
@@ -2817,14 +2817,22 @@ def alarm_count_out(request):
data_list
=
[]
for
i
in
req
:
new_list
=
[]
new_list
.
append
(
i
.
get
(
u'system'
))
new_list
.
append
(
i
.
get
(
u'total'
))
new_list
.
append
(
i
.
get
(
u'bad_work'
))
new_list
.
append
(
i
.
get
(
u'main_work'
))
new_list
.
append
(
i
.
get
(
u'normal_work'
))
new_list
.
append
(
i
.
get
(
u'bad_weekend'
))
new_list
.
append
(
i
.
get
(
u'main_weekend'
))
new_list
.
append
(
i
.
get
(
u'normal_weekend'
))
# new_list.append(i.get(u'system'))
# new_list.append(i.get(u'total'))
# new_list.append(i.get(u'bad_work'))
# new_list.append(i.get(u'main_work'))
# new_list.append(i.get(u'normal_work'))
# new_list.append(i.get(u'bad_weekend'))
# new_list.append(i.get(u'main_weekend'))
# new_list.append(i.get(u'normal_weekend'))
new_list
.
append
(
i
[
0
])
new_list
.
append
(
i
[
1
])
new_list
.
append
(
i
[
2
])
new_list
.
append
(
i
[
3
])
new_list
.
append
(
i
[
4
])
new_list
.
append
(
i
[
5
])
new_list
.
append
(
i
[
6
])
new_list
.
append
(
i
[
7
])
data_list
.
append
(
new_list
)
workbook
=
xlwt
.
Workbook
(
encoding
=
'utf-8'
)
...
...
templates/event_analysis/alarm_count.html
View file @
8cc061e9
...
...
@@ -35,9 +35,12 @@
element-loading-text=
"拼命加载中"
element-loading-spinner=
"el-icon-loading"
element-loading-background=
"rgba(0, 0, 0, 0.8)"
@
select=
"handleSelectionChange"
@
select-all=
"handleSelectionChange"
ref=
"table"
stripe
.
2
:header-cell-style=
"{background:'#409EFF',color:'white'}"
>
<el-table-column
type=
"selection"
width=
"35"
></el-table-column>
<el-table-column
width=
"200"
prop=
"system"
label=
"系统"
align=
"center"
></el-table-column>
<el-table-column
prop=
"total"
label=
"有效故障预警数"
align=
"center"
></el-table-column>
<el-table-column
prop=
"bad_work"
label=
"严重故障预警数(交易日)"
align=
"center"
></el-table-column>
...
...
@@ -45,8 +48,7 @@
<el-table-column
prop=
"normal_work"
label=
"次要故障预警数(交易日)"
align=
"center"
></el-table-column>
<el-table-column
prop=
"bad_weekend"
label=
"严重故障预警数(非交易日)"
align=
"center"
></el-table-column>
<el-table-column
prop=
"main_weekend"
label=
"主要故障预警数(非交易日)"
align=
"center"
></el-table-column>
<el-table-column
prop=
"normal_weekend"
label=
"次要故障预警数(非交易日)"
align=
"center"
></el-table-column>
<el-table-column
prop=
"normal_weekend"
label=
"次要故障预警数(非交易日)"
align=
"center"
></el-table-column>
</el-table>
</div>
<div
class=
"block"
style=
"height: 50px; margin-top: 15px"
>
...
...
@@ -77,7 +79,8 @@
pageSize
:
10
,
time
:
''
,
total
:
0
,
sysGroup
:
{}
sysGroup
:
{},
selectData
:
[]
}
},
mounted
()
{
...
...
@@ -104,16 +107,17 @@
axios
.
post
(
'
${SITE_URL}alarm_count_info/
'
,
newdata
).
then
(
res
=>
{
this
.
AlarmCountData
=
res
.
data
.
results
;
this
.
total
=
res
.
data
.
count
});
console
.
log
(
this
.
AlarmCountData
)
},
async
listOut
(){
console
.
log
(
!
this
.
AlarmCountData
.
length
)
if
(
!
this
.
AlarmCoun
tData
.
length
){
//
console.log(!this.AlarmCountData.length)
if
(
!
this
.
selec
tData
.
length
){
vm
.
$message
(
{
type
:
'
error
'
,
message
:
"
当前搜索条件下无
数据!
"
message
:
"
请选择要导出的
数据!
"
}
)
}
else
{
...
...
@@ -128,7 +132,7 @@
},
out_data
(){
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
.
post
(
'
${SITE_URL}alarm_count_out/
'
,
this
.
AlarmCoun
tData
).
then
(
res
=>
{
axios
.
post
(
'
${SITE_URL}alarm_count_out/
'
,
this
.
selec
tData
).
then
(
res
=>
{
if
(
res
.
data
==
1
)
{
resolve
(
'
ok
'
)}
})
})
...
...
@@ -146,11 +150,16 @@
console
.
log
(
"
当前页
"
+
val
);
if
(
this
.
currentPage
!=
val
)
{
this
.
currentPage
=
val
this
.
getTaskList
(()
=>
{
this
.
handleCurPageChange
()
})
this
.
searchList
()
}
},
handleSelectionChange
(
selection
)
{
this
.
selectData
=
[];
selection
.
map
((
item
,
index
)
=>
{
this
.
selectData
.
push
([
item
.
system
,
item
.
total
,
item
.
bad_work
,
item
.
main_work
,
item
.
normal_work
,
item
.
bad_weekend
,
item
.
main_weekend
,
item
.
normal_weekend
])
});
console
.
log
(
this
.
selectData
)
},
},
})
...
...
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