rt-sim-training-client/src/views/newMap/jointTrainingNew/index.vue

636 lines
25 KiB
Vue
Raw Normal View History

<template>
2020-07-23 18:04:13 +08:00
<div class="main" :style="{width: canvasWidth+'px'}">
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<Jl3d-Maintainer v-if="jl3dmaintainershow" :is-admin="isAdmin" @back="back" @handlerMemberManage="handlerMemberManage" />
<ibp-plate v-show="ibpShow" ref="ibpPlate" @hideIbp="hideIbp" />
2020-07-14 15:35:03 +08:00
<template v-show="panelShow" :panelShow="panelShow">
<transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
2020-06-08 18:26:30 +08:00
<menu-demon-joint
ref="demonMenu"
:group="group"
2020-07-31 18:49:35 +08:00
:offset="offset"
:offset-bottom="offsetBottom"
:data-error="dataError"
:user-role="userRole"
2020-06-30 14:27:32 +08:00
:is-admin="isAdmin"
:device-code="deviceCode"
:countdown-time="countdownTime"
2020-07-29 16:59:57 +08:00
@passflow="passflow"
@getUserRole="getUserRole"
@hidepanel="hidepanel"
2020-07-29 16:59:57 +08:00
@devicemodel="devicemodel"
@startCounting="startCounting"
2020-06-08 18:26:30 +08:00
@hidejl3dcctv="hidejl3dcctv"
2020-06-29 13:11:27 +08:00
@handlerMemberManage="handlerMemberManage"
/>
<menu-demon-schema
ref="menuSchema"
:group="group"
:offset="offset"
:user-role="userRole"
2020-06-30 14:27:32 +08:00
:is-admin="isAdmin"
2020-03-25 15:22:52 +08:00
:show-station="showStation"
:station-list="stationList"
:show-select-station="showSelectStation"
2020-05-09 20:24:59 +08:00
:data-error="dataError"
@runPlanLoadShow="runPlanLoadShow"
@faultChooseShow="faultChooseShow"
2020-03-25 15:22:52 +08:00
@switchStationMode="switchStationMode"
/>
2020-07-02 10:10:16 +08:00
<join-fault-choose ref="faultChoose" :group="group" :offset="offset" />
<join-run-plan-Load ref="runPlanLoad" :group="group" />
2020-07-28 11:29:39 +08:00
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
2020-05-19 14:47:47 +08:00
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
<js-question v-if="project == 'jsxt'" :offset="offset" :question-list="questionList" />
<members-manage ref="membersManage" :is-admin="isAdmin" @addSimulationMember="addSimulationMember" /> <!-- 成员管理 -->
2020-07-03 18:42:29 +08:00
<add-member ref="addMember" />
2020-07-08 13:11:22 +08:00
<Jl3d-Device
v-if="deviceShow"
ref="Jl3dDevice"
:panel-show="deviceShow"
@closedevice3dview="devicemodel"
/>
2020-07-14 15:35:03 +08:00
</template>
</div>
</template>
<script>
2020-03-17 14:54:03 +08:00
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import MenuDemonJoint from './menuDemon';
import MenuDemonSchema from './menuSchema';
import JsQuestion from './jsQuestion';
2020-03-17 14:54:03 +08:00
import JoinFaultChoose from '@/views/newMap/displayNew/demon/faultChoose';
import JoinRunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad';
import menuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import IbpPlate from '@/views/ibp/ibpsystem/index';
2020-05-19 14:47:47 +08:00
import MenuTrainList from './menuTrainList';
import { mapGetters } from 'vuex';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
2020-03-17 14:54:03 +08:00
import { loadNewMapDataByGroup } from '@/utils/loaddata';
2020-07-02 17:57:48 +08:00
import { clearSimulation, getSimulationInfoNew, getSimulationUserInfo, getSimulationMemberList, getAllSimulationUser } from '@/api/simulation';
import {getRaceUserById, getTestPaperDatail} from '@/api/competition';
2020-07-08 13:11:22 +08:00
import { getSessionStorage } from '@/utils/auth';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
2020-07-08 13:11:22 +08:00
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
2020-05-19 16:49:56 +08:00
import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer';
import { EventBus } from '@/scripts/event-bus';
2020-03-17 14:54:03 +08:00
import { timeFormat } from '@/utils/date';
import { Message } from 'element-ui';
import localStore from 'storejs';
2020-07-28 16:41:21 +08:00
import { getToken } from '@/utils/auth';
2020-07-02 17:57:48 +08:00
import MembersManage from './memberManage/membersManage';
import AddMember from './memberManage/addMember';
import { computationTime } from '@/utils/date';
export default {
name: 'JointTrainingDraft',
components: {
MapSystemDraft,
MenuDemonJoint,
MenuDemonSchema,
JoinFaultChoose,
JoinRunPlanLoad,
2020-05-19 14:47:47 +08:00
MenuTrainList,
menuSystemTime,
Jl3dDrive,
2020-05-19 16:49:56 +08:00
Jl3dMaintainer,
IbpPlate,
JsQuestion,
2020-06-29 13:11:27 +08:00
MembersManage,
2020-07-08 13:11:22 +08:00
AddMember,
Jl3dDevice
},
data() {
return {
trainingObj: {},
timeDemonNum: 0,
offset: 10,
offsetBottom: 15,
userRole: '',
deviceCode: '',
group: '',
mapId: '',
lineCode: '',
simulationShow: false,
drivingShow: false,
2020-05-19 16:49:56 +08:00
jl3dmaintainershow:false,
ibpShow: false,
panelShow: true,
2020-03-25 15:22:52 +08:00
ibpPart: '',
showStation: '',
2020-04-21 11:26:07 +08:00
stationList: [],
2020-07-24 18:38:19 +08:00
showSelectStation: false, // 宁波线集中站 显示
2020-05-09 20:24:59 +08:00
mapViewLoadedOver: false,
dataError: false,
countdownTime: '00:00:00',
practicalTime: 0,
countdown: null,
2020-06-05 14:46:37 +08:00
questionList: [],
2020-06-30 14:27:32 +08:00
practicalExamTime: 0,
isAdmin: false,
deviceShow: false,
centralizedStationMap: {}
};
},
computed: {
...mapGetters([
'canvasWidth'
]),
...mapGetters('map', [
'map',
2020-07-08 14:40:04 +08:00
'bigScreenConfig'
]),
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
},
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
2020-05-19 14:47:47 +08:00
},
prdType() {
return this.$store.state.training.prdType;
2020-05-25 13:40:25 +08:00
},
project() {
return getSessionStorage('project');
}
},
watch: {
2020-07-31 15:24:44 +08:00
'$store.state.config.menuBarLoadedCount': function (val) { // menuBar加载完成
this.setPosition();
},
2020-07-24 18:38:19 +08:00
'$store.state.training.prdType': function (prdType) {
this.setPosition();
2020-07-24 18:38:19 +08:00
if (prdType == '01' && this.$route.query.lineCode == '06') {
2020-03-25 15:22:52 +08:00
this.showSelectStation = true;
this.cancelBigScreenMode();
2020-07-24 18:38:19 +08:00
} else if (prdType == '02' && this.$route.query.lineCode == '06') {
2020-03-25 15:22:52 +08:00
this.showSelectStation = false;
this.cancelBigScreenMode();
2020-07-24 18:38:19 +08:00
} else if (prdType == '07') { // 大屏
this.setBigScreenMode();
} else {
this.cancelBigScreenMode();
2020-03-25 15:22:52 +08:00
}
},
2020-07-24 18:38:19 +08:00
'$store.state.map.mapViewLoadedCount': function () { // 地图视图加载完成标识
this.mapViewLoadedOver = true;
this.showSelectStation && this.setShowStation(this.showStation);
2020-07-02 17:57:48 +08:00
this.initMemberUserInfo();
2020-07-08 13:11:22 +08:00
if (this.$route.query.type === 'VR_PSD') {
this.deviceShow = true;
}
2020-07-08 15:49:16 +08:00
if (this.$route.query.type === 'DRIVE') {
2020-07-30 15:58:28 +08:00
this.$store.dispatch('training/setPrdType', '04');
this.$store.dispatch('training/setRoles', 'DRIVER');
2020-07-08 15:49:16 +08:00
this.hidepanel();
}
2020-07-03 18:42:29 +08:00
},
'$store.state.socket.memberChangeCount': function () { // 仿真成员变更
2020-07-03 18:42:29 +08:00
this.initMemberUserInfo();
},
'$store.state.socket.permissionOver': function () {
this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), {
confirmButtonText: this.$t('global.confirm'),
showClose: false,
callback: async (action) => {
await this.$store.dispatch('training/over');
2020-03-17 14:54:03 +08:00
await clearSimulation(this.group);
this.$router.go(-1);
}
});
},
2020-07-28 11:29:39 +08:00
'$store.state.app.windowSizeCount': function() { // 窗口变化
2020-07-29 16:59:57 +08:00
this.setWindowSize();
this.setPosition();
},
$route() {
2020-07-27 13:15:01 +08:00
this.initLoadData();
2020-03-25 15:22:52 +08:00
},
2020-07-24 18:38:19 +08:00
'$store.state.map.map': function (map) {
if (map) {
this.setStationList(map); // 获取集中站列表
2020-07-08 14:40:04 +08:00
}
2020-06-30 18:35:57 +08:00
},
'$store.state.socket.simulationRoleList':function(list) {
if (list && list.length) { // 人员变化监控
this.checkRoleChange(list);
2020-06-30 18:35:57 +08:00
}
}
},
async created() {
this.group = this.$route.query.group;
this.mapId = this.$route.query.mapId;
this.lineCode = this.$route.query.lineCode;
Message.closeAll();
},
async mounted() {
await this.setWindowSize();
await this.initLoadData();
},
async beforeDestroy() {
await this.$store.dispatch('training/end', null);
await this.$store.dispatch('training/reset');
await this.$store.dispatch('map/mapClear');
await this.$store.dispatch('training/setGroup', '');
if (this.countdown) {
clearInterval(this.countdown);
}
Message.closeAll();
},
methods: {
// 设置菜单和工具栏位置
setPosition() {
this.$nextTick(() => {
this.offset = 10;
this.offsetBottom = 15;
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
const menuBottom = document.getElementById('menuButton');
if (menuBar) {
2020-07-28 11:29:39 +08:00
this.offset = (menuBar.offsetHeight || 0) + 15;
}
if (menuTool) {
2020-07-28 11:29:39 +08:00
this.offset = (menuTool.offsetHeight || 0) + 15;
2020-07-21 15:38:47 +08:00
}
const buttonWidth = this.width - 1200;
if (menuBottom && buttonWidth < 780) {
2020-07-28 11:29:39 +08:00
this.offsetBottom = (menuBottom.offsetHeight || 0) + 15;
}
});
},
// 结束加载状态
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
2020-05-19 14:47:47 +08:00
setCenter(code) {
this.$jlmap.setCenter(code);
2020-05-19 14:47:47 +08:00
},
// 加载地图数据
initLoadData() {
const width = document.documentElement.clientWidth;
const height = document.documentElement.clientHeight + 200;
this.$store.dispatch('config/resize', { width, height });
try {
this.loadSimulationInfo();
this.initLoadDemonData();
} catch (error) {
this.$messageBox( this.$t('error.initializationFailed') + error.message);
this.endViewLoading();
}
},
2020-07-02 17:57:48 +08:00
initMemberUserInfo() {
// 获取仿真成员列表
2020-07-02 17:57:48 +08:00
getSimulationMemberList(this.$route.query.group).then(resp => {
2020-07-24 18:38:19 +08:00
this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.$store.state.user.id });
2020-07-02 17:57:48 +08:00
}).catch(() => {
this.$messageBox('获取仿真成员列表失败!');
});
2020-07-02 17:57:48 +08:00
getAllSimulationUser(this.$route.query.group).then(resp => {
this.$store.dispatch('training/setSimulationUserList', resp.data);
}).catch(() => {
this.$messageBox('获取所有仿真用户失败!');
});
},
2020-07-08 13:11:22 +08:00
devicemodel() {
if (this.deviceShow == false) {
this.deviceShow = true;
} else {
this.deviceShow = false;
}
},
2020-07-30 15:10:10 +08:00
/* 地图根据仿真group获取仿真基础信息 */
async loadSimulationInfo() {
const resp = await getSimulationInfoNew(this.group);
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
2020-05-25 10:32:14 +08:00
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
2020-05-19 17:05:23 +08:00
this.$store.dispatch('map/setRunPlanStatus', resp.data.planRunning);
2020-03-17 14:54:03 +08:00
if (resp.data.planRunning) {
this.$store.dispatch('training/simulationStart');
} else {
this.$store.dispatch('training/over');
}
2020-07-31 18:49:35 +08:00
this.$store.dispatch('training/countUsedTime');
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
this.dataError = true;
2020-05-09 20:24:59 +08:00
this.$messageBox('此地图数据正在维护中,无法运行!');
}
},
/* 获取个人仿真信息*/
async getUserRole() {
2020-06-30 14:27:32 +08:00
const res = await getSimulationUserInfo(this.group);
const data = res.data || {};
2020-07-08 13:49:14 +08:00
this.userRole = data.type || 'AUDIENCE';
this.deviceCode = data.deviceCode;
2020-06-30 14:27:32 +08:00
this.isAdmin = data.admin;
2020-07-01 18:52:29 +08:00
const deviceVO = this.$store.state.user.projectDevice;
2020-07-10 18:30:37 +08:00
if (deviceVO && deviceVO.type === 'VR_IBP') {
this.showIbp(this.deviceCode);
2020-07-01 18:52:29 +08:00
const config = JSON.parse(deviceVO.config);
this.ibpPart = config.part.toLowerCase();
} else {
this.hideIbp();
}
return res;
},
// 仿真系统
async initLoadDemonData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
if (this.lineCode) {
// 01 现地 02 行调 '' 观众
2020-05-25 16:38:03 +08:00
let resp = {data: {}};
2020-05-25 13:40:25 +08:00
if (this.project == 'jsxt' ) {
2020-05-25 18:26:05 +08:00
resp = await getRaceUserById(this.$route.query.raceId);
2020-07-08 13:49:14 +08:00
resp.data.userRole = resp.data.type;
const paperResp = await getTestPaperDatail(this.$route.query.raceId);
if (paperResp.data && paperResp.data.practicalQuestions) {
this.questionList = [];
2020-06-05 14:46:37 +08:00
this.practicalExamTime = paperResp.data.practicalExamTime;
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
const startTime = localStore.get(storeKey);
if (startTime) {
const dt = new Date().getTime() - startTime;
this.practicalTime = paperResp.data.practicalExamTime * 60 - Math.floor(dt / 1000);
} else {
2020-06-05 14:46:37 +08:00
this.practicalTime = this.practicalExamTime * 60;
}
this.countdownTime = computationTime(this.practicalTime);
paperResp.data.practicalQuestions.forEach(elem => {
this.questionList.push({name: elem.question.name, description:elem.question.description});
});
}
2020-05-25 13:40:25 +08:00
} else if (this.project == 'refereeJsxt') {
2020-05-25 16:38:03 +08:00
resp['code'] = 200;
resp.data['userRole'] = 'ADMIN';
2020-05-25 13:40:25 +08:00
} else {
resp = await this.getUserRole();
}
if (resp && resp.code == 200) {
2020-06-30 14:27:32 +08:00
this.setSimulationPrdType();
}
await this.getTrainDetail();
} else {
this.endViewLoading();
}
},
2020-06-30 14:27:32 +08:00
// 设置prdType和role
setSimulationPrdType(deviceCode) {
2020-06-30 14:27:32 +08:00
// Admin 管理员 Dispatcher 行调 STATION_SUPERVISOR 车站 Audience 观众 Driver 司机 MAINTAINER 通号 IBP:IBP盘
switch (this.userRole) {
2020-07-13 14:30:01 +08:00
case 'DISPATCHER':
this.$store.dispatch('training/setPrdType', '02');
this.$store.dispatch('training/setRoles', 'DISPATCHER');
this.hideIbp();
this.drivingShow = false;
if (this.lineCode === '07' || this.lineCode === '06') {
this.mapViewLoadedOver && this.setShowStation('');
}
this.jl3dmaintainershow = false;
2020-07-13 14:30:01 +08:00
break;
case 'STATION_SUPERVISOR':
this.$store.dispatch('training/setPrdType', '01');
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
this.hideIbp();
2020-07-24 18:38:19 +08:00
if (this.lineCode === '06' && deviceCode) {
this.$refs.menuSchema.chiShowStation = deviceCode;
this.mapViewLoadedOver && this.switchStationMode(deviceCode);
}
this.jl3dmaintainershow = false;
2020-07-13 14:30:01 +08:00
this.drivingShow = false;
break;
case 'AUDIENCE':
this.$store.dispatch('training/setPrdType', '');
this.$store.dispatch('training/setRoles', 'AUDIENCE');
this.jl3dmaintainershow = false;
this.drivingShow = false;
2020-07-13 14:30:01 +08:00
this.hideIbp();
break;
case 'DRIVER':
2020-07-28 16:41:21 +08:00
this.$store.dispatch('training/setPrdType', '04');
2020-07-13 14:30:01 +08:00
this.$store.dispatch('training/setRoles', 'DRIVER');
this.jl3dmaintainershow = false;
2020-07-13 14:30:01 +08:00
break;
case 'MAINTAINER':
this.$store.dispatch('training/setPrdType', '');
this.$store.dispatch('training/setRoles', 'MAINTAINER');
this.hideIbp();
this.jl3dmaintainershow = true;
this.drivingShow = false;
2020-07-13 14:30:01 +08:00
break;
2020-06-30 14:27:32 +08:00
}
},
/* 竞赛系统倒计时 */
startCounting() {
2020-06-05 14:46:37 +08:00
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
const startTime = localStore.get(storeKey);
if (!startTime) {
const storeValue = new Date().getTime();
localStore.set(storeKey, storeValue);
}
this.countdown = setInterval(() => {
if (this.practicalTime <= 0) {
if (this.countdown) {
clearInterval(this.countdown);
}
this.$refs.demonMenu.submit();
}
this.practicalTime--;
this.countdownTime = computationTime(this.practicalTime);
}, 1000);
},
async getTrainDetail() {
try {
2020-03-17 14:54:03 +08:00
await loadNewMapDataByGroup(this.group);
await this.$store.dispatch('training/setMapDefaultState');
2020-05-21 16:59:36 +08:00
if (this.userRole == 'MAINTAINER') {
this.jl3dmaintainershow = true;
2020-05-19 16:49:56 +08:00
}
} catch (error) {
this.$messageBox(this.$t('error.getMapDataFailed'));
this.endViewLoading();
}
},
back() {
this.$refs.demonMenu.back();
},
2020-07-08 14:40:04 +08:00
runPlanLoadShow() { // 运行图加载
this.$refs.runPlanLoad.doShow();
},
2020-07-08 14:40:04 +08:00
faultChooseShow() { // 故障列表加载
this.$refs.faultChoose.doShow();
2020-07-29 16:59:57 +08:00
},
passflow() {
const routeData = this.$router.resolve({
path:'/jlmap3d/passengerflow',
query:{
mapid:this.mapId,
group:this.group,
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
showdriving() {
this.panelShow = true;
this.drivingShow = false;
this.ibpShow = false;
},
showIbp(deviceCode) {
2020-07-01 18:52:29 +08:00
this.drivingShow = false;
this.panelShow = false;
this.ibpShow = true;
this.$refs.ibpPlate.show(deviceCode, this.ibpPart);
},
hidejl3dcctv() {
const routeData = this.$router.resolve({
path:'/jlmap3d/passengerflow',
query:{
mapid:this.mapId,
group:this.group,
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
2020-07-08 15:49:16 +08:00
hidepanel() { // 司机视角
2020-07-29 16:59:57 +08:00
if (this.$store.state.training.prdType == '04') {
2020-07-28 16:41:21 +08:00
this.panelShow = false;
this.drivingShow = true;
this.$refs.Jl3dDrive.show(this.mapId, this.group);
} else {
const routeData = this.$router.resolve({
path:'/jlmap3d/sandbox',
query:{
mapid: this.mapId,
group: this.group,
token: getToken(),
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
}
},
hideIbp() {
Message.closeAll();
this.jl3dmaintainershow = false;
this.panelShow = true;
this.ibpShow = false;
if (this.$refs && this.$refs.ibpPlate) {
this.$refs.ibpPlate.ibpDestroy();
}
},
messageInfo(message, type) {
this.$message({
showClose: true,
message: message,
type: type
});
},
setWindowSize() {
this.$store.dispatch('config/resize', { width: this.width, height: this.height });
if (this.prdType == '07') {
this.setBigScreenMode();
}
2020-03-25 15:22:52 +08:00
},
2020-07-24 18:38:19 +08:00
switchStationMode(stationCode) {
this.showStation = stationCode;
this.setShowStation(this.showStation);
},
2020-07-24 18:38:19 +08:00
setShowStation(stationCode) {
const nameList = Object.keys(this.$store.state.map.map);
let list = [];
nameList.forEach(item => {
if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) {
list = [...list, ...this.$store.state.map.map[item]];
}
});
2020-07-24 18:38:19 +08:00
this.$jlmap.updateShowStation(list, stationCode);
this.$jlmap.setCenter(stationCode);
2020-03-25 15:22:52 +08:00
},
2020-07-24 18:38:19 +08:00
setStationList(map) {
this.stationList = [];
2020-07-24 18:38:19 +08:00
(map.stationList || []).forEach(item => {
2020-03-25 15:22:52 +08:00
if (item.centralized) {
this.stationList.push({value: item.code, name: item.name});
this.centralizedStationMap[item.code] = item.code;
item.chargeStationCodeList && item.chargeStationCodeList.length && item.chargeStationCodeList.forEach(ele => {
this.centralizedStationMap[ele] = item.code;
});
2020-03-25 15:22:52 +08:00
}
});
2020-03-25 15:22:52 +08:00
if (this.stationList.length) {
this.showStation = this.stationList[0].value;
2020-03-25 15:22:52 +08:00
}
},
setBigScreenMode() {
2020-07-08 14:40:04 +08:00
if (this.bigScreenConfig.bigScreenSplitConfig.length) {
const offsetList = this.bigScreenConfig.offsetList;
const width = this.bigScreenConfig.width;
const height = this.bigScreenConfig.height;
const size = {
2020-07-08 14:40:04 +08:00
width: this.$store.state.app.width * width,
height: (this.$store.state.app.height - 60) * height,
offsetY: 60,
2020-07-08 14:40:04 +08:00
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
2020-07-24 18:38:19 +08:00
this.$jlmap.off('zoom'); // 禁止缩放
this.$jlmap.setUpdateScreen(size);
}
},
cancelBigScreenMode() {
2020-07-24 18:38:19 +08:00
this.$jlmap.on('zoom'); // 激活缩放
this.$jlmap.setRevoverBigScreen(); // 设置默认缩放 位移
},
2020-06-29 13:11:27 +08:00
handlerMemberManage() {
this.$refs.membersManage.doShow();
},
addSimulationMember() {
this.$refs.addMember.doShow();
2020-06-30 14:27:32 +08:00
},
2020-07-01 18:52:29 +08:00
checkRoleChange(data) {
2020-06-30 18:35:57 +08:00
data.forEach(item => {
2020-07-01 18:52:29 +08:00
if (item.messageType === 'KICK_OUT' && item.userId == this.userId) {
2020-06-30 18:35:57 +08:00
this.$messageBox('您已经被请离房间!');
this.$refs.demonMenu.back();
2020-07-01 18:52:29 +08:00
} else if (item.messageType === 'PLAY_CHANGE' && item.userId == this.userId) {
this.userRole = item.type || 'AUDIENCE';
this.setSimulationPrdType(this.centralizedStationMap[item.deviceCode]);
this.$nextTick(() => {
if (item.deviceCode) { this.setCenter(item.deviceCode); }
});
2020-06-30 18:35:57 +08:00
}
});
}
}
};
</script>
2020-07-14 18:14:39 +08:00
<style scoped lang="scss" rel="stylesheep/scss">
2020-06-29 13:11:27 +08:00
.main {
display: block;
width: 100%;
height: 100%;
overflow: hidden;
2020-07-14 15:35:03 +08:00
position: relative;
2020-06-29 13:11:27 +08:00
}
</style>