Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
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
海康威视
web-project
Commits
60eed144
Commit
60eed144
authored
Jul 26, 2024
by
qjeslks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
7.26.1
parent
c7982d6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
413 additions
and
12 deletions
+413
-12
AlarmInfoPage.vue
src/views/AlarmPage/AlarmInfoPage.vue
+6
-11
AlarmStatusPage.vue
src/views/AlarmPage/AlarmStatusPage.vue
+407
-1
No files found.
src/views/AlarmPage/AlarmInfoPage.vue
View file @
60eed144
...
...
@@ -9,7 +9,7 @@
<el-option
label=
"总管"
value=
"GetPipeAlarmData"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"
换热机组
:"
>
<el-form-item
label=
"
设备
:"
>
<el-cascader
:options=
"options"
v-model=
"AlarmInfo.Id"
:props=
"props"
collapse-tags
clearable
:show-all-levels=
"false"
placeholder=
"请选择"
style=
"min-width: 210px;"
/>
</el-form-item>
...
...
@@ -36,6 +36,7 @@
<el-card
class=
"moduleCard"
:height=
"tableHeight"
>
<el-table
:data=
"tableData"
:height=
"tableHeight"
v-loading=
"loading"
:cell-style=
"setCellStyle"
id=
"out-table"
border
highlight-current-row
:header-cell-style=
"setHeaderCellStyle"
@
sort-change=
"sortMethod"
:header-cell-class-name=
"handleHeadAddClass"
>
<el-table-column
prop=
"index"
label=
"编号"
:sortable=
"false"
width=
"80px"
fixed
/>
<el-table-column
prop=
"name"
label=
"设施名称"
:sortable=
"true"
width=
"200px"
fixed
/>
<el-table-column
prop=
"cnName"
label=
"报警类型"
:sortable=
"false"
width=
"200px"
fixed
/>
<el-table-column
prop=
"alarmDate"
label=
"报警时间"
:sortable=
"true"
width=
"200px"
fixed
/>
...
...
@@ -58,9 +59,6 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue';
import
http
from
'../../api/http'
;
import
zhCn
from
'element-plus/dist/locale/zh-cn.mjs'
import
store
from
"../../store/index"
;
import
{
getFileName
}
from
'../../utils/utils'
;
import
CfgSupply
from
'../../components/CfgSupply.vue'
;
import
{
column
}
from
'element-plus/es/components/table-v2/src/common.mjs'
;
//分页设置
const
currentPage
=
ref
(
1
)
...
...
@@ -109,8 +107,8 @@ function sortMethod({ order, prop }){
}
if
(
i
===
"name"
){
sortname
=
"name"
;
}
else
if
(
i
===
"alar
t
Date"
){
sortname
=
"alar
t
Date"
;
}
else
if
(
i
===
"alar
m
Date"
){
sortname
=
"alar
m
Date"
;
}
// console.log(sortname)
if
(
sortnames
===
""
){
...
...
@@ -167,7 +165,7 @@ const AlarmInfo = reactive({
"endTime"
:
endTime
,
"start"
:
0
,
"count"
:
30
,
"sort"
:
""
"sort"
:
"
alarmDate
"
})
getSupplys
();
...
...
@@ -340,10 +338,7 @@ function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
// AlarmInfo.pageIndex = 0;
// AlarmInfo.pageCount = 100000;
// if (AlarmInfo.interval === undefined) {
// AlarmInfo.interval = 2;
// }
// var fileName = getFileName("换热站历史数据");
// var fileName = getFileName("报警信息历史数据");
// await http.post("/api/transfer/hisExport", AlarmInfo, '正在导出数据....', { responseType: 'blob' }).then((content) => {
// try{
...
...
src/views/AlarmPage/AlarmStatusPage.vue
View file @
60eed144
<
template
>
报警状态
</
template
>
\ No newline at end of file
<
template
>
<!-- 条件筛选卡片 -->
<el-card
class=
"card-contianer"
>
<div
class=
"div-header"
>
<el-form-item
label=
"查询类型:"
>
<el-select
v-model=
"type"
placeholder=
"请选择"
style=
"width: 150px"
@
change=
"getoptions"
>
<el-option
label=
"换热机组"
value=
"GetTransAlarmStatusData"
/>
<el-option
label=
"锅炉"
value=
"GetBoilerAlarmStatusData"
/>
<el-option
label=
"总管"
value=
"GetPipeAlarmStatusData"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"设备:"
>
<el-cascader
:options=
"options"
v-model=
"AlarmInfo"
:props=
"props"
collapse-tags
clearable
:show-all-levels=
"false"
placeholder=
"请选择"
style=
"min-width: 210px;"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"getdata"
style=
"min-width: 70px;"
>
查询
</el-button>
</el-form-item>
</div>
</el-card>
<el-card
class=
"moduleCard"
:height=
"tableHeight"
>
<el-table
:data=
"tableData"
:row-class-name=
"rowClassName"
:height=
"tableHeight"
v-loading=
"loading"
:cell-style=
"setCellStyle"
id=
"out-table"
border
highlight-current-row
:header-cell-style=
"setHeaderCellStyle"
@
sort-change=
"sortMethod"
:header-cell-class-name=
"handleHeadAddClass"
>
<el-table-column
prop=
"index"
label=
"编号"
:sortable=
"false"
width=
"100px"
fixed
/>
<el-table-column
prop=
"name"
label=
"设施名称"
:sortable=
"true"
width=
"250px"
fixed
/>
<el-table-column
prop=
"cnName"
label=
"报警类型"
:sortable=
"false"
fixed
/>
<el-table-column
prop=
"gatherTime"
label=
"报警时间"
:sortable=
"true"
width=
"200px"
fixed
/>
<el-table-column
prop=
"topMost"
label=
"上上限"
:sortable=
"false"
width=
"200px"
fixed
>
<template
#
default=
"scope"
>
<div
class=
"div-form-img"
>
<el-image
class=
"img-center"
v-if=
"getImgUrl(scope,scope.column.property)"
style=
"width: 20px; height: 20px"
:src=
"getImgUrl(scope,scope.column.property)"
:fit=
"'cover'"
/>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"upper"
label=
"上限"
:sortable=
"false"
width=
"200px"
fixed
>
<
template
#
default=
"scope"
>
<div
class=
"div-form-img"
>
<el-image
class=
"img-center"
v-if=
"getImgUrl(scope,scope.column.property)"
style=
"width: 20px; height: 20px"
:src=
"getImgUrl(scope,scope.column.property)"
:fit=
"'cover'"
/>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"lower"
label=
"下限"
:sortable=
"false"
width=
"200px"
fixed
>
<
template
#
default=
"scope"
>
<div
class=
"div-form-img"
>
<el-image
class=
"img-center"
v-if=
"getImgUrl(scope,scope.column.property)"
style=
"width: 20px; height: 20px"
:src=
"getImgUrl(scope,scope.column.property)"
:fit=
"'cover'"
/>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"downMost"
label=
"下下限"
:sortable=
"false"
width=
"200px"
fixed
>
<
template
#
default=
"scope"
>
<div
class=
"div-form-img"
>
<el-image
class=
"img-center"
v-if=
"getImgUrl(scope,scope.column.property)"
style=
"width: 20px; height: 20px"
:src=
"getImgUrl(scope,scope.column.property)"
:fit=
"'cover'"
/>
</div>
</
template
>
</el-table-column>
</el-table>
</el-card>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
}
from
'vue'
;
import
http
from
'../../api/http'
;
import
store
from
"../../store/index"
;
//分页设置
const
currentPage
=
ref
(
1
)
var
pageSize
=
ref
(
30
)
const
disabled
=
ref
(
false
)
const
background
=
ref
(
false
);
const
options
=
reactive
([]);
const
tableData
=
ref
([]);
const
tableHeight
=
ref
(
500
);
const
enterpriseId
=
ref
();
const
loading
=
ref
(
true
);
const
sortField
=
reactive
({});
const
type
=
ref
(
'GetTransAlarmStatusData'
);
getEnterprise
();
function
getEnterprise
(){
var
result
=
store
.
getters
.
getEnterprise
();
if
(
result
)
{
enterpriseId
.
value
=
result
[
0
].
enterpriseId
;
}
}
const
props
=
{
multiple
:
true
,
emitPath
:
false
}
function
setContentHeight
()
{
tableHeight
.
value
=
window
.
innerHeight
-
195
;
}
//获取排序的方法
function
sortMethod
({
order
,
prop
}){
// 触发的排序和缓存的排序相同时,取消该字段的排序
if
(
!
order
||
sortField
[
prop
]
===
order
)
{
sortField
[
prop
]
=
null
}
else
{
sortField
[
prop
]
=
order
}
// console.log(sortField)
let
sortname
=
""
;
let
sortnames
=
""
;
let
direction
=
''
;
for
(
const
i
in
sortField
)
{
if
(
sortField
[
i
]
==
'ascending'
)
{
direction
=
'ASC'
}
else
if
(
sortField
[
i
]
==
'descending'
)
{
direction
=
'DESC'
}
if
(
i
===
"name"
){
sortname
=
"name"
;
}
else
if
(
i
===
"alarmDate"
){
sortname
=
"alarmDate"
;
}
// console.log(sortname)
if
(
sortnames
===
""
){
sortnames
=
sortnames
+
sortname
+
" "
+
direction
;
}
else
{
sortnames
=
sortnames
+
","
+
sortname
+
" "
+
direction
;
}
AlarmInfo
.
sort
=
sortnames
;
}
console
.
log
(
AlarmInfo
.
sort
)
getdata
()
//调用后端查询接口
}
function
handleHeadAddClass
({
column
})
{
if
(
sortField
[
column
.
property
])
{
column
.
order
=
sortField
[
column
.
property
]
}
}
var
date
=
new
Date
();
var
year
=
date
.
getFullYear
();
var
day
=
0
;
var
dateArr
=
[
date
.
getMonth
()
+
1
,
//月份从0~11,所以加一
date
.
getDate
(),
date
.
getHours
(),
date
.
getMinutes
(),
date
.
getSeconds
(),
];
for
(
var
i
=
0
;
i
<
dateArr
.
length
;
i
++
)
{
if
(
dateArr
[
i
]
>=
1
&&
dateArr
[
i
]
<=
9
)
{
dateArr
[
i
]
=
"0"
+
dateArr
[
i
];
}
}
day
=
dateArr
[
1
]
-
1
;
if
(
day
>=
1
&&
day
<=
9
)
{
day
=
"0"
+
day
;
}
var
startTime
=
sessionStorage
.
getItem
(
"DeviceQueryStart"
);
if
(
!
startTime
){
startTime
=
year
+
"-"
+
dateArr
[
0
]
+
'-'
+
day
+
" "
+
dateArr
[
2
]
+
":"
+
dateArr
[
3
]
+
":"
+
dateArr
[
4
];
sessionStorage
.
setItem
(
"DeviceQueryStart"
,
startTime
);
}
var
endTime
=
sessionStorage
.
getItem
(
"DeviceQueryEnd"
);
if
(
!
endTime
){
endTime
=
year
+
"-"
+
dateArr
[
0
]
+
"-"
+
dateArr
[
1
]
+
" "
+
dateArr
[
2
]
+
":"
+
dateArr
[
3
]
+
":"
+
dateArr
[
4
];
sessionStorage
.
setItem
(
"DeviceQueryEnd"
,
endTime
);
}
const
AlarmInfo
=
reactive
([])
getSupplys
();
getdata
();
function
getdata
()
{
sessionStorage
.
setItem
(
"DeviceQueryStart"
,
AlarmInfo
.
startTime
);
sessionStorage
.
setItem
(
"DeviceQueryEnd"
,
AlarmInfo
.
endTime
);
gettransfer
();
}
//获取选择列表
function
getoptions
(){
if
(
type
.
value
===
"GetPipeAlarmStatusData"
){
getPipes
();
}
else
if
(
type
.
value
===
"GetBoilerAlarmStatusData"
){
getBoilers
();
}
else
{
getSupplys
();
}
gettransfer
();
}
//获取锅炉列表
function
getBoilers
(){
loading
.
value
=
true
;
tableData
.
length
=
0
;
AlarmInfo
.
length
=
0
;
options
.
length
=
0
;
var
result
=
store
.
getters
.
getEnterprise
();
if
(
result
)
{
result
.
forEach
(
element
=>
{
if
(
element
.
enterpriseId
===
enterpriseId
.
value
){
if
(
element
.
enterpriseId
===
"9BCA54BC-8F27-4849-8D7D-50C5099E1949"
.
toLowerCase
()){
element
.
serviceCenterList
.
forEach
(
center
=>
{
center
.
supplyList
.
forEach
(
supply
=>
{
supply
.
boilerList
.
forEach
(
boiler
=>
{
options
.
push
({
value
:
boiler
.
boilerId
,
label
:
boiler
.
description
});
})
});
})
}
else
{
element
.
supplyList
.
forEach
(
supply
=>
{
supply
.
boilerList
.
forEach
(
boiler
=>
{
options
.
push
({
value
:
boiler
.
boilerId
,
label
:
boiler
.
description
});
})
})
}
}
});
options
.
forEach
(
element
=>
{
AlarmInfo
.
push
(
element
.
value
);
})
}
}
//获取总管列表
function
getPipes
(){
loading
.
value
=
true
;
tableData
.
length
=
0
;
AlarmInfo
.
length
=
0
;
var
result
=
store
.
getters
.
getEnterprise
();
if
(
result
)
{
options
.
length
=
0
;
result
.
forEach
(
element
=>
{
if
(
element
.
enterpriseId
===
enterpriseId
.
value
){
if
(
element
.
enterpriseId
===
"9BCA54BC-8F27-4849-8D7D-50C5099E1949"
.
toLowerCase
()){
element
.
serviceCenterList
.
forEach
(
center
=>
{
center
.
supplyList
.
forEach
(
supply
=>
{
options
.
push
({
value
:
supply
.
pipeInfo
.
pipeId
,
label
:
supply
.
pipeInfo
.
pipeName
});
});
})
}
else
{
element
.
supplyList
.
forEach
(
supply
=>
{
options
.
push
({
value
:
supply
.
pipeInfo
.
pipeId
,
label
:
supply
.
pipeInfo
.
pipeName
});
})
}
}
});
}
console
.
log
(
options
);
options
.
forEach
(
element
=>
{
AlarmInfo
.
push
(
element
.
value
);
})
console
.
log
(
AlarmInfo
.
value
);
}
//获取换热机组列表
function
getSupplys
(){
loading
.
value
=
true
;
tableData
.
length
=
0
;
options
.
length
=
0
;
AlarmInfo
.
length
=
0
;
var
result
=
store
.
getters
.
getEnterprise
();
if
(
result
)
{
result
.
forEach
(
element
=>
{
if
(
element
.
enterpriseId
===
enterpriseId
.
value
){
if
(
element
.
enterpriseId
===
"9BCA54BC-8F27-4849-8D7D-50C5099E1949"
.
toLowerCase
()){
element
.
serviceCenterList
.
forEach
(
center
=>
{
let
c
=
[];
center
.
supplyList
.
forEach
(
supply
=>
{
let
chi
=
[];
supply
.
transferList
.
forEach
(
unit
=>
{
chi
.
push
({
value
:
unit
.
unitId
,
label
:
unit
.
unitName
});
});
c
.
push
({
children
:
chi
,
label
:
supply
.
supplyName
});
});
options
.
push
({
children
:
c
,
label
:
center
.
serviceCenterName
});
})
}
else
{
element
.
supplyList
.
forEach
(
element
=>
{
let
chi
=
[];
element
.
transferList
.
forEach
(
unit
=>
{
chi
.
push
({
value
:
unit
.
unitId
,
label
:
unit
.
unitName
});
})
options
.
push
({
children
:
chi
,
label
:
element
.
supplyName
});
})
}
}
});
}
AlarmInfo
.
push
(
options
[
0
].
children
[
0
].
children
[
0
].
value
);
console
.
log
(
AlarmInfo
)
}
//获取数据列表
function
gettransfer
()
{
loading
.
value
=
true
;
if
(
currentPage
.
value
==
1
)
{
AlarmInfo
.
start
=
0
;
AlarmInfo
.
count
=
pageSize
.
value
;
}
else
{
AlarmInfo
.
start
=
((
currentPage
.
value
-
1
)
*
pageSize
.
value
)
+
1
;
AlarmInfo
.
count
=
pageSize
.
value
-
1
;
}
http
.
post
(
"/api/alarm/"
+
type
.
value
,
AlarmInfo
).
then
((
result
)
=>
{
console
.
log
(
result
.
data
);
if
(
result
.
data
!==
null
){
tableData
.
value
=
result
.
data
;
}
if
(
result
.
data
===
null
||
AlarmInfo
.
length
<
1
){
tableData
.
value
=
null
;
}
loading
.
value
=
false
;
});
}
function
setCellStyle
({
row
,
column
,
rowIndex
,
columnIndex
})
{
let
css_color
=
{};
css_color
[
'padding-left'
]
=
'px'
;
css_color
[
'padding-right'
]
=
'0px'
;
css_color
[
'borderColor'
]
=
'#97d5fd'
;
css_color
[
'padding'
]
=
'5px'
;
return
css_color
;
}
function
setHeaderCellStyle
({
row
,
column
,
rowIndex
,
columnIndex
})
{
let
css_color
;
var
backcolor
=
'd9f1ff'
;
css_color
=
{
'background-color'
:
'#'
+
backcolor
,
'padding-left'
:
'0px'
,
'padding-right'
:
'0px'
,
'borderColor'
:
'#97d5fd'
,
'color'
:
'#000'
,
'text-align'
:
'center'
,
'vertical-align'
:
'top'
};
var
backcolor
=
'd9f1ff'
;
css_color
=
{
'background-color'
:
'#'
+
backcolor
,
'padding-left'
:
'0px'
,
'padding-right'
:
'0px'
,
'borderColor'
:
'#97d5fd'
,
'color'
:
'#000'
,
'text-align'
:
'center'
,
'vertical-align'
:
'top'
};
return
css_color
;
}
function
getImgUrl
(
scope
,
item
)
{
console
.
log
(
scope
,
item
)
var
url
=
null
;
switch
(
scope
.
row
[
item
])
{
case
true
:
url
=
new
URL
(
'/imgs/status/status_alarm.png'
,
import
.
meta
.
url
).
href
;
break
;
}
return
url
;
}
onMounted
(()
=>
{
setContentHeight
();
window
.
addEventListener
(
'resize'
,
setContentHeight
);
})
onUnmounted
(()
=>
{
window
.
removeEventListener
(
'resize'
,
setContentHeight
);
})
</
script
>
<
style
lang=
"less"
scoped
>
.moduleCard {
width: auto;
overflow: auto;
padding: 0px;
::v-deep .el-card__body {
padding: 0px;
}
}
.pagination {
padding: 4px;
margin-left: 20px;
height: 30px;
//background-color: #8939cf;
vertical-align: middle;
}
//鼠标所在行的颜色
::v-deep .el-table__body tr:hover>td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
::v-deep .el-table__body tr.current-row>td {
background-color: #92cbf1 !important;
}
.card-contianer {
width: auto;
height: 70px;
.div-header {
width: 100%;
display: flex;
margin: 20px;
}
}
.el-form-item {
margin-top: -20px;
margin-right: 30px;
}
.el-tag--mini {
height: 21px !important
}
.el-cascader .el-input .el-input__inner:focus, .el-cascader .el-input.is-focus .el-input__inner{
height: 33px; //这里高度根据需求自己设定
}
.el-cascader__tags {
display: inline-flex;
margin-right: 10px;
flex-wrap: nowrap;
}
:deep(.div-form-img) {
display: flex;
align-items: center;
justify-content: center;
}
</
style
>
\ No newline at end of file
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