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
99928fdb
Commit
99928fdb
authored
Aug 10, 2024
by
xuke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报警参数-第二次提交
parent
fd1e8cdf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
130 additions
and
57 deletions
+130
-57
AlarmStatusPage.vue
src/views/AlarmPage/AlarmStatusPage.vue
+130
-57
No files found.
src/views/AlarmPage/AlarmStatusPage.vue
View file @
99928fdb
...
@@ -242,8 +242,8 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue';
...
@@ -242,8 +242,8 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue';
import
http
from
'../../api/http'
;
import
http
from
'../../api/http'
;
import
store
from
"../../store/index"
;
import
store
from
"../../store/index"
;
import
{
ElMessage
}
from
'element-plus'
;
import
{
ElMessage
}
from
'element-plus'
;
import
{
watch
}
from
'fs'
;
import
{
watchEffect
}
from
'vue'
;
import
{
watchEffect
}
from
'vue'
;
import
{
add
}
from
'lodash'
;
//分页设置
//分页设置
const
currentPage
=
ref
(
1
)
const
currentPage
=
ref
(
1
)
...
@@ -505,33 +505,6 @@ console.log("AlarmInfo.value:::", AlarmInfo.value);
...
@@ -505,33 +505,6 @@ console.log("AlarmInfo.value:::", AlarmInfo.value);
let
cnNames_before
=
ref
([])
let
cnNames_before
=
ref
([])
let
cnNames_after
=
ref
([])
let
cnNames_after
=
ref
([])
console
.
log
(
"---------------------AlarmInfo.value:"
,
AlarmInfo
.
value
);
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
({
let
params
=
ref
({
"pipeAlarmParaId"
:
""
,
"pipeAlarmParaId"
:
""
,
...
@@ -550,11 +523,10 @@ let params = ref({
...
@@ -550,11 +523,10 @@ let params = ref({
"isActive"
:
""
,
"isActive"
:
""
,
"updateNullFields"
:
""
,
"updateNullFields"
:
""
,
})
})
let
addParams
=
ref
({
let
addParams
=
ref
({
"updateNullFields"
:
""
,
"updateNullFields"
:
""
,
"pipeParaBaseId"
:
""
,
"pipeId"
:
dept
.
value
,
"gatherType"
:
""
,
"voicePath"
:
""
,
"voicePath"
:
""
,
"isVoice"
:
""
,
"isVoice"
:
""
,
"topMost"
:
""
,
"topMost"
:
""
,
...
@@ -566,24 +538,84 @@ let addParams = ref({
...
@@ -566,24 +538,84 @@ let addParams = ref({
"isAlarm"
:
""
,
"isAlarm"
:
""
,
"isActive"
:
""
"isActive"
:
""
})
})
const
reset
=
()
=>
{
addParams
.
value
=
{
"updateNullFields"
:
""
,
"voicePath"
:
""
,
"isVoice"
:
""
,
"topMost"
:
""
,
"upper"
:
""
,
"lower"
:
""
,
"downMost"
:
""
,
"alarmPlan"
:
""
,
"isShortMessage"
:
""
,
"isAlarm"
:
""
,
"isActive"
:
""
}
}
let
param
=
ref
({
let
param
=
ref
({
"cnName"
:
""
,
"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
=
()
=>
{
const
paramsSetting
=
()
=>
{
getCnNames
()
getCnNames
()
}
}
let
newRow
=
ref
({})
const
selectParams
=
(
row
)
=>
{
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
)
if
(
type
.
value
===
"GetPipeAlarmStatusData"
)
{
console
.
log
(
"dataaaaa:"
,
data
);
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
)
{
data
.
then
(
function
(
val
)
{
console
.
log
(
"valllll:"
,
val
);
console
.
log
(
"valllll:"
,
val
);
params
.
value
=
val
.
data
params
.
value
=
val
.
data
...
@@ -595,28 +627,69 @@ const selectParams = (row) => {
...
@@ -595,28 +627,69 @@ const selectParams = (row) => {
}
}
}
}
watchEffect
(()
=>
{
addParams
.
value
.
pipeId
=
dept
.
value
console
.
log
(
addParams
.
value
.
pipeId
);
})
//"pipeId": "",
// "boilerId": "",
// "unitId": "",
// 总管
const
onAdd
=
()
=>
{
const
onAdd
=
()
=>
{
// const data = http.post("api/alarm/para/pipesave", { ...addParams.value }, false)
console
.
log
(
"!!!!!!!"
,
addParams
.
value
);
// console.log("新增data:::", data);
if
(
newType
.
value
===
1
)
{
// if (data.success) {
addParams
.
value
.
pipeId
=
dept
.
value
// ElMessage.success("修改成功!!")
addParams
.
value
.
pipeParaBaseId
=
newRow
.
value
// } else {
addParams
.
value
.
gatherType
=
1
// ElMessage.error("修改失败!!")
addParams
.
value
.
voicePath
=
1
// }
http
.
post
(
"api/alarm/para/pipesave"
,
{
...
addParams
.
value
},
false
).
then
((
res
)
=>
{
http
.
post
(
"api/alarm/para/pipesave"
,
{
...
addParams
.
value
},
false
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
ElMessage
.
success
(
"修改成功!!"
)
ElMessage
.
success
(
"总管新增成功!!"
)
getCnNames
()
delete
addParams
.
value
.
pipeId
}
else
{
delete
addParams
.
value
.
pipeParaBaseId
ElMessage
.
error
(
"修改失败!!"
)
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
(
"锅炉修改失败!!"
)
}
})
}
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
button
=
ref
(
true
)
...
...
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