综合演练仿真调整
This commit is contained in:
parent
8f4cecec0c
commit
ce180b1448
@ -26,8 +26,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$store.state.socket.roomInvite': function (val) {
|
'$store.state.socket.simulationInvite': function (val) {
|
||||||
if (val.creatorId) {
|
if (val.creator) {
|
||||||
this.subscribeMessage(val);
|
this.subscribeMessage(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -73,7 +73,7 @@ export default {
|
|||||||
if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt') {
|
if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt') {
|
||||||
this.$refs.deomonTopic.doShow(res);
|
this.$refs.deomonTopic.doShow(res);
|
||||||
}
|
}
|
||||||
this.$store.dispatch('socket/setRoomInvite');
|
this.$store.dispatch('socket/setSimulationInvite');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
subscribe() {
|
subscribe() {
|
||||||
|
@ -37,3 +37,18 @@ export function getAllSimulationUser(group) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 获取用户所在的综合演练
|
||||||
|
export function getSimulationListCantainUser() {
|
||||||
|
return request({
|
||||||
|
url: `/api/jointSimulation/list/containUser`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 将制定用户踢出房间
|
||||||
|
export function kickOutMember(group, userId) {
|
||||||
|
return request({
|
||||||
|
url: `/api/jointSimulation/${group}/kickOut?userId=${userId}`,
|
||||||
|
method: 'delete'
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -83,3 +83,13 @@ export function checkLoginLine() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 获取登录信息(用户&设备)
|
||||||
|
export function getLoginInfo(token) {
|
||||||
|
return request({
|
||||||
|
url: '/api/login/loginUserInfo',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
token
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import DeomonList from '@/views/demonstration/deomonList/index_APP_TARGET';
|
import DeomonList from '@/views/demonstration/deomonList/index';
|
||||||
import Qcode from './Qcode';
|
import Qcode from './Qcode';
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
import LangStorage from '@/utils/lang';
|
import LangStorage from '@/utils/lang';
|
||||||
|
@ -23,7 +23,7 @@ function handle(state, data) {
|
|||||||
case 'Simulation_DeviceStatus': // 仿真-设备状态消息
|
case 'Simulation_DeviceStatus': // 仿真-设备状态消息
|
||||||
state.equipmentStatus = msg;
|
state.equipmentStatus = msg;
|
||||||
break;
|
break;
|
||||||
case 'Simulation_User': // 仿真-聊天界面用户进出仿真消息
|
case 'Simulation_User': // 仿真-进出仿真消息
|
||||||
handleSimulationUserinfo(state, msg); // 用户进出仿真消息
|
handleSimulationUserinfo(state, msg); // 用户进出仿真消息
|
||||||
break;
|
break;
|
||||||
case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息
|
case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息
|
||||||
@ -82,8 +82,8 @@ function handle(state, data) {
|
|||||||
case 'JointTraining_User_Permit': // 综合演练室-用户获取权限消息
|
case 'JointTraining_User_Permit': // 综合演练室-用户获取权限消息
|
||||||
state.userPermit = msg;
|
state.userPermit = msg;
|
||||||
break;
|
break;
|
||||||
case 'JointTraining_Room_Invite': // 综合演练室-房间邀请消息
|
case 'Simulation_Invite': // 综合演练-仿真邀请消息
|
||||||
state.roomInvite = msg;
|
state.simulationInvite = msg;
|
||||||
break;
|
break;
|
||||||
case 'Big_Screen_Simulation_DeviceStatus': // 大屏仿真状态数据
|
case 'Big_Screen_Simulation_DeviceStatus': // 大屏仿真状态数据
|
||||||
state.equipmentStatus = msg;
|
state.equipmentStatus = msg;
|
||||||
@ -240,7 +240,7 @@ const socket = {
|
|||||||
userOutRoom: {}, // 用户退出房间消息
|
userOutRoom: {}, // 用户退出房间消息
|
||||||
userInSimulation: {}, // 用户进入仿真消息
|
userInSimulation: {}, // 用户进入仿真消息
|
||||||
userBackRoom: {}, // 用户从仿真返回房间消息
|
userBackRoom: {}, // 用户从仿真返回房间消息
|
||||||
roomInvite: {}, // 用户扫码信息
|
simulationInvite: {}, // 用户扫码信息
|
||||||
|
|
||||||
permissionOver: {}, // 权限结束
|
permissionOver: {}, // 权限结束
|
||||||
|
|
||||||
@ -301,8 +301,8 @@ const socket = {
|
|||||||
handlePushMsgQueue(state, msg);
|
handlePushMsgQueue(state, msg);
|
||||||
},
|
},
|
||||||
|
|
||||||
setRoomInvite: (state, roomInvite) => {
|
setSimulationInvite: (state, simulationInvite) => {
|
||||||
state.roomInvite = roomInvite;
|
state.simulationInvite = simulationInvite;
|
||||||
},
|
},
|
||||||
setRoomSubscribe:(state, roomIsSubscribe)=>{
|
setRoomSubscribe:(state, roomIsSubscribe)=>{
|
||||||
state.roomIsSubscribe = roomIsSubscribe;
|
state.roomIsSubscribe = roomIsSubscribe;
|
||||||
@ -352,8 +352,8 @@ const socket = {
|
|||||||
commit('setSimulationTextList', {});
|
commit('setSimulationTextList', {});
|
||||||
},
|
},
|
||||||
|
|
||||||
setRoomInvite: ({ commit }) => {
|
setSimulationInvite: ({ commit }) => {
|
||||||
commit('setRoomInvite', {});
|
commit('setSimulationInvite', {});
|
||||||
},
|
},
|
||||||
|
|
||||||
setMessage: ({ state }, data) => {
|
setMessage: ({ state }, data) => {
|
||||||
|
@ -110,20 +110,19 @@ const user = {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
SetProjecteDevice({ commit }, deviceVo) {
|
||||||
|
commit('SET_PROJECTDEVICE', deviceVo);
|
||||||
|
},
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
GetInfo({ commit }, token) {
|
GetInfo({ commit }, token) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getInfo(token).then(response => {
|
getInfo(token).then(response => {
|
||||||
const user = response.data.userVO;
|
const user = response.data;
|
||||||
if (user.roles && user.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
if (user.roles && user.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||||
commit('SET_ROLES', user.roles);
|
commit('SET_ROLES', user.roles);
|
||||||
} else {
|
} else {
|
||||||
reject('getInfo: roles must be a non-null array !');
|
reject('getInfo: roles must be a non-null array !');
|
||||||
}
|
}
|
||||||
if (response.data.deviceVO) {
|
|
||||||
commit('SET_PROJECTDEVICE', response.data.deviceVO.code);
|
|
||||||
}
|
|
||||||
commit('SET_NAME', user.name);
|
commit('SET_NAME', user.name);
|
||||||
commit('SET_NICKNAME', user.nickname);
|
commit('SET_NICKNAME', user.nickname);
|
||||||
commit('SET_ID', user.id);
|
commit('SET_ID', user.id);
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
:style="{height: height+'px'}"
|
:style="{height: height+'px'}"
|
||||||
>
|
>
|
||||||
<div slot-scope="{ node, data }" class="list-elem custom-tree-node">
|
<div slot-scope="{ node, data }" class="list-elem custom-tree-node">
|
||||||
<span v-if="data.state=='01'">{{ '['+data.mapName+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickName)) }}</span>
|
<span v-if="data.state=='01'">{{ '['+data.map.name+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickname)) }}</span>
|
||||||
<span v-else>{{ '['+data.mapName+']'+($t('global.trainingHasStart').replace('{name}', data.creator.nickName)) }}</span>
|
<span v-else>{{ '['+data.map.name+']'+($t('global.trainingHasStart').replace('{name}', data.creator.nickname)) }}</span>
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -43,8 +43,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getjointTrainListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew } from '@/api/jointTraining';
|
import { getSimulationListCantainUser } from '@/api/jointSimulation';
|
||||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
import { launchFullscreen } from '@/utils/screen';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
||||||
@ -100,8 +99,11 @@ export default {
|
|||||||
this.pageLoading = true;
|
this.pageLoading = true;
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
const resp = await getjointTrainListNew();
|
this.trainingList = [];
|
||||||
this.trainingList = resp.data || [];
|
const resp = await getSimulationListCantainUser();
|
||||||
|
if (resp.data) {
|
||||||
|
this.trainingList = resp.data;
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
} finally {
|
} finally {
|
||||||
@ -113,18 +115,9 @@ export default {
|
|||||||
},
|
},
|
||||||
async handleJoinRoom(data) {
|
async handleJoinRoom(data) {
|
||||||
try {
|
try {
|
||||||
const rest = await getPublishMapInfo(data.mapId);
|
|
||||||
await getjointTrainingNew(data.group);
|
|
||||||
if (data.state == '02') {
|
|
||||||
this.subscribe(data.group);
|
|
||||||
launchFullscreen();
|
launchFullscreen();
|
||||||
const query = { lineCode: rest.data.lineCode, mapId: data.mapId, group: data.group, drawWay: true };
|
const query = { lineCode: data.map.lineCode, mapId: data.map.id, group: data.group};
|
||||||
await putJointTrainingSimulationEntranceNew(data.group);
|
this.$router.push({path:'/jointTrainingNew', query:query});
|
||||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
|
||||||
} else if (data.state == '01') {
|
|
||||||
const query = { group: data.group, drawWay: true };
|
|
||||||
this.$router.push({ path: `/trainroom`, query: query });
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
} finally {
|
} finally {
|
||||||
@ -146,7 +139,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.el-tree {
|
.el-tree {
|
||||||
overflow: hidden !important;
|
overflow: auto !important;
|
||||||
.list-elem {
|
.list-elem {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
@ -1,190 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog
|
|
||||||
v-dialogDrag
|
|
||||||
v-dialogLoading="pageLoading"
|
|
||||||
:title="title"
|
|
||||||
:visible.sync="show"
|
|
||||||
width="600px"
|
|
||||||
:before-close="doClose"
|
|
||||||
:z-index="2000"
|
|
||||||
:modal="false"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
>
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
|
|
||||||
<el-tree
|
|
||||||
ref="tree"
|
|
||||||
node-key="group"
|
|
||||||
class="filter-tree"
|
|
||||||
default-expand-all
|
|
||||||
:data="trainingList"
|
|
||||||
:props="defaultProps"
|
|
||||||
:filter-node-method="filterNode"
|
|
||||||
:style="{height: height+'px'}"
|
|
||||||
>
|
|
||||||
<div slot-scope="{ node, data }" class="list-elem custom-tree-node">
|
|
||||||
<span v-if="data.state=='01'">{{ '['+data.mapName+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickName)) }}</span>
|
|
||||||
<span v-else>{{ '['+data.mapName+']'+($t('global.trainingHasStart').replace('{name}', data.creator.nickName)) }}</span>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
@click="handleJoinRoom(data)"
|
|
||||||
>进入</el-button>
|
|
||||||
</div>
|
|
||||||
</el-tree>
|
|
||||||
</el-scrollbar>
|
|
||||||
<span
|
|
||||||
slot="footer"
|
|
||||||
class="dialog-footer"
|
|
||||||
>
|
|
||||||
<el-button v-loading="loading" type="primary" @click="handleJoin">{{ $t('global.joinNewRoom') }}</el-button>
|
|
||||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getjointTrainList, getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
|
|
||||||
import { getjointTrainListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew } from '@/api/jointTraining';
|
|
||||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
|
||||||
import { ProjectCode } from '@/scripts/ProjectConfig';
|
|
||||||
import { getToken } from '@/utils/auth';
|
|
||||||
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'DeomonList',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogShow: false,
|
|
||||||
height: 120,
|
|
||||||
trainingList: [],
|
|
||||||
defaultProps: {
|
|
||||||
label: 'roomName'
|
|
||||||
},
|
|
||||||
group: '',
|
|
||||||
loading: false,
|
|
||||||
pageLoading: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
show() {
|
|
||||||
return this.dialogShow;
|
|
||||||
},
|
|
||||||
title() {
|
|
||||||
return this.$t('global.synthesisTrainingTitle');
|
|
||||||
},
|
|
||||||
isWatch() {
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
isjoin() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
filterNode(value, data) {
|
|
||||||
if (!value) return true;
|
|
||||||
return data.label.indexOf(value) !== -1;
|
|
||||||
},
|
|
||||||
async subscribe(group) {
|
|
||||||
if (!this.$store.state.socket.roomIsSubscribe) {
|
|
||||||
this.clearSubscribe(group);
|
|
||||||
const header = { group: group || '', 'X-Token': getToken() };
|
|
||||||
creatSubscribe(`${roomTopic}\/${group}`, header);
|
|
||||||
await this.$store.dispatch('socket/setRoomSubscribe', true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async clearSubscribe(group) {
|
|
||||||
clearSubscribe(`${roomTopic}\/${group}`);
|
|
||||||
await this.$store.dispatch('socket/setRoomSubscribe', false);
|
|
||||||
},
|
|
||||||
async doShow() {
|
|
||||||
try {
|
|
||||||
this.pageLoading = true;
|
|
||||||
this.dialogShow = true;
|
|
||||||
this.loading = false;
|
|
||||||
const project = getSessionStorage('project');
|
|
||||||
const param = {};
|
|
||||||
if (ProjectCode[project]) {
|
|
||||||
param.projectCode = ProjectCode[project];
|
|
||||||
}
|
|
||||||
const resp = await getjointTrainListNew(param);
|
|
||||||
const rest = await getjointTrainList(param);
|
|
||||||
const newMapData = resp.data || [];
|
|
||||||
const oldMapData = rest.data || [];
|
|
||||||
this.trainingList = [...newMapData, ...oldMapData];
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
} finally {
|
|
||||||
this.pageLoading = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async doClose() {
|
|
||||||
this.dialogShow = false;
|
|
||||||
},
|
|
||||||
async handleJoinRoom(data) {
|
|
||||||
try {
|
|
||||||
const rest = await getPublishMapInfo(data.mapId);
|
|
||||||
let path = '';
|
|
||||||
if (rest.data.drawWay) {
|
|
||||||
await getjointTrainingNew(data.group);
|
|
||||||
path = '/jointTrainingNew';
|
|
||||||
} else {
|
|
||||||
await getjointTraining(data.group);
|
|
||||||
path = '/jointTraining';
|
|
||||||
}
|
|
||||||
if (data.state == '02') {
|
|
||||||
this.subscribe(data.group);
|
|
||||||
launchFullscreen();
|
|
||||||
const query = { lineCode: rest.data.lineCode, mapId: data.mapId, group: data.group, drawWay: rest.data.drawWay };
|
|
||||||
if (rest.data.drawWay) {
|
|
||||||
await putJointTrainingSimulationEntranceNew(data.group);
|
|
||||||
} else {
|
|
||||||
await putJointTrainingSimulationEntrance(data.group);
|
|
||||||
}
|
|
||||||
this.$router.push({ path: path, query: query });
|
|
||||||
} else if (data.state == '01') {
|
|
||||||
const query = { group: data.group, drawWay: rest.data.drawWay };
|
|
||||||
this.$router.push({ path: `/trainroom`, query: query });
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
} finally {
|
|
||||||
this.loading = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleJoin() {
|
|
||||||
this.$emit('enterQcode');
|
|
||||||
this.dialogShow = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
||||||
/deep/ {
|
|
||||||
.el-dialog__body {
|
|
||||||
padding: 0px 30px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tree {
|
|
||||||
overflow: auto !important;
|
|
||||||
.list-elem {
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tree-node.is-current>.el-tree-node__content {
|
|
||||||
background-color: #e4e3e3 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.custom-tree-node {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
font-size: 14px;
|
|
||||||
padding-right: 8px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -18,12 +18,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
|
|
||||||
import { getjointTrainingNew, putJointTrainingSimulationEntranceNew} from '@/api/jointTraining';
|
|
||||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
import { launchFullscreen } from '@/utils/screen';
|
||||||
import { getToken } from '@/utils/auth';
|
|
||||||
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DeomonList',
|
name: 'DeomonList',
|
||||||
@ -32,8 +27,8 @@ export default {
|
|||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
group: '',
|
group: '',
|
||||||
roomName: '',
|
roomName: '',
|
||||||
state: '',
|
|
||||||
mapId: '',
|
mapId: '',
|
||||||
|
lineCode: '',
|
||||||
loading: false
|
loading: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -51,51 +46,20 @@ export default {
|
|||||||
doShow(data) {
|
doShow(data) {
|
||||||
this.roomName = data.creator.nickName;
|
this.roomName = data.creator.nickName;
|
||||||
this.group = data.group;
|
this.group = data.group;
|
||||||
this.state = data.state;
|
this.mapId = data.map.id;
|
||||||
this.mapId = data.mapId;
|
this.lineCode = data.map.lineCode;
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
},
|
},
|
||||||
async subscribe() {
|
|
||||||
if (!this.$store.state.socket.roomIsSubscribe) {
|
|
||||||
this.clearSubscribe();
|
|
||||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
|
||||||
creatSubscribe(`${roomTopic}\/${this.group}`, header);
|
|
||||||
await this.$store.dispatch('socket/setRoomSubscribe', true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async clearSubscribe() {
|
|
||||||
clearSubscribe(`${roomTopic}\/${this.group}`);
|
|
||||||
await this.$store.dispatch('socket/setRoomSubscribe', false);
|
|
||||||
},
|
|
||||||
async handleJoin() {
|
async handleJoin() {
|
||||||
try {
|
try {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const rest = await getPublishMapInfo(this.mapId);
|
|
||||||
const drawWay = rest.data.drawWay;
|
|
||||||
if (drawWay) {
|
|
||||||
await getjointTrainingNew(this.group);
|
|
||||||
} else {
|
|
||||||
await getjointTraining(this.group);
|
|
||||||
}
|
|
||||||
if (this.state == '02') {
|
|
||||||
this.subscribe();
|
|
||||||
launchFullscreen();
|
launchFullscreen();
|
||||||
const query = { lineCode: rest.data.lineCode, mapId: this.mapId, group: this.group, drawWay: drawWay };
|
const query = { lineCode: this.lineCode, mapId: this.mapId, group: this.group};
|
||||||
if (drawWay) {
|
this.$router.push({path: `/jointTrainingNew`, query: query});
|
||||||
await putJointTrainingSimulationEntranceNew(this.group);
|
|
||||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
|
||||||
} else {
|
|
||||||
await putJointTrainingSimulationEntrance(this.group);
|
|
||||||
this.$router.push({ path: `/jointTraining`, query: query });
|
|
||||||
}
|
|
||||||
} else if (this.state == '01') {
|
|
||||||
const query = { group: this.group, drawWay: drawWay };
|
|
||||||
this.$router.push({ path: `/trainroom`, query: query });
|
|
||||||
}
|
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$messageBox(this.$t('tip.enterTrainingRoomFailed'));
|
this.$messageBox(this.$t('tip.enterTrainingRoomFailed'));
|
||||||
|
@ -110,7 +110,7 @@ import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
|||||||
import Cookies from 'js-cookie';
|
import Cookies from 'js-cookie';
|
||||||
import md5 from 'js-md5';
|
import md5 from 'js-md5';
|
||||||
import QrcodeVue from 'qrcode.vue';
|
import QrcodeVue from 'qrcode.vue';
|
||||||
import { getLoginWmurl, checkLoginStatus, getInfo } from '@/api/login';
|
import { getLoginWmurl, checkLoginStatus, getLoginInfo } from '@/api/login';
|
||||||
import { LoginParams } from '@/utils/login';
|
import { LoginParams } from '@/utils/login';
|
||||||
import bgImg from '@/assets/bg1.jpg';
|
import bgImg from '@/assets/bg1.jpg';
|
||||||
import bgIbpImg from '@/assets/bg_ibp.png';
|
import bgIbpImg from '@/assets/bg_ibp.png';
|
||||||
@ -374,7 +374,7 @@ export default {
|
|||||||
this.$router.push({ path: this.path, query:{ raceId:this.$route.query.raceId } });
|
this.$router.push({ path: this.path, query:{ raceId:this.$route.query.raceId } });
|
||||||
}
|
}
|
||||||
} else if (this.$route.query.projectDevice) {
|
} else if (this.$route.query.projectDevice) {
|
||||||
getInfo(getToken()).then(res => {
|
getLoginInfo(getToken()).then(res => {
|
||||||
getSimulationInfoNew(res.data.group).then(resp => {
|
getSimulationInfoNew(res.data.group).then(resp => {
|
||||||
const query = { group: res.data.group, drawWay: true, mapId: resp.data.map.id, lineCode:resp.data.map.lineCode, projectDevice: this.$route.query.projectDevice };
|
const query = { group: res.data.group, drawWay: true, mapId: resp.data.map.id, lineCode:resp.data.map.lineCode, projectDevice: this.$route.query.projectDevice };
|
||||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" />
|
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" />
|
||||||
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
|
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
|
||||||
<js-question v-if="project==='jsxt'" :offset="offset" :question-list="questionList" />
|
<js-question v-if="project==='jsxt'" :offset="offset" :question-list="questionList" />
|
||||||
<members-manage ref="membersManage" @addSimulationMember="addSimulationMember" />
|
<members-manage ref="membersManage" :is-admin="isAdmin" @addSimulationMember="addSimulationMember" />
|
||||||
<add-member ref="addMember" @refreshMemberTree="refreshMemberTree" />
|
<add-member ref="addMember" @refreshMemberTree="refreshMemberTree" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -218,6 +218,11 @@ export default {
|
|||||||
'$store.state.map.map': function (val) {
|
'$store.state.map.map': function (val) {
|
||||||
this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01';
|
this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01';
|
||||||
this.setStationList(val);
|
this.setStationList(val);
|
||||||
|
},
|
||||||
|
'$store.state.socket.simulationRoleList':function(val) {
|
||||||
|
if (val && val.length) {
|
||||||
|
this.checkIsKickOut(val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
@ -360,7 +365,7 @@ export default {
|
|||||||
async getUserRole() {
|
async getUserRole() {
|
||||||
const res = await getSimulationUserInfo(this.group);
|
const res = await getSimulationUserInfo(this.group);
|
||||||
const data = res.data || {};
|
const data = res.data || {};
|
||||||
this.userRole = data.userRole || 'AUDIENCE';
|
this.userRole = data.role || 'AUDIENCE';
|
||||||
this.deviceCode = data.deviceCode;
|
this.deviceCode = data.deviceCode;
|
||||||
this.isAdmin = data.admin;
|
this.isAdmin = data.admin;
|
||||||
this.ibpPart = data.ibpPart;
|
this.ibpPart = data.ibpPart;
|
||||||
@ -406,7 +411,7 @@ export default {
|
|||||||
resp = await this.getUserRole();
|
resp = await this.getUserRole();
|
||||||
}
|
}
|
||||||
if (resp && resp.code == 200) {
|
if (resp && resp.code == 200) {
|
||||||
this.userRole = resp.data.userRole || 'AUDIENCE';
|
this.userRole = resp.data.role || 'AUDIENCE';
|
||||||
this.setSimulationPrdType();
|
this.setSimulationPrdType();
|
||||||
}
|
}
|
||||||
await this.getTrainDetail();
|
await this.getTrainDetail();
|
||||||
@ -619,6 +624,14 @@ export default {
|
|||||||
changeAdminMode(adminMode, swch) {
|
changeAdminMode(adminMode, swch) {
|
||||||
this.adminMode = adminMode;
|
this.adminMode = adminMode;
|
||||||
this.setSimulationPrdType(swch);
|
this.setSimulationPrdType(swch);
|
||||||
|
},
|
||||||
|
checkIsKickOut(data) {
|
||||||
|
data.forEach(item => {
|
||||||
|
if (item.messageType === 'KICKOUT' && item.userId == this.userId) {
|
||||||
|
this.$messageBox('您已经被请离房间!');
|
||||||
|
this.$refs.demonMenu.back();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
class="room__container--members"
|
class="room__container--members"
|
||||||
:room="room"
|
:room="room"
|
||||||
:members="members"
|
:members="members"
|
||||||
|
:is-admin="isAdmin"
|
||||||
:height="height"
|
:height="height"
|
||||||
@message="messageInfo"
|
@message="messageInfo"
|
||||||
/>
|
/>
|
||||||
@ -67,6 +68,14 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
eMembers
|
eMembers
|
||||||
},
|
},
|
||||||
|
props: {
|
||||||
|
isAdmin: {
|
||||||
|
type: Boolean,
|
||||||
|
default() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
show: false,
|
show: false,
|
||||||
@ -134,6 +143,11 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
queryMember(val) {
|
queryMember(val) {
|
||||||
this.$refs.tree.filter(val);
|
this.$refs.tree.filter(val);
|
||||||
|
},
|
||||||
|
'$store.state.socket.simulationRoleList':function(val) {
|
||||||
|
if (val && val.length) {
|
||||||
|
this.handlerMemberOnOff(val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -258,6 +272,23 @@ export default {
|
|||||||
falg = this.memberData[data.id].nickName.indexOf(value) !== -1;
|
falg = this.memberData[data.id].nickName.indexOf(value) !== -1;
|
||||||
}
|
}
|
||||||
return data.label.indexOf(value) !== -1 || falg;
|
return data.label.indexOf(value) !== -1 || falg;
|
||||||
|
},
|
||||||
|
handlerMemberOnOff(data) {
|
||||||
|
data.forEach(item => {
|
||||||
|
let memberIndex = -1;
|
||||||
|
this.members.forEach((member, index) =>{
|
||||||
|
if (member.userId === item.userId) {
|
||||||
|
member.online = item.online;
|
||||||
|
memberIndex = index;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (item.messageType === 'ENTER' && memberIndex < 0) {
|
||||||
|
delete item.messageType;
|
||||||
|
this.members.push(item);
|
||||||
|
} else if (item.messageType === 'KICKOUT' && memberIndex > -1) {
|
||||||
|
this.members.splice(memberIndex, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -308,7 +308,9 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async back() {
|
async back() {
|
||||||
|
if (this.isAdmin) {
|
||||||
await clearSimulation(this.group);
|
await clearSimulation(this.group);
|
||||||
|
}
|
||||||
this.$store.dispatch('training/over').then(() => {
|
this.$store.dispatch('training/over').then(() => {
|
||||||
this.backLoading = true;
|
this.backLoading = true;
|
||||||
if (this.$route.query.projectDevice) {
|
if (this.$route.query.projectDevice) {
|
||||||
@ -319,7 +321,6 @@ export default {
|
|||||||
history.go(-1);
|
history.go(-1);
|
||||||
exitFullscreen();
|
exitFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
jumpjlmap3d() {
|
jumpjlmap3d() {
|
||||||
|
@ -7,8 +7,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import PopMenu from '@/components/PopMenu';
|
import PopMenu from '@/components/PopMenu';
|
||||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||||
import { putJointTrainingUserkicked } from '@/api/chat';
|
import { kickOutMember } from '@/api/jointSimulation';
|
||||||
import { putJointTrainingUserkickedNew} from '@/api/jointTraining';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -73,11 +72,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async kicked() {
|
async kicked() {
|
||||||
try {
|
try {
|
||||||
if (this.drawWay === 'true' ) {
|
await kickOutMember(this.$route.query.group, this.clickUserId);
|
||||||
await putJointTrainingUserkickedNew(this.clickUserId, this.$route.query.group);
|
|
||||||
} else {
|
|
||||||
await putJointTrainingUserkicked(this.clickUserId, this.$route.query.group);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,12 @@ export default {
|
|||||||
height: {
|
height: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
isAdmin: {
|
||||||
|
type: Boolean,
|
||||||
|
default() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -79,9 +85,8 @@ export default {
|
|||||||
x: e.clientX,
|
x: e.clientX,
|
||||||
y: e.clientY
|
y: e.clientY
|
||||||
};
|
};
|
||||||
|
if (this.isAdmin) {
|
||||||
if (this.userId == this.room.creatorId) {
|
this.clickUserId = `${obj.userId || ''}`;
|
||||||
this.clickUserId = `${obj.id || ''}`;
|
|
||||||
this.$store.dispatch('menuOperation/setPopMenu', { position, menu: DeviceMenu.JointRoom });
|
this.$store.dispatch('menuOperation/setPopMenu', { position, menu: DeviceMenu.JointRoom });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user