Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
e-shield-h5
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 4cd73381
authored
Jul 25, 2022
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
冒烟 问题
1 parent
8a708d2a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
src/components/mapContent.vue
src/views/fence.vue
src/views/index.vue
src/components/mapContent.vue
View file @
4cd7338
...
@@ -9,7 +9,8 @@
...
@@ -9,7 +9,8 @@
</div>
</div>
<div
v-show=
"isUploaded"
>
<div
v-show=
"isUploaded"
>
<a
class=
"map-cmd-icon location"
@
click=
"getLocation"
>
<a
class=
"map-cmd-icon location"
@
click=
"getLocation"
>
<span
class=
"icon icon-location"
></span>
<span
v-if=
"!isGetLocation"
class=
"icon icon-location"
></span>
<van-loading
v-else
color=
"#1989fa"
/>
</a>
</a>
<a
class=
"map-cmd-icon refresh-car"
@
click=
"refresh"
>
<a
class=
"map-cmd-icon refresh-car"
@
click=
"refresh"
>
<span
class=
"icon icon-refresh-car"
></span>
<span
class=
"icon icon-refresh-car"
></span>
...
@@ -30,6 +31,7 @@ export default {
...
@@ -30,6 +31,7 @@ export default {
const
satelActive
=
ref
(
null
);
const
satelActive
=
ref
(
null
);
const
roadActive
=
ref
(
null
);
const
roadActive
=
ref
(
null
);
const
sharePage
=
ref
(
false
);
const
sharePage
=
ref
(
false
);
const
isGetLocation
=
ref
(
false
);
onMounted
(()
=>
{});
onMounted
(()
=>
{});
const
initMap
=
(
id
)
=>
{
const
initMap
=
(
id
)
=>
{
sharePage
.
value
=
JSON
.
parse
(
localStorage
.
getItem
(
"sharePage"
));
sharePage
.
value
=
JSON
.
parse
(
localStorage
.
getItem
(
"sharePage"
));
...
@@ -55,6 +57,7 @@ export default {
...
@@ -55,6 +57,7 @@ export default {
let
currMarker
=
null
;
let
currMarker
=
null
;
// 获取定位
// 获取定位
const
getLocation
=
()
=>
{
const
getLocation
=
()
=>
{
isGetLocation
.
value
=
true
;
map
.
plugin
(
"AMap.Geolocation"
,
function
()
{
map
.
plugin
(
"AMap.Geolocation"
,
function
()
{
var
geolocation
=
new
window
.
AMap
.
Geolocation
({
var
geolocation
=
new
window
.
AMap
.
Geolocation
({
enableHighAccuracy
:
true
,
enableHighAccuracy
:
true
,
...
@@ -69,6 +72,7 @@ export default {
...
@@ -69,6 +72,7 @@ export default {
if
(
currMarker
)
{
if
(
currMarker
)
{
currMarker
.
setMap
(
null
);
currMarker
.
setMap
(
null
);
}
}
isGetLocation
.
value
=
false
;
currMarker
=
new
window
.
AMap
.
Marker
({
currMarker
=
new
window
.
AMap
.
Marker
({
position
:
data
.
position
,
position
:
data
.
position
,
content
:
'<span class="curr-marker"></span>'
,
content
:
'<span class="curr-marker"></span>'
,
...
@@ -77,7 +81,9 @@ export default {
...
@@ -77,7 +81,9 @@ export default {
});
});
map
.
setFitView
();
map
.
setFitView
();
});
});
window
.
AMap
.
event
.
addListener
(
geolocation
,
"error"
,
()
=>
{});
window
.
AMap
.
event
.
addListener
(
geolocation
,
"error"
,
()
=>
{
isGetLocation
.
value
=
false
;
});
});
});
};
};
// 刷新
// 刷新
...
@@ -94,6 +100,7 @@ export default {
...
@@ -94,6 +100,7 @@ export default {
refresh
,
refresh
,
isUploaded
,
isUploaded
,
sharePage
,
sharePage
,
isGetLocation
,
};
};
},
},
};
};
...
...
src/views/fence.vue
View file @
4cd7338
...
@@ -96,6 +96,7 @@ export default defineComponent({
...
@@ -96,6 +96,7 @@ export default defineComponent({
const
routeQuery
=
route
.
query
;
const
routeQuery
=
route
.
query
;
const
hasRadiusFence
=
ref
(
false
);
const
hasRadiusFence
=
ref
(
false
);
const
hasProviceCityFence
=
ref
(
false
);
const
hasProviceCityFence
=
ref
(
false
);
const
adcodeItemName
=
ref
(
null
);
let
district
=
null
;
let
district
=
null
;
onMounted
(()
=>
{
onMounted
(()
=>
{
AMapLoader
.
load
({
AMapLoader
.
load
({
...
@@ -112,7 +113,18 @@ export default defineComponent({
...
@@ -112,7 +113,18 @@ export default defineComponent({
});
});
});
});
// 地图刷新
// 地图刷新
const
refreshCb
=
()
=>
{};
const
refreshCb
=
(
map
)
=>
{
map
.
clearMap
();
getData
(
map
);
if
(
hasRadiusFence
.
value
)
{
createCircle
(
currLnglat
.
value
,
radiusNum
.
value
);
createPoint
(
currLnglat
.
value
);
}
if
(
hasProviceCityFence
.
value
&&
adcodeItemName
.
value
)
{
coverArea
(
adcodeItemName
.
value
,
map
);
}
map
.
setFitView
();
};
// 切换围栏类型
// 切换围栏类型
const
changeFenceType
=
(
index
)
=>
{
const
changeFenceType
=
(
index
)
=>
{
selectedTypeItem
.
value
=
index
;
selectedTypeItem
.
value
=
index
;
...
@@ -132,6 +144,7 @@ export default defineComponent({
...
@@ -132,6 +144,7 @@ export default defineComponent({
val
[
"gpsLocation"
].
elng
,
val
[
"gpsLocation"
].
elng
,
val
[
"gpsLocation"
].
elat
val
[
"gpsLocation"
].
elat
);
);
drawMarker
(
currLnglat
.
value
);
});
});
}
else
{
}
else
{
Dialog
({
message
:
"暂无数据"
});
Dialog
({
message
:
"暂无数据"
});
...
@@ -162,7 +175,6 @@ export default defineComponent({
...
@@ -162,7 +175,6 @@ export default defineComponent({
currentMap
=
currentMap
currentMap
=
currentMap
?
currentMap
?
currentMap
:
mapContentRefs
.
value
.
init
(
"fenceContainer"
);
:
mapContentRefs
.
value
.
init
(
"fenceContainer"
);
drawMarker
(
currLnglat
.
value
);
currentMap
.
setFitView
();
currentMap
.
setFitView
();
showSettingDialog
.
value
=
false
;
showSettingDialog
.
value
=
false
;
hasRadiusFence
.
value
=
true
;
hasRadiusFence
.
value
=
true
;
...
@@ -188,6 +200,7 @@ export default defineComponent({
...
@@ -188,6 +200,7 @@ export default defineComponent({
Toast
(
Toast
(
`设定
${
proviceCityType
.
value
===
1
?
"跨省"
:
"跨市"
}
围栏成功`
`设定
${
proviceCityType
.
value
===
1
?
"跨省"
:
"跨市"
}
围栏成功`
);
);
adcodeItemName
.
value
=
adcodeItem
.
name
;
coverArea
(
adcodeItem
.
name
,
currentMap
);
coverArea
(
adcodeItem
.
name
,
currentMap
);
currentMap
.
setFitView
();
currentMap
.
setFitView
();
hasProviceCityFence
.
value
=
true
;
hasProviceCityFence
.
value
=
true
;
...
@@ -271,6 +284,7 @@ export default defineComponent({
...
@@ -271,6 +284,7 @@ export default defineComponent({
map
:
currentMap
,
map
:
currentMap
,
offset
:
new
window
.
AMap
.
Pixel
(
-
17
,
-
26
),
offset
:
new
window
.
AMap
.
Pixel
(
-
17
,
-
26
),
});
});
currentMap
.
setFitView
();
};
};
// 地图添加圆
// 地图添加圆
const
createCircle
=
(
lnglat
,
radius
)
=>
{
const
createCircle
=
(
lnglat
,
radius
)
=>
{
...
@@ -321,6 +335,7 @@ export default defineComponent({
...
@@ -321,6 +335,7 @@ export default defineComponent({
createCircle
,
createCircle
,
hasRadiusFence
,
hasRadiusFence
,
hasProviceCityFence
,
hasProviceCityFence
,
adcodeItemName
,
};
};
},
},
});
});
...
...
src/views/index.vue
View file @
4cd7338
...
@@ -598,7 +598,7 @@ export default defineComponent({
...
@@ -598,7 +598,7 @@ export default defineComponent({
GET_ALL_CAR_LIST
({
GET_ALL_CAR_LIST
({
pageSize
:
10
,
pageSize
:
10
,
pageNumber
:
pageNumber
.
value
,
pageNumber
:
pageNumber
.
value
,
term
:
keyWord
.
value
,
keyWord
:
keyWord
.
value
,
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
list
.
value
=
list
.
value
.
concat
(
res
.
data
.
list
);
list
.
value
=
list
.
value
.
concat
(
res
.
data
.
list
);
...
...
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