Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
卡
卡车调度系统
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
caicaicai
卡车调度系统
Commits
10722cc3
Commit
10722cc3
authored
Apr 20, 2022
by
caicaicai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
7d73bb27
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
75 deletions
+73
-75
Map.vue
src/components/mars3d/Map.vue
+62
-64
graphicManager.js
src/components/mars3d/js/graphicManager.js
+2
-1
index.vue
src/views/MLargeScreen/components/dataAnalysis/index.vue
+2
-2
index.vue
...iews/MLargeScreen/components/intelligentSchedul/index.vue
+7
-8
No files found.
src/components/mars3d/Map.vue
View file @
10722cc3
...
...
@@ -150,9 +150,25 @@ export default {
that
.
zuobianData
=
data1
//console.log("zuobianData",that.zuobianData);
//console.log("weilanName",that.weilanName);
this
.
getlishiguijiFn
();
}
})
},
//后台获取数据——获取实时位置
getlishiguijiFn
()
{
let
that
=
this
;
HttpReq
.
truckDispatching
.
getCarTrajectoryQuery
().
then
((
res
)
=>
{
//console.log(res);
if
(
res
.
code
==
200
){
that
.
historyTrajectoryData
=
res
.
data
;
this
.
$nextTick
(()
=>
{
if
(
this
.
appendToBody
)
{
document
.
body
.
appendChild
(
this
.
$el
)
console
.
log
(
465
);
}
if
(
this
.
mapKey
)
{
this
.
initMars3d
(
this
.
options
)
...
...
@@ -163,16 +179,6 @@ export default {
}
})
}
})
},
//后台获取数据——获取实时位置
getlishiguijiFn
()
{
let
that
=
this
;
HttpReq
.
truckDispatching
.
getCarTrajectoryQuery
().
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
that
.
historyTrajectoryData
=
res
.
data
;
}
})
},
...
...
@@ -196,7 +202,6 @@ export default {
//围栏回显
that
.
zuobianData
.
forEach
(
function
(
item
,
index
){
//console.log(item);
var
graphicLayer
=
new
mars3d
.
layer
.
GraphicLayer
();
map
.
addLayer
(
graphicLayer
);
initLayerManager
(
graphicLayer
,
that
.
weilanName
[
index
]);
...
...
@@ -204,10 +209,11 @@ export default {
})
//实时位置
var
graphicLayer4
=
new
mars3d
.
layer
.
GraphicLayer
();
map
.
addLayer
(
graphicLayer4
)
//that.addDemoGraphics(graphicLayer4);
// that.historyTrajectoryData.forEach((item,index)=>{
// var graphicLayer4 = new mars3d.layer.GraphicLayer();
// map.addLayer(graphicLayer4)
// that.addDemoGraphics(graphicLayer4,item);
// })
// 抛出事件
this
.
$emit
(
'
onload
'
,
map
)
...
...
@@ -246,68 +252,60 @@ export default {
return
property
;
},
//实时位置
addDemoGraphics
(
graphicLayer4
)
{
addDemoGraphics
(
graphicLayer4
,
item
)
{
let
that
=
this
;
for
(
let
i
=
0
;
i
<
1
;
i
++
)
{
const
graphic
=
new
mars3d
.
graphic
.
ModelPrimitive
({
style
:
{
url
:
"
//data.mars3d.cn/gltf/mars/car/tufangche.glb
"
,
scale
:
0.1
,
minimumPixelSize
:
50
,
// 高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
highlight
:
{
type
:
mars3d
.
EventType
.
click
,
silhouette
:
true
,
silhouetteColor
:
"
#ff0000
"
,
silhouetteSize
:
4
},
label
:
{
// 不需要文字时,去掉label配置即可
text
:
"
鲁A12345
"
,
font_size
:
16
,
color
:
"
#ffffff
"
,
outline
:
true
,
outlineColor
:
"
#000000
"
,
pixelOffsetY
:
-
20
,
distanceDisplayCondition
:
true
,
distanceDisplayCondition_far
:
50000
,
distanceDisplayCondition_near
:
0
}
const
graphic
=
new
mars3d
.
graphic
.
ModelPrimitive
({
style
:
{
url
:
"
//data.mars3d.cn/gltf/mars/car/tufangche.glb
"
,
scale
:
0.1
,
minimumPixelSize
:
50
,
// 高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
highlight
:
{
type
:
mars3d
.
EventType
.
click
,
silhouette
:
true
,
silhouetteColor
:
"
#ff0000
"
,
silhouetteSize
:
4
},
})
graphicLayer4
.
addGraphic
(
graphic
)
}
label
:
{
// 不需要文字时,去掉label配置即可
text
:
item
.
name
,
font_size
:
16
,
color
:
"
#ffffff
"
,
outline
:
true
,
outlineColor
:
"
#000000
"
,
pixelOffsetY
:
-
20
,
distanceDisplayCondition
:
true
,
distanceDisplayCondition_far
:
50000
,
distanceDisplayCondition_near
:
0
}
},
})
graphicLayer4
.
addGraphic
(
graphic
)
// 设置动态位置
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphic
.
addDynamicPosition
(
that
.
randomPoint
(
))
// 首次出现的位置
graphic
.
addDynamicPosition
(
Cesium
.
Cartesian3
.
fromDegrees
(
item
.
lat
,
item
.
lon
,
500
))
// 首次出现的位置
})
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphic
.
addDynamicPosition
(
that
.
randomPoint
(
),
50
)
// 按20
秒运动至指定位置
graphic
.
addDynamicPosition
(
that
.
randomPoint
(
item
.
name
),
6
)
// 按6
秒运动至指定位置
})
// 定时更新动态位置(setInterval为演示)
setInterval
(()
=>
{
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphic
.
addDynamicPosition
(
that
.
randomPoint
(),
50
)
})
},
20
000
)
//
setInterval(() => {
//
graphicLayer4.eachGraphic((graphic) => {
// graphic.addDynamicPosition(that.randomPoint(item.name), 6
)
//
})
// }, 6
000)
},
// 取区域内的随机点
randomPoint
()
{
this
.
getlishiguijiFn
()
// const jd = this.random(117.130666 * 1000, 117.130241 * 1000) / 1000
// const wd = this.random(36.655207 * 1000, 36.665207 * 1000) / 1000
// console.log("jd",jd);
// console.log("wd",wd);
// return Cesium.Cartesian3.fromDegrees(jd, wd, 500)
randomPoint
(
name
)
{
HttpReq
.
truckDispatching
.
getCarTrajectoryQuery
({
name
:
name
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
return
Cesium
.
Cartesian3
.
fromDegrees
(
res
.
data
[
0
].
lat
,
res
.
data
[
0
].
lon
,
500
)
}
})
},
random
(
min
,
max
)
{
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
+
1
)
+
min
)
}
}
}
</
script
>
...
...
src/components/mars3d/js/graphicManager.js
View file @
10722cc3
...
...
@@ -178,7 +178,8 @@ import $ from 'jquery'
//attr.text = "围栏";
// attr["视频"] = `<video src='http://data.mars3d.cn/file/video/lukou.mp4' controls autoplay style="width: 300px;" ></video>`;
return
mars3d
.
Util
.
getTemplateHtml
({
title
:
"
围栏区域
"
,
template
:
"
all
"
,
attr
:
attr
});
//return mars3d.Util.getTemplateHtml({ title: "围栏区域", template: "all", attr: attr });
return
mars3d
.
Util
.
getTemplateHtml
({
title
:
"
围栏区域
"
,
template
:
"
all
"
});
});
}
...
...
src/views/MLargeScreen/components/dataAnalysis/index.vue
View file @
10722cc3
...
...
@@ -916,9 +916,9 @@ export default {
width
:
100%
;
height
:
19vh
;
}
.table-box
{
/*
.table-box{
margin-top: -10px;
}
}
*/
dl
{
display
:
table
;
width
:
100%
;
...
...
src/views/MLargeScreen/components/intelligentSchedul/index.vue
View file @
10722cc3
...
...
@@ -17,8 +17,7 @@
<div
class=
"voiceAppContent_2_content"
>
<el-checkbox-group
v-model=
"selectCarRadioArray"
>
<el-checkbox
v-for=
"(item,index) in carsInforData"
:label=
"item"
:key=
"index"
style=
"margin-top:7px;"
>
<div
style=
"width:7.5vw;margin-left:1.7vw;"
>
{{
item
.
name
}}
</div>
<div>
{{
item
.
number
}}
</div>
<div
style=
"width:12vw;margin-left:1.7vw;text-align: center;"
>
{{
item
.
number
}}
</div>
</el-checkbox>
</el-checkbox-group>
</div>
...
...
@@ -27,7 +26,7 @@
<div
class=
"voiceAppContent_2_title"
>
已选中车辆
</div>
<div
class=
"voiceAppContent_3_content"
>
<div
v-for=
"(item,index) in selectCarRadioArray"
:key=
"index"
class=
"voiceAppContent_3_content_selectCar"
>
<div>
{{
item
.
n
ame
}}
</div>
<div>
{{
item
.
n
umber
}}
</div>
<div
style=
"width:20px;height:20px;background-color: rgb(4,112,171);text-align: center;font-size:30px;line-height:20px;cursor: pointer;"
@
click=
"cancelSelect(index)"
>
<span>
×
</span>
</div>
...
...
@@ -205,9 +204,9 @@ export default {
//页面刚进入时开启长连接
this
.
initWebSocket
();
this
.
heartbeatTimer
=
setInterval
(()
=>
{
this
.
reconnect
();
},
10000
)
//
this.heartbeatTimer = setInterval(() => {
//
this.reconnect();
//
}, 10000)
}
else
{
this
.
whetherShow
=
false
;
...
...
@@ -521,9 +520,9 @@ export default {
.intelligentSchScrView_leftView_content
,
.intelligentSchScrView_rightView_content
{
width
:
100%
;
}
.table-box
{
/*
.table-box{
margin-top: -10px;
}
}
*/
dl
{
display
:
table
;
width
:
100%
;
...
...
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