Commit 100f3e45 authored by xxx's avatar xxx

完成路径图页面

parent 2126f22a
......@@ -205,30 +205,82 @@
}
}
}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,
});
this.$nextTick(()=>{
if(res.code == 200){
this.$notify({
title: '关键点信息上传成功,即将刷新页面!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
setTimeout(function (){
window.location.reload();
},2000);
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 = {};
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 {
},
//删除装点
entruckingDelFn(){
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => {
this.$notify({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
})
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) => {
this.$notify({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
})
})
}
})
},
//保存卸点
detrainingServeFn(){
......@@ -259,16 +276,33 @@ export default {
},
//删除卸点
detrainingDelFn(){
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => {
this.$notify({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
})
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) => {
this.$notify({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
})
})
}
})
},
//保存控制点
controlPointServeFn(){
......@@ -279,40 +313,59 @@ export default {
duration: 2500
})
}else{
if(this.transmitWay == 'add'){
let arr1 = [];
this.selectConnectPointArray.forEach((item,index)=>{
this.controlPointData.forEach((item1,index1)=>{
if(item == item1.end){
let obj1 = {};
obj1.start = this.controlPointValue3;
obj1.end = item1.end;
obj1.weight = item1.weight;
arr1.push(obj1);
return;
}
})
})
this.$nextTick(()=>{
this.$refs.mars3dViewerMapMethod.uploaded(this.controlPointValue3,'控制点',this.transmitWay,arr1);
let arr1 = [];
this.selectConnectPointArray.forEach((item,index)=>{
this.controlPointData.forEach((item1,index1)=>{
if(item == item1.end){
let obj1 = {};
obj1.start = this.controlPointValue3;
obj1.end = item1.end;
obj1.weight = item1.weight;
arr1.push(obj1);
return;
}
})
}else{
}
})
this.$nextTick(()=>{
this.$refs.mars3dViewerMapMethod.uploaded(this.controlPointValue3,'控制点',this.transmitWay,arr1);
})
}
},
//删除控制点
controlPointDelFn(){
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => {
this.$notify({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
})
//获取起点为该控制点的数据
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({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
})
})
}
})
}
})
},
//点击关键点获取对应数据
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