Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
oEshield
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1fdadbf4
authored
Apr 18, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复地图报错
1 parent
5d71032c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
33 deletions
src/main.js
src/pages/monitor/fenceMap.vue
src/utils/monitor.js
src/main.js
View file @
1fdadbf
import
'font-awesome/css/font-awesome.min.css'
import
'font-awesome/css/font-awesome.min.css'
import
'
.
/assets/scss/element-variables.scss'
import
'
@
/assets/scss/element-variables.scss'
//import Vue from 'vue'
//import Vue from 'vue'
import
ElementUI
from
'element-ui'
;
import
ElementUI
from
'element-ui'
;
import
'animate.css/animate.min.css'
import
'animate.css/animate.min.css'
import
'
.
/assets/scss/style.scss'
import
'
@
/assets/scss/style.scss'
import
'element-ui/lib/theme-chalk/index.css'
;
import
'element-ui/lib/theme-chalk/index.css'
;
import
'
.
/assets/spritesmith-generated/sprite.css'
import
'
@
/assets/spritesmith-generated/sprite.css'
import
Router
from
'vue-router'
import
Router
from
'vue-router'
import
routes
from
'
.
/router'
import
routes
from
'
@
/router'
import
'
.
/core/public-path'
;
import
'
@
/core/public-path'
;
import
actions
from
'
.
/core/actions'
;
import
actions
from
'
@
/core/actions'
;
import
vLayout
from
'pages/Layout.vue'
import
vLayout
from
'
@/
pages/Layout.vue'
import
vFullLayout
from
'pages/FullWidthLayout.vue'
import
vFullLayout
from
'
@/
pages/FullWidthLayout.vue'
import
store
from
'
.
/vuex/store.js'
import
store
from
'
@
/vuex/store.js'
import
App
from
'
.
/App.vue'
import
App
from
'
@
/App.vue'
import
Vue
from
'vue'
import
Vue
from
'vue'
...
...
src/pages/monitor/fenceMap.vue
View file @
1fdadbf
...
@@ -52,7 +52,7 @@ import remoteLoad from "utils/remoteLoad.js";
...
@@ -52,7 +52,7 @@ import remoteLoad from "utils/remoteLoad.js";
import
mapService
from
"utils/mapService.js"
;
import
mapService
from
"utils/mapService.js"
;
import
FenceMapControll
from
"./FenceMapControll.vue"
;
import
FenceMapControll
from
"./FenceMapControll.vue"
;
const
BUSINESS_SERVICE
=
services
.
business
;
const
BUSINESS_SERVICE
=
services
.
business
;
const
mapMenu
=
''
const
mapMenu
=
""
;
import
{
CONSTANT
}
from
"../../constant"
;
import
{
CONSTANT
}
from
"../../constant"
;
export
default
{
export
default
{
props
:
[
"fenceMapModalVisible"
,
"init"
,
"readonlyStatus"
],
props
:
[
"fenceMapModalVisible"
,
"init"
,
"readonlyStatus"
],
...
@@ -151,42 +151,38 @@ export default {
...
@@ -151,42 +151,38 @@ export default {
},
},
bindSearch
()
{
bindSearch
()
{
const
self
=
this
;
const
self
=
this
;
this
.
auto
=
new
AMap
.
Autocomplete
({
AMap
.
plugin
(
"AMap.Autocomplete"
,
function
()
{
self
.
auto
=
new
AMap
.
Autocomplete
({
input
:
"fenceMapSearch"
,
input
:
"fenceMapSearch"
,
});
});
this
.
autoCenterMarker
=
new
AMap
.
Marker
({
self
.
autoCenterMarker
=
new
AMap
.
Marker
({
icon
:
require
(
"images/auto-center-marker.gif"
),
icon
:
require
(
"images/auto-center-marker.gif"
),
map
:
this
.
mapObj
,
map
:
self
.
mapObj
,
offset
:
new
AMap
.
Pixel
(
-
12
,
-
12
),
offset
:
new
AMap
.
Pixel
(
-
12
,
-
12
),
visible
:
false
,
visible
:
false
,
});
});
this
.
autoCenterMarker
.
on
(
"rightclick"
,
(
e
)
=>
{
self
.
autoCenterMarker
.
on
(
"rightclick"
,
(
e
)
=>
{
if
(
self
.
mapObj
.
getAllOverlays
(
"circle"
).
length
)
{
if
(
self
.
mapObj
.
getAllOverlays
(
"circle"
).
length
)
{
window
.
mapMenu
.
contextMenu
.
open
(
self
.
mapObj
,
e
.
lnglat
);
window
.
mapMenu
.
contextMenu
.
open
(
self
.
mapObj
,
e
.
lnglat
);
self
.
contextMenuPositon
=
e
.
lnglat
;
//右键菜单位置
self
.
contextMenuPositon
=
e
.
lnglat
;
//右键菜单位置
}
}
});
});
AMap
.
event
.
addListener
(
this
.
auto
,
"select"
,
(
e
)
=>
{
AMap
.
event
.
addListener
(
self
.
auto
,
"select"
,
(
e
)
=>
{
if
(
e
.
poi
&&
e
.
poi
.
location
)
{
if
(
e
.
poi
&&
e
.
poi
.
location
)
{
this
.
mapObj
.
setCenter
(
e
.
poi
.
location
);
self
.
mapObj
.
setCenter
(
e
.
poi
.
location
);
this
.
autoCenterMarker
.
setPosition
(
e
.
poi
.
location
);
self
.
autoCenterMarker
.
setPosition
(
e
.
poi
.
location
);
/*for(var i = 0, l = this.polygons.length; i < l; i++) {
/*for(var i = 0, l = this.polygons.length; i < l; i++) {
this.polygons[i].setMap(null);
this.polygons[i].setMap(null);
}*/
}*/
this
.
autoCenterMarker
.
show
();
self
.
autoCenterMarker
.
show
();
this
.
mapObj
.
add
(
this
.
autoCenterMarker
);
self
.
mapObj
.
add
(
self
.
autoCenterMarker
);
//this.form.lng = e.poi.location.lng;
//this.form.lat = e.poi.location.lat;
//this.contextMenuPositon = e.poi.location
//window.mapMenu.contextMenu.open(this.mapObj, mapService.getLngLat(e.poi.location.lng, e.poi.location.lat))
}
}
this
.
mapObj
.
setZoom
(
14
);
self
.
mapObj
.
setZoom
(
14
);
});
});
});
},
},
bindContextMenu
()
{
bindContextMenu
()
{
...
@@ -198,13 +194,15 @@ export default {
...
@@ -198,13 +194,15 @@ export default {
var
content
=
[];
var
content
=
[];
this
.
contextMenuPositon
=
null
;
this
.
contextMenuPositon
=
null
;
content
.
push
(
'<div class="context_menu" >'
)
content
.
push
(
'<div class="context_menu" >'
);
content
.
push
(
'<p onclick="mapMenu.moveCenter()"><span>设置围栏中心</span></p>'
)
content
.
push
(
content
.
push
(
'</div>'
)
'<p onclick="mapMenu.moveCenter()"><span>设置围栏中心</span></p>'
);
content
.
push
(
"</div>"
);
this
.
contextMenu
=
new
AMap
.
ContextMenu
({
this
.
contextMenu
=
new
AMap
.
ContextMenu
({
isCustom
:
true
,
isCustom
:
true
,
content
:
content
.
join
(
''
),
content
:
content
.
join
(
""
),
});
});
map
.
on
(
"rightclick"
,
(
e
)
=>
{
map
.
on
(
"rightclick"
,
(
e
)
=>
{
if
(
self
.
mapObj
.
getAllOverlays
(
"circle"
).
length
)
{
if
(
self
.
mapObj
.
getAllOverlays
(
"circle"
).
length
)
{
...
@@ -215,7 +213,7 @@ export default {
...
@@ -215,7 +213,7 @@ export default {
}
}
ContextMenu
.
prototype
.
moveCenter
=
function
()
{
ContextMenu
.
prototype
.
moveCenter
=
function
()
{
console
.
log
(
'6666666666'
)
console
.
log
(
"6666666666"
);
self
.
moveCenter
();
self
.
moveCenter
();
this
.
contextMenu
.
close
();
this
.
contextMenu
.
close
();
};
};
...
...
src/utils/monitor.js
View file @
1fdadbf
...
@@ -194,7 +194,7 @@ const monitor = {
...
@@ -194,7 +194,7 @@ const monitor = {
});
});
//
mapService.setFitView(MAP);
mapService
.
setFitView
(
MAP
);
this
.
allData
=
this
.
allData
.
concat
(
data
);
this
.
allData
=
this
.
allData
.
concat
(
data
);
EventBus
.
$emit
(
'uiMap.monitor.drawDone'
);
EventBus
.
$emit
(
'uiMap.monitor.drawDone'
);
if
(
this
.
isCompare
){
if
(
this
.
isCompare
){
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment