运行图编制 代码调整
This commit is contained in:
parent
9984b13759
commit
ca3f01104e
@ -87,14 +87,6 @@ export function getRpListByMapId(mapId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取地图原始站间运行等级 */
|
|
||||||
export function getMapStationRun(mapId) {
|
|
||||||
return request({
|
|
||||||
url: `/api/runPlan/draft/${mapId}/stationRunLevel`,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 分页获取用户站间运行等级 */
|
/** 分页获取用户站间运行等级 */
|
||||||
export function getMapStationRunUser(mapId) {
|
export function getMapStationRunUser(mapId) {
|
||||||
return request({
|
return request({
|
||||||
@ -147,14 +139,6 @@ export function checkServiceNumberExist({ planId, serviceNumber }) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// /** 查询交路列表*/
|
|
||||||
// export function getRoutingList(planId) {
|
|
||||||
// return request({
|
|
||||||
// url: `/api/runPlan/draft/${planId}/routingList`,
|
|
||||||
// method: 'get'
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
/** 查询用户交路数据 (新版)*/
|
/** 查询用户交路数据 (新版)*/
|
||||||
export function listUserRoutingData(mapId) {
|
export function listUserRoutingData(mapId) {
|
||||||
return request({
|
return request({
|
||||||
@ -164,10 +148,11 @@ export function listUserRoutingData(mapId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// //////// 新添加
|
||||||
/** 根据交路查询交路区段列表*/
|
/** 根据交路查询交路区段列表*/
|
||||||
export function querySectionListByRouting({ planId, routingCode }) {
|
export function querySectionListByRouting(routingCode) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/runPlan/draft/${planId}/${routingCode}/routingSectionList`,
|
url: `/api/runPlan/draft/${routingCode}/routingSectionList`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -258,15 +243,6 @@ export function updatePlanTrip(data) {
|
|||||||
|
|
||||||
/** 根据车次号查询交路 */
|
/** 根据车次号查询交路 */
|
||||||
export function getRoutingBySDTNumber(params) {
|
export function getRoutingBySDTNumber(params) {
|
||||||
// 旧版
|
|
||||||
// return request({
|
|
||||||
// url: `/api/runPlan/draft/${params.planId}/routing`,
|
|
||||||
// method: 'get',
|
|
||||||
// params: {
|
|
||||||
// SDTNumber: params.SDTNumber
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// 新版
|
|
||||||
return request({
|
return request({
|
||||||
url: `/api/runPlan/draft/${params.planId}/userRouting`,
|
url: `/api/runPlan/draft/${params.planId}/userRouting`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
@ -80,20 +80,12 @@ export default {
|
|||||||
departureInterval:[
|
departureInterval:[
|
||||||
{ required: true, message: '请填写发车间隔', trigger: 'blur' }
|
{ required: true, message: '请填写发车间隔', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
// inboundRouting: [
|
|
||||||
// { required: true, message: '请选择回库交路', trigger: 'change' }
|
|
||||||
// ],
|
|
||||||
runningRouting: [
|
runningRouting: [
|
||||||
{ required: true, message: '请选择环路', trigger: 'blur' },
|
{ required: true, message: '请选择环路', trigger: 'blur' },
|
||||||
{ required: true, message: '请选择环路', trigger: 'change' }
|
{ required: true, message: '请选择环路', trigger: 'change' }
|
||||||
]
|
]
|
||||||
// outboundRouting: [
|
|
||||||
// { required: true, message: '请选择出库交路', trigger: 'change' }
|
|
||||||
// ]
|
|
||||||
},
|
},
|
||||||
// outboundRouteList: [],
|
|
||||||
runningRouteList: []
|
runningRouteList: []
|
||||||
// inboundRouteList: []
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -114,12 +106,10 @@ export default {
|
|||||||
{ prop: 'overTime', label: '结束时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'},
|
{ prop: 'overTime', label: '结束时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'},
|
||||||
{ prop: 'runLevel', label: '运行等级', type: 'select', options: this.runLevelList },
|
{ prop: 'runLevel', label: '运行等级', type: 'select', options: this.runLevelList },
|
||||||
{ prop: 'departureInterval', label: '发车间隔', type: 'number', show:this.formModel.gernarateType == '02', min:0, step:1, precisionFlag:true, precision:0, message:'s'},
|
{ prop: 'departureInterval', label: '发车间隔', type: 'number', show:this.formModel.gernarateType == '02', min:0, step:1, precisionFlag:true, precision:0, message:'s'},
|
||||||
// { prop: 'outboundRouting', label: '出库交路', type: 'select', options: this.outboundRouteList, clearable: true, change:true, onChange: this.onOutboundRouteChange, noDataText:'请先设置交路'},
|
|
||||||
{ prop: 'runningRouting1', label: '环路交路1', type: 'select', show:false},
|
{ prop: 'runningRouting1', label: '环路交路1', type: 'select', show:false},
|
||||||
{ prop: 'runningRouting2', label: '环路交路2', type: 'select', show:false},
|
{ prop: 'runningRouting2', label: '环路交路2', type: 'select', show:false},
|
||||||
{ prop: 'outAndIn', label: '自动生成出入库', type: 'switchBox', show:true, activeColor:'#409eff', inactiveColor:'#dcdfe6' },
|
{ prop: 'outAndIn', label: '自动生成出入库', type: 'switchBox', show:true, activeColor:'#409eff', inactiveColor:'#dcdfe6' },
|
||||||
{ prop: 'runningRouting', label:'交路', type: 'select', options: this.runningRouteList, noDataText:'请先设置交路', clearable: true, change:true, onChange:this.onRunningRouteChange}
|
{ prop: 'runningRouting', label:'交路', type: 'select', options: this.runningRouteList, noDataText:'请先设置交路', clearable: true, change:true, onChange:this.onRunningRouteChange}
|
||||||
// { prop: 'inboundRouting', label: '入库交路', type: 'select', options: this.inboundRouteList, noDataText:'请先设置交路', clearable: true, change:true, onChange:this.onInboundRouteChange}
|
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -134,6 +124,7 @@ export default {
|
|||||||
listUserRoutingData(mapId).then(response => {
|
listUserRoutingData(mapId).then(response => {
|
||||||
const list = response.data;
|
const list = response.data;
|
||||||
// this.routingList = list.map(elem => { return { value: elem.code, label: elem.name, routingType:elem.routingType, startSectionCode: elem.startSectionCode, endSectionCode: elem.endSectionCode }; });
|
// this.routingList = list.map(elem => { return { value: elem.code, label: elem.name, routingType:elem.routingType, startSectionCode: elem.startSectionCode, endSectionCode: elem.endSectionCode }; });
|
||||||
|
// console.time();
|
||||||
list.forEach(elem=>{
|
list.forEach(elem=>{
|
||||||
// this.routingList.push({value: elem.code, label: elem.name, routingType:elem.routingType});
|
// this.routingList.push({value: elem.code, label: elem.name, routingType:elem.routingType});
|
||||||
this.routingMap[elem.id] = {parkSectionCodeList:elem.parkSectionCodeList};
|
this.routingMap[elem.id] = {parkSectionCodeList:elem.parkSectionCodeList};
|
||||||
@ -141,35 +132,24 @@ export default {
|
|||||||
// const name = elem.name;
|
// const name = elem.name;
|
||||||
// let temp = '';
|
// let temp = '';
|
||||||
if (elem.right) {
|
if (elem.right) {
|
||||||
// temp = name.split('-')[0];
|
|
||||||
// const data = ;
|
|
||||||
const data = runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode];
|
const data = runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode];
|
||||||
if (!data) { runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode] = {}; }
|
if (!data) { runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode] = {}; }
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].label = elem.name;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].label = elem.name;
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].value = elem.startSectionCode + '-' + elem.endSectionCode;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].value = elem.startSectionCode + '-' + elem.endSectionCode;
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].runningRouting1 = elem.id;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].runningRouting1 = elem.id;
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].runningRouting1 = elem.id;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].runningRouting1 = elem.id;
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].startSectionCode = elem.startSectionCode;
|
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].endSectionCode = elem.endSectionCode;
|
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].startStationCode = elem.startStationCode;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].startStationCode = elem.startStationCode;
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].endStationCode = elem.endStationCode;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].endStationCode = elem.endStationCode;
|
||||||
} else {
|
} else {
|
||||||
// temp = name.split('-')[1];
|
|
||||||
// const data = ;
|
|
||||||
const data = runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode];
|
const data = runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode];
|
||||||
if (!data) { runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode] = {}; }
|
if (!data) { runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode] = {}; }
|
||||||
// runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].label = elem.name;
|
|
||||||
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].value = elem.endSectionCode + '-' + elem.startSectionCode;
|
|
||||||
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].runningRouting2 = elem.id;
|
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].runningRouting2 = elem.id;
|
||||||
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].startSectionCode = elem.startSectionCode;
|
|
||||||
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].endSectionCode = elem.endSectionCode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.runningRoutingMap = runningRoutingMap;
|
this.runningRoutingMap = runningRoutingMap;
|
||||||
// this.onOutboundRouteChange();
|
|
||||||
this.onRunningRouteChange();
|
this.onRunningRouteChange();
|
||||||
// this.onInboundRouteChange();
|
// console.timeEnd();
|
||||||
this.dataLoading = false;
|
this.dataLoading = false;
|
||||||
}).catch(_ => {
|
}).catch(_ => {
|
||||||
console.log(_);
|
console.log(_);
|
||||||
@ -222,51 +202,10 @@ export default {
|
|||||||
this.formModel.runningRouting2 = '';
|
this.formModel.runningRouting2 = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!this.outboundRouteList.find(route => route.value == this.formModel.outboundRouting)) {
|
|
||||||
// this.formModel.outboundRouting = '';
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (!this.inboundRouteList.find(route => route.value == this.formModel.inboundRouting)) {
|
|
||||||
// this.formModel.inboundRouting = '';
|
|
||||||
// }
|
|
||||||
|
|
||||||
this.$nextTick(_ => {
|
this.$nextTick(_ => {
|
||||||
this.$refs.dataform && this.$refs.dataform.clearValidate();
|
this.$refs.dataform && this.$refs.dataform.clearValidate();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// onOutboundRouteChange(outboundRouting = '') {
|
|
||||||
// const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting);
|
|
||||||
// const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting);
|
|
||||||
|
|
||||||
// if (this.formModel.runningRouting) {
|
|
||||||
// this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => {
|
|
||||||
// return route.runningRouting1 && route.runningRouting2 && (
|
|
||||||
// outboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
|
|
||||||
// inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode)
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => {
|
|
||||||
// return route.runningRouting1 && route.runningRouting2 && (
|
|
||||||
// outboundRoute && !inboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
|
|
||||||
// !outboundRoute && inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode) ||
|
|
||||||
// outboundRoute && inboundRoute && (
|
|
||||||
// outboundRoute.endSectionCode != inboundRoute.startSectionCode && JSON.stringify([route.startSectionCode, route.endSectionCode].sort()) == JSON.stringify([outboundRoute.endSectionCode, inboundRoute.startSectionCode].sort()) ||
|
|
||||||
// outboundRoute.endSectionCode == inboundRoute.startSectionCode && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode)
|
|
||||||
// ) ||
|
|
||||||
// !inboundRoute && !outboundRoute
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (!outboundRouting) {
|
|
||||||
// this.outboundRouteList = this.covertRouting(this.routingList, route => {
|
|
||||||
// return route.routingType == 'OUTBOUND';
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// this.checkRouteCurrentValue();
|
|
||||||
// },
|
|
||||||
onRunningRouteChange(runningRouting = '') {
|
onRunningRouteChange(runningRouting = '') {
|
||||||
const temp = this.runningRoutingMap[runningRouting];
|
const temp = this.runningRoutingMap[runningRouting];
|
||||||
if (temp) {
|
if (temp) {
|
||||||
@ -304,57 +243,8 @@ export default {
|
|||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.outboundRouteList = this.covertRouting(this.routingList, route => {
|
|
||||||
// return route.routingType == 'OUTBOUND' && (
|
|
||||||
// runningRoute
|
|
||||||
// ? [runningRoute.startSectionCode, runningRoute.endSectionCode].includes(route.endSectionCode)
|
|
||||||
// : true
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
|
|
||||||
// this.inboundRouteList = this.covertRouting(this.routingList, route => {
|
|
||||||
// return route.routingType == 'INBOUND' && (
|
|
||||||
// runningRoute
|
|
||||||
// ? [runningRoute.startSectionCode, runningRoute.endSectionCode].includes(route.startSectionCode)
|
|
||||||
// : true
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
|
|
||||||
this.checkRouteCurrentValue();
|
this.checkRouteCurrentValue();
|
||||||
},
|
},
|
||||||
// onInboundRouteChange(inboundRouting = '') {
|
|
||||||
// const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting);
|
|
||||||
// const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting);
|
|
||||||
|
|
||||||
// if (this.formModel.runningRouting) {
|
|
||||||
// this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => {
|
|
||||||
// return route.runningRouting1 && route.runningRouting2 && (
|
|
||||||
// outboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
|
|
||||||
// inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode)
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => {
|
|
||||||
// return route.runningRouting1 && route.runningRouting2 && (
|
|
||||||
// outboundRoute && !inboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
|
|
||||||
// !outboundRoute && inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode) ||
|
|
||||||
// outboundRoute && inboundRoute && (
|
|
||||||
// outboundRoute.endSectionCode != inboundRoute.startSectionCode && JSON.stringify([route.startSectionCode, route.endSectionCode].sort()) == JSON.stringify([outboundRoute.endSectionCode, inboundRoute.startSectionCode].sort()) ||
|
|
||||||
// outboundRoute.endSectionCode == inboundRoute.startSectionCode && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode)
|
|
||||||
// ) ||
|
|
||||||
// !inboundRoute && !outboundRoute
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (!inboundRouting) {
|
|
||||||
// this.inboundRouteList = this.covertRouting(this.routingList, route => {
|
|
||||||
// return route.routingType == 'INBOUND';
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// this.checkRouteCurrentValue();
|
|
||||||
// },
|
|
||||||
doClose() {
|
doClose() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
// this.$refs.dataform.validateField('runningRouting');
|
// this.$refs.dataform.validateField('runningRouting');
|
||||||
@ -371,8 +261,6 @@ export default {
|
|||||||
runLevel:3, // 运行等级
|
runLevel:3, // 运行等级
|
||||||
departureInterval:300, // 发车间隔
|
departureInterval:300, // 发车间隔
|
||||||
outAndIn:false, // 自动生成出入库
|
outAndIn:false, // 自动生成出入库
|
||||||
// inboundRouting:'', // 回库交路code
|
|
||||||
// outboundRouting:'', // 出库交路code
|
|
||||||
runningRouting1: '', // 环路code1
|
runningRouting1: '', // 环路code1
|
||||||
runningRouting2: '', // 环路code2
|
runningRouting2: '', // 环路code2
|
||||||
runningRouting:''
|
runningRouting:''
|
||||||
|
Loading…
Reference in New Issue
Block a user