大铁项目 发送发车预告 代码调整

This commit is contained in:
joylink_cuiweidong 2022-06-15 13:32:42 +08:00
parent 30ca5c7cb1
commit e697233c6c
2 changed files with 47 additions and 13 deletions

View File

@ -149,6 +149,11 @@
</div>
<div class="runplanTableNo">5</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.arriveRunPlan&&scope.row.arriveRunPlan.adjacentMessage==1 && scope.row.passenger=='PASSENGER'" class="passagerTrain" />
<div v-if="scope.row.arriveRunPlan&&scope.row.arriveRunPlan.adjacentMessage==1 && scope.row.passenger=='GOODS_TRAIN'" class="goodTrain" />
<div v-if="scope.row.arriveRunPlan&&scope.row.arriveRunPlan.adjacentMessage==2 ">{{ scope.row.adjacentMessage }}</div>
</template>
</el-table-column>
<el-table-column width="70">
<template slot="header">
@ -313,6 +318,11 @@
</div>
<div class="runplanTableNo">23</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.departRunPlan&&scope.row.departRunPlan.adjacentMessage==1 && scope.row.passenger=='PASSENGER'" class="passagerTrain" />
<div v-if="scope.row.departRunPlan&&scope.row.departRunPlan.adjacentMessage==1 && scope.row.passenger=='GOODS_TRAIN'" class="goodTrain" />
<div v-if="scope.row.departRunPlan&&scope.row.departRunPlan.adjacentMessage==2 ">{{ scope.row.adjacentMessage }}</div>
</template>
</el-table-column>
<el-table-column width="70">
<template slot="header">
@ -559,6 +569,7 @@ export default {
this.tableData = [];
this.loadData();
this.isShow = true;
window.addEventListener('keydown', this.handleKeyDown);
// arriveRunPlan: Object
// code: "00110010"
// departRunPlan: Object
@ -572,6 +583,19 @@ export default {
this.isShow = false;
this.rpMenuPopShow = false;
this.currentRow = null;
window.removeEventListener('keydown', this.handleKeyDown);
},
handleKeyDown(event) {
event.stopPropagation();
event.preventDefault();
switch (event.code) {
case 'F1':
this.sendNotcie();
break;
case 'F2':
this.agreeNotcie();
break;
}
},
sendRunplan() {
if (document.getElementById('sendRunplan').className.includes('active')) {
@ -680,13 +704,13 @@ export default {
commitOperate(menuOperate.CTC.sendNotcie, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 2).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
this.doClose();
}
// if (valid) {
// this.doClose();
// }
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.doClose();
// this.doClose();
this.noticeInfo();
});
@ -699,12 +723,12 @@ export default {
this.loading = false;
this.clearRpRow();
if (valid) {
this.doClose();
// this.doClose();
}
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.doClose();
// this.doClose();
this.noticeInfo();
});
}
@ -725,7 +749,7 @@ export default {
position: absolute;
top: 0;
left: 0;
z-index: 38;
z-index: 2010;
margin-top: 34px;
display: block;
overflow: scroll;
@ -1021,4 +1045,6 @@ export default {
background-color: #6aa8ec;
color: #fff;
}
.passagerTrain{background:#f00}
.goodTrain{background:#00f}
</style>

View File

@ -209,7 +209,8 @@ function handle(state, data) {
const tripNumberAr = element.arriveRunPlan && element.arriveRunPlan.tripNumber;
if (tripNumberDe) { parseInt(tripNumberDe[tripNumberDe.length - 1]) % 2 == 0 ? element.departRunPlan.up = tripNumberDe : element.departRunPlan.down = tripNumberDe; }
if (tripNumberAr) { parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr; }
state.railCtcRunplanInitMsg[element.code] = element;
const code = element.stationCode + '' + element.code;
state.railCtcRunplanInitMsg[code] = element;
});
break;
// 大铁项目 ctc 运行图改变信息
@ -217,11 +218,18 @@ function handle(state, data) {
msg.forEach(element => {
const tripNumberDe = element.departRunPlan && element.departRunPlan.tripNumber;
const tripNumberAr = element.arriveRunPlan && element.arriveRunPlan.tripNumber;
element.departRunPlan.up = '';
element.departRunPlan.down = '';
if (tripNumberDe) { parseInt(tripNumberDe[tripNumberDe.length - 1]) % 2 == 0 ? element.departRunPlan.up = tripNumberDe : element.departRunPlan.down = tripNumberDe; }
if (tripNumberAr) { parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr; }
state.railCtcRunplanInitMsg[element.code] = copyAssign(state.railCtcRunplanInitMsg[element.code], element);
if (tripNumberDe) {
element.departRunPlan.up = '';
element.departRunPlan.down = '';
parseInt(tripNumberDe[tripNumberDe.length - 1]) % 2 == 0 ? element.departRunPlan.up = tripNumberDe : element.departRunPlan.down = tripNumberDe;
}
if (tripNumberAr) {
element.arriveRunPlan.up = '';
element.arriveRunPlan.down = '';
parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr;
}
const code = element.stationCode + '' + element.code;
state.railCtcRunplanInitMsg[code] = copyAssign(state.railCtcRunplanInitMsg[code], element);
});
state.railCtcRunplanChange++;
break;