Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety
Project
Project
Details
Activity
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
耿迪迪
gassafety
Commits
88ce93fd
Commit
88ce93fd
authored
3 years ago
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加消警功能
parent
eaa1ccd3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
449 additions
and
326 deletions
+449
-326
.env.development
gassafety-web/.env.development
+1
-1
info.js
gassafety-web/src/api/enterprise/info.js
+17
-0
lineInfoWindowWarn.vue
...ty-web/src/components/PopWindowGis/lineInfoWindowWarn.vue
+38
-3
markerInfoWindowWarn.vue
...-web/src/components/PopWindowGis/markerInfoWindowWarn.vue
+345
-303
index.vue
gassafety-web/src/views/enterprise/mapView/index.vue
+48
-19
No files found.
gassafety-web/.env.development
View file @
88ce93fd
...
...
@@ -8,7 +8,7 @@ VUE_APP_BASE_API = '/dev-api'
VUE_APP_MAP_CENTER = '石家庄'
#代理地址
VUE_APP_TARGET = 'http://
36.148.23.59:8901
/gassafety'
VUE_APP_TARGET = 'http://
192.168.2.28:8903
/gassafety'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
This diff is collapsed.
Click to expand it.
gassafety-web/src/api/enterprise/info.js
View file @
88ce93fd
/*
* @Author: your name
* @Date: 2021-07-16 10:06:43
* @LastEditTime: 2022-01-18 11:36:15
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-web/src/api/enterprise/info.js
*/
import
request
from
'@/utils/request'
// 查询企业基本信息列表
...
...
@@ -51,3 +59,12 @@ export function exportInfo(query) {
params
:
query
})
}
// 消除警报
export
function
handEliminationAlarm
(
query
)
{
return
request
({
url
:
'dataMonitoring/deviceAlarm/handEliminationAlarm'
,
method
:
'get'
,
params
:
query
})
}
This diff is collapsed.
Click to expand it.
gassafety-web/src/components/PopWindowGis/lineInfoWindowWarn.vue
View file @
88ce93fd
...
...
@@ -89,6 +89,7 @@
}}
<
/span
>
<
/div
>
<
/div
>
<
div
@
click
.
stop
=
"stopPropatation"
class
=
"btn"
>
<
span
@
mousedown
.
stop
=
"deviceMore"
>
<
el
-
button
class
=
"elbtn"
type
=
"primary"
>
设备详情
<
/el-button
>
...
...
@@ -99,6 +100,9 @@
<
span
v
-
else
@
mousedown
.
stop
=
"checkWork"
>
<
el
-
button
class
=
"elbtn"
type
=
"primary"
>
查看工单
<
/el-button
>
<
/span
>
<
span
@
click
=
"handelR"
>
<
el
-
button
class
=
"elbtn"
type
=
"primary"
>
消警
<
/el-button
>
<
/span
>
<
/div
>
<
/div
>
<
/div
>
...
...
@@ -107,12 +111,16 @@
<
script
>
//line移入时的的infowindow
import
moment
from
"moment"
;
// 消除警报
import
{
handEliminationAlarm
}
from
"@/api/enterprise/info"
;
export
default
{
props
:
{
obj
:
{
typs
:
Object
}
,
}
,
data
()
{
return
{
}
;
return
{
loading
:
null
,
}
;
}
,
created
()
{
// console.log("created", this.obj);
...
...
@@ -200,7 +208,34 @@ export default {
}
,
close
()
{
this
.
obj
.
polyline
.
infoWindow
.
close
();
this
.
obj
.
polyline
.
getExtData
().
class
.
view
.
domAllShow
()
this
.
obj
.
polyline
.
getExtData
().
class
.
view
.
domAllShow
();
}
,
handelR
()
{
this
.
$confirm
(
"是否消除警报"
)
.
then
((
item
)
=>
{
if
(
item
==
"confirm"
)
{
this
.
loading
=
this
.
$loading
({
lock
:
true
,
text
:
"Loading"
,
spinner
:
"el-icon-loading"
,
background
:
"rgba(0, 0, 0, 0.7)"
,
}
);
handEliminationAlarm
({
alarmId
:
this
.
obj
.
alarmId
,
}
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
obj
.
polyline
.
getExtData
().
class
.
closeInfoWindow
();
this
.
loading
.
close
();
}
}
);
}
}
)
.
catch
((
item
)
=>
{
console
.
log
(
item
);
this
.
loading
.
close
();
}
);
}
,
}
,
}
;
...
...
@@ -242,7 +277,7 @@ export default {
}
.
left
{
padding
-
left
:
22
px
;
width
:
100
%
;
width
:
100
%
;
overflow
:
hidden
;
}
.
right
{
...
...
This diff is collapsed.
Click to expand it.
gassafety-web/src/components/PopWindowGis/markerInfoWindowWarn.vue
View file @
88ce93fd
This diff is collapsed.
Click to expand it.
gassafety-web/src/views/enterprise/mapView/index.vue
View file @
88ce93fd
...
...
@@ -473,9 +473,9 @@ export default {
//抽屉是否收回
backFlag
:
true
,
mapStyle
:
true
,
// 设备轮询用的定时器
deviceTimer
:
null
,
deviceTimer
:
null
,
};
},
created
()
{
...
...
@@ -691,18 +691,26 @@ export default {
// 过滤报警管道
const
polyLineArr
=
list
.
filter
((
item
)
=>
{
return
item
.
deviceType
==
"0"
;
return
item
.
deviceType
==
"0"
||
item
.
deviceType
==
"管道"
;
});
// 过滤报警的其它设备
const
deviceArr
=
list
.
filter
((
item
)
=>
{
return
item
.
deviceType
!=
"
0"
;
return
item
.
deviceType
!=
"
管道"
;
});
// 管道
console
.
log
(
"polyLineArr"
,
polyLineArr
)
if
(
polyLineArr
.
length
>
0
)
{
polyLineArr
.
forEach
((
item
)
=>
{
// 获取循报警设备的id
const
{
deviceId
,
orderId
,
alarmId
,
alarmType
,
alarmValue
,
endTime
}
=
item
;
const
{
deviceId
,
orderId
,
alarmId
,
alarmType
,
alarmValue
,
endTime
,
dealStatus
,
}
=
item
;
console
.
log
(
"endTime"
,
endTime
);
// 获取polyLine
const
polyline
=
this
.
gaoMap
.
polyLines
.
filter
((
item
)
=>
{
...
...
@@ -718,35 +726,46 @@ export default {
options
.
lineData
.
view
=
this
;
options
.
lineData
.
alarmId
=
alarmId
;
options
.
lineData
.
orderId
=
orderId
;
if
(
endTime
)
{
polyline
.
setOptions
({
strokeColor
:
"#2EE7E7"
});
// dealStatus==4 就是取消报警状态
if
(
endTime
||
dealStatus
==
4
)
{
// 判断管道颜色
const
pipePressureObj
=
this
.
gaoMap
.
polyLines
.
filter
(
item
=>
{
return
options
.
lineData
.
alarmId
==
item
.
getExtData
().
lineData
.
alarmId
;
})[
0
];
const
{
pipePressure
}
=
pipePressureObj
.
getExtData
().
lineData
;
polyline
.
setOptions
({
strokeColor
:
lineColor
[
pipePressure
]
});
options
.
lineData
.
alarmState
=
0
;
options
.
lineData
.
dealStatus
=
4
// 报警类型
options
.
lineData
.
alarmType
=
null
;
// 报警信息
options
.
lineData
.
alarmValue
=
null
;
console
.
log
(
"管道
回复
"
);
console
.
log
(
"管道"
);
}
else
{
// 报警声音
this
.
audio
();
polyline
.
setOptions
({
strokeColor
:
"#ff0000"
});
options
.
lineData
.
alarmState
=
1
;
// 报警类型
// 报警类型
options
.
lineData
.
alarmType
=
alarmType
;
// 报警信息
options
.
lineData
.
alarmValue
=
alarmValue
;
console
.
log
(
"管道报警"
);
}
polyline
.
setExtData
(
options
);
console
.
log
(
"dealStatus"
,
dealStatus
)
const
myP
=
this
.
allList
[
0
].
filter
((
item
)
=>
{
console
.
log
(
item
.
selfData
.
alarmState
);
return
item
.
selfData
.
alarmState
;
return
item
.
selfData
.
alarmState
||
item
.
selfData
.
dealStatus
==
4
;
})[
0
];
// console.log("this.allList[0]", this.allList[0]);
// console.log("myP", myP);
// 改变左侧列表的状态(1报警,0,正常)
myP
.
alarmState
=
options
.
lineData
.
alarmState
;
console
.
log
(
"myP"
,
myP
);
if
(
myP
)
{
myP
.
alarmState
=
options
.
lineData
.
alarmState
;
}
}
});
}
...
...
@@ -756,8 +775,15 @@ export default {
if
(
deviceArr
.
length
>
0
)
{
deviceArr
.
forEach
((
item
)
=>
{
// 获取循报警设备的id
const
{
deviceId
,
alarmId
,
alarmType
,
alarmValue
,
endTime
,
orderId
}
=
item
;
const
{
deviceId
,
alarmId
,
alarmType
,
alarmValue
,
endTime
,
orderId
,
dealStatus
,
}
=
item
;
// 获取polyLine
const
device
=
this
.
gaoMap
.
markers
.
filter
((
item
)
=>
{
const
{
deviceId
:
id
,
troubleId
}
=
item
.
getExtData
();
...
...
@@ -771,7 +797,9 @@ export default {
options
.
view
=
this
;
options
.
alarmId
=
alarmId
;
options
.
orderId
=
orderId
;
if
(
endTime
)
{
// dealStatus==4 就是取消报警状态
if
(
endTime
||
dealStatus
==
4
)
{
options
.
alarmState
=
0
;
// 报警类型
options
.
alarmType
=
null
;
...
...
@@ -812,7 +840,7 @@ export default {
// 3是流量计 4是压力表
if
(
device
.
getExtData
().
deviceType
==
3
)
{
// 如果有endtime说明已经维护好了
if
(
endTime
)
{
if
(
endTime
||
dealStatus
==
4
)
{
this
.
gaoMap
.
changeMarkIcon
(
device
,
require
(
`@/assets/images/liuliangji.png`
)
...
...
@@ -824,7 +852,7 @@ export default {
);
}
}
else
if
(
device
.
getExtData
().
deviceType
==
4
)
{
if
(
endTime
)
{
if
(
endTime
||
dealStatus
==
4
)
{
this
.
gaoMap
.
changeMarkIcon
(
device
,
require
(
`@/assets/images/yalibiao.png`
)
...
...
@@ -848,7 +876,7 @@ export default {
"ws://36.148.23.59:8901/gassafety/websocketServer"
);
// this.ws = new WebSocket(
// "ws://192.168.2.2
3
:8903/gassafety/websocketServer"
// "ws://192.168.2.2
8
:8903/gassafety/websocketServer"
// );
this
.
ws
.
onopen
=
(
evt
)
=>
{
console
.
log
(
"WebSockets开启"
);
...
...
@@ -858,6 +886,7 @@ export default {
// console.log("Received Message: " + evt.data);
// ws.close();
const
obj
=
JSON
.
parse
(
evt
.
data
);
console
.
log
(
"接受socketobj"
,
obj
);
this
.
statusChange
([
obj
]);
};
this
.
ws
.
onclose
=
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
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