This commit is contained in:
fan 2022-06-17 13:08:23 +08:00
commit 3843c01f40
3 changed files with 49 additions and 8 deletions

View File

@ -155,7 +155,7 @@
<div v-if="scope.row.arriveRunPlan&&scope.row.arriveRunPlan.adjacentMessage==2 ">{{ coverTime(scope.row.arriveRunPlan.adjacentMessageTime) }}</div>
</template>
</el-table-column>
<el-table-column width="70">
<el-table-column width="70" prop="arriveRunPlan.adjacentDepart">
<template slot="header">
<div class="runplanTableTname runplanThreeLevel"><br><br><br></div>
<div class="runplanTableNo">6</div>
@ -167,6 +167,9 @@
<div class="runplanTableTname runplanFourLevel"><br></div>
<div class="runplanTableNo">7</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.arriveRunPlan">{{ coverTime(scope.row.arriveRunPlan.planTime) }}</div>
</template>
</el-table-column>
<el-table-column width="70" prop="arriveRunPlan.actualTime">
<template slot="header">
@ -324,7 +327,7 @@
<div v-if="scope.row.departRunPlan&&scope.row.departRunPlan.adjacentMessage==2 ">{{ coverTime(scope.row.departRunPlan.adjacentMessageTime) }}</div>
</template>
</el-table-column>
<el-table-column width="70">
<el-table-column width="70" prop="departRunPlan.adjacentDepart">
<template slot="header">
<div class="runplanTableTname runplanThreeLevel"><br><br><br></div>
<div class="runplanTableNo">24</div>
@ -336,6 +339,9 @@
<div class="runplanTableTname runplanFourLevel"><br></div>
<div class="runplanTableNo">25</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.departRunPlan">{{ coverTime(scope.row.departRunPlan.planTime) }}</div>
</template>
</el-table-column>
<el-table-column width="70" prop="departRunPlan.actualTime">
<template slot="header">
@ -551,15 +557,27 @@ export default {
loadData() {
this.tableData = [];
const railCtcRunplanInitMsg = copyAssign({}, this.$store.state.socket.railCtcRunplanInitMsg);
this.tableData = Object.values(railCtcRunplanInitMsg).filter(data=>{
const tableData = Object.values(railCtcRunplanInitMsg).filter(data=>{
if (data.departRunPlan) {
data.departRunPlan.planTime = data.departRunPlan.planTime.split(':').splice(0, 2).join(':');
// data.departRunPlan.planTime = this.coverTime(data.departRunPlan.planTime);
if (data.departRunPlan.adjacentDepart) { data.departRunPlan.adjacentDepart = this.coverTime(data.departRunPlan.adjacentDepart); }
if (data.departRunPlan.actualTime) { data.departRunPlan.actualTime = this.coverTime(data.departRunPlan.actualTime); }
}
if (data.arriveRunPlan) {
data.arriveRunPlan.planTime = data.arriveRunPlan.planTime.split(':').splice(0, 2).join(':');
// data.arriveRunPlan.planTime = this.coverTime(data.arriveRunPlan.planTime);
if (data.arriveRunPlan.adjacentDepart) { data.arriveRunPlan.adjacentDepart = this.coverTime(data.arriveRunPlan.adjacentDepart); }
if (data.arriveRunPlan.actualTime) { data.arriveRunPlan.actualTime = this.coverTime(data.arriveRunPlan.actualTime); }
}
return data.stationCode == this.$store.state.training.roleDeviceCode;
});
this.tableData = tableData.sort((prev, next)=>{
const prevPlanTime = prev.departRunPlan ? prev.departRunPlan.planTime : prev.arriveRunPlan ? prev.arriveRunPlan.planTime : '00:00:00';
const nextPlanTime = next.departRunPlan ? next.departRunPlan.planTime : next.arriveRunPlan ? next.arriveRunPlan.planTime : '00:00:00';
return new Date('2000-06-18 ' + prevPlanTime).getTime() - new Date('2000-06-18 ' + nextPlanTime).getTime();
});
},
coverTime(time) {
return time.split(':').splice(0, 2).join(':');
},
doShow() {
this.filterSectionList = [];

View File

@ -108,6 +108,22 @@ export default {
NoticeInfo
},
data() {
var validateTripNumber = (rule, value, callback) => {
if (value) {
const judge = /^[a-zA-Z0-9]*[\d]$/.test(value);
if (judge) {
if (value.toString().length > 2 || value.toString().length < 6) {
callback('车次长度2-6位');
} else {
callback();
}
} else {
callback('字母+数字,最后一位数字');
}
} else {
callback('请输入车次');
}
};
return {
dialogShow: false,
loading: false,
@ -131,11 +147,13 @@ export default {
{ required: true, message: '请选择股道', trigger: 'change' }
],
arriveTripNumber:[
{ required: true, message: '请输入到达车次', trigger: 'blur' }
{ required: true, validator: validateTripNumber, trigger: 'blur' }
// message: ''
],
departTripNumber:[
{ required: true, message: '请输入到达车次', trigger: 'blur' }
{ required: true, validator: validateTripNumber, trigger: 'blur' }
],
// message: ''
arriveTime: [
{ required: true, message: '请选择到达时间', trigger: 'blur' },
{ required: true, message: '请选择到达时间', trigger: 'change' }
@ -160,7 +178,6 @@ export default {
{ required: true, message: '请选择前方车站', trigger: 'blur' },
{ required: true, message: '请选择前方车站', trigger: 'change' }
]
// { validator: validateJudgePass, trigger: 'blur' }
}
};
},

View File

@ -397,11 +397,17 @@ export default {
that.$message.error('发布失败');
});
},
coverTime(time) {
return time.split(':').splice(0, 2).join(':');
},
handleData() {
this.tableData = [];
const railCtcStationManageRpMsg = copyAssign({}, this.$store.state.socket.railCtcStationManageRpMsg);
this.tableData = Object.values(railCtcStationManageRpMsg).filter(data=>{
data.arriveTime = this.coverTime(data.arriveTime);
data.departTime = this.coverTime(data.departTime);
return data.stationCode == this.currentStationCode;
});
// stationCode
// trackSectionCode