Merge remote-tracking branch 'remotes/origin/test_newRunplan' into test

This commit is contained in:
joylink_cuiweidong 2021-03-18 15:02:03 +08:00
commit b0a04a9dec
6 changed files with 200 additions and 185 deletions

View File

@ -123,7 +123,16 @@ export function verifyMap(id) {
});
}
/** 分页查询交路数据(新版)*/
/** 分页查询地图交路数据(新版)*/
export function listRoutingDataInMap(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/routingData`,
method: 'get',
params: params
});
}
/** 分页查询交路数据(新版 用户)*/
export function listRoutingData(mapId, params) {
return request({
// url: `/api/mapBuild/${mapId}/routingData`,
@ -227,10 +236,10 @@ export function updateRoutingData(data) {
/** 在草稿运行图加载时先同步调下这个接口,【生成默认交路关联的运行等级/停站时间/折返时间】 */
export function generateRunPlanInfoSync(mapId) {
return request({
url: `/api/runPlan/userData/${mapId}/defaultRouting/sync`,
method: 'put'
})
return request({
url: `/api/runPlan/userData/${mapId}/defaultRouting/sync`,
method: 'put'
});
}
/** 根据地图交路区段生成站间运行等级(新版)*/

View File

@ -77,8 +77,8 @@ export default {
{label: '自动折返', name:'turned', menus:TurnedOperate},
{label: '目的地码', name:'destination', menus:DestinationOperate},
{label: this.$t('map.automaticSignal'), name:'automatic', menus:AutomaticOperate},
{label: this.$t('map.signalApprochSection'), name:'signal', menus:SignalOperate}
// {label: this.$t('map.routing'), name:'routing', menus:RoutingOperate},
{label: this.$t('map.signalApprochSection'), name:'signal', menus:SignalOperate},
{label: this.$t('map.routing'), name:'routing', menus:RoutingOperate}
// {label: '', name:'dwellTime', menus:DwellTimeOperate},
// {label: '', name:'runLevel', menus:RunLevelOperate}
]

View File

@ -15,7 +15,8 @@
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { listRoutingData, deleteRoutingData, getRoutingData, generateStationRunData } from '@/api/jmap/mapdraft';
import { listRoutingDataInMap } from '@/api/jmap/mapdraft';
// import { deleteRoutingData, getRoutingData, generateStationRunData } from '@/api/jmap/mapdraft';
import PreViewField from './preview';
export default {
@ -79,8 +80,9 @@ export default {
indexShow: true,
columns: [
{
title: this.$t('map.routingCode'),
prop: 'code'
title: '交路名称',
prop: 'name',
width:'260'
},
{
title: this.$t('map.startStation'),
@ -123,28 +125,28 @@ export default {
handleClick: this.sectionDetail
}
]
},
{
type: 'button',
title: this.$t('map.operation'),
width: '300',
buttons: [
{
name: this.$t('map.compile'),
handleClick: this.editObj
},
{
name: this.$t('map.deleteObj'),
handleClick: this.deleteObj,
type: 'danger'
},
{
name: '生成站间运行数据',
handleClick: this.generateData,
type: 'danger'
}
]
}
// {
// type: 'button',
// title: this.$t('map.operation'),
// width: '300',
// buttons: [
// {
// name: this.$t('map.compile'),
// handleClick: this.editObj
// },
// {
// name: this.$t('map.deleteObj'),
// handleClick: this.deleteObj,
// type: 'danger'
// },
// {
// name: '',
// handleClick: this.generateData,
// type: 'danger'
// }
// ]
// }
]
}
};
@ -207,7 +209,7 @@ export default {
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return listRoutingData(this.mapInfo.id, params);
return listRoutingDataInMap(this.mapInfo.id, params);
}
},
acquireMapList() {
@ -232,43 +234,43 @@ export default {
}
return data;
},
editObj(index, row) {
getRoutingData(row.id).then(response => {
const data = Object.assign({ code: response.data.id }, response.data);
this.$emit('routingSelected', data);
this.doClose();
});
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
this.$confirm('是否确认删除交路', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
//
deleteRoutingData(row.id).then(response => {
this.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('map.failDelete'));
});
}).catch();
}
},
generateData(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
//
generateStationRunData(row.id).then(response => {
this.$message.success(this.$t('map.generateStationRunDataSuccess'));
//
this.reloadTable();
}).catch((error) => {
//
this.$messageBox(this.$t('map.generateStationRunDataFailed') + ': ' + error.message);
});
}
},
// editObj(index, row) {
// getRoutingData(row.id).then(response => {
// const data = Object.assign({ code: response.data.id }, response.data);
// this.$emit('routingSelected', data);
// this.doClose();
// });
// },
// deleteObj(index, row) {
// if (this.mapInfo && this.mapInfo.id && row) {
// this.$confirm('', this.$t('global.tips'), {
// confirmButtonText: this.$t('global.confirm'),
// cancelButtonText: this.$t('global.cancel'),
// type: 'warning'
// }).then(() => {
// //
// deleteRoutingData(row.id).then(response => {
// this.$message.success(this.$t('map.successfullyDelete'));
// this.reloadTable();
// }).catch(() => {
// this.$messageBox(this.$t('map.failDelete'));
// });
// }).catch();
// }
// },
// generateData(index, row) {
// if (this.mapInfo && this.mapInfo.id && row) {
// //
// generateStationRunData(row.id).then(response => {
// this.$message.success(this.$t('map.generateStationRunDataSuccess'));
// //
// this.reloadTable();
// }).catch((error) => {
// //
// this.$messageBox(this.$t('map.generateStationRunDataFailed') + ': ' + error.message);
// });
// }
// },
sectionDetail(index, row) {
const sectionDict = {};
const stationDict = {};

View File

@ -1,22 +1,22 @@
<template>
<div style="height: 100%;">
<route-draft
<!-- <route-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
/>
/> -->
<!-- :route-data="routeData" -->
<route-detail ref="routeDetail" :map-info="mapInfo" @routingSelected="routingSelected" />
</div>
</template>
<script>
import RouteDraft from './route';
// import RouteDraft from './route';
import RouteDetail from './detail';
export default {
name: 'PathOperate',
components: {
RouteDraft,
// RouteDraft,
RouteDetail
},
props: {
@ -80,10 +80,10 @@ export default {
this.$emit('setCenter', code);
},
initLoad() {
this.$refs.routeEdit.batchSectionListFocus(true);
// this.$refs.routeEdit.batchSectionListFocus(true);
},
batchSectionListFocus(flag) {
this.$refs.routeEdit.batchSectionListFocus(flag);
// this.$refs.routeEdit.batchSectionListFocus(flag);
}
}
};

View File

@ -51,8 +51,9 @@ export default {
overTime: '', //
runLevel:'', //
departureInterval:180, //
inboundRouting:'', // code
outboundRouting:'', // code
// inboundRouting:'', // code
// outboundRouting:'', // code
outAndIn:false, //
runningRouting1: '', // code1
runningRouting2: '', // code2
runningRouting:''
@ -76,20 +77,20 @@ export default {
departureInterval:[
{ required: true, message: '请填写发车间隔', trigger: 'blur' }
],
inboundRouting: [
{ required: true, message: '请选择回库交路', trigger: 'change' }
],
// inboundRouting: [
// { required: true, message: '', trigger: 'change' }
// ],
runningRouting: [
{ required: true, message: '请选择环路', trigger: 'blur' },
{ required: true, message: '请选择环路', trigger: 'change' }
],
outboundRouting: [
{ required: true, message: '请选择出库交路', trigger: 'change' }
]
// outboundRouting: [
// { required: true, message: '', trigger: 'change' }
// ]
},
outboundRouteList: [],
runningRouteList: [],
inboundRouteList: []
// outboundRouteList: [],
runningRouteList: []
// inboundRouteList: []
};
},
computed: {
@ -98,7 +99,7 @@ export default {
},
form() {
return {
labelWidth: '100px',
labelWidth: '140px',
size:'small',
items: [
{ prop: 'gernarateType', label: '生成类型', type: 'checkBox', children: [
@ -110,11 +111,12 @@ 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: '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: '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}
{ 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}
]
};
}
@ -159,9 +161,9 @@ export default {
}
});
this.runningRoutingMap = runningRoutingMap;
this.onOutboundRouteChange();
// this.onOutboundRouteChange();
this.onRunningRouteChange();
this.onInboundRouteChange();
// this.onInboundRouteChange();
this.dataLoading = false;
}).catch(_ => {
console.log(_);
@ -214,51 +216,51 @@ export default {
this.formModel.runningRouting2 = '';
}
if (!this.outboundRouteList.find(route => route.value == this.formModel.outboundRouting)) {
this.formModel.outboundRouting = '';
}
// 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 = '';
}
// 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);
// 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 (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';
});
}
// if (!outboundRouting) {
// this.outboundRouteList = this.covertRouting(this.routingList, route => {
// return route.routingType == 'OUTBOUND';
// });
// }
this.checkRouteCurrentValue();
},
// this.checkRouteCurrentValue();
// },
onRunningRouteChange(runningRouting = '') {
const temp = this.runningRoutingMap[runningRouting];
if (temp) {
@ -266,69 +268,69 @@ export default {
this.formModel.runningRouting2 = temp.runningRouting2;
}
const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting);
const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting);
const runningRoute = Object.values(this.runningRoutingMap).find(route => route.value == this.formModel.runningRouting);
// const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting);
// const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting);
// const runningRoute = Object.values(this.runningRoutingMap).find(route => route.value == this.formModel.runningRouting);
if (!this.formModel.runningRouting) {
this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => route.runningRouting1 && route.runningRouting2 && (
outboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode) ||
!inboundRoute && !outboundRoute
));
this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => route.runningRouting1 && route.runningRouting2
// && (outboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
// inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode) ||
//! inboundRoute && !outboundRoute)
);
}
this.outboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'OUTBOUND' && (
runningRoute
? [runningRoute.startSectionCode, runningRoute.endSectionCode].includes(route.endSectionCode)
: true
);
});
// 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.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);
// 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 (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';
});
}
// if (!inboundRouting) {
// this.inboundRouteList = this.covertRouting(this.routingList, route => {
// return route.routingType == 'INBOUND';
// });
// }
this.checkRouteCurrentValue();
},
// this.checkRouteCurrentValue();
// },
doClose() {
this.loading = false;
// this.$refs.dataform.validateField('runningRouting');
@ -342,8 +344,9 @@ export default {
overTime: '', //
runLevel:'', //
departureInterval:180, //
inboundRouting:'', // code
outboundRouting:'', // code
outAndIn:false, //
// inboundRouting:'', // code
// outboundRouting:'', // code
runningRouting1: '', // code1
runningRouting2: '', // code2
runningRouting:''
@ -366,6 +369,7 @@ export default {
delete formModel.serviceNumber;
}
delete formModel.gernarateType;
delete formModel.runningRouting;
this.loading = true;
generatePlanTrain(this.$route.query.planId || this.loadRunPlanId, formModel).then(res => {

View File

@ -289,10 +289,10 @@ export default {
serviceObj = this.$store.state.runPlan.editData[row.serviceNumber] || {};
const op = this.myChart.getOption();
//console.log(op.series);
// console.log(op.series);
// const array1 = []; op.series[1].data.forEach(each=>{ array1.push({dataTime:each[0], temperature:each[1], serviceNumber:each[3]}); });
//const array1 = []; op.series[5].data.forEach(each=>{ array1.push({dataTime:each[0], kiloMemter:each[1], serviceNumber:each[3], tripNumber:'05'}); });
//debugger;
// const array1 = []; op.series[5].data.forEach(each=>{ array1.push({dataTime:each[0], kiloMemter:each[1], serviceNumber:each[3], tripNumber:'05'}); });
// debugger;
op.series.forEach((item, index) => {
item.lineStyle.color = '#000';
item.lineStyle.width = 0.5;