191 lines
4.9 KiB
Vue
191 lines
4.9 KiB
Vue
|
<template>
|
||
|
<div>
|
||
|
<div v-if="isAllShow&&project != 'bjd'" class="display_top_draft" :style="allStyle">
|
||
|
<div class="btn_hover" @click="menuClick">菜单</div>
|
||
|
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
|
||
|
<el-button v-if="jl3dmodelShow && !isContest && project !== 'bjd'" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
|
||
|
</el-button-group>
|
||
|
</div>
|
||
|
<Jl3d-Device
|
||
|
v-if="deviceif"
|
||
|
v-show="deviceShow"
|
||
|
ref="Jl3dDevice"
|
||
|
:panel-show="deviceShow"
|
||
|
@closedevice3dview="jumpjlmap3dmodel"
|
||
|
/>
|
||
|
</div>
|
||
|
</template>
|
||
|
<script>
|
||
|
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
|
||
|
import { getToken } from '@/utils/auth';
|
||
|
import { getSessionStorage } from '@/utils/auth';
|
||
|
import { EventBus } from '@/scripts/event-bus';
|
||
|
import { getPostByProjectCode } from '@/api/learn';
|
||
|
import { ProjectCode } from '@/scripts/ProjectConfig';
|
||
|
export default {
|
||
|
name:'DemonMenu',
|
||
|
components:{
|
||
|
Jl3dDevice,
|
||
|
},
|
||
|
props:{
|
||
|
isAllShow:{
|
||
|
type:Boolean,
|
||
|
require:true
|
||
|
},
|
||
|
jl3dmodelShow:{
|
||
|
type:Boolean,
|
||
|
require:true
|
||
|
},
|
||
|
jl3dnameShow:{
|
||
|
type:Boolean,
|
||
|
require:true
|
||
|
},
|
||
|
cctvShow:{
|
||
|
type:Boolean,
|
||
|
require:true
|
||
|
},
|
||
|
trafficplanShow:{
|
||
|
type:Boolean,
|
||
|
require:true
|
||
|
},
|
||
|
traffictrainShow:{
|
||
|
type:Boolean,
|
||
|
require:true
|
||
|
},
|
||
|
scheduleLoadShow:{
|
||
|
type:Boolean,
|
||
|
require:true
|
||
|
},
|
||
|
driverShow:{
|
||
|
type:Boolean,
|
||
|
require:true
|
||
|
},
|
||
|
schedulePreviewShow:{
|
||
|
type:Boolean,
|
||
|
require:true
|
||
|
},
|
||
|
jlmap3dFaultShow:{
|
||
|
type:Boolean,
|
||
|
require:true
|
||
|
},
|
||
|
allStyle:{
|
||
|
type:String,
|
||
|
default() {
|
||
|
return '';
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
hoverBtn: false,
|
||
|
btnWidth: 0,
|
||
|
group:'',
|
||
|
mapId:'',
|
||
|
lineCode:'',
|
||
|
practiceDisabled:false,
|
||
|
deviceif:false,
|
||
|
deviceShow: true,
|
||
|
drivingShow: false,
|
||
|
messageBoard: false,
|
||
|
jl3dtrafficplan:this.$t('display.demon.trafficplantext'),
|
||
|
jl3dtraffictrain:this.$t('display.demon.traffictraintext'),
|
||
|
jl3dpassflow:this.$t('display.demon.passengerflow'),
|
||
|
jl3dname: this.$t('display.demon.threeDimensionalView'),
|
||
|
jl3dmodel: this.$t('display.demon.deviceView')
|
||
|
};
|
||
|
},
|
||
|
computed:{
|
||
|
isDrive() {
|
||
|
return this.$route.query.prdType == '04';
|
||
|
},
|
||
|
project() {
|
||
|
return getSessionStorage('project');
|
||
|
},
|
||
|
isContest() {
|
||
|
return this.$route.params.mode === 'demon' && this.project == 'drts';
|
||
|
},
|
||
|
running() {
|
||
|
return this.$store.state.training.started;
|
||
|
},
|
||
|
isLocal() { // 是否为本地项目
|
||
|
return process.env.VUE_APP_PRO === 'local';
|
||
|
}
|
||
|
},
|
||
|
mounted() {
|
||
|
this.group = this.$route.query.group;
|
||
|
this.mapId = this.$route.query.mapId;
|
||
|
this.lineCode = this.$route.query.lineCode;
|
||
|
EventBus.$on('loadScene', () => {
|
||
|
this.practiceDisabled = true;
|
||
|
});
|
||
|
EventBus.$on('quitScene', () => {
|
||
|
this.practiceDisabled = false;
|
||
|
});
|
||
|
if (this.project) {
|
||
|
getPostByProjectCode(ProjectCode[this.project]).then(resp => {
|
||
|
if (resp.data) {
|
||
|
this.messageBoard = true;
|
||
|
}
|
||
|
}).catch(() => {
|
||
|
console.log('获取留言板信息失败');
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
methods:{
|
||
|
menuClick() {
|
||
|
this.hoverBtn = !this.hoverBtn;
|
||
|
if (this.hoverBtn) {
|
||
|
this.btnWidth = 600;
|
||
|
} else {
|
||
|
this.btnWidth = 0;
|
||
|
}
|
||
|
},
|
||
|
jumpjlmap3dmodel() {
|
||
|
if (this.deviceif == false) {
|
||
|
this.deviceif = true;
|
||
|
} else {
|
||
|
if (this.deviceShow == false) {
|
||
|
this.deviceShow = true;
|
||
|
} else {
|
||
|
this.deviceShow = false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
</script>
|
||
|
<style lang="scss" scoped>
|
||
|
.display_top_draft{
|
||
|
position: absolute;
|
||
|
left: 5px;
|
||
|
top: 15px;
|
||
|
height: 32px;
|
||
|
overflow: hidden;
|
||
|
padding-left: 44px;
|
||
|
z-index: 35;
|
||
|
.btn_hover{
|
||
|
position: absolute;
|
||
|
left: 0;
|
||
|
top: 0;
|
||
|
z-index: 2;
|
||
|
color: #4e4d4d;
|
||
|
font-size: 14px;
|
||
|
background: #fff;
|
||
|
padding: 8px;
|
||
|
border-radius: 5px;
|
||
|
display: block;
|
||
|
cursor: pointer;
|
||
|
float: left;
|
||
|
height: 32px;
|
||
|
}
|
||
|
.button_group_box{
|
||
|
float: left;
|
||
|
transition: all 0.5s;
|
||
|
overflow: hidden;
|
||
|
margin-left: -700px;
|
||
|
// transform: translateX(0px);
|
||
|
}
|
||
|
}
|
||
|
</style>
|