Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pingshan-ranqi
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
yaqizhang
pingshan-ranqi
Commits
8e099d67
Commit
8e099d67
authored
Nov 10, 2021
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
切换公司设备功能完成
parent
6079d5b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
148 additions
and
52 deletions
+148
-52
gaodeMapView.js
gassafety-web/src/utils/gaodeMapView.js
+4
-0
index.vue
gassafety-web/src/views/enterprise/mapView/index.vue
+144
-52
No files found.
gassafety-web/src/utils/gaodeMapView.js
View file @
8e099d67
...
...
@@ -426,6 +426,8 @@ class gaodeMap {
// 如果这个值为false说明不是workerpoint,就push进去
if
(
!
marker
.
workerPoint
)
{
// 全部隐藏
marker
.
hide
();
this
.
markers
.
push
(
marker
);
map
.
setZoom
(
"13"
);
}
...
...
@@ -913,6 +915,8 @@ class gaodeMap {
class
:
this
}
});
// 全部隐藏
polyline
.
hide
()
this
.
polyLines
.
push
(
polyline
);
// 信息窗体
...
...
gassafety-web/src/views/enterprise/mapView/index.vue
View file @
8e099d67
...
...
@@ -390,7 +390,8 @@ export default {
// 1新建,2编辑,3删除,点按钮变色
targetNum
:
0
,
// 左边的bar的active判定 被选中显示的设备
leftBarNum
:
[
1
,
2
,
3
,
4
,
7
,
8
,
9
,
10
],
// leftBarNum: [1, 2, 3, 4, 7, 8, 9, 10],
leftBarNum
:
[],
// leftBarNum: [],
// 管道的长度
pipeLength
:
0
,
...
...
@@ -619,7 +620,8 @@ export default {
// 所有设备上图结束之后,左边的抽屉加载数据
this
.
pipeList
().
then
((
res
)
=>
{
console
.
log
(
"开始报警准备"
);
this
.
getSelectAlarmDevice
();
// 报警设备读取不在这里读取了,在燃气公司切换的时候读取
// this.getSelectAlarmDevice();
});
// 获取报警资源
}
...
...
@@ -632,7 +634,7 @@ export default {
if
(
response
.
code
==
200
)
{
console
.
log
(
"所有设备"
,
response
.
data
);
//各种苏剧分离存储
this
.
deviceClassify
(
response
.
data
);
//
this.deviceClassify(response.data);
for
(
var
i
=
0
;
i
<
response
.
data
.
length
;
i
++
)
{
if
(
"1"
==
response
.
data
[
i
].
deviceType
)
{
this
.
gaoMap
.
addMarker
(
...
...
@@ -661,7 +663,7 @@ export default {
// console.log("管道", res);
if
(
res
.
code
==
200
)
{
this
.
gaoMap
.
addPolyline
(
res
.
data
);
this
.
pipeClassify
(
res
.
data
);
//
this.pipeClassify(res.data);
// 获取管道长度
}
return
res
.
code
;
...
...
@@ -778,7 +780,9 @@ export default {
// console.log("this.allList[0]", this.allList[0]);
// console.log("myP", myP);
// 改变左侧列表的状态(1报警,0,正常)
myP
.
alarmState
=
options
.
lineData
.
alarmState
;
if
(
myP
)
{
myP
.
alarmState
=
options
.
lineData
.
alarmState
;
}
}
});
}
...
...
@@ -819,17 +823,25 @@ export default {
device
.
setExtData
(
options
);
// 找到是列表里的哪个,改变它的状态,让列表里的这个设备变成红色
const
myDevice
=
this
.
allList
.
filter
((
item
)
=>
{
for
(
let
i
=
0
;
i
<
item
.
length
;
i
++
)
{
const
iten
=
item
[
i
];
// 不是隐患也不是值班人员
if
(
!
iten
.
troubleId
&&
!
iten
.
userId
)
{
return
iten
.
deviceId
==
device
.
getExtData
().
deviceId
;
const
myDevice
=
this
.
allList
.
filter
((
item
)
=>
{
for
(
let
i
=
0
;
i
<
item
.
length
;
i
++
)
{
const
iten
=
item
[
i
];
// 不是隐患也不是值班人员
if
(
!
iten
.
troubleId
&&
!
iten
.
userId
)
{
if
(
iten
.
deviceId
==
device
.
getExtData
().
deviceId
)
{
return
true
;
}
}
}
}
})[
0
][
0
];
})[
0
]
?.
filter
((
item
)
=>
{
return
item
.
deviceId
==
device
.
getExtData
().
deviceId
;
})[
0
];
// console.log("myDevice", myDevice);
myDevice
.
alarmState
=
options
.
alarmState
;
if
(
myDevice
)
{
myDevice
.
alarmState
=
options
.
alarmState
;
}
// const imageName = device.getExtData()
// console.log(imageName)
...
...
@@ -937,7 +949,7 @@ export default {
}
});
},
// 选择公司
// 选择
燃气
公司
compChange
(
item
)
{
const
index
=
this
.
compChangeArr
.
indexOf
(
item
);
if
(
index
<
0
)
{
...
...
@@ -946,12 +958,47 @@ export default {
this
.
compChangeArr
.
splice
(
index
,
1
);
}
console
.
log
(
this
.
compChangeArr
);
this
.
comPDeviceChange
();
this
.
filterCompDevice
(
this
.
compChangeArr
);
// 管道长度获取
this
.
pipeLength
=
this
.
pipeLengthMath
(
this
.
allList
[
0
]);
},
// 让着五个设备点亮
comPDeviceChange
()
{
[
1
,
2
,
3
,
4
,
7
].
forEach
((
item
)
=>
{
const
index
=
this
.
leftBarNum
.
indexOf
(
item
);
if
(
this
.
compChangeArr
.
length
==
0
)
{
if
(
index
>=
0
)
{
this
.
leftBarNum
.
splice
(
index
,
1
);
}
}
else
{
if
(
index
<
0
)
{
this
.
leftBarNum
.
push
(
item
);
}
}
});
// 管道根据公司显示隐藏
this
.
gaoMap
.
polyLines
.
forEach
((
item
)
=>
{
const
{
enterpriseId
}
=
item
.
getExtData
().
lineData
;
if
(
this
.
compChangeArr
.
indexOf
(
enterpriseId
)
>=
0
)
{
item
.
show
();
}
else
{
item
.
hide
();
}
});
// 设备根据公司显示隐藏
this
.
gaoMap
.
markers
.
forEach
((
item
)
=>
{
const
{
enterpriseId
}
=
item
.
getExtData
();
// 只有收到公司限制的设备会显示跟隐藏
if
(
enterpriseId
)
{
if
(
this
.
compChangeArr
.
indexOf
(
enterpriseId
)
>=
0
)
{
item
.
show
();
}
else
{
item
.
hide
();
}
}
});
},
// 过滤公司的设备并更新左侧抽屉数据
filterCompDevice
(
arr
)
{
...
...
@@ -972,7 +1019,7 @@ export default {
const
deviceArr
=
this
.
gaoMap
.
markers
.
filter
((
item
)
=>
{
const
{
enterpriseId
}
=
item
.
getExtData
();
console
.
log
(
item
.
getExtData
());
//
console.log(item.getExtData());
return
arr
.
indexOf
(
enterpriseId
)
>=
0
;
})
.
map
((
item
)
=>
{
...
...
@@ -982,7 +1029,10 @@ export default {
this
.
deviceClassify
(
deviceArr
);
// 存储之后执行程序初始化抽屉里的设备
this
.
pipeList
();
this
.
pipeList
().
then
((
res
)
=>
{
// 上图之后读取报警设备
this
.
getSelectAlarmDevice
();
});
console
.
log
(
"pipeArr"
,
pipeArr
,
deviceArr
);
},
// 切换公司的时候管道跟前4个设备重置
...
...
@@ -1015,46 +1065,88 @@ export default {
this
.
leftBarNum
.
splice
(
index
,
1
);
}
else
{
this
.
leftBarNum
.
push
(
item
.
value
);
this
.
panTo
(
item
);
}
// 1,2,3,4,7分别对应数据库type5,1,2,3,4
// console.log(this.leftBarNum);
if
(
this
.
leftBarNum
.
includes
(
1
))
{
this
.
gaoMap
.
lineShow
(
true
);
// this.panTo(item);
}
else
{
this
.
gaoMap
.
lineShow
(
false
);
}
// 如果是受到公司限制的设备
if
([
1
,
2
,
3
,
4
,
7
].
includes
(
item
.
value
))
{
// 管道
if
(
item
.
value
==
1
)
{
// this.compChangeArr
this
.
gaoMap
.
polyLines
.
forEach
((
iten
)
=>
{
const
{
enterpriseId
}
=
iten
.
getExtData
().
lineData
;
if
(
// 公司匹配,管道单一不需要匹配设备
this
.
compChangeArr
.
includes
(
enterpriseId
)
&&
// 是否是选中项
this
.
leftBarNum
.
includes
(
item
.
value
)
)
{
iten
.
show
();
}
else
{
iten
.
hide
();
}
});
// 其他四个设备
}
else
{
this
.
gaoMap
.
markers
.
forEach
((
iten
)
=>
{
const
{
enterpriseId
,
deviceType
}
=
iten
.
getExtData
();
if
(
// 公司匹配
this
.
compChangeArr
.
includes
(
enterpriseId
)
&&
//设备匹配
item
.
type
==
deviceType
)
{
// //是否是选中项
if
(
this
.
leftBarNum
.
includes
(
item
.
value
))
{
iten
.
show
();
}
else
{
iten
.
hide
();
}
// console.log("marks",this.gaoMap.markers)
// this.gaoMap.markerShow();
if
(
this
.
leftBarNum
.
includes
(
2
))
{
this
.
gaoMap
.
markerShow
(
1
,
true
);
// this.panTo(item);
}
else
{
this
.
gaoMap
.
markerShow
(
1
,
false
);
}
}
});
}
if
(
this
.
leftBarNum
.
includes
(
3
))
{
this
.
gaoMap
.
markerShow
(
2
,
true
);
// this.panTo(item);
}
else
{
this
.
gaoMap
.
markerShow
(
2
,
false
);
return
;
}
// 1,2,3,4,7分别对应数据库type5,1,2,3,4
// console.log(this.leftBarNum);
// if (this.leftBarNum.includes(1)) {
// this.gaoMap.lineShow(true);
// // this.panTo(item);
// } else {
// this.gaoMap.lineShow(false);
// }
if
(
this
.
leftBarNum
.
includes
(
4
))
{
this
.
gaoMap
.
markerShow
(
3
,
true
);
// this.panTo(item);
}
else
{
this
.
gaoMap
.
markerShow
(
3
,
false
);
}
// // console.log("marks",this.gaoMap.markers)
// // this.gaoMap.markerShow();
// if (this.leftBarNum.includes(2)) {
// this.gaoMap.markerShow(1, true);
// // this.panTo(item);
// } else {
// this.gaoMap.markerShow(1, false);
// }
// if (this.leftBarNum.includes(3)) {
// this.gaoMap.markerShow(2, true);
// // this.panTo(item);
// } else {
// this.gaoMap.markerShow(2, false);
// }
// if (this.leftBarNum.includes(4)) {
// this.gaoMap.markerShow(3, true);
// // this.panTo(item);
// } else {
// this.gaoMap.markerShow(3, false);
// }
// if (this.leftBarNum.includes(7)) {
// this.gaoMap.markerShow(4, true);
// // this.panTo(item);
// } else {
// this.gaoMap.markerShow(4, false);
// }
if
(
this
.
leftBarNum
.
includes
(
7
))
{
this
.
gaoMap
.
markerShow
(
4
,
true
);
// this.panTo(item);
}
else
{
this
.
gaoMap
.
markerShow
(
4
,
false
);
}
// 隐患
if
(
this
.
leftBarNum
.
includes
(
8
))
{
this
.
gaoMap
.
markerShow
(
8
,
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