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
88edbf14
Commit
88edbf14
authored
Sep 20, 2022
by
xxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改关键点设置
parent
3cc946a1
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
344 additions
and
84 deletions
+344
-84
kongzhidian1.png
src/assets/images/cutGraph/kongzhidian1.png
+0
-0
xiechedian1.png
src/assets/images/cutGraph/xiechedian1.png
+0
-0
zhuangchedian1.png
src/assets/images/cutGraph/zhuangchedian1.png
+0
-0
common.js
src/assets/js/common.js
+62
-0
Map4.vue
src/components/mars3d/Map4.vue
+108
-60
index.vue
src/views/regionalManagement/regionalPathMap/index.vue
+174
-24
No files found.
src/assets/images/cutGraph/kongzhidian1.png
0 → 100644
View file @
88edbf14
11.6 KB
src/assets/images/cutGraph/xiechedian1.png
0 → 100644
View file @
88edbf14
7.6 KB
src/assets/images/cutGraph/zhuangchedian1.png
0 → 100644
View file @
88edbf14
2.91 KB
src/assets/js/common.js
View file @
88edbf14
...
...
@@ -2357,6 +2357,68 @@ var HttpReq = function(){
data
:
data
,
})
},
//设置控制点——关键点信息表
apiCpointQuery
:
function
(
param
){
return
request
({
url
:
'
/api/Cpoint
'
,
method
:
'
get
'
,
params
:
param
,
})
},
apiCpointAdd
:
function
(
data
){
return
request
({
url
:
'
/api/Cpoint
'
,
method
:
'
POST
'
,
data
:
data
,
}).
then
((
res
)
=>
{
return
res
})
},
apiCpointUpdate
:
function
(
data
){
return
request
({
url
:
'
/api/Cpoint
'
,
method
:
'
PUT
'
,
data
:
data
,
})
},
apiCpointDel
:
function
(
data
){
return
request
({
url
:
'
/api/Cpoint
'
,
method
:
'
Delete
'
,
data
:
data
,
})
},
//设置控制点——关键点连接信息表
apiPathmapQuery
:
function
(
param
){
return
request
({
url
:
'
/api/Pathmap
'
,
method
:
'
get
'
,
params
:
param
,
})
},
apiPathmapAdd
:
function
(
data
){
return
request
({
url
:
'
/api/Pathmap
'
,
method
:
'
POST
'
,
data
:
data
,
}).
then
((
res
)
=>
{
return
res
})
},
apiPathmapUpdate
:
function
(
data
){
return
request
({
url
:
'
/api/Pathmap
'
,
method
:
'
PUT
'
,
data
:
data
,
})
},
apiPathmapDel
:
function
(
data
){
return
request
({
url
:
'
/api/Pathmap
'
,
method
:
'
Delete
'
,
data
:
data
,
})
},
...
...
src/components/mars3d/Map4.vue
View file @
88edbf14
...
...
@@ -20,6 +20,9 @@
import
*
as
mars3d
from
'
mars3d
'
import
*
as
Cesium
from
'
mars3d-cesium/Build/Cesium/Cesium
'
import
{
initGraphicManager
,
initLayerManager
,
bindLayerContextMenu
}
from
'
./js/graphicManager
'
import
zhuangchetubiao
from
'
../../assets/images/cutGraph/zhuangchedian1.png
'
import
xiechetubiao
from
'
../../assets/images/cutGraph/xiechedian1.png
'
import
kongzhidiantubiao
from
'
../../assets/images/cutGraph/kongzhidian1.png
'
// 导入插件(其他插件类似,插件清单访问:http://mars3d.cn/dev/guide/start/install.html)
...
...
@@ -35,14 +38,14 @@
name
:
'
mars3dViewer
'
,
created
(){
this
.
getCoordinate
();
//
this.getCoordinate();
},
data
(){
return
{
zuobianData
:[],
toJavaCoordinates
:[],
weilanName
:[]
,
controlPointId
:
0
,
}
},
...
...
@@ -85,63 +88,84 @@
methods
:
{
//后台获取数据
getCoordinate
()
{
let
that
=
this
;
// HttpReq.truckDispatching.screenMapSetUpQuery({size:9999}).then((res) => {
// if(true){;
// //console.log(res);
// let data1 = [];
// for(let key in res){
// that.weilanName.push(key);
// let arrays = [];
// res[key].forEach(function(item){
// var arr = [];
// arr[0] = item.lon;
// arr[1] = item.lat;
// arr[2] = "500";
// arrays.push(arr);
// })
// 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
)
// 构建地图
})
}
// }
// })
getCoordinate
(
data
)
{
this
.
zuobianData
=
data
;
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
(
text
,
color
){
let
newData
=
[...
this
.
toJavaCoordinates
];
newData
.
pop
();
let
allObj
=
{};
allObj
.
name
=
text
;
allObj
.
zuobiao
=
newData
;
allObj
.
color
=
color
;
this
.
toJavaCoordinates
=
[];
//console.log(allObj);
//发送添加电子围栏请求
HttpReq
.
truckDispatching
.
screenMapSetUpAdd
(
allObj
).
then
((
res
)
=>
{
uploaded
(
text
,
type
,
way
){
if
(
way
==
'
add
'
){
if
(
JSON
.
stringify
(
this
.
toJavaCoordinates
)
==
'
[]
'
){
this
.
$notify
({
title
:
'
区域信息上传成功,即将重新加载
!
'
,
type
:
'
success
'
,
title
:
'
未选择
'
+
type
+
'
位置
!
'
,
type
:
'
error
'
,
duration
:
2500
})
}
else
{
let
lastData
=
{};
lastData
.
name
=
text
;
lastData
.
type
=
type
;
lastData
.
lon
=
this
.
toJavaCoordinates
[
0
][
0
];
lastData
.
lat
=
this
.
toJavaCoordinates
[
0
][
1
];
HttpReq
.
truckDispatching
.
apiCpointAdd
(
lastData
).
then
((
res
)
=>
{
this
.
$notify
({
title
:
'
关键点信息上传中,请勿操作!
'
,
type
:
'
success
'
,
duration
:
2000
,
dangerouslyUseHTMLString
:
true
,
});
this
.
$nextTick
(()
=>
{
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
关键点信息上传成功,即将刷新页面!
'
,
type
:
'
success
'
,
duration
:
2000
,
dangerouslyUseHTMLString
:
true
,
});
setTimeout
(
function
(){
window
.
location
.
reload
();
},
2000
);
}
})
})
}
}
else
if
(
way
==
'
edit
'
){
let
lastData
=
{};
lastData
.
id
=
this
.
controlPointId
;
lastData
.
name
=
text
;
HttpReq
.
truckDispatching
.
apiCpointUpdate
(
lastData
).
then
((
res
)
=>
{
this
.
$notify
({
title
:
'
关键点信息上传中,请勿操作!
'
,
type
:
'
success
'
,
duration
:
2000
,
dangerouslyUseHTMLString
:
true
,
});
setTimeout
(
function
(){
window
.
location
.
reload
();
},
2000
);
}).
catch
(
function
(
error
)
{
});
this
.
$nextTick
(()
=>
{
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
关键点信息上传成功,即将刷新页面!
'
,
type
:
'
success
'
,
duration
:
2000
,
dangerouslyUseHTMLString
:
true
,
});
// setTimeout(function (){
// window.location.reload();
// },2000);
}
})
})
}
},
//创建地图
initMars3d
(
options
)
{
...
...
@@ -161,16 +185,33 @@
this
[
`map
${
this
.
mapKey
}
`
]
=
map
//围栏回显
// that.zuobianData.forEach(function(item,index){
// var graphicLayer = new mars3d.layer.GraphicLayer();
// map.addLayer(graphicLayer);
// initLayerManager(graphicLayer,that.weilanName[index]);
// that.addGraphic_01(graphicLayer,item,that.weilanName[index]);
// })
that
.
zuobianData
.
forEach
(
function
(
item
,
index
){
var
graphicLayer
=
new
mars3d
.
layer
.
GraphicLayer
();
map
.
addLayer
(
graphicLayer
);
initLayerManager
(
graphicLayer
);
that
.
bindLayerPopup
(
graphicLayer
,
item
)
that
.
addDemoGraphic1
(
graphicLayer
,
item
);
})
// 抛出事件
this
.
$emit
(
'
onload
'
,
map
)
},
//关键点位置
addDemoGraphic1
(
graphicLayer
,
item
)
{
const
graphic
=
new
mars3d
.
graphic
.
BillboardEntity
({
name
:
item
.
name
,
position
:
[
item
.
lon
,
item
.
lat
,
1000
],
style
:
{
image
:
item
.
type
==
'
装车点
'
?
zhuangchetubiao
:
item
.
type
==
'
卸车点
'
?
xiechetubiao
:
kongzhidiantubiao
,
scale
:
0.15
,
horizontalOrigin
:
Cesium
.
HorizontalOrigin
.
CENTER
,
verticalOrigin
:
Cesium
.
VerticalOrigin
.
BOTTOM
,
clampToGround
:
true
,
label
:
{
text
:
item
.
name
,
pixelOffsetY
:
-
40
,
color
:
'
blue
'
},
},
})
graphicLayer
.
addGraphic
(
graphic
)
},
//关键点设置
btnStartDraw
(){
this
.
toJavaCoordinates
=
[];
...
...
@@ -202,6 +243,13 @@
},
});
},
bindLayerPopup
(
graphicLayer
,
item
)
{
let
that
=
this
;
graphicLayer
.
bindPopup
(
function
(
event
)
{
that
.
$parent
.
clickPointFn
(
item
);
that
.
controlPointId
=
item
.
id
;
})
},
}
}
...
...
src/views/regionalManagement/regionalPathMap/index.vue
View file @
88edbf14
This diff is collapsed.
Click to expand it.
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