西安二号线运行图导入调整

This commit is contained in:
fan 2020-04-23 13:36:34 +08:00
parent 61c385f570
commit 5f526a4497
5 changed files with 36 additions and 20 deletions

View File

@ -1,7 +1,7 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
const StationMap = {
YARD1: '潏河转换轨',
YARD2: '潏河转换轨',
YARD1: '潏河停车场',
YARD2: '潏河停车场',
WQN: '韦曲南站',
HTC: '航天城站',
FQY: '凤栖原站',
@ -84,7 +84,6 @@ export default {
}
if (valueStr.includes('FT') || valueStr.includes('LT')) {
valueStr = valueStr.replace('FT', '').replace('LT', '');
console.log(valueStr);
}
valueStr = tripObj.trainId + valueStr;
delete tripObj.trainId;
@ -133,6 +132,23 @@ export default {
}
}
}
const deleteIndexList = [];
const secondStation = ['北客站', '韦曲南站'];
const firstStation = ['潏河停车场', '渭河转换轨'];
JsonData.forEach((item, i) => {
if (item.arrivalList.length === 2 && firstStation.includes(item.arrivalList[0].stationName) && secondStation.includes(item.arrivalList[1].stationName)) {
JsonData[i + 1].arrivalList[0].arriveTime = item.arrivalList[1].arriveTime;
JsonData[i + 1].arrivalList.unshift(item.arrivalList[0]);
deleteIndexList.unshift(i);
} else if (item.arrivalList.length === 2 && firstStation.includes(item.arrivalList[1].stationName) && secondStation.includes(item.arrivalList[0].stationName)) {
JsonData[i - 1].arrivalList[JsonData[i - 1].arrivalList.length - 1].departureTime = item.arrivalList[0].departureTime;
JsonData[i - 1].arrivalList.push(item.arrivalList[1]);
deleteIndexList.unshift(i);
}
});
deleteIndexList.forEach(item => {
JsonData.splice(item, 1);
});
return JsonData;
},

View File

@ -79,8 +79,8 @@ export default {
this.lessonName = response.data[0].name;
this.lessonRemark = response.data[0].remarks;
this.loading = false;
}).catch(()=>{
this.$messageBox(this.$t('approval.failedToGetCourseData'));
// }).catch(()=>{
// this.$messageBox(this.$t('approval.failedToGetCourseData'));
});
},
doClose() {

View File

@ -148,8 +148,8 @@ export default {
adminPublishLesson(params, row.id).then(response => {
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.coursePublishFailed'));
// }).catch(() => {
// this.$messageBox(this.$t('tip.coursePublishFailed'));
});
});
},
@ -169,7 +169,7 @@ export default {
this.rejectId = '';
this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
// this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.dialogFormVisible = false;
this.rejectId = '';
this.doClose();

View File

@ -137,8 +137,8 @@ export default {
};
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
// }).catch(error => {
// this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
});
},
handleConfirmPass(data) {
@ -149,16 +149,16 @@ export default {
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${resp.data[0]}`);
}
this.reloadTable();
}).catch(error => {
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${error.message}`);
// }).catch(error => {
// this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${error.message}`);
});
},
handleConfirmReject(data) {
rejectRunPlan(data.id, data).then(resp => {
this.reloadTable();
this.$message.success(this.$t('approval.rejectRunPlanSuccess'));
}).catch(error => {
this.$messageBox(`${this.$t('approval.rejectRunPlanFailed')}: ${error.message}`);
// }).catch(error => {
// this.$messageBox(`${this.$t('approval.rejectRunPlanFailed')}: ${error.message}`);
});
}
}

View File

@ -140,24 +140,24 @@ export default {
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, try:0, lineCode:mapInfo.lineCode};
this.$router.push({ path: `${UrlConfig.design.display}/demon`, query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
// }).catch(error => {
// this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
});
},
handleConfirmReject(data) {
rejectScript(data.id, data).then(resp => {
this.reloadTable();
this.$message.success(this.$t('approval.rejectScriptSuccess'));
}).catch(error => {
this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`);
// }).catch(error => {
// this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`);
});
},
handleConfirmPass(data) {
publishScript(data.id).then(resp => {
this.reloadTable();
this.$message.success(this.$t('approval.passedScriptSuccess'));
}).catch(error => {
this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${error.message}`);
// }).catch(error => {
// this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${error.message}`);
});
}
}