ibp盘调整

This commit is contained in:
fan 2019-09-06 14:48:06 +08:00
parent 20acc0e667
commit ceccbbc825
5 changed files with 30 additions and 18 deletions

View File

@ -69,7 +69,7 @@ deviceRender[deviceType.AppendageBox] = {
deviceRender[deviceType.IbpLine] = {
_type: deviceType.IbpLine,
zlevel: 1,
z: 3
z: 1
};
/** Elevator 渲染配置 */

File diff suppressed because one or more lines are too long

View File

@ -83,11 +83,11 @@ export default {
}
},
methods: {
show () {
show (deviceCode) {
document.getElementById(this.ibpId).oncontextmenu = function (e) {
return false;
};
const data = parser(ibpData, {width: this.canvasWidth, height: this.canvasHeight});
const data = parser(ibpData[deviceCode], {width: this.canvasWidth, height: this.canvasHeight});
this.$ibp = new IbpPan({
dom: document.getElementById(this.ibpId),
config: {
@ -108,15 +108,15 @@ export default {
});
Vue.prototype.$ibp = this.$ibp;
this.$ibp.on('contextmenu', this.onContextMenu, this);
this.setMap(data);
this.$store.dispatch('ibp/setIbpData', ibpData);
this.setMap(data,ibpData[deviceCode]);
this.$store.dispatch('ibp/setIbpData', ibpData[deviceCode]);
this.initClockTime(this.initTime);
window.document.oncontextmenu = function () {
return false;
};
},
setMap(data) {
this.$ibp.setMap(ibpData, data);
setMap(data,oldData) {
this.$ibp.setMap(oldData, data);
},
//
onSelected(em) {

View File

@ -1,12 +1,12 @@
<template>
<div class="main" :style="{width: canvasWidth+'px'}" @mousemove="mousemove">
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<ibp-plate v-show="ibpShow" ref="ibpPlate" @hideIbp="hideIbp" />
<ibp-plate v-show="ibpShow" ref="ibpPlate" @hideIbp="hideIbp"/>
<div v-show="panelShow" :panelShow="panelShow">
<transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<menu-demon-joint ref="demonMenu" :group="group" :user-role="userRole" @getUserRole="getUserRole" @hidepanel="hidepanel" @showIbp="showIbp" />
<menu-demon-joint ref="demonMenu" :group="group" :user-role="userRole" :deviceCode="deviceCode" @getUserRole="getUserRole" @hidepanel="hidepanel" @showIbp="showIbp" />
<menu-demon-schema
ref="menuSchema"
:group="group"
@ -16,7 +16,7 @@
@runPlanViewShow="runPlanViewShow"
@faultChooseShow="faultChooseShow"
/>
IBP
<join-fault-choose ref="faultChoose" :group="group" />
<join-run-plan-Load ref="runPlanLoad" :group="group" />
<join-run-plan-view ref="runPlanView" :group="group" />
@ -43,6 +43,7 @@ import { getUserRoles, deljointTrainRoom } from '@/api/chat';
import { runDiagramOver, getSimulationInfo } from '@/api/simulation';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import { EventBus } from '@/scripts/event-bus';
import ibpData from '@/ibp/constant/ibpData';
export default {
name: 'JointTrainingDraft',
@ -69,6 +70,7 @@ export default {
mapBox: null,
mapBoxP: null,
userRole: '',
deviceCode: '',
group: '',
mapId: '',
skinCode: '',
@ -278,6 +280,7 @@ export default {
async getUserRole() {
const res = await getUserRoles(this.group);
this.userRole = res.data.userRole;
this.deviceCode = res.data.deviceCode;
return res;
},
// 仿
@ -334,11 +337,15 @@ export default {
this.drivingShow = false;
this.ibpShow =false;
},
showIbp() {
showIbp(deviceCode) {
if (!deviceCode || !ibpData[deviceCode]){
this.$messageBox(`未绑定车站或该车站IBP盘暂未绘制`);
return;
}
this.drivingShow = false;
this.panelShow = false;
this.ibpShow = true;
this.$refs.ibpPlate.show();
this.$refs.ibpPlate.show(deviceCode);
},
hidepanel() {
this.panelShow = false;

View File

@ -39,7 +39,13 @@ export default {
userRole: {
type: String,
required: true
}
},
deviceCode: {
type: String,
default() {
return '';
}
}
},
data() {
return {
@ -305,7 +311,7 @@ export default {
this.$emit('hidepanel');
},
jumpIbp() {
this.$emit('showIbp');
this.$emit('showIbp',this.deviceCode);
}
}
};