This commit is contained in:
sunzhenyu 2020-04-01 09:14:40 +08:00
commit 65fb03834f
7 changed files with 73 additions and 25 deletions

View File

@ -371,6 +371,9 @@ class Jlmap {
this.$painter.update(oDevice);
}
} else {
if (elem.deviceType === 'TRAIN') {
store.dispatch('map/updateTrainState', elem);
}
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
if (elem.dispose) {
this.$painter.delete(oDevice);

View File

@ -238,8 +238,8 @@ export function commitOperate(operate, paramList, over) {
store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
store.dispatch('menuOperation/handleBreakFlag', { break: true });
resolve({operate:step});
}
resolve({ valid: valid, operate: step });
}).catch(error=>{
reject(error);
});

View File

@ -283,8 +283,8 @@ export function commitOperate(operate, paramList, over) {
store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
store.dispatch('menuOperation/handleBreakFlag', { break: true });
resolve({operate:step});
}
resolve({ valid: valid, operate: step });
}).catch(error=>{
reject(error);
});

View File

@ -701,6 +701,9 @@ const map = {
updateAutoReentryState: (state, status) => {
state.autoReentryData[status.code] = deepAssign(state.autoReentryData[status.code], status);
},
updateTrainState:(state, status) =>{
state.map.trainList[parseInt(status.code) - 1] = deepAssign(state.map.trainList[parseInt(status.code) - 1], status);
},
setMapVersion:(state, version) => {
state.version = version;
}
@ -744,6 +747,9 @@ const map = {
updateAutoReentryState: ({ commit }, status) => {
commit('updateAutoReentryState', status);
},
updateTrainState:({ commit }, status) => {
commit('updateTrainState', status);
},
getRouteDataListByCode: ({ state, commit }, code) => { // 获取进路数据
return new Promise((resolve) => {
const list = [];

View File

@ -20,7 +20,6 @@
:props="defaultProps"
:filter-node-method="filterNode"
:style="{height: height+'px'}"
@node-click="clickEvent"
>
<div slot-scope="{ node, data }" class="list-elem custom-tree-node">
<span v-if="data.state=='01'">{{ '['+data.mapName+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickName)) }}</span>
@ -37,14 +36,13 @@
slot="footer"
class="dialog-footer"
>
<el-button v-loading="loading" type="primary" :disabled="!group" @click="handleJoin">{{ $t('global.joinNewRoom') }}</el-button>
<el-button v-loading="loading" type="primary" @click="handleJoin">{{ $t('global.joinNewRoom') }}</el-button>
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getjointTrainList, getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
import { getjointTrainListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew } from '@/api/jointTraining';
import { getPublishMapInfo } from '@/api/jmap/map';
import { launchFullscreen } from '@/utils/screen';
@ -60,8 +58,6 @@ export default {
label: 'roomName'
},
group: '',
state: '',
mapId: '',
loading: false,
pageLoading: false
};
@ -85,11 +81,6 @@ export default {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
clickEvent(obj, node, data) {
this.state = obj.state;
this.group = obj.group;
this.mapId = obj.mapId;
},
async doShow() {
try {
this.pageLoading = true;
@ -97,15 +88,6 @@ export default {
this.loading = false;
const resp = await getjointTrainListNew();
this.trainingList = resp.data || [];
this.$nextTick(() => {
var training = this.trainingList[0] || {};
if (training) {
this.state = training.state;
this.group = training.group;
this.mapId = training.mapId;
this.$refs.tree.setCurrentKey(this.group);
}
});
} catch (e) {
console.error(e);
} finally {
@ -117,15 +99,15 @@ export default {
},
async handleJoinRoom(data) {
try {
const rest = await getPublishMapInfo(this.mapId);
const rest = await getPublishMapInfo(data.mapId);
await getjointTrainingNew(data.group);
if (data.state == '02') {
launchFullscreen();
const query = { lineCode: rest.data.lineCode, mapId: this.mapId, group: this.group, drawWay: true };
await putJointTrainingSimulationEntranceNew(this.group);
const query = { lineCode: rest.data.lineCode, mapId: data.mapId, group: data.group, drawWay: true };
await putJointTrainingSimulationEntranceNew(data.group);
this.$router.push({ path: `/jointTrainingNew`, query: query });
} else if (data.state == '01') {
const query = { group: this.group, drawWay: true };
const query = { group: data.group, drawWay: true };
this.$router.push({ path: `/trainroom`, query: query });
}
} catch (e) {

View File

@ -25,6 +25,8 @@
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :group="group" />
<menu-train-list v-if="isDemon" />
<menu-schema
v-if="isDemon || isScript "
ref="menuSchema"
@ -71,6 +73,7 @@ import { EventBus } from '@/scripts/event-bus';
import Vue from 'vue';
import LeftSlider from '@/views/newMap/displayNew/LeftSlider';
import { getSessionStorage } from '@/utils/auth';
import MenuTrainList from '@/views/newMap/displayNew/menuTrainList';
//
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
@ -88,6 +91,7 @@ export default {
MenuScript,
MenuSchema,
MenuSystemTime,
MenuTrainList,
// Jl3dSimulation,
Jl3dDrive,
Jl3dDevice,

View File

@ -0,0 +1,53 @@
<template>
<div class="menuTrainList">
<el-drawer
title=""
:visible.sync="table"
direction="rtl"
size="50%"
>
<el-table :data="trainList" height="100%">
<el-table-column property="groupNumber" label="车组号" width="100" />
<el-table-column property="serviceNumber" label="表号" width="100" />
<el-table-column property="tripNumber" label="车次号" width="100" />
<el-table-column property="right" label="是否上行" width="90" />
</el-table>
</el-drawer>
</div>
</template>
<script>
// import { TrainingMode } from '@/scripts/ConstDic';
export default {
data() {
return {
trainList:[],
table: false
};
},
computed: {
},
watch:{
'$store.state.map.mapViewLoadedCount': function () {
this.trainList = this.$store.state.map.map.trainList;
},
'$store.state.socket.equipmentStatus': function (val) {
// debugger;
this.trainList = this.$store.state.map.map.trainList;
}
},
mounted() {
}
};
</script>
<style lang="scss" scoped>
.menuTrainList{
position: absolute;
right: 0;
top: 15%;
width: 400px;
height: 70%;
border-radius: 10px 0px 0px 10px;
padding: 5px;
background: #fff;
}
</style>