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] = { deviceRender[deviceType.IbpLine] = {
_type: deviceType.IbpLine, _type: deviceType.IbpLine,
zlevel: 1, zlevel: 1,
z: 3 z: 1
}; };
/** Elevator 渲染配置 */ /** Elevator 渲染配置 */

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

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