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
91831caa
Commit
91831caa
authored
Aug 11, 2024
by
裴文涛
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.91isoft.com:90/hikvision/web-project
parents
086aeb08
99666f63
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
268 additions
and
96 deletions
+268
-96
AlarmStatusPage.vue
src/views/AlarmPage/AlarmStatusPage.vue
+268
-96
No files found.
src/views/AlarmPage/AlarmStatusPage.vue
View file @
91831caa
...
...
@@ -62,8 +62,7 @@
</el-table>
</el-card>
<el-dialog
v-model=
"show"
class=
"dialog"
:show-scrollbar=
"true"
>
<el-dialog
@
close=
"onClose"
v-model=
"show"
class=
"dialog"
:show-scrollbar=
"true"
>
<div
class=
"div-header"
>
<el-form
:inline=
"true"
>
<el-form-item
label=
"查询类型:"
>
...
...
@@ -81,15 +80,15 @@
<el-button
type=
"primary"
@
click=
"paramsSetting"
style=
"min-width: 70px;"
>
确定
</el-button>
</el-form-item>
</el-form>
</div>
<el-row>
<el-col
:span=
"6"
>
<div
class=
"left"
>
<el-table
:data=
"cnNames_before"
:style=
"{ width: '100%' }"
>
<el-table-column
prop=
"cnName"
>
<el-table
:data=
"cnNames_before"
class=
"scroll-table"
:row-style=
"{ height: '16px' }"
:cell-style=
"{ padding: '0px' }"
>
<el-table-column
prop=
"cnName"
class-name=
"before-hover-column"
:show-overflow-tooltip=
"true"
>
<
template
#
default=
"scope"
>
<div
@
click=
"selectParams(scope.row)"
>
{{
scope
.
row
.
cnName
}}
</div>
<div
@
click=
"select
Before
Params(scope.row)"
>
{{
scope
.
row
.
cnName
}}
</div>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -98,7 +97,6 @@
<el-col
:span=
"12"
>
<div
class=
"middle"
>
<!-- <el-card class="card_contianer"> -->
<table
cellpadding=
"0"
cellspacing=
"1"
border=
"1"
class=
"big_table"
>
<tr>
<th
style=
"width: 25%"
>
报警名称:
</th>
...
...
@@ -130,7 +128,7 @@
<table
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td
style=
"text-align: left"
>
<el-input
style=
"width: 80%"
v-model=
"addParams.topMost"
></el-input>
<el-input
v-float-number
style=
"width: 80%"
v-model=
"addParams.topMost"
></el-input>
</td>
</tr>
</table>
...
...
@@ -142,7 +140,7 @@
<table
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td
style=
"text-align: left"
>
<el-input
style=
"width: 80%"
v-model=
"addParams.upper"
></el-input>
<el-input
v-float-number
style=
"width: 80%"
v-model=
"addParams.upper"
></el-input>
</td>
</tr>
</table>
...
...
@@ -155,21 +153,21 @@
<table
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td
style=
"text-align: left"
>
<el-input
style=
"width: 80%"
v-model=
"addParams.downMost"
></el-input>
<el-input
v-float-number
style=
"width: 80%"
v-model=
"addParams.downMost"
></el-input>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th
style=
"width: 25%"
>
报警预案
</th>
<td
style=
"width: 60%; margin: 0; padding: 0"
>
<table
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td
style=
"text-align: left"
>
<el-input
style=
"width: 80%"
type=
"textarea"
rows=
"6"
v-model=
"addParams.alarmPlan"
></el-input>
<el-input
v-float-number
style=
"width: 80%"
type=
"textarea"
rows=
"6"
v-model=
"addParams.alarmPlan"
></el-input>
</td>
</tr>
</table>
...
...
@@ -188,7 +186,7 @@
</td>
</tr>
<tr>
<th
style=
"width: 25%"
>
启用短
息
通知:
</th>
<th
style=
"width: 25%"
>
启用短
信
通知:
</th>
<td
style=
"width: 60%; margin:0; padding: 0"
>
<table
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
...
...
@@ -206,11 +204,10 @@
<el-button
:disabled=
"param.cnName === '' ? true : false"
type=
"primary"
@
click=
"onAdd"
>
添加
</el-button>
<el-button
disabled
type=
"primary"
@
click=
"onDel"
>
删除
</el-button>
</div>
<div
v-else
=
"button"
>
<div
v-else
>
<el-button
type=
"primary"
@
click=
"onEdit"
>
修改
</el-button>
<el-button
type=
"primary"
@
click=
"onDel"
>
删除
</el-button>
</div>
</div>
<!-- </el-card> -->
</div>
...
...
@@ -218,20 +215,18 @@
<el-col
:span=
"6"
>
<div
class=
"left"
>
<el-table
:data=
"cnNames_after"
:style=
"{ width: '100%' }"
>
<el-table-column
prop=
"cnName"
>
<el-table
:data=
"cnNames_after"
class=
"scroll-table"
:row-style=
"{ height: '16px' }"
:cell-style=
"{ padding: '0px' }"
>
<el-table-column
prop=
"cnName"
class-name=
"after-hover-column"
>
<
template
#
default=
"scope"
>
<div
@
click=
"selectParams(scope.row)"
>
{{
scope
.
row
.
cnName
}}
</div>
<div
@
click=
"select
After
Params(scope.row)"
>
{{
scope
.
row
.
cnName
}}
</div>
</
template
>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
</el-dialog>
</template>
...
...
@@ -242,8 +237,9 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue';
import
http
from
'../../api/http'
;
import
store
from
"../../store/index"
;
import
{
ElMessage
}
from
'element-plus'
;
import
{
watch
}
from
'fs'
;
import
{
watchEffect
}
from
'vue'
;
import
{
add
}
from
'lodash'
;
import
{
vFloatNumber
}
from
"@/utils/directives.js"
;
//分页设置
const
currentPage
=
ref
(
1
)
...
...
@@ -262,10 +258,6 @@ const refreshItem = ref(0)
const
AlarmInfo
=
ref
([])
const
dept
=
ref
(
''
)
function
open
()
{
show
.
value
=
true
}
...
...
@@ -276,7 +268,6 @@ function onsubmit() {
function
onCancel
()
{
show
.
value
=
false
refreshItem
++
}
getEnterprise
();
...
...
@@ -297,7 +288,7 @@ function handleHeadAddClass({ column }) {
if
(
sortField
[
column
.
property
])
{
column
.
order
=
sortField
[
column
.
property
]
}
}
;
}
var
date
=
new
Date
();
var
year
=
date
.
getFullYear
();
...
...
@@ -330,8 +321,6 @@ if (!endTime) {
sessionStorage
.
setItem
(
"DeviceQueryEnd"
,
endTime
);
}
getSupplys
();
getdata
();
function
getdata
()
{
...
...
@@ -340,7 +329,6 @@ function getdata() {
gettransfer
();
}
//获取选择列表
function
getoptions
()
{
if
(
type
.
value
===
"GetPipeAlarmStatusData"
)
{
...
...
@@ -410,10 +398,6 @@ function getPipes() {
}
});
}
// options.forEach(element => {
// AlarmInfo.push(element.value);
// })
// console.log(AlarmInfo.value);
}
//获取换热机组列表
...
...
@@ -505,33 +489,6 @@ console.log("AlarmInfo.value:::", AlarmInfo.value);
let
cnNames_before
=
ref
([])
let
cnNames_after
=
ref
([])
console
.
log
(
"---------------------AlarmInfo.value:"
,
AlarmInfo
.
value
);
let
newType
=
ref
(
0
)
watchEffect
(()
=>
{
console
.
log
(
"监听::::"
,
type
.
value
);
if
(
type
.
value
===
"GetPipeAlarmStatusData"
)
{
newType
.
value
=
1
}
else
if
(
type
.
value
===
"GetBoilerAlarmStatusData"
)
{
newType
.
value
=
2
}
else
{
newType
.
value
=
3
}
})
// 接口2:换热站基础参数编号(transParaBaseId) -> 接口1:baseId
const
getCnNames
=
()
=>
{
// console.log('dept-------------------', dept.value);
// console.log("++++++++++++++++++++++++", newType.value);
let
data
=
http
.
post
(
"api/alarm/para/GetAlarmPara"
,
{
type
:
newType
.
value
,
id
:
dept
.
value
},
false
);
data
.
then
(
function
(
val
)
{
cnNames_before
.
value
=
val
.
data
.
before
cnNames_after
.
value
=
val
.
data
.
after
// console.log("cnNames_before@@@@", cnNames_before);
// console.log("cnNames_after@@@@", cnNames_after);
// console.log("cnNames_before.transParaBaseId:", cnNames_before.transParaBaseId)
});
}
let
params
=
ref
({
"pipeAlarmParaId"
:
""
,
...
...
@@ -547,14 +504,13 @@ let params = ref({
"alarmPlan"
:
""
,
"isShortMessage"
:
""
,
"isAlarm"
:
""
,
"isActive"
:
""
,
"isActive"
:
true
,
"updateNullFields"
:
""
,
})
let
addParams
=
ref
({
"updateNullFields"
:
""
,
"pipeParaBaseId"
:
""
,
"pipeId"
:
dept
.
value
,
"gatherType"
:
""
,
"voicePath"
:
""
,
"isVoice"
:
""
,
"topMost"
:
""
,
...
...
@@ -564,26 +520,84 @@ let addParams = ref({
"alarmPlan"
:
""
,
"isShortMessage"
:
""
,
"isAlarm"
:
""
,
"isActive"
:
""
"isActive"
:
true
})
const
reset
=
()
=>
{
addParams
.
value
=
{
"updateNullFields"
:
""
,
"voicePath"
:
""
,
"isVoice"
:
""
,
"topMost"
:
""
,
"upper"
:
""
,
"lower"
:
""
,
"downMost"
:
""
,
"alarmPlan"
:
""
,
"isShortMessage"
:
""
,
"isAlarm"
:
""
,
"isActive"
:
true
}
}
let
param
=
ref
({
"cnName"
:
""
,
"transParaBaseId"
:
""
"baseId"
:
""
})
let
newType
=
ref
(
0
)
watchEffect
(()
=>
{
console
.
log
(
"监听::::"
,
type
.
value
);
if
(
type
.
value
===
"GetPipeAlarmStatusData"
)
{
newType
.
value
=
1
param
.
value
.
baseId
=
"pipeParaBaseId"
}
else
if
(
type
.
value
===
"GetBoilerAlarmStatusData"
)
{
newType
.
value
=
2
param
.
value
.
baseId
=
"boilerParaBaseId"
}
else
{
newType
.
value
=
3
param
.
value
.
baseId
=
"transParaBaseId"
}
})
// 接口2:换热站基础参数编号(transParaBaseId) -> 接口1:baseId
const
getCnNames
=
()
=>
{
// console.log('dept-------------------', dept.value);
// console.log("++++++++++++++++++++++++", newType.value);
let
data
=
http
.
post
(
"api/alarm/para/GetAlarmPara"
,
{
type
:
newType
.
value
,
id
:
dept
.
value
},
false
);
data
.
then
(
function
(
val
)
{
cnNames_before
.
value
=
val
.
data
.
before
cnNames_after
.
value
=
val
.
data
.
after
console
.
log
(
"cnNames_before@@@@"
,
cnNames_before
);
console
.
log
(
"cnNames_after@@@@"
,
cnNames_after
);
// console.log("cnNames_before.transParaBaseId:", cnNames_before.transParaBaseId)
});
}
// 点击确定查询数据
const
paramsSetting
=
()
=>
{
getCnNames
()
}
const
selectParams
=
(
row
)
=>
{
param
.
value
.
transParaBaseId
=
row
.
transParaBaseId
console
.
log
(
"param.value.transParaBaseId========"
,
param
.
value
.
transParaBaseId
);
if
(
param
.
value
.
transParaBaseId
)
{
const
data
=
http
.
post
(
"/api/alarm/para/GetAlarmParaInfo"
,
{
type
:
newType
.
value
,
id
:
dept
.
value
,
baseid
:
param
.
value
.
transParaBaseId
},
false
)
console
.
log
(
"dataaaaa:"
,
data
);
let
newRow
=
ref
({})
const
selectBeforeParams
=
(
row
)
=>
{
reset
()
button
.
value
=
true
if
(
type
.
value
===
"GetPipeAlarmStatusData"
)
{
newType
.
value
=
1
param
.
value
.
baseId
=
"pipeParaBaseId"
}
else
if
(
type
.
value
===
"GetBoilerAlarmStatusData"
)
{
newType
.
value
=
2
param
.
value
.
baseId
=
"boilerParaBaseId"
}
else
{
newType
.
value
=
3
param
.
value
.
baseId
=
"transParaBaseId"
}
console
.
log
(
"+++++++++++++++++"
,
param
.
value
.
baseId
);
param
.
value
.
baseId
=
row
[
param
.
value
.
baseId
]
newRow
.
value
=
param
.
value
.
baseId
if
(
param
.
value
.
baseId
)
{
const
data
=
http
.
post
(
"api/alarm/para/GetAlarmParaInfo"
,
{
type
:
newType
.
value
,
id
:
dept
.
value
,
baseid
:
param
.
value
.
baseId
},
false
)
console
.
log
(
"查看baseId --- dataaaaa:"
,
data
);
data
.
then
(
function
(
val
)
{
console
.
log
(
"valllll:"
,
val
);
params
.
value
=
val
.
data
...
...
@@ -595,37 +609,157 @@ const selectParams = (row) => {
}
}
watchEffect
(()
=>
{
addParams
.
value
.
pipeId
=
dept
.
value
console
.
log
(
addParams
.
value
.
pipeId
);
})
// 添加参数后
// 删除参数id -> 需要添加参数后的参数的id
const
delId
=
ref
(
0
)
const
selectAfterParams
=
(
row
)
=>
{
reset
()
button
.
value
=
false
if
(
type
.
value
===
"GetPipeAlarmStatusData"
)
{
newType
.
value
=
1
param
.
value
.
baseId
=
"pipeParaBaseId"
}
else
if
(
type
.
value
===
"GetBoilerAlarmStatusData"
)
{
newType
.
value
=
2
param
.
value
.
baseId
=
"boilerParaBaseId"
}
else
{
newType
.
value
=
3
param
.
value
.
baseId
=
"transParaBaseId"
}
console
.
log
(
"+++++++++++++++++"
,
param
.
value
.
baseId
);
param
.
value
.
baseId
=
row
[
param
.
value
.
baseId
]
newRow
.
value
=
param
.
value
.
baseId
if
(
param
.
value
.
baseId
)
{
const
data
=
http
.
post
(
"/api/alarm/para/GetAlarmParaInfo"
,
{
type
:
newType
.
value
,
id
:
dept
.
value
,
baseid
:
param
.
value
.
baseId
},
false
)
console
.
log
(
"查看baseId --- dataaaaa:"
,
data
);
data
.
then
(
function
(
val
)
{
console
.
log
(
"valllll:"
,
val
);
addParams
.
value
=
{
...
val
.
data
}
console
.
log
(
"addParams.value/////////"
,
addParams
.
value
);
console
.
log
(
"!!!!!Params.value:"
,
params
.
value
);
param
.
value
.
cnName
=
row
.
cnName
if
(
type
.
value
===
1
)
{
delId
.
value
=
val
.
data
.
pipeAlarmParaId
}
else
if
(
type
.
value
===
2
)
{
delId
.
value
=
val
.
data
.
boilerAlarmParaId
}
else
{
delId
.
value
=
val
.
data
.
transAlarmParaId
}
});
}
else
{
ElMessage
.
info
(
"该参数暂不需要修改..."
)
}
}
// 总管
const
onAdd
=
()
=>
{
// const data = http.post("api/alarm/para/pipesave", { ...addParams.value }, false)
// console.log("新增data:::", data);
// if (data.success) {
// ElMessage.success("修改成功!!")
// } else {
// ElMessage.error("修改失败!!")
// }
console
.
log
(
"!!!!!!!"
,
addParams
.
value
);
if
(
newType
.
value
===
1
)
{
addParams
.
value
.
pipeId
=
dept
.
value
addParams
.
value
.
pipeParaBaseId
=
newRow
.
value
if
(
dept
.
value
===
"f8fdf686-30ec-4e4c-ab60-d74ec8b98e3f"
)
{
addParams
.
value
.
gatherType
=
4
}
else
{
addParams
.
value
.
gatherType
=
1
}
http
.
post
(
"api/alarm/para/pipesave"
,
{
...
addParams
.
value
},
false
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
ElMessage
.
success
(
"修改成功!!"
)
ElMessage
.
success
(
"总管新增成功!!"
)
delete
addParams
.
value
.
pipeId
delete
addParams
.
value
.
pipeParaBaseId
delete
addParams
.
value
.
gatherType
delete
addParams
.
value
.
voicePath
reset
()
param
.
value
.
cnName
=
""
getCnNames
()
}
else
{
ElMessage
.
error
(
"总管修改失败!!"
)
}
})
}
else
if
(
newType
.
value
===
2
)
{
addParams
.
value
.
boilerParaBaseId
=
newRow
.
value
addParams
.
value
.
boilerId
=
dept
.
value
http
.
post
(
"api/alarm/para/boilersave"
,
{
...
addParams
.
value
},
false
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
ElMessage
.
success
(
"锅炉修改成功!!"
)
delete
addParams
.
value
.
boilerParaBaseId
delete
addParams
.
value
.
boilerId
reset
()
param
.
value
.
cnName
=
""
getCnNames
()
}
else
{
ElMessage
.
error
(
"
修改失败!!"
)
ElMessage
.
error
(
"锅炉
修改失败!!"
)
}
})
}
else
if
(
newType
.
value
===
3
)
{
addParams
.
value
.
transParaBaseId
=
newRow
.
value
addParams
.
value
.
unitId
=
dept
.
value
http
.
post
(
"api/alarm/para/transsave"
,
{
...
addParams
.
value
},
false
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
ElMessage
.
success
(
"换热机修改成功!!"
)
delete
addParams
.
value
.
transParaBaseId
delete
addParams
.
value
.
unitId
reset
()
param
.
value
.
cnName
=
""
getCnNames
()
}
else
{
ElMessage
.
error
(
"换热机修改失败!!"
)
}
})
}
}
// 按钮
const
button
=
ref
(
true
)
// 删除逻辑
const
onDel
=
()
=>
{
if
(
type
.
value
===
1
)
{
http
.
post
(
"api/alarm/para/pipedelete"
,
{
id
:
delId
.
value
},
false
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
ElMessage
.
success
(
"总管参数删除成功!!"
)
reset
()
getCnNames
()
}
else
{
ElMessage
.
error
(
"删除失败!!"
)
}
})
}
else
if
(
type
.
value
===
2
)
{
http
.
post
(
"api/alarm/para/boilerdelete"
,
{
id
:
delId
.
value
},
false
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
ElMessage
.
success
(
"锅炉参数删除成功!!"
)
getCnNames
()
reset
()
}
else
{
ElMessage
.
error
(
"删除失败!!"
)
}
})
}
else
{
http
.
post
(
"api/alarm/para/transdelete"
,
{
id
:
delId
.
value
},
false
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
ElMessage
.
success
(
"换热站参数删除成功!!"
)
getCnNames
()
reset
()
}
else
{
ElMessage
.
error
(
"删除失败!!"
)
}
})
}
}
// 关闭dialog清空数据
const
onClose
=
()
=>
{
type
.
value
=
""
dept
.
value
=
""
cnNames_before
.
value
=
""
cnNames_after
.
value
=
""
reset
()
param
.
value
.
cnName
=
""
}
onMounted
(()
=>
{
setContentHeight
();
window
.
addEventListener
(
'resize'
,
setContentHeight
);
})
onUnmounted
(()
=>
{
window
.
removeEventListener
(
'resize'
,
setContentHeight
);
...
...
@@ -684,7 +818,7 @@ onUnmounted(() => {
.el-cascader .el-input .el-input__inner:focus,
.el-cascader .el-input.is-focus .el-input__inner {
height: 33px;
//这里高度根据需求自己设定
height: 33px;
}
.el-cascader__tags {
...
...
@@ -768,6 +902,44 @@ table td {
}
.dialog {
width: 60%;
width: 70%;
}
// dialog中的滚动条
.scroll-table {
max-height: 400px;
overflow-y: auto;
}
// .scroll-table,
// .scroll-table .el-table__header-wrapper,
// .scroll-table .el-table__body-wrapper,
// .scroll-table .el-table__row,
// .scroll-table th,
// .scroll-table td {
// border: none !important;
// }
.scroll-table::-webkit-scrollbar {
width: 5px;
}
.scroll-table::-webkit-scrollbar-thumb {
background-color: #BFBFBF;
// border-radius: 1px;
}
.scroll-table::-webkit-scrollbar-track {
background-color: #f0f0f0;
}
.before-hover-column .cell:hover {
background-color: #CECECE;
color: white;
}
.after-hover-column .cell:hover {
background-color: #508EFF;
color: white;
}
</
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