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 2ad545a4
authored
Dec 27, 2024
by
wangzhihui
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug修复
1 parent
fd0463c1
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
231 additions
and
106 deletions
package-lock.json
package.json
src/assets/scss/monitor.scss
src/pages/monitor/addFence.vue
src/pages/monitor/addPoi.vue
src/pages/monitor/alarmAnalysis.vue
src/pages/monitor/editFence.vue
src/pages/monitor/fenceMap.vue
src/pages/monitor/replay.vue
src/pages/monitor/zoneCar.vue
src/utils/fence.js
src/utils/mapBService.js
src/utils/monitor.js
src/utils/replay.js
package-lock.json
View file @
2ad545a
...
...
@@ -2329,9 +2329,9 @@
"dev"
:
true
},
"clipboard"
:
{
"version"
:
"2.0.
4
"
,
"resolved"
:
"http
://registry.npm.taobao.org/clipboard/download/clipboard-2.0.4
.tgz"
,
"integrity"
:
"sha
1-g22v1mzw/qXXHOXVsL9ulYAJES0
="
,
"version"
:
"2.0.
11
"
,
"resolved"
:
"http
s://registry.npmmirror.com/clipboard/-/clipboard-2.0.11
.tgz"
,
"integrity"
:
"sha
512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw=
="
,
"requires"
:
{
"good-listener"
:
"^1.2.2"
,
"select"
:
"^1.1.2"
,
...
...
@@ -3279,8 +3279,8 @@
},
"delegate"
:
{
"version"
:
"3.2.0"
,
"resolved"
:
"http
://registry.npm.taobao.org/delegate/download
/delegate-3.2.0.tgz"
,
"integrity"
:
"sha
1-tmtxwxWFIuirV0T3INjKDCr1kWY
="
"resolved"
:
"http
s://registry.npmmirror.com/delegate/-
/delegate-3.2.0.tgz"
,
"integrity"
:
"sha
512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=
="
},
"delegates"
:
{
"version"
:
"1.0.0"
,
...
...
@@ -5800,8 +5800,8 @@
},
"good-listener"
:
{
"version"
:
"1.2.2"
,
"resolved"
:
"http
://registry.npm.taobao.org/good-listener/download
/good-listener-1.2.2.tgz"
,
"integrity"
:
"sha
1-1TswzfkxPf+33JoNR3CWqm0UXFA
="
,
"resolved"
:
"http
s://registry.npmmirror.com/good-listener/-
/good-listener-1.2.2.tgz"
,
"integrity"
:
"sha
512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw=
="
,
"requires"
:
{
"delegate"
:
"^3.1.2"
}
...
...
@@ -11687,8 +11687,8 @@
},
"select"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"http
://registry.npm.taobao.org/select/download
/select-1.1.2.tgz"
,
"integrity"
:
"sha
1-DnNQrN7ICxEIUoeG7B1EGNEbOW0
="
"resolved"
:
"http
s://registry.npmmirror.com/select/-
/select-1.1.2.tgz"
,
"integrity"
:
"sha
512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=
="
},
"select-hose"
:
{
"version"
:
"2.0.0"
,
...
...
@@ -12918,8 +12918,8 @@
},
"tiny-emitter"
:
{
"version"
:
"2.1.0"
,
"resolved"
:
"http
://registry.npm.taobao.org/tiny-emitter/download
/tiny-emitter-2.1.0.tgz"
,
"integrity"
:
"sha
1-HRpW7fxRxD6GPLtTgqcjMONVVCM
="
"resolved"
:
"http
s://registry.npmmirror.com/tiny-emitter/-
/tiny-emitter-2.1.0.tgz"
,
"integrity"
:
"sha
512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=
="
},
"tmp"
:
{
"version"
:
"0.0.33"
,
...
...
package.json
View file @
2ad545a
...
...
@@ -17,7 +17,7 @@
"calendar-months"
:
"^1.0.1"
,
"caniuse-lite"
:
"^1.0.30001292"
,
"chart.js"
:
"^2.7.2"
,
"clipboard"
:
"^2.0.
4
"
,
"clipboard"
:
"^2.0.
11
"
,
"dayjs"
:
"^1.11.11"
,
"downloadjs"
:
"^1.4.7"
,
"echarts"
:
"^5.5.0"
,
...
...
src/assets/scss/monitor.scss
View file @
2ad545a
...
...
@@ -389,6 +389,7 @@
.map-infowindow-ct
{
&
>
p
{
display
:
flex
;
min-width
:
300px
;
}
// .lb {}
...
...
@@ -396,7 +397,6 @@
.des
{
flex
:
1
;
word-break
:
break-all
;
max-width
:
160px
;
}
.icon
{
...
...
@@ -459,7 +459,7 @@
color
:
rgba
(
0
,
153
,
68
,
0
.8
);
margin
:
2px
;
cursor
:
pointer
;
white-space
:
nowrap
;
&
:hover
{
color
:
rgba
(
0
,
153
,
68
,
1
);
border-color
:
rgba
(
0
,
153
,
68
,
1
);
...
...
@@ -569,10 +569,41 @@
cursor
:
pointer
;
}
.map-infowindow-title
{
.map-infowindow-title
-other
{
position
:
relative
;
padding-right
:
30px
;
white-space
:
nowrap
;
.question_icon
{
display
:
inline-block
;
background
:
url('https://img01.glsx.com.cn/weapp/resource/e-shield/circle-question.png')
no-repeat
;
background-size
:
20px
auto
;
width
:
20px
;
height
:
20px
;
vertical-align
:
middle
;
}
.popover_box
{
position
:
absolute
;
background
:
rgba
(
0
,
0
,
0
,
0
.5
);
top
:
20px
;
right
:
0px
;
padding
:
10px
;
z-index
:
2
;
border-radius
:
4px
;
color
:
#fff
;
font-size
:
12px
;
pointer-events
:
none
;
p
{
margin
:
0
;
}
}
}
.map-infowindow-title
{
position
:
relative
;
padding-right
:
30px
;
white-space
:
nowrap
;
width
:
300px
;
.question_icon
{
display
:
inline-block
;
background
:
url('https://img01.glsx.com.cn/weapp/resource/e-shield/circle-question.png')
no-repeat
;
...
...
@@ -650,4 +681,7 @@
.resident_btn_hidden
{
display
:
none
;
}
.BMap_bubble_top
{
height
:
7px
!
important
;
}
\ No newline at end of file
src/pages/monitor/addFence.vue
View file @
2ad545a
...
...
@@ -504,7 +504,8 @@ export default {
},
});
},
mounted
()
{
async
mounted
()
{
await
this
.
$refs
.
fenceMap
.
initBMap
()
//this.listener();
this
.
$nextTick
(()
=>
{
let
check
=
()
=>
{
...
...
@@ -841,6 +842,7 @@ export default {
let
oParams
=
{};
oParams
.
fenceId
=
id
;
GET_ELECFENCE_INFO
(
oParams
).
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
code
!=
200
)
{
return
false
;
}
...
...
src/pages/monitor/addPoi.vue
View file @
2ad545a
...
...
@@ -171,6 +171,9 @@ export default {
this
.
autoComplete
=
AMap
.
invoke
(
"Autocomplete"
,
{
input
:
"poiMapSearch"
,
});
AMap
.
invoke
(
"LocalCity"
,
(
res
)
=>
{
AMap
.
invoke
(
'panTo'
,
res
.
center
)
});
AMap
.
invoke
(
"autocompleteShow"
);
AMap
.
invoke
(
"autocompleteAddEventListener"
,
"onconfirm"
,
(
e
)
=>
{
let
_poi
=
e
.
item
.
value
;
...
...
@@ -210,22 +213,91 @@ export default {
addMassMarkers
(
arr
)
{
let
_this
=
this
;
let
_query
=
_this
.
$route
.
query
;
let
markers
=
[];
//
let markers = [];
for
(
let
i
=
0
,
len
=
arr
.
length
;
i
<
len
;
i
++
)
{
let
k
=
arr
[
i
];
if
(
k
.
lnglat
)
{
let
m
=
k
.
lnglat
.
split
(
","
);
let
lnglatXY
=
mapService
.
getLngLat
(
m
[
0
],
m
[
1
]);
markers
.
push
(
lnglatXY
);
//
markers.push(lnglatXY);
let
marker
=
mapService
.
createPoiMarker
(
lnglatXY
,
AMap
);
AMap
.
invoke
(
"addOverlay"
,
marker
);
AMap
.
invoke
(
"markerAddEventListener"
,
"click"
,
(
e
)
=>
{
let
data
=
{
...
e
,
...
k
};
this
.
markerEvent
(
data
);
});
marker
.
info
=
k
this
.
markers
[
i
]
=
marker
;
this
.
$set
(
this
.
markerList
,
k
.
id
,
marker
);
// this.infowins[i] = infoWindow;
// AMap.invoke("addOverlay", marker);
// AMap.invoke("markerAddEventListener", "click", (e) => {
// let data = { ...e, ...k };
// this.markerEvent(data);
// });
}
}
AMap
.
invoke
(
"setViewport"
,
markers
);
this
.
createClusterer
();
// AMap.invoke("setViewport", markers);
},
createClusterer
()
{
var
cluster
,
markers
=
[];
for
(
let
idx
in
this
.
markers
)
{
markers
.
push
(
this
.
markers
[
idx
]);
}
let
icon
=
require
(
'images/poi-marker-default.png'
)
this
.
cluster
=
AMap
.
invoke
(
"Cluster"
,
markers
,
(
data
)
=>
{
console
.
log
(
data
)
return
{
point
:
[
data
.
latLng
.
lng
,
data
.
latLng
.
lat
],
properties
:
{
address
:
data
.
address
,
near
:
data
.
near
,
poiType
:
data
.
poiType
,
// id: data.id,
// sn: data.sn,
// adcode: data.adcode,
marker
:
data
,
},
};
},
{
clusterMinPoints
:
2
,
clusterMaxZoom
:
18
,
updateRealTime
:
true
,
fitViewOnClick
:
true
,
renderSingleStyle
:
{
type
:
Cluster
.
ClusterRender
.
WEBGL
,
style
:
{
width
:
14
,
height
:
19
,
icon
:
icon
},
},
}
);
AMap
.
invoke
(
"clusterSetData"
,
this
.
cluster
);
//click | mouseover | mouseout | change | destroy
AMap
.
invoke
(
"clusterAddEventListener"
,
"click"
,
(
e
)
=>
{
if
(
e
.
properties
&&
e
.
properties
.
marker
)
{
let
data
=
{...
e
.
properties
.
marker
,...
e
.
properties
.
marker
.
info
}
this
.
markerEvent
(
data
);
// AMap.invoke(
// "infoWindowDisableCloseOnClick",
// e.properties.marker.openInfoWindow
// );
// AMap.invoke(
// "mapOpenInfoWindow",
// e.properties.marker.openInfoWindow,
// e.properties.marker.getPosition()
// );
}
});
// AMap.invoke("clusterAddEventListener", "mouseout", (e) => {
// AMap.invoke("mapCloseInfoWindow");
// });
},
// 地图右键添加poi点
...
...
@@ -386,7 +458,6 @@ export default {
// 删除poi点
removePoi
(
row
)
{
console
.
log
(
row
);
let
_this
=
this
;
let
_message
=
"确认删除该POI信息吗?"
;
let
_typeList
=
{
...
...
@@ -428,8 +499,13 @@ export default {
_params.id = row.id;
DELETE_POI_INFO(_params).then((res) => {
if (res.code == 200) {
// console.log(this.markerList,row)
let _marker = _this.markerList[row.id];
AMap.invoke('removeOverlay', _marker)
// AMap.invoke(
// "infoWindowDisableCloseOnClick",
// _InfoWindow
// );
_InfoWindow && AMap.invoke('mapCloseInfoWindow', _InfoWindow);
showToast({
message: "删除成功",
...
...
@@ -448,6 +524,7 @@ export default {
let _this = this;
let _query = _this.$route.query;
GET_POI_TRACK().then((res) => {
console.log(res,'GET_POI_TRACK')
if (res.code == 200) {
let _list = res.data || [];
_this.addMassMarkers(_list);
...
...
src/pages/monitor/alarmAnalysis.vue
View file @
2ad545a
...
...
@@ -271,6 +271,9 @@ export default {
async
initBMap
()
{
this
.
mapObj
=
await
mapService
.
init
(
"alarmMap"
);
window
.
AMap
=
this
.
mapObj
;
AMap
.
invoke
(
"LocalCity"
,
(
res
)
=>
{
AMap
.
invoke
(
'panTo'
,
res
.
center
)
});
this
.
isInitMap
=
true
;
this
.
boxShow
=
true
;
this
.
getStayPointList
(
this
.
vehicleId
);
...
...
src/pages/monitor/editFence.vue
View file @
2ad545a
...
...
@@ -764,7 +764,7 @@ export default {
if
(
!
value
)
return
true
;
return
data
.
label
.
indexOf
(
value
)
!==
-
1
;
},
listener
()
{
async
listener
()
{
const
state
=
history
.
state
;
if
(
!
state
)
{
this
.
init
(
null
);
...
...
@@ -775,7 +775,8 @@ export default {
this
.
readonlyStatus
=
readonlyStatus
;
this
.
fenceId
=
fenceId
;
}
this
.
init
(
btnRemark
);
await
this
.
$refs
.
fenceMap
.
initBMap
()
this
.
init
(
btnRemark
);
},
init
(
btnRemark
)
{
const
{
id
,
btnText
}
=
this
.
$route
.
query
;
...
...
@@ -784,26 +785,19 @@ export default {
this
.
btnText
=
btnText
;
}
if
(
typeof
this
.
fenceId
!=
"undefined"
)
{
console
.
log
(
1
)
btnRemark
===
"viewUpdated"
?
this
.
getUpdatedFenceDetail
(
this
.
fenceId
)
:
this
.
getFenceDetail
(
this
.
fenceId
);
}
else
{
// 线路编号无意义 屏蔽
// MONITOR_SERVICE.getNewFenceId().then((res)=>{
// if(res.returnCode == 0){
// this.form.fenceNo = res.data.fenceNo;
// this.$refs.fenceMap.initFence({
// fenceType: 'circle'
// });
// }
// });
this
.
$refs
.
fenceMap
.
initFence
({
fenceType
:
"polygon"
,
polygonPath
:
this
.
polygonPath
,
});
// 新增定位到当前位置
AMap
.
invoke
(
"LocalCity"
,
(
res
)
=>
{
AMap
.
invoke
(
'panTo'
,
res
.
center
)
});
this
.
restainFenceName
=
undefined
;
}
},
...
...
@@ -849,7 +843,6 @@ export default {
if
(
data
.
lnglat
)
{
this
.
polygonPath
=
data
.
lnglat
.
split
(
"|"
).
map
((
item
)
=>
{
let
arr
=
item
.
split
(
","
);
console
.
log
(
arr
);
return
mapService
.
getLngLat
(
arr
[
0
],
arr
[
1
]);
});
}
...
...
src/pages/monitor/fenceMap.vue
View file @
2ad545a
...
...
@@ -117,7 +117,7 @@ export default {
// _this.bindContextMenu();
// _this.bindSearch();
// });
this
.
initBMap
();
//
this.initBMap();
},
watch
:
{
lng
(
newVal
)
{
...
...
@@ -127,11 +127,16 @@ export default {
//this.transfer()
},
},
async
created
()
{},
async
created
()
{
// this.initBMap();
},
methods
:
{
async
initBMap
()
{
this
.
mapObj
=
await
mapService
.
init
(
"mapContainer"
);
window
.
AMap
=
this
.
mapObj
;
AMap
.
invoke
(
"LocalCity"
,
(
res
)
=>
{
// AMap.invoke('panTo',res.center)
});
this
.
bindContextMenu
();
this
.
bindSearch
();
},
...
...
@@ -266,6 +271,7 @@ export default {
}
},
initFence
(
data
)
{
console
.
log
(
data
)
let
_this
=
this
;
this
.
_mapPromiseTimeout
=
setInterval
(
function
()
{
if
(
_this
.
mapObj
)
{
...
...
@@ -398,6 +404,7 @@ export default {
});
AMap
.
invoke
(
"addOverlay"
,
self
.
polygon
);
AMap
.
invoke
(
'setZoom'
,
17
)
}
else
{
var
styleOptions
=
{
strokeColor
:
"#FF33FF"
,
// 边线颜色
...
...
src/pages/monitor/replay.vue
View file @
2ad545a
...
...
@@ -570,7 +570,6 @@ export default {
times
:
"0"
,
locationType
:
this
.
form
.
replayType
==
"RtTrack"
?
0
:
1
,
}).
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
code
==
200
)
{
const
data
=
res
.
data
;
if
(
data
.
length
)
{
...
...
src/pages/monitor/zoneCar.vue
View file @
2ad545a
...
...
@@ -228,9 +228,13 @@ export default {
},
methods
:
{
async
initBMap
()
{
console
.
log
(
11111111111
);
this
.
mapObj
=
await
mapService
.
init
(
"map"
);
this
.
mapLoading
=
false
;
window
.
AMap
=
this
.
mapObj
;
AMap
.
invoke
(
"LocalCity"
,
(
res
)
=>
{
AMap
.
invoke
(
'panTo'
,
res
.
center
)
});
this
.
autoComplete
=
AMap
.
invoke
(
"Autocomplete"
,
{
input
:
"tipInput"
,
});
...
...
@@ -248,7 +252,6 @@ export default {
}
},
// 获取地址
getAddress
()
{
let
_this
=
this
;
...
...
@@ -656,16 +659,15 @@ export default {
// 如果是地址,则标记出对应的点
if (query.menuId == 1 && query.lng) {
let poi
=AMap.invoke('Point',query.lng, query.lat)
let poi
= AMap.invoke("Point", query.lng, query.lat);
this.autoCenterMarker = mapService.createMarker(poi);
AMap.invoke(
'addOverlay',
this.autoCenterMarker);
AMap.invoke(
"addOverlay",
this.autoCenterMarker);
AMap.invoke("panTo", poi);
}
this.drawRectangle(query);
this.getAreaLocation();
this.autoComplete.setInputValue(this.form.address);
},
...
...
@@ -689,22 +691,22 @@ export default {
});
AMap.invoke("addOverlay", overlay);
console.log(overlay);
AMap.invoke("rectOpenEdit", overlay,{
isOpen:false,
enableDragging:
true
AMap.invoke("rectOpenEdit", overlay,
{
isOpen:
false,
enableDragging:
true,
}); //开启编辑
// AMap.invoke("rectCloseEdit"); //关闭编辑
// AMap.invoke("rectAddEventListener", "operate-change", (e) => {
// console.log(e.target);
// });
this.rectangle
=overlay
this.rectangle
= overlay;
this.calculateWidthHeight(overlay.getBounds());
let _zoom = AMap.invoke("getZoom");
AMap.invoke("setZoom",
24)
AMap.invoke("setZoom",
24);
console.log(_zoom);
if (_zoom < 11) {
AMap.invoke("setZoom",
11)
AMap.invoke("setZoom",
11);
}
AMap.invoke("panTo", pathArr[0], true);
...
...
src/utils/fence.js
View file @
2ad545a
...
...
@@ -2,7 +2,7 @@
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2024-11-28 16:37:15
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2024-12-2
0 11:07:37
* @LastEditTime: 2024-12-2
6 15:31:02
* @FilePath: \oEshield\src\utils\fence.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -109,20 +109,22 @@ const fence = {
},
updateFenceCircle
(
data
){
console
.
log
(
data
)
let
center
AMap
.
invoke
(
'circleDisableEditing'
)
if
(
data
.
radius
&&
this
.
circle
){
this
.
circle
.
setRadius
(
data
.
radius
*
1
)
}
if
(
data
.
lng
&&
data
.
lat
){
let
center
=
mapService
.
getLngLat
(
data
.
lng
,
this
.
lat
);
center
=
mapService
.
getLngLat
(
data
.
lng
,
this
.
lat
);
this
.
circle
&&
this
.
circle
.
setCenter
(
center
);
AMap
.
invoke
(
'panTo'
,
center
,
true
)
}
center
=
this
.
circle
&&
this
.
circle
.
getCenter
()
AMap
.
invoke
(
'removeOverlay'
,
this
.
circle
)
AMap
.
invoke
(
'addOverlay'
,
this
.
circle
)
AMap
.
invoke
(
'circleEnableEditing'
)
AMap
.
invoke
(
'panTo'
,
center
,
true
)
},
createFenceCircle
(
data
)
{
if
(
!
this
.
circle
){
...
...
@@ -215,6 +217,7 @@ const fence = {
})
AMap
.
invoke
(
'addOverlay'
,
self
.
polygon
)
AMap
.
invoke
(
'setZoom'
,
17
)
}
else
if
(
self
.
isEditMode
)
{
var
styleOptions
=
{
strokeColor
:
'#FF33FF'
,
// 边线颜色
...
...
src/utils/mapBService.js
View file @
2ad545a
...
...
@@ -2,7 +2,7 @@
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2024-12-06 14:10:32
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2024-12-2
3 14:10:33
* @LastEditTime: 2024-12-2
7 17:25:57
* @FilePath: \oEshield\src\utils\mapBService.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -56,7 +56,7 @@ MapService.prototype = {
// 添加比例尺
mapapi
.
invoke
(
"ScaleControl"
)
// 距离测量
//
mapapi.invoke('DistanceTool',this.mapInstance)
mapapi
.
invoke
(
'DistanceTool'
,
this
.
mapInstance
)
resolve
(
mapapi
)
// //距离测量
...
...
@@ -124,7 +124,7 @@ MapService.prototype = {
createPointMarker
:
function
(
lnglatXY
)
{
let
that
=
this
,
url
=
require
(
'images/point.png'
),
size
=
that
.
map
.
invoke
(
'Size'
,
36
,
22
)
size
=
that
.
map
.
invoke
(
'Size'
,
18
,
18
)
var
marker
=
that
.
map
.
invoke
(
'Marker'
,
lnglatXY
,
{
icon
:
that
.
map
.
invoke
(
'Icon'
,
url
,
size
)
})
...
...
@@ -279,6 +279,7 @@ MapService.prototype = {
return
Circle
},
createInfoWindow
(
marker
,
map
,
div
,
isInfoOpen
,
isInfoAutoMove
)
{
console
.
log
(
div
,
'div'
)
var
self
=
this
;
var
infoWindow
=
self
.
map
.
invoke
(
'InfoWindow'
,
div
,{
enableAutoPan
:
!!
isInfoAutoMove
...
...
@@ -288,42 +289,41 @@ MapService.prototype = {
if
(
clipboard
)
{
clipboard
.
destroy
();
}
clipboard
=
new
ClipboardJS
(
'.copy-btn'
,
{
text
:
function
(
trigger
)
{
return
trigger
.
getAttribute
(
'aria-label'
);
}
})
clipboard
.
on
(
'success'
,
function
(
e
)
{
e
.
clearSelection
();
EventBus
.
$emit
(
'uiMap.copySuccess'
);
});
clipboard
.
on
(
'error'
,
function
(
e
)
{
});
if
(
isInfoOpen
)
{
infoWindow
.
redraw
();
}
//给Marker绑定单击事件
// marker.addEventListener('click', markerClick);
self
.
map
.
invoke
(
'markerAddEventListener'
,
'click'
,
markerClick
)
self
.
map
.
invoke
(
'infoWindowAddEventListener'
,
'open'
,()
=>
{
clipboard
=
new
ClipboardJS
(
document
.
querySelectorAll
(
'.copy-btn'
),
{
text
:
function
(
trigger
)
{
console
.
log
(
trigger
,
trigger
.
getAttribute
(
'aria-label'
),
'trigger'
)
return
trigger
.
getAttribute
(
'aria-label'
);
}
})
clipboard
.
on
(
'success'
,
function
(
e
)
{
e
.
clearSelection
();
EventBus
.
$emit
(
'uiMap.copySuccess'
);
});
clipboard
.
on
(
'error'
,
function
(
e
)
{
console
.
log
(
e
,
'err'
)
});
})
function
markerClick
(
e
)
{
//infoWindow.setContent(e.target.content);
self
.
map
.
invoke
(
"mapOpenInfoWindow"
,
infoWindow
,
e
.
target
.
getPosition
())
// infoWindow.open(map, e.target.getPosition());
}
return
infoWindow
;
},
// 初始化复制事件
initCopyEvent
()
{
var
clipboard
=
new
ClipboardJS
(
'.copy-btn'
,
{
text
:
function
(
trigger
)
{
return
trigger
.
getAttribute
(
'aria-label'
);
}
})
},
// 车辆监控-查看位置点
bindMonitorInfoWindow
:
function
(
marker
,
map
,
info
,
isInfoOpen
,
isInfoAutoMove
)
{
...
...
@@ -707,6 +707,7 @@ MapService.prototype = {
// 根据权限-显示店面名称、车牌号
let
list
=
vue
.
prototype
.
$parentCommon
.
getAuthData
();
console
.
log
(
list
,
'list'
)
let
o
=
list
.
find
(
k
=>
k
.
origin
.
permissionTag
==
'oEshield_monitor_store_name'
);
let
n
=
list
.
find
(
k
=>
k
.
origin
.
permissionTag
==
'oEshield_monitor_plate_number'
);
if
(
o
&&
info
.
shopName
)
{
...
...
@@ -715,7 +716,8 @@ MapService.prototype = {
if
(
n
&&
info
.
licensePlate
)
{
_html
+=
`<p><i class="icon_info_plate"></i>车牌号: <span class="des copy-btn" aria-label="
${
info
.
licensePlate
}
">
${
info
.
licensePlate
||
'--'
}
</span></p>`
;
}
}
console
.
log
(
info
,
'info'
)
_html
+=
`<p class="" aria-label="
${
info
.
sn
}
"><i class="icon icon-info_device"></i> 设备号:<span class="des copy-btn" aria-label="
${
info
.
sn
}
(
${
info
.
isSource
===
'1'
?
'有线'
:
'无线'
}
)">
${
info
.
sn
}
(
${
info
.
isSource
===
'1'
?
'有线'
:
'无线'
}
)</span>
<span class="battery" data-battery>
...
...
@@ -730,7 +732,7 @@ MapService.prototype = {
</p>
<p><i class="icon icon-info_time"></i> 最后上点时间: <span class="des copy-btn" data-time aria-label=""></span></p>
<p><i class="icon icon-info_location"></i> 最后上点地址: <span class="des adr copy-btn" data-transferAddress aria-label="
${
info
.
transferAddress
}
">
${
info
.
transferAddress
}
</span>
<a class="" data-clipboard-text="
${
info
.
transferAddress
}
"><i class="icon icon-info_copy copy-btn" data-address-icon aria-label="
${
info
.
transferAddress
}
"></i></a>
<a class="" data-clipboard-text="
${
info
.
transferAddress
}
"><i class="icon icon-info_copy copy-btn
copy-btn1
" data-address-icon aria-label="
${
info
.
transferAddress
}
"></i></a>
</p>
<p><i class="icon icon-info_type"></i> 定位类型:<span class="el-button-group">`
...
...
@@ -792,7 +794,7 @@ MapService.prototype = {
<div class="map-infowindow-ct">
<p><i class="icon icon-info_time"></i> 停留时间: <span class="des">
${
info
.
begintime
}
</span></p>
<p><i class="icon icon-info_location"></i> 停留地址: <span class="des adr" >
${
info
.
transferAddress
}
</span>
<a class="
copy-btn address-copy" id="address-copy" address-copy data-clipboard-text="
${
info
.
transferAddress
}
"><i class="icon icon-info_copy
"></i></a>
<a class="
address-copy" id="address-copy" address-copy data-clipboard-text="
${
info
.
transferAddress
}
"><i class="icon copy-btn icon-info_copy" aria-label="
${
info
.
transferAddress
}
"></i></a>
</p>
<p><i class="icon icon-info_stop"></i> 停留时长: <span class="des">
${
info
.
duration
}
</span></p>
</div>`
;
...
...
@@ -802,7 +804,7 @@ MapService.prototype = {
<div class="map-infowindow-ct">
<p><i class="icon icon-info_device"></i> 设备号: <span class="des">
${
info
.
sn
}
</span></p>
<p><i class="icon icon-info_location"></i> 常驻地址: <span class="des adr" >
${
info
.
transferAddress
}
</span>
<a
class="copy-btn" data-clipboard-text="
${
info
.
transferAddress
}
"><i class="icon icon-info_copy
"></i></a>
<a
data-clipboard-text="
${
info
.
transferAddress
}
"><i class="copy-btn icon icon-info_copy" aria-label="
${
info
.
transferAddress
}
"></i></a>
</p>
<p><i class="icon icon-info_device"></i> 驻留次数: <span class="des">
${
info
.
totalTimes
}
次</span></p>
<p><i class="icon icon-info_stop"></i> 驻留时长: <span class="des">
${
info
.
totalDurationString
}
</span></p>
...
...
@@ -832,7 +834,7 @@ MapService.prototype = {
msg
=
'定位'
}
return
`<h3 class="map-infowindow-title">
${
info
.
name
||
'--'
}
/
${
info
.
standNo
||
'--'
}
</h3>
return
`<h3 class="map-infowindow-title
-other
">
${
info
.
name
||
'--'
}
/
${
info
.
standNo
||
'--'
}
</h3>
<div class="map-infowindow-ct">
<p><i class="icon icon-info_device"></i> 设备号: <span class="des">
${
info
.
sn
}
(
${
info
.
source
==
1
?
'有线'
:
'无线'
}
)</span></p>
<p><i class="icon icon-info_time"></i>
${
msg
}
时间: <span class="des"data-time>
${
info
.
time
}
</span></p>
...
...
src/utils/monitor.js
View file @
2ad545a
...
...
@@ -96,8 +96,7 @@ const monitor = {
const
lnglat
=
this
.
markers
[
snSourceType
].
getPosition
();
AMap
.
invoke
(
"mapOpenInfoWindow"
,
this
.
infowins
[
snSourceType
],
lnglat
)
AMap
.
invoke
(
'addOverlay'
,
this
.
markers
[
snSourceType
])
mapService
.
mapInstance
.
panTo
(
lnglat
,
true
)
AMap
.
invoke
(
'panTo'
,
lnglat
)
}
});
...
...
@@ -107,9 +106,10 @@ const monitor = {
let
eLocation
=
item
[
item
.
eLocateType
];
if
(
this
.
markers
[
snSourceType
])
{
this
.
markers
[
snSourceType
].
setPosition
(
mapService
.
getLngLat
(
parseFloat
(
eLocation
.
elng
),
parseFloat
(
eLocation
.
e
lat
)));
AMap
.
invoke
(
"mapOpenInfoWindow"
,
this
.
infowins
[
snSourceType
],
mapService
.
getLngLat
(
parseFloat
(
eLocation
.
elng
),
parseFloat
(
eLocation
.
e
lat
)))
this
.
markers
[
snSourceType
].
setPosition
(
mapService
.
getLngLat
(
parseFloat
(
eLocation
.
blng
),
parseFloat
(
eLocation
.
b
lat
)));
AMap
.
invoke
(
"mapOpenInfoWindow"
,
this
.
infowins
[
snSourceType
],
mapService
.
getLngLat
(
parseFloat
(
eLocation
.
blng
),
parseFloat
(
eLocation
.
b
lat
)))
AMap
.
invoke
(
'addOverlay'
,
this
.
markers
[
snSourceType
])
// this.infowins[snSourceType].setPosition();
}
...
...
@@ -131,7 +131,7 @@ const monitor = {
if
(
res
.
returnCode
==
0
)
{
const
data
=
res
.
data
if
(
data
)
{
const
transferObj
=
{
elat
:
data
.
wifiLat
,
e
lng
:
data
.
wifiLng
}
const
transferObj
=
{
blat
:
data
.
wifiLat
,
b
lng
:
data
.
wifiLng
}
MAPGEO
.
transferAddressByGroup
({
data
:
[
transferObj
]
},
()
=>
{
infoDiv
.
querySelector
(
'[data-transferAddress]'
).
textContent
=
transferObj
.
transferAddress
;
infoDiv
.
querySelector
(
'[data-time]'
).
textContent
=
data
.
lastReportTime
;
...
...
@@ -139,8 +139,8 @@ const monitor = {
const
snSourceType
=
`
${
info
.
sn
}
:
${
info
.
isSource
}
`
if
(
this
.
markers
[
snSourceType
])
{
this
.
markers
[
snSourceType
].
setPosition
(
mapService
.
getLngLat
(
parseFloat
(
transferObj
.
elng
),
parseFloat
(
transferObj
.
e
lat
)));
AMap
.
invoke
(
"mapOpenInfoWindow"
,
this
.
infowins
[
snSourceType
],
mapService
.
getLngLat
(
parseFloat
(
transferObj
.
e
lng
)))
this
.
markers
[
snSourceType
].
setPosition
(
mapService
.
getLngLat
(
parseFloat
(
transferObj
.
blng
),
parseFloat
(
transferObj
.
b
lat
)));
AMap
.
invoke
(
"mapOpenInfoWindow"
,
this
.
infowins
[
snSourceType
],
mapService
.
getLngLat
(
parseFloat
(
transferObj
.
b
lng
)))
AMap
.
invoke
(
'addOverlay'
,
this
.
markers
[
snSourceType
])
}
gpsBtn
&&
gpsBtn
.
classList
.
remove
(
'el-button--primary'
);
...
...
@@ -166,18 +166,19 @@ const monitor = {
this
.
data
=
data
;
const
transferObj
=
[]
data
.
forEach
((
item
)
=>
{
if
(
item
.
gpsLocation
&&
item
.
gpsLocation
.
elat
&&
item
.
gpsLocation
.
e
lng
)
{
if
(
item
.
gpsLocation
&&
item
.
gpsLocation
.
blat
&&
item
.
gpsLocation
.
b
lng
)
{
transferObj
.
push
(
item
.
gpsLocation
)
}
if
(
item
.
bsLocation
&&
item
.
bsLocation
.
elat
&&
item
.
bsLocation
.
e
lng
)
{
if
(
item
.
bsLocation
&&
item
.
bsLocation
.
blat
&&
item
.
bsLocation
.
b
lng
)
{
transferObj
.
push
(
item
.
bsLocation
)
}
})
MAPGEO
.
transferAddressByGroup
({
data
:
transferObj
},
()
=>
{
this
.
data
.
forEach
((
item
,
idx
)
=>
{
console
.
log
(
item
)
let
eLocation
=
item
[
item
.
eLocateType
];
if
(
!
eLocation
.
elng
&&
!
eLocation
.
e
lat
)
return
;
if
(
!
eLocation
.
blng
&&
!
eLocation
.
b
lat
)
return
;
let
isInfoOpen
=
false
;
let
tag
=
`
${
item
.
sn
}
:
${
item
.
isSource
}
`
;
if
(
this
.
infowins
[
tag
]
&&
this
.
infowins
[
tag
].
isOpen
())
{
...
...
@@ -187,8 +188,8 @@ const monitor = {
let
infoWindow
;
let
snSourceType
=
`
${
item
.
sn
}
:
${
item
.
isSource
}
`
if
(
this
.
markers
[
tag
])
{
this
.
markers
[
tag
].
setPosition
(
mapService
.
getLngLat
(
parseFloat
(
eLocation
.
elng
),
parseFloat
(
eLocation
.
e
lat
)));
//this.infowins[tag].setPosition(mapService.getLngLat(parseFloat(eLocation.
elng), parseFloat(eLocation.e
lat)));
this
.
markers
[
tag
].
setPosition
(
mapService
.
getLngLat
(
parseFloat
(
eLocation
.
blng
),
parseFloat
(
eLocation
.
b
lat
)));
//this.infowins[tag].setPosition(mapService.getLngLat(parseFloat(eLocation.
blng), parseFloat(eLocation.b
lat)));
//infoWindow = mapService.bindMonitorInfoWindow(this.markers[tag], MAP, item, isInfoOpen);
console
.
log
(
this
.
markers
,
'markers'
)
this
.
infowins
[
tag
]
=
mapService
.
bindMonitorInfoWindow
(
this
.
markers
[
tag
],
AMap
,
item
,
isInfoOpen
,
this
.
isCompare
?
true
:
false
);
...
...
@@ -196,7 +197,7 @@ const monitor = {
EventBus
.
$emit
(
`uiMap.monitor.changeStatus.
${
snSourceType
}
`
)
}
else
{
this
.
infowins
[
tag
]
&&
MAP
.
remove
(
this
.
infowins
[
tag
]);
const
getLngLat
=
mapService
.
getLngLat
(
parseFloat
(
eLocation
.
elng
),
parseFloat
(
eLocation
.
e
lat
))
const
getLngLat
=
mapService
.
getLngLat
(
parseFloat
(
eLocation
.
blng
),
parseFloat
(
eLocation
.
b
lat
))
let
marker
=
mapService
.
createCarMarker
(
getLngLat
,
AMap
);
infoWindow
=
mapService
.
bindMonitorInfoWindow
(
marker
,
AMap
,
item
,
isInfoOpen
,
this
.
isCompare
?
true
:
false
);
this
.
markers
[
tag
]
=
marker
;
...
...
src/utils/replay.js
View file @
2ad545a
...
...
@@ -44,9 +44,9 @@ const replay = {
let
p1
=
replayData
[
0
];
let
p2
=
replayData
[
replayData
.
length
-
1
];
let
line
=
AMap
.
invoke
(
'Polyline'
,
replayData
,
{
strokeColor
:
'#0b94db'
,
strokeWeight
:
6
})
replay
.
startMarker
=
mapService
.
createStartMarker
(
p1
,
AMap
);
replay
.
endMarker
=
mapService
.
createEndMarker
(
p2
,
AMap
);
replay
.
dis
=
AMap
.
invoke
(
'getDistance'
,
p1
,
p2
)
/
1000
// 算出轨迹的距离(km)
replay
.
startMarker
=
mapService
.
createStartMarker
(
p1
,
AMap
);
replay
.
endMarker
=
mapService
.
createEndMarker
(
p2
,
AMap
);
replay
.
dis
=
AMap
.
invoke
(
'getDistance'
,
p1
,
p2
)
/
1000
// 算出轨迹的距离(km)
AMap
.
invoke
(
'setViewport'
,
replayData
);
AMap
.
invoke
(
'addOverlay'
,
line
)
AMap
.
invoke
(
'addOverlay'
,
replay
.
startMarker
)
...
...
@@ -56,7 +56,7 @@ const replay = {
defaultContent
:
replay
.
getNavgInfoContent
(
firstItem
),
autoView
:
true
,
// 是否开启自动视野调整,如果开启那么路书在运动过程中会根据视野自动调整
speed
:
replay
.
getSpeed
(
replay
.
speed
,
replay
.
dis
),
icon
:
AMap
.
invoke
(
'Icon'
,
'https://e-shield-old.glsx.com.cn/images/icon_car.png'
,
AMap
.
invoke
(
'Size'
,
36
,
22
),{
anchor
:
AMap
.
invoke
(
'Size'
,
24
,
24
)
}),
icon
:
AMap
.
invoke
(
'Icon'
,
'https://e-shield-old.glsx.com.cn/images/icon_car.png'
,
AMap
.
invoke
(
'Size'
,
36
,
22
),{
anchor
:
AMap
.
invoke
(
'Size'
,
18
,
11
)
}),
enableRotation
:
true
,
// 是否设置marker随着道路的走向进行旋转
})
AMap
.
invoke
(
'lushuStart'
)
//开始
...
...
@@ -89,6 +89,7 @@ const replay = {
</div>`
},
destroy
:
function
(){
AMap
.
invoke
(
'clearsOverlay'
)
// const MAP = mapService.map;
// if(replay.pathSimplifierIns){
// replay.pathSimplifierIns.hide();
...
...
@@ -105,6 +106,7 @@ const replay = {
bindEvent
(){
//解析轨迹地址
EventBus
.
$on
(
'uiMap.replay.transferAdr'
,
function
(
data
){
console
.
log
(
data
)
replay
.
data
=
data
;
replay
.
transferAddressByGroup
();
});
...
...
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