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
e9eb04be
Commit
e9eb04be
authored
Apr 11, 2022
by
caicaicai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
3b5f6f50
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
136 additions
and
33 deletions
+136
-33
.env.development
.env.development
+3
-3
common.js
src/assets/js/common.js
+32
-0
Map.vue
src/components/mars3d/Map.vue
+3
-3
Map2.vue
src/components/mars3d/Map2.vue
+43
-14
graphicManager.js
src/components/mars3d/js/graphicManager.js
+13
-13
index.vue
...iews/MLargeScreen/components/intelligentSchedul/index.vue
+42
-0
No files found.
.env.development
View file @
e9eb04be
...
...
@@ -2,10 +2,10 @@ ENV = 'development'
# 接口地址
#VUE_APP_BASE_API = 'http://localhost:8000'
VUE_APP_BASE_API = 'http://192.168.0.11
0
:8001'
VUE_APP_BASE_API = 'http://192.168.0.11
1
:8001'
VUE_APP_WS_API = 'ws://localhost:8000'
VUE_APP_LOCAL_API = 'http://192.168.0.11
0
:8001'
VUE_APP_LOCAL_API2 = 'http://192.168.0.11
0
:8001'
VUE_APP_LOCAL_API = 'http://192.168.0.11
1
:8001'
VUE_APP_LOCAL_API2 = 'http://192.168.0.11
1
:8001'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true
src/assets/js/common.js
View file @
e9eb04be
...
...
@@ -1888,6 +1888,38 @@ var HttpReq = function(){
data
:
data
,
})
},
//获取地图车辆轨迹——获取所有实时坐标
getCarTrajectoryQuery
:
function
(
param
){
return
request
({
url
:
'
/gps/all
'
,
method
:
'
get
'
,
params
:
param
,
})
},
//获取地图车辆轨迹——获取所有实时坐标
getAllNewTimeCarTrajectoryQuery
:
function
(
param
){
return
request
({
url
:
'
/gps/all
'
,
method
:
'
get
'
,
params
:
param
,
})
},
//获取地图车辆轨迹——获取历史轨迹
getAllHistroyCarTrajectoryQuery
:
function
(
param
){
return
request
({
url
:
'
/gps/line
'
,
method
:
'
get
'
,
params
:
param
,
})
},
//获取地图车辆轨迹——获取历史一个设备坐标
getOneHistroyCarTrajectoryQuery
:
function
(
param
){
return
request
({
url
:
'
/gps
'
,
method
:
'
get
'
,
params
:
param
,
})
},
...
...
src/components/mars3d/Map.vue
View file @
e9eb04be
...
...
@@ -138,7 +138,7 @@ export default {
let
that
=
this
;
HttpReq
.
truckDispatching
.
screenMapSetUpQuery
({
size
:
9999
}).
then
((
res
)
=>
{
if
(
true
){;
console
.
log
(
res
);
//
console.log(res);
let
data1
=
[];
for
(
let
key
in
res
){
that
.
weilanName
.
push
(
key
);
...
...
@@ -153,8 +153,8 @@ export default {
data1
.
push
(
arrays
)
}
that
.
zuobianData
=
data1
console
.
log
(
"
zuobianData
"
,
that
.
zuobianData
);
console
.
log
(
"
weilanName
"
,
that
.
weilanName
);
//
console.log("zuobianData",that.zuobianData);
//
console.log("weilanName",that.weilanName);
if
(
this
.
appendToBody
)
{
document
.
body
.
appendChild
(
this
.
$el
)
...
...
src/components/mars3d/Map2.vue
View file @
e9eb04be
...
...
@@ -42,6 +42,7 @@ export default {
data
(){
return
{
historyTrajectoryData
:[],
persons
:[
[
"
122.128833
"
,
"
37.526448
"
,
"
500
"
],
[
"
122.128638
"
,
"
37.522818
"
,
"
500
"
],
...
...
@@ -89,6 +90,7 @@ export default {
[
"
122.127833
"
,
"
37.525448
"
,
"
500
"
],
],
deviceId
:
'
DESKTOP-L56LKGM
'
,
zuobianData
:[],
toJavaCoordinates
:[],
weilanName
:[],
...
...
@@ -136,6 +138,7 @@ export default {
//后台获取数据
getCoordinate
()
{
let
that
=
this
;
//获取电子围栏
HttpReq
.
truckDispatching
.
screenMapSetUpQuery
({
size
:
9999
}).
then
((
res
)
=>
{
if
(
true
){;
//console.log(res);
...
...
@@ -153,22 +156,48 @@ export default {
data1
.
push
(
arrays
)
}
that
.
zuobianData
=
data1
console
.
log
(
"
zuobianData
"
,
that
.
zuobianData
);
console
.
log
(
"
weilanName
"
,
that
.
weilanName
);
if
(
this
.
appendToBody
)
{
document
.
body
.
appendChild
(
this
.
$el
)
}
if
(
this
.
mapKey
)
{
this
.
initMars3d
(
this
.
options
)
}
else
{
mars3d
.
Resource
.
fetchJson
({
url
:
this
.
url
}).
then
((
data
)
=>
{
this
.
initMars3d
(
data
.
map3d
)
// 构建地图
})
}
//console.log("zuobianData",that.zuobianData);
//console.log("weilanName",that.weilanName);
}
})
//获取历史轨迹
HttpReq
.
truckDispatching
.
getAllHistroyCarTrajectoryQuery
({
id
:
that
.
deviceId
}).
then
((
res
)
=>
{
console
.
log
(
'
获取历史轨迹
'
,
res
);
if
(
res
.
code
==
200
){
let
obj1
=
{};
let
array1
=
[];
res
.
data
.
line
.
forEach
((
item
,
index
)
=>
{
let
array2
=
[];
array2
.
push
(
item
.
location
.
x
);
array2
.
push
(
item
.
location
.
y
);
array2
.
push
(
'
500
'
);
array1
.
push
(
array2
);
})
obj1
.
name
=
res
.
data
.
devId
;
obj1
.
arrays
=
array1
;
that
.
historyTrajectoryData
.
push
(
obj1
);
console
.
log
(
that
.
historyTrajectoryData
);
}
})
this
.
$nextTick
(()
=>
{
if
(
this
.
appendToBody
)
{
document
.
body
.
appendChild
(
this
.
$el
)
}
if
(
this
.
mapKey
)
{
this
.
initMars3d
(
this
.
options
)
}
else
{
mars3d
.
Resource
.
fetchJson
({
url
:
this
.
url
}).
then
((
data
)
=>
{
this
.
initMars3d
(
data
.
map3d
)
// 构建地图
})
}
})
},
//上传围栏数据
uploaded
(){
...
...
src/components/mars3d/js/graphicManager.js
View file @
e9eb04be
...
...
@@ -358,19 +358,19 @@ import $ from 'jquery'
//绑定Popup
graphic
.
bindPopup
(
item
);
//绑定右键菜单
graphic
.
bindContextMenu
([
{
text
:
"
删除对象[graphic绑定的]
"
,
iconCls
:
"
fa fa-trash-o
"
,
callback
:
function
(
e
)
{
let
graphic
=
e
.
graphic
;
if
(
graphic
)
{
graphic
.
remove
();
}
},
},
]);
//
绑定右键菜单
//
graphic.bindContextMenu([
//
{
//
text: "删除对象[graphic绑定的]",
//
iconCls: "fa fa-trash-o",
//
callback: function (e) {
//
let graphic = e.graphic;
//
if (graphic) {
//
graphic.remove();
//
}
//
},
//
},
//
]);
//测试 颜色闪烁
if
(
graphic
.
startFlicker
)
{
...
...
src/views/MLargeScreen/components/intelligentSchedul/index.vue
View file @
e9eb04be
...
...
@@ -135,6 +135,7 @@ import * as echarts from 'echarts';
export
default
{
data
()
{
return
{
websocket
:
null
,
whetherShow
:
false
,
selectCarFleet
:
''
,
//搜索对应车队
carFleetData
:[],
//车队信息
...
...
@@ -146,6 +147,10 @@ export default {
dispatchDetailsList
:[],
//智能调度情况表
}
},
created
(){
//页面刚进入时开启长连接
this
.
initWebSocket
();
},
mounted
()
{
},
methods
:
{
//获取总数据
...
...
@@ -349,8 +354,45 @@ export default {
},
//初始化weosocket
initWebSocket
(){
//const wsuri = "ws://114.116.108.246:81/websocket/socketServer?userId="+userId;//连接地址,可加参数
const
wsuri
=
"
ws://192.168.0.111:8001/webSocket?userId=7
"
;
this
.
websocket
=
new
WebSocket
(
wsuri
);
this
.
websocket
.
onopen
=
this
.
websocketonopen
;
this
.
websocket
.
onerror
=
this
.
websocketonerror
;
this
.
websocket
.
onmessage
=
this
.
websocketonmessage
;
this
.
websocket
.
onclose
=
this
.
websocketclose
;
},
//WebSocket连接成功
websocketonopen
()
{
console
.
log
(
"
WebSocket连接成功
"
);
},
//WebSocket连接错误
websocketonerror
(
e
)
{
console
.
log
(
"
WebSocket连接发生错误
"
);
},
//WebSocket数据接收
websocketonmessage
(
e
){
console
.
log
(
"
ee
"
,
e
);
console
.
log
(
"
eeee
"
,
e
.
data
);
const
redata
=
JSON
.
parse
(
e
.
data
);
console
.
log
(
"
eeee---
"
,
redata
);
},
//WebSocket数据发送
websocketsend
(
agentData
){
this
.
websock
.
send
(
agentData
);
},
//WebSocket关闭
websocketclose
(
e
){
console
.
log
(
"
connection closed (
"
+
e
.
code
+
"
)
"
);
},
},
destroyed
:
function
()
{
//页面销毁时关闭长连接
this
.
websocketclose
();
},
}
</
script
>
...
...
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