Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NewTruckTerminalSyetem
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
SQL_Mou
NewTruckTerminalSyetem
Commits
9df807eb
Commit
9df807eb
authored
Aug 31, 2022
by
xxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
b3fe62e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
index.vue
src/views/MLargeScreen/index.vue
+36
-3
No files found.
src/views/MLargeScreen/index.vue
View file @
9df807eb
...
...
@@ -134,6 +134,11 @@ export default {
batteryEnegy
:
0
,
//判断卸车1
boo1
:
false
,
//暂存的经纬度
oldxy
:{
lat
:
0
,
//纬度
lng
:
0
,
//经度
},
}
},
mounted
(){
...
...
@@ -147,7 +152,7 @@ export default {
if
(
this
.
carclass
==
'
铲车
'
){
this
.
loadData1
();
}
//获取报警记录
//获取报警记录
以及坐标计算距离并返回给后台
httpGet
(
vehicleInformationQuery
,{
number
:
this
.
carnumber
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
if
(
res
.
data
.
totalElements
==
0
){
...
...
@@ -174,10 +179,27 @@ export default {
});
}
});
//获取车辆坐标计算距离并返回给后台
httpGet
(
carRealTimeLocationQuery2
,{
name
:
res
.
data
.
content
[
0
].
equipmentName
}).
then
((
res2
)
=>
{
if
(
res2
.
data
){
if
(
this
.
oldxy
.
lat
==
0
||
this
.
oldxy
.
lng
==
0
){
this
.
oldxy
.
lat
=
res2
.
data
.
location
.
y
;
this
.
oldxy
.
lng
=
res2
.
data
.
location
.
x
;
}
else
{
let
distance1
=
this
.
getDistance
(
this
.
oldxy
.
lat
,
this
.
oldxy
.
lng
,
res2
.
data
.
location
.
y
,
res2
.
data
.
location
.
x
)
+
parseFloat
(
res
.
data
.
content
[
0
].
odo
);
putForJson
(
vehicleInformationUpdate
,{
id
:
res
.
data
.
content
[
0
].
id
,
odo
:
distance1
}).
then
((
res
)
=>
{});
this
.
$nextTick
(()
=>
{
this
.
oldxy
.
lat
=
res2
.
data
.
location
.
y
;
this
.
oldxy
.
lng
=
res2
.
data
.
location
.
x
;
})
}
}
});
}
}
});
},
20000
)
},
15000
)
},
methods
:{
...
...
@@ -506,6 +528,17 @@ export default {
}
});
},
//根据两个经纬度计算距离
getDistance
(
lat1
,
lng1
,
lat2
,
lng2
)
{
var
radLat1
=
lat1
*
Math
.
PI
/
180.0
;
var
radLat2
=
lat2
*
Math
.
PI
/
180.0
;
var
a
=
radLat1
-
radLat2
;
var
b
=
lng1
*
Math
.
PI
/
180.0
-
lng2
*
Math
.
PI
/
180.0
;
var
s
=
2
*
Math
.
asin
(
Math
.
sqrt
(
Math
.
pow
(
Math
.
sin
(
a
/
2
),
2
)
+
Math
.
cos
(
radLat1
)
*
Math
.
cos
(
radLat2
)
*
Math
.
pow
(
Math
.
sin
(
b
/
2
),
2
)));
s
=
s
*
6378.137
// EARTH_RADIUS;
s
=
Math
.
round
(
s
*
10000
)
/
10000
;
return
s
},
//执行路径
zhixinglujing
(
boo
){
//this.$refs.mars3dViewerMapMethod.addArrowGraphic3(boo);
...
...
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