添加ningbo01列车信息
This commit is contained in:
parent
4f7b04fde5
commit
2cddeac881
246
src/jmapNew/theme/ningbo_01/menus/dialog/trainDetail.vue
Normal file
246
src/jmapNew/theme/ningbo_01/menus/dialog/trainDetail.vue
Normal file
@ -0,0 +1,246 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm train-info" :title="title" :visible.sync="show" width="460px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-select
|
||||
v-model="groupNumber"
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 100%;"
|
||||
:disabled="false"
|
||||
@change="changeTrain"
|
||||
>
|
||||
<el-option
|
||||
v-for="trainNumber in activeTrainList"
|
||||
:key="trainNumber"
|
||||
:label="trainNumber"
|
||||
:value="trainNumber"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="tabsBox">
|
||||
<div v-for="(item,index) in tabsList" :key="index" class="simulate-tabs-button" :class="[tabType===item.value?'active':'']" @click="changeTabs(item.value)">{{ item.label }}</div>
|
||||
</div>
|
||||
<el-table :data="tableData" :show-header="false" border height="360">
|
||||
<el-table-column prop="key" label="key" />
|
||||
<el-table-column prop="value" label="value" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import {TrainType} from '@/scripts/ConstDic';
|
||||
import LangStorage from '@/utils/lang';
|
||||
|
||||
export default {
|
||||
name: 'TrainDetail',
|
||||
data() {
|
||||
return {
|
||||
tabsList: [
|
||||
{ label: '基本信息', value: 'baseInfo' },
|
||||
{ label: '车组信息', value: 'groupInfo' },
|
||||
{ label: '计划信息', value: 'planInfo' },
|
||||
{ label: 'ATC信息', value: 'atcInfo' },
|
||||
{ label: '车辆信息', value: 'carInfo' }
|
||||
],
|
||||
baseInfo: [],
|
||||
groupInfo: [],
|
||||
planInfo: [],
|
||||
atcInfo: [],
|
||||
carInfo: [],
|
||||
dialogShow: false,
|
||||
groupNumber: '',
|
||||
tabType: 'baseInfo'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return '列车信息';
|
||||
},
|
||||
activeTrainList() {
|
||||
return this.$store.state.map.activeTrainList;
|
||||
},
|
||||
tableData() {
|
||||
return this[this.tabType] ? this[this.tabType] : [];
|
||||
},
|
||||
stationNames() {
|
||||
return new Map(this.$store.state.map.map.stationList.map(s=>[s.code, s.name]));
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeTrain(val) {
|
||||
const train = this.$store.getters['map/getDeviceByCode'](val);
|
||||
console.log('🚀 ~ file: trainDetail.vue:70 ~ changeTrain ~ val:', val, train);
|
||||
if (train) {
|
||||
this.initData(train);
|
||||
}
|
||||
},
|
||||
doShow(selected) {
|
||||
this.initData(selected);
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
changeTabs(type) {
|
||||
switch (type) {
|
||||
case 'baseInfo':
|
||||
this.tabType = 'baseInfo';
|
||||
break;
|
||||
case 'groupInfo':
|
||||
this.tabType = 'groupInfo';
|
||||
break;
|
||||
case 'planInfo':
|
||||
this.tabType = 'planInfo';
|
||||
break;
|
||||
case 'atcInfo':
|
||||
this.tabType = 'atcInfo';
|
||||
break;
|
||||
case 'carInfo':
|
||||
this.tabType = 'carInfo';
|
||||
break;
|
||||
}
|
||||
},
|
||||
initData(model) {
|
||||
console.log(this.stationNames.get(model.stationCode), this.stationNames, model.stationCode, '=====');
|
||||
this.groupNumber = model.groupNumber;
|
||||
this.baseInfo = [
|
||||
{key: '车组号', value: model.groupNumber || ''},
|
||||
{key: '单程号', value: model.tripNumber || ''},
|
||||
{key: '服务号', value: model.serviceNumber || ''},
|
||||
{key: '目的地号', value: model.destinationCode || ''},
|
||||
{key: '类型', value: TrainType[model.type] || ''},
|
||||
{key: '司机号', value: ''},
|
||||
{key: '车站', value: this.stationNames.get(model.stationCode)},
|
||||
{key: '所处设备', value: `${model.sectionModel ? (model.sectionModel.parentName ? model.sectionModel.parentName : model.sectionModel.name) : ''}`},
|
||||
{key: '跟踪模式', value: `${model.runLevel === 'CBTC' ? 'CTC' : model.runLevel}模式`},
|
||||
{key: '标记ATP切除', value: '标记ATP恢复'},
|
||||
{key: '停站状态', value: `${!model.stop ? '未停' : '停站'}`}
|
||||
];
|
||||
this.groupInfo = [
|
||||
{key: '车组号', value: model.groupNumber || ''},
|
||||
{key: '设备ID', value: '1'},
|
||||
{key: '车头号1', value: ''},
|
||||
{key: '车头号2', value: ''},
|
||||
{key: '车厢号1', value: ''},
|
||||
{key: '车厢号2', value: ''},
|
||||
{key: '车厢号3', value: ''},
|
||||
{key: '车厢号4', value: ''},
|
||||
{key: '车厢号5', value: ''},
|
||||
{key: '车厢号6', value: ''},
|
||||
{key: '车厢号7', value: ''},
|
||||
{key: '车厢号8', value: ''}
|
||||
];
|
||||
this.planInfo = [
|
||||
{key: '车组号', value: model.groupNumber || ''},
|
||||
{key: '单程号', value: model.tripNumber || ''},
|
||||
{key: '服务号', value: model.serviceNumber || ''},
|
||||
{key: '运行等级', value: model.runLevel},
|
||||
{key: '状态', value: this.getPlanStatus(model)},
|
||||
{key: '计划偏离', value: model.dt},
|
||||
{key: '停站时间', value: `${model.parkingRemainTime < 0 ? '无效' : `${model.parkingRemainTime}s`}`},
|
||||
{key: '计划到站', value: ''},
|
||||
{key: '计划到点', value: ''},
|
||||
{key: '计划发点', value: ''},
|
||||
{key: '终端发车站台', value: ''},
|
||||
{key: '终端发车时间', value: ''},
|
||||
{key: '预计离开站台', value: ''},
|
||||
{key: '预计离开时间', value: ''},
|
||||
{key: '预计到达站台', value: ''},
|
||||
{key: '预计到达时间', value: ''},
|
||||
{key: '区间运行时分', value: ''}
|
||||
];
|
||||
this.atcInfo = [
|
||||
{key: '车组号', value: model.groupNumber || ''},
|
||||
{key: '单程号', value: model.tripNumber || ''},
|
||||
{key: '服务号', value: model.serviceNumber || ''},
|
||||
{key: '运行方向', value: model.right ? '上行' : '下行'},
|
||||
{key: '有效驾驶模式', value: `${model.driveMode}模式`},
|
||||
{key: '速度', value: `${model.speed || 0} km/h`},
|
||||
{key: '司机号', value: ''},
|
||||
{key: 'ATC状态', value: '全部有效'},
|
||||
{key: '扣车状态', value: model.runControlStatus === '01' ? '正常' : model.runControlStatus === '03' ? '跳停' : '扣车'},
|
||||
{key: '车门状态', value: model.speed ? '关闭' : '开启'},
|
||||
{key: '驾驶模式', value: `${model.driveMode}模式`},
|
||||
{key: '车载目的地号', value: model.destinationCode || ''}
|
||||
];
|
||||
this.carInfo = [];
|
||||
},
|
||||
getPlanStatus(model) {
|
||||
const device = model.instance;
|
||||
let destinationText = LangStorage.getLang() == 'en' ? 'unknown' : '未知';
|
||||
if (device.style.Train.soonerOrLater && device.style.Train.soonerOrLater.level === 5 && device.style.Train.soonerOrLater.serviceNumber) {
|
||||
if (device.model.dt > 240) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'early seriously' : '严重早点';
|
||||
} else if (device.model.dt > 120) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'early' : '早点';
|
||||
} else if (device.model.dt < -240) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'late seriously ' : '严重晚点';
|
||||
} else if (device.model.dt < -120) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'late' : '晚点';
|
||||
} else {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'on time' : '准点';
|
||||
}
|
||||
} else if (device.style.Train.soonerOrLater && device.style.Train.soonerOrLater.level === 5) {
|
||||
if (device.model.dt > 120) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'early seriously' : '严重早点';
|
||||
} else if (device.model.dt >= 15 && device.model.dt <= 120) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'early' : '早点';
|
||||
} else if (device.model.dt >= -120 && device.model.dt <= -15) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'late' : '晚点';
|
||||
} else if (device.model.dt < -120) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'late seriously ' : '严重晚点';
|
||||
} else {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'on time' : '准点';
|
||||
}
|
||||
} else if (device.style.Train.soonerOrLater && device.style.Train.soonerOrLater.level === 3) {
|
||||
if (device.model.dt > 120) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'early' : '早点';
|
||||
} else if (device.model.dt < -120) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'late' : '晚点';
|
||||
} else {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'on time' : '准点';
|
||||
}
|
||||
}
|
||||
return destinationText;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.tabsBox {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
|
||||
.simulate-tabs-button {
|
||||
border-top: solid 1px #FBFAEF;
|
||||
border-left: solid 1px #FBFAEF;
|
||||
border-bottom: solid 1px #858273;
|
||||
border-right: solid 1px #858273;
|
||||
width: 80px;
|
||||
height: 28px;
|
||||
font-size: 14px;
|
||||
line-height: 28px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
&:hover{
|
||||
border-top: solid 1px #858273;
|
||||
border-left: solid 1px #858273;
|
||||
border-bottom: solid 1px #FBFAEF;
|
||||
border-right: solid 1px #FBFAEF;
|
||||
}
|
||||
}
|
||||
.active{
|
||||
border-top: solid 1px #858273;
|
||||
border-left: solid 1px #858273;
|
||||
border-bottom: solid 1px #FBFAEF;
|
||||
border-right: solid 1px #FBFAEF;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -11,6 +11,7 @@
|
||||
<trainSetWorkATP ref="trainSetWorkATP" />
|
||||
<speed-limit ref="speedLimit" pop-class="ningbo-01__systerm" />
|
||||
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
|
||||
<train-detail ref="trainDetail" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -32,6 +33,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import TrainDetail from './dialog/trainDetail';
|
||||
|
||||
export default {
|
||||
name: 'MenuTrain',
|
||||
@ -46,7 +48,8 @@ export default {
|
||||
TrainSetWork,
|
||||
trainSetWorkATP,
|
||||
SetFault,
|
||||
SpeedLimit
|
||||
SpeedLimit,
|
||||
TrainDetail
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -137,7 +140,7 @@ export default {
|
||||
},
|
||||
{
|
||||
label: '列车信息',
|
||||
handler: this.undeveloped,
|
||||
handler: this.trainDetail,
|
||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
||||
isShow: selected => selected && selected._type === 'Train'
|
||||
}
|
||||
@ -239,6 +242,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
trainDetail() {
|
||||
this.$refs.trainDetail.doShow(this.selected);
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = [];
|
||||
|
Loading…
Reference in New Issue
Block a user