Commit 100f3e45 authored by xxx's avatar xxx

完成路径图页面

parent 2126f22a
...@@ -205,30 +205,82 @@ ...@@ -205,30 +205,82 @@
} }
} }
}else if(way == 'edit'){ }else if(way == 'edit'){
let lastData = {}; if(type == '控制点'){
lastData.id = this.controlPointId; //获取起点为该控制点的数据
lastData.name = text; HttpReq.truckDispatching.apiPathmapQuery({size:9999,start:text}).then((res1) => {
HttpReq.truckDispatching.apiCpointUpdate(lastData).then((res) => { if(res1.code == 200){
this.$notify({ let idArr1 = [];
title: '关键点信息上传中,请勿操作!', res1.data.content.forEach((item1,index1)=>{
type: 'success', idArr1.push(item1.id);
duration: 2000, })
dangerouslyUseHTMLString: true, //获取终点为该控制点的数据
}); HttpReq.truckDispatching.apiPathmapQuery({size:9999,end:text}).then((res2) => {
this.$nextTick(()=>{ if(res2.code == 200){
if(res.code == 200){ res2.data.content.forEach((item2,index2)=>{
this.$notify({ idArr1.push(item2.id);
title: '关键点信息上传成功,即将刷新页面!', })
type: 'success', //删除
duration: 2000, HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
dangerouslyUseHTMLString: true, //重新添加
}); let lastData = {};
setTimeout(function (){ lastData.id = this.controlPointId;
window.location.reload(); lastData.name = text;
},2000); 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 = {};
lastData.id = this.controlPointId;
lastData.name = text;
HttpReq.truckDispatching.apiCpointUpdate(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);
}
})
})
}
} }
}, },
......
...@@ -232,16 +232,33 @@ export default { ...@@ -232,16 +232,33 @@ export default {
}, },
//删除装点 //删除装点
entruckingDelFn(){ entruckingDelFn(){
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => { let delname = '';
this.$notify({ if(this.entruckingValue1.length == 1){
title: '删除成功,即将重新加载,请勿操作!', delname = this.entruckingValue1[0];
type: 'success', }else{
duration: 2500 delname = this.entruckingValue1[0] + '/' + this.entruckingValue1[1];
}); }
setTimeout(function (){ HttpReq.truckDispatching.apiPathmapQuery({size:9999,end:delname}).then((res1) => {
window.location.reload(); if(res1.code == 200){
},2000); 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) => {
this.$notify({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
})
})
}
})
}, },
//保存卸点 //保存卸点
detrainingServeFn(){ detrainingServeFn(){
...@@ -259,16 +276,33 @@ export default { ...@@ -259,16 +276,33 @@ export default {
}, },
//删除卸点 //删除卸点
detrainingDelFn(){ detrainingDelFn(){
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => { let delname = '';
this.$notify({ if(this.detrainingValue2.length == 1){
title: '删除成功,即将重新加载,请勿操作!', delname = this.detrainingValue2[0];
type: 'success', }else{
duration: 2500 delname = this.detrainingValue2[0] + '/' + this.detrainingValue2[1];
}); }
setTimeout(function (){ HttpReq.truckDispatching.apiPathmapQuery({size:9999,end:delname}).then((res1) => {
window.location.reload(); if(res1.code == 200){
},2000); 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) => {
this.$notify({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
})
})
}
})
}, },
//保存控制点 //保存控制点
controlPointServeFn(){ controlPointServeFn(){
...@@ -279,40 +313,59 @@ export default { ...@@ -279,40 +313,59 @@ 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)=>{ if(item == item1.end){
if(item == item1.end){ let obj1 = {};
let obj1 = {}; obj1.start = this.controlPointValue3;
obj1.start = this.controlPointValue3; obj1.end = item1.end;
obj1.end = item1.end; obj1.weight = item1.weight;
obj1.weight = item1.weight; arr1.push(obj1);
arr1.push(obj1); return;
return; }
}
})
})
this.$nextTick(()=>{
this.$refs.mars3dViewerMapMethod.uploaded(this.controlPointValue3,'控制点',this.transmitWay,arr1);
}) })
}else{ })
this.$nextTick(()=>{
} this.$refs.mars3dViewerMapMethod.uploaded(this.controlPointValue3,'控制点',this.transmitWay,arr1);
})
} }
}, },
//删除控制点 //删除控制点
controlPointDelFn(){ controlPointDelFn(){
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => { //获取起点为该控制点的数据
this.$notify({ HttpReq.truckDispatching.apiPathmapQuery({size:9999,start:this.controlPointValue3}).then((res1) => {
title: '删除成功,即将重新加载,请勿操作!', if(res1.code == 200){
type: 'success', let idArr1 = [];
duration: 2500 res1.data.content.forEach((item1,index1)=>{
}); idArr1.push(item1.id);
setTimeout(function (){ })
window.location.reload(); //获取终点为该控制点的数据
},2000); 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({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},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