2020-04-21 15:08:27 +08:00
|
|
|
<template>
|
|
|
|
<data-table
|
|
|
|
id="PlanStatusBar"
|
|
|
|
ref="dataTable"
|
|
|
|
:height="height-11"
|
|
|
|
:config="stationListConfig"
|
|
|
|
:close="false"
|
|
|
|
:style="{top: maxmini? maxTop-110+'px':maxTop-21+'px'}"
|
|
|
|
@touch="touch"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import DataTable from './menusPlan/components/dataTable';
|
2021-03-17 13:35:15 +08:00
|
|
|
import { formatTime, formatName } from '@/jmapNew/theme/parser/util.js';
|
2020-04-21 15:08:27 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PlanStatusBar',
|
|
|
|
components: {
|
|
|
|
DataTable
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
maxTop: {
|
|
|
|
type: Number,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
maxmini: true,
|
|
|
|
height: 100,
|
|
|
|
stationListConfig: {
|
|
|
|
data: [],
|
|
|
|
showClose: true,
|
|
|
|
highlightCurrentRow: true,
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
prop: 'stationName',
|
|
|
|
label: '站台',
|
|
|
|
width: 400
|
|
|
|
},
|
|
|
|
{
|
2020-12-29 18:37:33 +08:00
|
|
|
prop: 'endTime',
|
2020-04-21 15:08:27 +08:00
|
|
|
label: '到点'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
prop: 'stopTime',
|
|
|
|
label: '停站时间'
|
|
|
|
},
|
|
|
|
{
|
2020-12-29 18:37:33 +08:00
|
|
|
prop: 'startTime',
|
2020-04-21 15:08:27 +08:00
|
|
|
label: '发点'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
prop: 'level',
|
|
|
|
label: '运行等级'
|
|
|
|
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
'$store.state.runPlan.selected': function (select) {
|
|
|
|
this.stationListConfig.data = [];
|
2020-12-08 13:56:36 +08:00
|
|
|
if (select) {
|
|
|
|
const serviceObj = this.$store.state.runPlan.editData[select.serviceNumber];
|
|
|
|
if (serviceObj) {
|
|
|
|
const trainMap = serviceObj.trainMap;
|
|
|
|
if (trainMap) {
|
|
|
|
const trainObj = trainMap[select.tripNumber];
|
|
|
|
if (trainObj) {
|
|
|
|
const stationTimeList = trainObj.stationTimeList;
|
|
|
|
if (stationTimeList && stationTimeList.length) {
|
2020-12-29 18:37:33 +08:00
|
|
|
for (var i = 0; i < stationTimeList.length; i += 2) {
|
2020-12-08 13:56:36 +08:00
|
|
|
const stationObj = {
|
2020-12-29 18:37:33 +08:00
|
|
|
stationName: formatName(stationTimeList[i].stationCode),
|
|
|
|
endTime : formatTime(i == 0 ? null : stationTimeList[i].secondTime + 7200),
|
|
|
|
stopTime: formatTime(i == 0 ? null : stationTimeList[i + 1].secondTime - stationTimeList[i].secondTime),
|
|
|
|
startTime: formatTime(stationTimeList[i + 1].secondTime + 7200),
|
|
|
|
level:formatTime(i == (stationTimeList.length - 2) ? null : (stationTimeList[i + 2].secondTime - stationTimeList[i + 1].secondTime))
|
2020-12-08 13:56:36 +08:00
|
|
|
};
|
|
|
|
this.stationListConfig.data.push(stationObj);
|
2020-12-29 18:37:33 +08:00
|
|
|
}
|
2020-12-08 13:56:36 +08:00
|
|
|
}
|
2020-04-21 15:08:27 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
touch(maxmini) {
|
|
|
|
this.maxmini = maxmini;
|
|
|
|
this.$emit('setPosition');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2020-07-31 16:22:29 +08:00
|
|
|
<style scoped rel="stylesheet/scss" lang="scss">
|
2020-04-21 15:08:27 +08:00
|
|
|
@import "src/styles/mixin.scss";
|
|
|
|
|
|
|
|
#PlanStatusBar {
|
|
|
|
z-index: 5;
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
</style>
|