This commit is contained in:
fan 2021-03-25 13:03:27 +08:00
commit a3d6dc727f
5 changed files with 23 additions and 155 deletions

View File

@ -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) {
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) {
return request({
@ -164,10 +148,11 @@ export function listUserRoutingData(mapId) {
});
}
// //////// 新添加
/** 根据交路查询交路区段列表*/
export function querySectionListByRouting({ planId, routingCode }) {
export function querySectionListByRouting(routingCode) {
return request({
url: `/api/runPlan/draft/${planId}/${routingCode}/routingSectionList`,
url: `/api/runPlan/draft/${routingCode}/routingSectionList`,
method: 'get'
});
}
@ -258,15 +243,6 @@ export function updatePlanTrip(data) {
/** 根据车次号查询交路 */
export function getRoutingBySDTNumber(params) {
// 旧版
// return request({
// url: `/api/runPlan/draft/${params.planId}/routing`,
// method: 'get',
// params: {
// SDTNumber: params.SDTNumber
// }
// });
// 新版
return request({
url: `/api/runPlan/draft/${params.planId}/userRouting`,
method: 'get',

View File

@ -48,12 +48,12 @@ export default {
{ value: 5, label: '等级五' }
],
formModel: {
gernarateType:'01',
gernarateType:'02',
serviceNumber:'', //
beginTime: '', //
overTime: '', //
runLevel:'', //
departureInterval:180, //
beginTime: '06:00:00', //
overTime: '22:00:00', //
runLevel:3, //
departureInterval:300, //
// inboundRouting:'', // code
// outboundRouting:'', // code
outAndIn:false, //
@ -80,20 +80,12 @@ export default {
departureInterval:[
{ required: true, message: '请填写发车间隔', trigger: 'blur' }
],
// inboundRouting: [
// { required: true, message: '', trigger: 'change' }
// ],
runningRouting: [
{ required: true, message: '请选择环路', trigger: 'blur' },
{ required: true, message: '请选择环路', trigger: 'change' }
]
// outboundRouting: [
// { required: true, message: '', trigger: 'change' }
// ]
},
// outboundRouteList: [],
runningRouteList: []
// inboundRouteList: []
};
},
computed: {
@ -114,12 +106,10 @@ export default {
{ prop: 'overTime', label: '结束时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'},
{ 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: 'outboundRouting', label: '', type: 'select', options: this.outboundRouteList, clearable: true, change:true, onChange: this.onOutboundRouteChange, noDataText:''},
{ prop: 'runningRouting1', label: '环路交路1', type: 'select', show:false},
{ prop: 'runningRouting2', label: '环路交路2', type: 'select', show:false},
{ 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: '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 => {
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 }; });
// console.time();
list.forEach(elem=>{
// this.routingList.push({value: elem.code, label: elem.name, routingType:elem.routingType});
this.routingMap[elem.id] = {parkSectionCodeList:elem.parkSectionCodeList};
@ -141,35 +132,24 @@ export default {
// const name = elem.name;
// let temp = '';
if (elem.right) {
// temp = name.split('-')[0];
// const data = ;
const 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].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].startSectionCode = elem.startSectionCode;
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].endSectionCode = elem.endSectionCode;
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].startStationCode = elem.startStationCode;
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].endStationCode = elem.endStationCode;
} else {
// temp = name.split('-')[1];
// const data = ;
const 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].startSectionCode = elem.startSectionCode;
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].endSectionCode = elem.endSectionCode;
}
}
});
this.runningRoutingMap = runningRoutingMap;
// this.onOutboundRouteChange();
this.onRunningRouteChange();
// this.onInboundRouteChange();
// console.timeEnd();
this.dataLoading = false;
}).catch(_ => {
console.log(_);
@ -222,51 +202,10 @@ export default {
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.$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 = '') {
const temp = this.runningRoutingMap[runningRouting];
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();
},
// 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() {
this.loading = false;
// this.$refs.dataform.validateField('runningRouting');
@ -364,19 +254,18 @@ export default {
// this.$refs.dataform.clearValidate();
// blur
this.formModel = {
gernarateType:'01',
gernarateType:'02',
serviceNumber:'', //
beginTime: '', //
overTime: '', //
runLevel:'', //
departureInterval:180, //
beginTime: '06:00:00', //
overTime: '22:00:00', //
runLevel:3, //
departureInterval:300, //
outAndIn:false, //
// inboundRouting:'', // code
// outboundRouting:'', // code
runningRouting1: '', // code1
runningRouting2: '', // code2
runningRouting:''
};
this.$emit('close');
// this.dialogShow = false;
},
covertRouting(list, cb = e => true) {

View File

@ -2,7 +2,7 @@
<el-dialog :title="title" :visible.sync="dialogShow" custom-class="content-route" width="100%" :fullscreen="true" top="0px" :before-close="close" :z-index="2000" :append-to-body="true">
<div class="content-box">
<div v-if="type=='generateRouting'">
<gernarate-plan ref="gernaratePlanTrain" />
<gernarate-plan ref="gernaratePlanTrain" @close="closeDialog" />
</div>
<jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" @onSelect="clickEvent" />
<!-- :style="{height: $store.state.app.height-54+'px' }" -->
@ -144,6 +144,9 @@ export default {
if (this.type == 'routeMap') { this.$refs.routeConfig.createRouteEvent(); }
// if (this.type == 'runplanParams') { this.$refs.runPlanConfig.clear(); }
if (this.type == 'generateRouting') { this.$refs.gernaratePlanTrain.doClose(); }
},
closeDialog() {
this.dialogShow = false;
}
}
};

View File

@ -29,7 +29,7 @@
<modifying-station-stop-time ref="modifyingStationStopTime" />
<populating-generic-data ref="populatingGenericData" :load-run-plan-id="planId" />
<edit-plan-name ref="editPlan" @renewal="refreshMapName" />
<gernarate-plan ref="gernaratePlanTrain" />
<!-- <gernarate-plan ref="gernaratePlanTrain" /> -->
</div>
</template>

View File

@ -266,8 +266,7 @@ export default {
};
</script>
<style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss";
<style scoped lang="scss">
$size: 26px;
$background: #ffffee;
$color: #0000;
@ -275,6 +274,7 @@ export default {
.el-dialog__wrapper {
position: relative;
width: 100%;
height: 32px;
}
.frosted-glass{