实训设计添加车务终端管理、路票、薄册

This commit is contained in:
dong 2022-09-19 13:23:07 +08:00
parent bddde1e239
commit 4b9ae158a5

View File

@ -10,10 +10,15 @@
</div>
<div class="fault-button">
<el-button-group>
<el-button v-if="prdType === '01'" size="small" @click="goCtc">车务终端</el-button>
<el-button v-if="lineCode === '16' && project !== 'teaching' && prdType === '01' " size="small" @click="goCtc">车务终端</el-button>
<el-button v-if="lineCode === '16' && project !== 'teaching' && prdType === '01'" size="small" @click="goRpManage">车务管理终端</el-button>
<el-button v-if="lineCode ==='16' && prdType === '01'" size="small" @click="showTrainTicket">路票</el-button>
<el-button v-if="showRegisterBookBtn" size="small" @click="showRegisterBook">簿册</el-button>
</el-button-group>
<el-button size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式':'切换到故障模式' }}</el-button>
</div>
<train-ticket ref="trainTicket" />
<register-book ref="registerBook" />
</div>
</template>
<script>
@ -32,6 +37,8 @@ import { getMemberListCommon, getUserListCommon } from '@/api/rtSimulation';
import Vue from 'vue';
import {mapGetters} from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import TrainTicket from '@/views/newMap/trainTicket/index.vue';
import RegisterBook from '@/views/newMap/registerBook/index';
import DispatcherStation from '@/views/newMap/jointTrainingNew/dispatcherStation.vue';
export default {
@ -40,6 +47,8 @@ export default {
JlmapVisual,
chatBox,
VoiceChatBox,
TrainTicket,
RegisterBook,
DispatcherStation
},
data() {
@ -69,6 +78,10 @@ export default {
lineCode() {
return this.$route.query.lineCode;
},
showRegisterBookBtn() {
const roleList = ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_SIGNALER', 'STATION_SWITCH_MAN', 'STATION_MASTER', 'STATION_WORKER', 'DEVICE_MANAGER'];
return this.$route.query.lineCode === '16' && roleList.includes(this.$store.state.training.userRole);
},
faultMode() {
return this.$store.state.training.operatemode === OperateMode.FAULT;
},
@ -177,6 +190,38 @@ export default {
});
window.open(routeData.href, '_blank');
},
goRpManage() {
const routeData = this.$router.resolve({
path:'/bigTrainRunplanManage',
query:{
group: this.$route.query.group,
mapId:this.$route.query.mapId,
project: this.project,
prdType: this.$route.query.prdType,
lineCode:this.$route.query.lineCode,
// stationCode:this.$store.state.training.roleDeviceCode,
// token:getToken(),
noPreLogout: true
}
});
window.open(routeData.href, '_blank');
},
showTrainTicket() {
const stationSupervisorList = [];
for (const memberId in this.$store.state.training.memberData) {
const item = this.$store.state.training.memberData[memberId];
if (item.type === 'STATION_SUPERVISOR') {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
const memberData = { labelName: '值班员-' + device.name + (item.name ? `-${item.name }` : ''), id:item.id, userId:item.userId };
stationSupervisorList.push(memberData);
}
}
EventBus.$emit('trainTicketMember', stationSupervisorList);
this.$refs.trainTicket.doShow();
},
showRegisterBook() {
this.$refs.registerBook.doShow();
},
//
getDeviceByEm(em) {
var device = this.$store.getters['map/getDeviceByCode'](em.deviceCode) || null;