修改AUSTool 编辑区域后,删除bug。

修改AUSTool 删除计划组,没有group的错误
This commit is contained in:
lVAL 2020-10-30 11:12:06 +08:00
parent 40bf0d2d89
commit 1af1e3bd6f
4 changed files with 60 additions and 24 deletions

View File

@ -80,6 +80,7 @@ export default {
listLines().then(resp => {
this.lineList = resp.data;
}).catch(error => {
console.error(error);
this.$message.info(error.message);
})
},
@ -88,6 +89,7 @@ export default {
listStations(this.lineId).then(resp => {
this.stationList = resp.data;
}).catch(error => {
console.error(error);
this.$message.info(error.message);
})
}
@ -103,6 +105,7 @@ export default {
this.refreshStationList();
this.$message.success('修改成功。')
}).catch(error => {
console.error(error);
this.$message.info(error.message);
})
}

View File

@ -264,15 +264,18 @@ export default {
turnBackTime: data.turnBackTime
}
}).catch(error => {
console.error(error);
this.$message.info(error.message);
})
}).catch(error => {
console.error(error);
this.$message.info(error.message);
})
} else {
this.$refs.schedule.clear();
}
}).catch(error => {
console.error(error);
this.$messageBox(error.message);
})
} else {
@ -396,6 +399,7 @@ export default {
this.$router.replace({ path: 'AUStool'});
this.$message.success('Run plan group created successfully.')
}).catch(error => {
console.error(error);
this.$message.info(error.message);
})
},
@ -412,13 +416,16 @@ export default {
? this.$router.replace({ path: 'AUStool'})
: this.loadPlanData();
}).catch(error => {
console.error(error);
this.$message.info(error.message);
})
}).catch(error => {
console.error(error);
this.$message.info(error.message);
})
}).catch(() => {
this.$message({ type: 'info', message: 'Deletion cancelled.' });
}).catch(error => {
console.error(error);
this.$message.info('Deletion cancelled.');
});
},
doSetPlanParams(data) {
@ -426,6 +433,7 @@ export default {
this.config = data;
this.$message.success('Parameters of plan were modified successfully.');
}).catch(error => {
console.error(error);
this.$message.info(error.message);
})
},
@ -437,6 +445,7 @@ export default {
modifyAreaNote(this.planId, data.id, model).then(resp => {
this.refresh(false);
}).catch(error => {
console.error(error);
this.$message.info(error.message);
this.refresh(false);
});
@ -451,6 +460,7 @@ export default {
justTripNoRunning(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false);
}).catch(error => {
console.error(error);
this.$message.info(error.message);
this.refresh(false);
});
@ -466,6 +476,7 @@ export default {
justTripNoStop(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false);
}).catch(error => {
console.error(error);
this.$message.info(error.message);
this.refresh(false);
});
@ -481,6 +492,7 @@ export default {
justTripTurnBack(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false);
}).catch(error => {
console.error(error);
this.$message.info(error.message);
this.refresh(false);
});
@ -497,6 +509,7 @@ export default {
addRpTrip(this.planId, model).then(resp => {
this.refresh();
}).catch(error => {
console.error(error);
this.$message.info(error.message);
this.refresh();
this.$refs.schedule.clearGraphic(['mark']);
@ -518,6 +531,7 @@ export default {
createRpArea(this.planId, model).then(resp => {
this.refresh();
}).catch(error => {
console.error(error);
this.$message.info(error.message);
this.refresh();
this.$refs.schedule.clearGraphic(['mark']);
@ -532,7 +546,8 @@ export default {
translateRpService(this.planId, this.selected.serviceNo, model).then(resp => {
this.refresh(false);
}).catch(error => {
this.refresh(false);
this.refresh(false);
console.error(error);
this.$message.info(error.message);
});
}
@ -551,7 +566,8 @@ export default {
modifyRpArea(this.planId, data.areaNo, model).then(resp => {
this.refresh(false);
}).catch(error => {
this.refresh(false);
this.refresh(false);
console.error(error);
this.$message.info(error.message);
});
}
@ -566,11 +582,13 @@ export default {
delRpService(this.planId, this.selected.serviceNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
this.refresh();
console.error(error);
this.$message.info(error.message);
});
}).catch(() => {
this.$message({ type: 'info', message: 'Deletion cancelled.' });
}).catch(error => {
console.error(error);
this.$message.info('Deletion cancelled.');
});
}
},
@ -585,11 +603,13 @@ export default {
delRpTrip(this.planId, this.selected.tripNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
this.refresh();
console.error(error);
this.$message.info(error.message);
});
}).catch(() => {
this.$message({ type: 'info', message: 'Deletion cancelled.' });
}).catch(error => {
console.error(error);
this.$message.info('Deletion cancelled.');
});
}
},
@ -604,11 +624,13 @@ export default {
delRpArea(this.planId, data.areaNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
this.refresh();
console.error(error);
this.$message.info(error.message);
});
}).catch(() => {
this.$message({ type: 'info', message: 'Deletion cancelled.' });
}).catch(error => {
console.error(error);
this.$message.info('Deletion cancelled.');
});
}
},
@ -620,7 +642,8 @@ export default {
if (cls) {
this.onClear();
}
}).catch(() => {
}).catch(error => {
console.error(error);
this.$messageBox('Failed to load the plan.');
});
}

View File

@ -203,7 +203,8 @@ export default {
const mw = this.myChart.getWidth()-100;
const view = this.myChart.getViewOfComponentModel({__viewId: "_ec_shape_graphic"});
if (view.group) {
if (view &&
view.group) {
view.group.eachChild(el => {
if (['area'].includes(el.subType)) {
const position1 = this.myChart.convertToPixel('grid', el.point1);
@ -452,7 +453,10 @@ export default {
const elemList = option.graphic[0].elements.filter(el => { return !['drag'].includes(el.subType) });
const elem = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == e.target.model.areaNo; });
option.graphic[0].elements = this.calcHornList(elemList, elem);
if (elem) {
option.graphic[0].elements = this.calcHornList(elemList, elem);
}
this.myChart.setOption(option, true);
}
},
@ -642,14 +646,16 @@ export default {
const elemList = option.graphic[0].elements.filter(el => { return !['drag'].includes(el.subType) });
const elem = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; });
elem.position = args.position;
elem.point1 = args.point1;
elem.point2 = args.point2;
elem.shape.width = args.width;
elem.shape.height = args.height;
elem.style.textOffset = [ -args.width/2, -args.height/2 ];
if (elem) {
elem.position = args.position;
elem.point1 = args.point1;
elem.point2 = args.point2;
elem.shape.width = args.width;
elem.shape.height = args.height;
elem.style.textOffset = [ -args.width/2, -args.height/2 ];
option.graphic[0].elements = this.calcHornList(elemList, elem);
}
option.graphic[0].elements = this.calcHornList(elemList, elem);
this.myChart.setOption(option, true);
}
}

View File

@ -250,6 +250,7 @@ export default {
this.myChart.hideLoading();
}
} catch (error) {
console.error(error);
this.$messageBox(error.message);
}
},
@ -286,7 +287,9 @@ export default {
this.target.model) {
const elemList = option.graphic[0].elements.filter(el => { return !['drag'].includes(el.subType) });
const elem = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == this.target.model.areaNo; });
option.graphic[0].elements = this.calcHornList(elemList, elem);
if (elem) {
option.graphic[0].elements = this.calcHornList(elemList, elem);
}
}
}
@ -300,6 +303,7 @@ export default {
this.setTargetLight();
}
} catch (error) {
console.error(error);
this.$messageBox(error.message);
}
},