Commit 100f3e45 authored by xxx's avatar xxx

完成路径图页面

parent 2126f22a
...@@ -205,6 +205,57 @@ ...@@ -205,6 +205,57 @@
} }
} }
}else if(way == 'edit'){ }else if(way == 'edit'){
if(type == '控制点'){
//获取起点为该控制点的数据
HttpReq.truckDispatching.apiPathmapQuery({size:9999,start:text}).then((res1) => {
if(res1.code == 200){
let idArr1 = [];
res1.data.content.forEach((item1,index1)=>{
idArr1.push(item1.id);
})
//获取终点为该控制点的数据
HttpReq.truckDispatching.apiPathmapQuery({size:9999,end:text}).then((res2) => {
if(res2.code == 200){
res2.data.content.forEach((item2,index2)=>{
idArr1.push(item2.id);
})
//删除
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
//重新添加
let lastData = {};
lastData.id = this.controlPointId;
lastData.name = text;
HttpReq.truckDispatching.apiCpointUpdate(lastData).then((res3) => {
this.$notify({
title: '关键点信息上传中,请勿操作!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
if(res3.code == 200){
arr1.forEach((itemAdd1,indexAdd1)=>{
HttpReq.truckDispatching.apiPathmapAdd(itemAdd1).then((res4) => {})
})
this.$nextTick(()=>{
this.$notify({
title: '关键点信息上传成功,即将刷新页面!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
setTimeout(function (){
window.location.reload();
},2000);
})
}
})
})
}
})
}
})
}else{
let lastData = {}; let lastData = {};
lastData.id = this.controlPointId; lastData.id = this.controlPointId;
lastData.name = text; lastData.name = text;
...@@ -230,6 +281,7 @@ ...@@ -230,6 +281,7 @@
}) })
}) })
} }
}
}, },
//创建地图 //创建地图
......
...@@ -232,6 +232,20 @@ export default { ...@@ -232,6 +232,20 @@ export default {
}, },
//删除装点 //删除装点
entruckingDelFn(){ entruckingDelFn(){
let delname = '';
if(this.entruckingValue1.length == 1){
delname = this.entruckingValue1[0];
}else{
delname = this.entruckingValue1[0] + '/' + this.entruckingValue1[1];
}
HttpReq.truckDispatching.apiPathmapQuery({size:9999,end:delname}).then((res1) => {
if(res1.code == 200){
let idArr1 = [];
res1.data.content.forEach((item1,index1)=>{
idArr1.push(item1.id);
})
//删除
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => { HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => {
this.$notify({ this.$notify({
title: '删除成功,即将重新加载,请勿操作!', title: '删除成功,即将重新加载,请勿操作!',
...@@ -242,6 +256,9 @@ export default { ...@@ -242,6 +256,9 @@ export default {
window.location.reload(); window.location.reload();
},2000); },2000);
}) })
})
}
})
}, },
//保存卸点 //保存卸点
detrainingServeFn(){ detrainingServeFn(){
...@@ -259,6 +276,20 @@ export default { ...@@ -259,6 +276,20 @@ export default {
}, },
//删除卸点 //删除卸点
detrainingDelFn(){ detrainingDelFn(){
let delname = '';
if(this.detrainingValue2.length == 1){
delname = this.detrainingValue2[0];
}else{
delname = this.detrainingValue2[0] + '/' + this.detrainingValue2[1];
}
HttpReq.truckDispatching.apiPathmapQuery({size:9999,end:delname}).then((res1) => {
if(res1.code == 200){
let idArr1 = [];
res1.data.content.forEach((item1,index1)=>{
idArr1.push(item1.id);
})
//删除
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => { HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => {
this.$notify({ this.$notify({
title: '删除成功,即将重新加载,请勿操作!', title: '删除成功,即将重新加载,请勿操作!',
...@@ -269,6 +300,9 @@ export default { ...@@ -269,6 +300,9 @@ export default {
window.location.reload(); window.location.reload();
},2000); },2000);
}) })
})
}
})
}, },
//保存控制点 //保存控制点
controlPointServeFn(){ controlPointServeFn(){
...@@ -279,7 +313,6 @@ export default { ...@@ -279,7 +313,6 @@ export default {
duration: 2500 duration: 2500
}) })
}else{ }else{
if(this.transmitWay == 'add'){
let arr1 = []; let arr1 = [];
this.selectConnectPointArray.forEach((item,index)=>{ this.selectConnectPointArray.forEach((item,index)=>{
this.controlPointData.forEach((item1,index1)=>{ this.controlPointData.forEach((item1,index1)=>{
...@@ -296,14 +329,26 @@ export default { ...@@ -296,14 +329,26 @@ export default {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs.mars3dViewerMapMethod.uploaded(this.controlPointValue3,'控制点',this.transmitWay,arr1); this.$refs.mars3dViewerMapMethod.uploaded(this.controlPointValue3,'控制点',this.transmitWay,arr1);
}) })
}else{
}
} }
}, },
//删除控制点 //删除控制点
controlPointDelFn(){ controlPointDelFn(){
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => { //获取起点为该控制点的数据
HttpReq.truckDispatching.apiPathmapQuery({size:9999,start:this.controlPointValue3}).then((res1) => {
if(res1.code == 200){
let idArr1 = [];
res1.data.content.forEach((item1,index1)=>{
idArr1.push(item1.id);
})
//获取终点为该控制点的数据
HttpReq.truckDispatching.apiPathmapQuery({size:9999,end:this.controlPointValue3}).then((res2) => {
if(res2.code == 200){
res2.data.content.forEach((item2,index2)=>{
idArr1.push(item2.id);
})
//删除
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((resDel2) => {
this.$notify({ this.$notify({
title: '删除成功,即将重新加载,请勿操作!', title: '删除成功,即将重新加载,请勿操作!',
type: 'success', type: 'success',
...@@ -313,6 +358,14 @@ export default { ...@@ -313,6 +358,14 @@ export default {
window.location.reload(); window.location.reload();
},2000); },2000);
}) })
})
}
})
}
})
}, },
//点击关键点获取对应数据 //点击关键点获取对应数据
clickPointFn(item){ clickPointFn(item){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment