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
04d91f49
Commit
04d91f49
authored
Nov 11, 2022
by
xxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改定位判断方法
parent
e7e43b5b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
26 deletions
+38
-26
Map.vue
src/components/mars3d/Map.vue
+4
-4
index.vue
src/views/MLargeScreen/index.vue
+34
-22
No files found.
src/components/mars3d/Map.vue
View file @
04d91f49
...
@@ -252,22 +252,22 @@ export default {
...
@@ -252,22 +252,22 @@ export default {
})
})
//三秒后位置
//三秒后位置
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphic
.
addDynamicPosition
(
Cesium
.
Cartesian3
.
fromDegrees
(
that
.
defaultjd
,
that
.
defaultwd
,
1000
),
3
)
graphic
.
addDynamicPosition
(
Cesium
.
Cartesian3
.
fromDegrees
(
that
.
defaultjd
,
that
.
defaultwd
,
1000
),
1
)
})
})
//定时更新动态位置
//定时更新动态位置
setInterval
(()
=>
{
setInterval
(()
=>
{
httpGet
(
carRealTimeLocationQuery2
,{
name
:
equipmentName
}).
then
((
res
)
=>
{
httpGet
(
carRealTimeLocationQuery2
,{
name
:
equipmentName
}).
then
((
res
)
=>
{
if
(
res
.
data
){
if
(
res
.
data
){
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphic
.
addDynamicPosition
(
Cesium
.
Cartesian3
.
fromDegrees
(
res
.
data
.
location
.
x
,
res
.
data
.
location
.
y
,
1000
),
3
)
graphic
.
addDynamicPosition
(
Cesium
.
Cartesian3
.
fromDegrees
(
res
.
data
.
location
.
x
,
res
.
data
.
location
.
y
,
1000
),
1
)
})
})
}
else
{
}
else
{
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphic
.
addDynamicPosition
(
Cesium
.
Cartesian3
.
fromDegrees
(
that
.
defaultjd
,
that
.
defaultwd
,
1000
),
3
)
graphic
.
addDynamicPosition
(
Cesium
.
Cartesian3
.
fromDegrees
(
that
.
defaultjd
,
that
.
defaultwd
,
1000
),
1
)
})
})
}
}
});
});
},
25
00
)
},
10
00
)
},
},
// 装车箭头线 graphicLayer.removeGraphic(graphic);
// 装车箭头线 graphicLayer.removeGraphic(graphic);
...
...
src/views/MLargeScreen/index.vue
View file @
04d91f49
...
@@ -136,7 +136,6 @@ export default {
...
@@ -136,7 +136,6 @@ export default {
personalName
:
''
,
personalName
:
''
,
zongTimer1
:
null
,
zongTimer1
:
null
,
zongTimer2
:
null
,
zongTimer2
:
null
,
zongTimer3
:
null
,
currentTime
:
''
,
currentTime
:
''
,
selectFunction
:
0
,
selectFunction
:
0
,
carnumber
:
''
,
carnumber
:
''
,
...
@@ -177,12 +176,10 @@ export default {
...
@@ -177,12 +176,10 @@ export default {
this
.
setNowTimes
();
this
.
setNowTimes
();
this
.
zongTimer1
=
setInterval
(()
=>
{
this
.
zongTimer1
=
setInterval
(()
=>
{
this
.
setNowTimes
();
this
.
setNowTimes
();
},
1000
)
this
.
zongTimer3
=
setInterval
(()
=>
{
if
(
this
.
equipmentName
){
if
(
this
.
equipmentName
){
this
.
getCarLoaction
();
this
.
getCarLoaction
();
}
}
},
2
000
)
},
1
000
)
this
.
zongTimer2
=
setInterval
(()
=>
{
this
.
zongTimer2
=
setInterval
(()
=>
{
if
(
this
.
carnumber
==
''
){
if
(
this
.
carnumber
==
''
){
return
return
...
@@ -364,11 +361,26 @@ export default {
...
@@ -364,11 +361,26 @@ export default {
let
LoaObj1
=
{};
let
LoaObj1
=
{};
let
LoaObj1xy
=
{};
let
LoaObj1xy
=
{};
//判断该车是否在行驶状态
//判断该车是否在行驶状态
if
(
that
.
getDistanceIndex
(
that
.
navigatorXY
.
y
,
that
.
navigatorXY
.
x
,
position
.
coords
.
latitude
,
position
.
coords
.
longitude
)
<=
1
){
let
drivingDistance
=
that
.
getDistanceIndex
(
that
.
navigatorXY
.
y
,
that
.
navigatorXY
.
x
,
position
.
coords
.
latitude
,
position
.
coords
.
longitude
);
console
.
log
(
drivingDistance
);
if
(
drivingDistance
<=
1
){
that
.
leftBtnDisable
=
true
;
that
.
leftBtnDisable
=
true
;
}
else
{
}
else
{
that
.
leftBtnDisable
=
false
;
that
.
leftBtnDisable
=
false
;
}
}
if
(
drivingDistance
>
10
&&
drivingDistance
<
10000
){
LoaObj1xy
.
x
=
that
.
navigatorXY
.
x
;
LoaObj1xy
.
y
=
that
.
navigatorXY
.
y
;
LoaObj1
.
gndRate
=
''
;
LoaObj1
.
location
=
LoaObj1xy
;
LoaObj1
.
name
=
that
.
equipmentName
;
LoaObj1
.
time
=
new
Date
().
getTime
();
let
zuizhong1
=
{};
zuizhong1
.
name
=
that
.
equipmentName
;
zuizhong1
.
jsonObject
=
JSON
.
stringify
(
LoaObj1
);
httpPostForJson
(
gpsPhoneGpsQuery
,
zuizhong1
).
then
((
res1
)
=>
{})
httpPostForJson
(
carRealTimeLocationQuery2
,
JSON
.
stringify
(
LoaObj1
)).
then
((
res2
)
=>
{})
}
else
{
LoaObj1xy
.
x
=
position
.
coords
.
longitude
;
LoaObj1xy
.
x
=
position
.
coords
.
longitude
;
LoaObj1xy
.
y
=
position
.
coords
.
latitude
;
LoaObj1xy
.
y
=
position
.
coords
.
latitude
;
that
.
navigatorXY
.
x
=
position
.
coords
.
longitude
;
that
.
navigatorXY
.
x
=
position
.
coords
.
longitude
;
...
@@ -382,6 +394,7 @@ export default {
...
@@ -382,6 +394,7 @@ export default {
zuizhong1
.
jsonObject
=
JSON
.
stringify
(
LoaObj1
);
zuizhong1
.
jsonObject
=
JSON
.
stringify
(
LoaObj1
);
httpPostForJson
(
gpsPhoneGpsQuery
,
zuizhong1
).
then
((
res1
)
=>
{})
httpPostForJson
(
gpsPhoneGpsQuery
,
zuizhong1
).
then
((
res1
)
=>
{})
httpPostForJson
(
carRealTimeLocationQuery2
,
JSON
.
stringify
(
LoaObj1
)).
then
((
res2
)
=>
{})
httpPostForJson
(
carRealTimeLocationQuery2
,
JSON
.
stringify
(
LoaObj1
)).
then
((
res2
)
=>
{})
}
},
},
//locationError 获取失败的话
//locationError 获取失败的话
function
(
error
)
{
function
(
error
)
{
...
@@ -714,12 +727,11 @@ export default {
...
@@ -714,12 +727,11 @@ export default {
this
.
$refs
.
startOrderReceivingMethod
.
dingshiqiCloseFn
();
this
.
$refs
.
startOrderReceivingMethod
.
dingshiqiCloseFn
();
if
(
this
.
zongTimer1
)
{
if
(
this
.
zongTimer1
)
{
clearInterval
(
this
.
zongTimer1
);
clearInterval
(
this
.
zongTimer1
);
this
.
zongTimer1
=
null
;
}
}
if
(
this
.
zongTimer2
)
{
if
(
this
.
zongTimer2
)
{
clearInterval
(
this
.
zongTimer2
);
clearInterval
(
this
.
zongTimer2
);
}
this
.
zongTimer2
=
null
;
if
(
this
.
zongTimer3
)
{
clearInterval
(
this
.
zongTimer3
);
}
}
}
}
}
}
...
...
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