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
5bdd931d
Commit
5bdd931d
authored
Sep 14, 2021
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gis地图修改管道的颜色
parent
e04bb723
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
5 deletions
+45
-5
gaodeMapView.js
gassafety-web/src/utils/gaodeMapView.js
+13
-5
mapCommon.js
gassafety-web/src/utils/mapCommon.js
+8
-0
index.vue
gassafety-web/src/views/enterprise/mapView/index.vue
+24
-0
No files found.
gassafety-web/src/utils/gaodeMapView.js
View file @
5bdd931d
...
@@ -15,6 +15,7 @@ import workerManInfowindow from "../components/PopWindowGis/workerManInfowindow.
...
@@ -15,6 +15,7 @@ import workerManInfowindow from "../components/PopWindowGis/workerManInfowindow.
import
workerManView
from
"../components/PopWindowGis/workerManView.vue"
;
import
workerManView
from
"../components/PopWindowGis/workerManView.vue"
;
import
{
getArray
}
from
"@/utils/gassafety.js"
;
import
{
getArray
}
from
"@/utils/gassafety.js"
;
import
{
lineColor
}
from
"./mapCommon.js"
;
import
{
delPipe
}
from
"@/api/device/pipe.js"
;
import
{
delPipe
}
from
"@/api/device/pipe.js"
;
import
vue
from
"../main"
;
import
vue
from
"../main"
;
import
{
Card
}
from
"element-ui"
;
import
{
Card
}
from
"element-ui"
;
...
@@ -32,6 +33,7 @@ export const DEVICE_TYPE = {
...
@@ -32,6 +33,7 @@ export const DEVICE_TYPE = {
SMALLINSPECTOR
:
"workPoint"
,
SMALLINSPECTOR
:
"workPoint"
,
TROUBLE
:
"trouble"
TROUBLE
:
"trouble"
};
};
class
gaodeMap
{
class
gaodeMap
{
// 所有线的数组
// 所有线的数组
polyLines
=
[];
polyLines
=
[];
...
@@ -112,6 +114,8 @@ class gaodeMap {
...
@@ -112,6 +114,8 @@ class gaodeMap {
this
.
myMap
.
on
(
"zoomstart"
,
()
=>
{
this
.
myMap
.
on
(
"zoomstart"
,
()
=>
{
// console.log("缩放开始")
// console.log("缩放开始")
this
.
closeInfoWindow
();
this
.
closeInfoWindow
();
this
.
polyLinesColorClear
()
});
});
this
.
myMap
.
on
(
"moveend"
,
()
=>
{
this
.
myMap
.
on
(
"moveend"
,
()
=>
{
if
(
this
.
handleInfoWindowOpenFunc
)
{
if
(
this
.
handleInfoWindowOpenFunc
)
{
...
@@ -284,7 +288,7 @@ class gaodeMap {
...
@@ -284,7 +288,7 @@ class gaodeMap {
marker
.
on
(
"mouseover"
,
this
.
wokerManOpen
);
marker
.
on
(
"mouseover"
,
this
.
wokerManOpen
);
marker
.
on
(
"mouseout"
,
e
=>
{
marker
.
on
(
"mouseout"
,
e
=>
{
e
.
target
.
infoWindow
.
close
();
e
.
target
.
infoWindow
.
close
();
this
.
domAllShow
()
this
.
domAllShow
()
;
});
});
marker
.
on
(
"mousedown"
,
e
=>
{
marker
.
on
(
"mousedown"
,
e
=>
{
...
@@ -805,14 +809,15 @@ class gaodeMap {
...
@@ -805,14 +809,15 @@ class gaodeMap {
//console.log("包装的数组", arr);
//console.log("包装的数组", arr);
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
const
item
=
arr
[
i
];
const
item
=
arr
[
i
];
let
{
coordinates
}
=
item
;
let
{
coordinates
,
pipePressure
}
=
item
;
console
.
log
(
pipePressure
);
// //console.log("coordinates",coordinates)
// //console.log("coordinates",coordinates)
// let path = coordinates ? getArray(coordinates) :[];
// let path = coordinates ? getArray(coordinates) :[];
// 字符串转二维数组
// 字符串转二维数组
let
path
=
coordinates
?
eval
(
coordinates
)
:
[];
let
path
=
coordinates
?
eval
(
coordinates
)
:
[];
let
polyline
=
new
AMap
.
Polyline
({
let
polyline
=
new
AMap
.
Polyline
({
path
,
path
,
strokeColor
:
"#2EE7E7"
,
strokeColor
:
lineColor
[
pipePressure
]
,
strokeWeight
:
4
,
strokeWeight
:
4
,
strokeOpacity
:
0.9
,
strokeOpacity
:
0.9
,
zIndex
:
50
,
zIndex
:
50
,
...
@@ -834,6 +839,8 @@ class gaodeMap {
...
@@ -834,6 +839,8 @@ class gaodeMap {
//添加事件
//添加事件
polyline
.
on
(
"mousedown"
,
this
.
polylineMouseOver
);
polyline
.
on
(
"mousedown"
,
this
.
polylineMouseOver
);
polyline
.
on
(
"mouseover"
,
()
=>
{
polyline
.
on
(
"mouseover"
,
()
=>
{
// lineColor
polyline
.
setOptions
({
strokeColor
:
"#F7FE38"
});
polyline
.
setOptions
({
strokeColor
:
"#F7FE38"
});
});
});
polyline
.
on
(
"mouseout"
,
e
=>
{
polyline
.
on
(
"mouseout"
,
e
=>
{
...
@@ -841,7 +848,7 @@ class gaodeMap {
...
@@ -841,7 +848,7 @@ class gaodeMap {
if
(
polyline
.
getExtData
().
lineData
.
alarmState
==
1
)
{
if
(
polyline
.
getExtData
().
lineData
.
alarmState
==
1
)
{
polyline
.
setOptions
({
strokeColor
:
"#ff0000"
});
polyline
.
setOptions
({
strokeColor
:
"#ff0000"
});
}
else
{
}
else
{
polyline
.
setOptions
({
strokeColor
:
"#2EE7E7"
});
polyline
.
setOptions
({
strokeColor
:
lineColor
[
pipePressure
]
});
}
}
// infoWindow.close();
// infoWindow.close();
});
});
...
@@ -935,7 +942,8 @@ class gaodeMap {
...
@@ -935,7 +942,8 @@ class gaodeMap {
if
(
item
.
getExtData
().
lineData
.
alarmState
==
1
)
{
if
(
item
.
getExtData
().
lineData
.
alarmState
==
1
)
{
item
.
setOptions
({
strokeColor
:
"#ff0000"
});
item
.
setOptions
({
strokeColor
:
"#ff0000"
});
}
else
{
}
else
{
item
.
setOptions
({
strokeColor
:
"#2EE7E7"
});
const
{
pipePressure
}
=
item
.
getExtData
().
lineData
;
item
.
setOptions
({
strokeColor
:
lineColor
[
pipePressure
]
});
}
}
}
}
});
});
...
...
gassafety-web/src/utils/mapCommon.js
0 → 100644
View file @
5bdd931d
// 管道压力(1低压,2中压,3次高压,4高压) 颜色不同
export
const
lineColor
=
{
"1"
:
"#2EE7E7"
,
"2"
:
"#FFFFFF"
,
"3"
:
"#18FF0F"
,
"4"
:
"#DE67FA"
}
\ No newline at end of file
gassafety-web/src/views/enterprise/mapView/index.vue
View file @
5bdd931d
...
@@ -103,6 +103,14 @@
...
@@ -103,6 +103,14 @@
<div
:class=
"{ active: !mapStyle }"
@
click=
"mapChange(1)"
>
卫星地图
</div>
<div
:class=
"{ active: !mapStyle }"
@
click=
"mapChange(1)"
>
卫星地图
</div>
<div
:class=
"{ active: mapStyle }"
@
click=
"mapChange(2)"
>
全景地图
</div>
<div
:class=
"{ active: mapStyle }"
@
click=
"mapChange(2)"
>
全景地图
</div>
</div>
</div>
<!-- 管道压力 -->
<div
class=
"pipePressure"
>
<!-- <div>管道压力</div> -->
<div
class=
"hasColorBox"
:style=
"{color:lineColor[`1`]}"
>
低压
</div>
<div
class=
"hasColorBox"
:style=
"{color:lineColor[`2`]}"
>
中压
</div>
<div
class=
"hasColorBox"
:style=
"{color:lineColor[`3`]}"
>
次高
</div>
<div
class=
"hasColorBox"
:style=
"{color:lineColor[`4`]}"
>
高压
</div>
</div>
<div
class=
"switch"
@
click=
"backFlag = !backFlag"
>
<div
class=
"switch"
@
click=
"backFlag = !backFlag"
>
<img
v-if=
"!backFlag"
src=
"@/assets/images/l.png"
alt=
""
/>
<img
v-if=
"!backFlag"
src=
"@/assets/images/l.png"
alt=
""
/>
<img
v-else
src=
"@/assets/images/r.png"
alt=
""
/>
<img
v-else
src=
"@/assets/images/r.png"
alt=
""
/>
...
@@ -295,6 +303,7 @@ import Right from "./components/Right.vue";
...
@@ -295,6 +303,7 @@ import Right from "./components/Right.vue";
import
CreateWork
from
"./components/CreateWork.vue"
;
import
CreateWork
from
"./components/CreateWork.vue"
;
import
CreateWorkTrouble
from
"./components/CreateWorkTrouble.vue"
;
import
CreateWorkTrouble
from
"./components/CreateWorkTrouble.vue"
;
import
{
getInspectorLocations
}
from
"@/api/inspectorLocation/location"
;
import
{
getInspectorLocations
}
from
"@/api/inspectorLocation/location"
;
import
{
lineColor
}
from
"@/utils/mapCommon.js"
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -305,6 +314,7 @@ export default {
...
@@ -305,6 +314,7 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
lineColor
,
gaoMap
:
null
,
gaoMap
:
null
,
deviceType
:
false
,
deviceType
:
false
,
value
:
""
,
value
:
""
,
...
@@ -1687,6 +1697,20 @@ input[type="radio"] {
...
@@ -1687,6 +1697,20 @@ input[type="radio"] {
}
}
}
}
}
}
.pipePressure
{
position
:
absolute
;
color
:
#fff
;
right
:
-52px
;
top
:
50px
;
padding
:
1px
;
// background: rgba(6, 29, 51, 0.8);
.hasColorBox
{
border
:
1px
solid
#053b6a
;
padding
:
2px
5px
;
margin-bottom
:
5px
;
}
}
.scroll
{
.scroll
{
// height: 100%;
// height: 100%;
position
:
relative
;
position
:
relative
;
...
...
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