综合演练仿真调整
This commit is contained in:
parent
8f4cecec0c
commit
ce180b1448
@ -26,8 +26,8 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.roomInvite': function (val) {
|
||||
if (val.creatorId) {
|
||||
'$store.state.socket.simulationInvite': function (val) {
|
||||
if (val.creator) {
|
||||
this.subscribeMessage(val);
|
||||
}
|
||||
},
|
||||
@ -73,7 +73,7 @@ export default {
|
||||
if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt') {
|
||||
this.$refs.deomonTopic.doShow(res);
|
||||
}
|
||||
this.$store.dispatch('socket/setRoomInvite');
|
||||
this.$store.dispatch('socket/setSimulationInvite');
|
||||
}
|
||||
},
|
||||
subscribe() {
|
||||
|
@ -37,3 +37,18 @@ export function getAllSimulationUser(group) {
|
||||
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'
|
||||
});
|
||||
}
|
||||
// 获取登录信息(用户&设备)
|
||||
export function getLoginInfo(token) {
|
||||
return request({
|
||||
url: '/api/login/loginUserInfo',
|
||||
method: 'get',
|
||||
params: {
|
||||
token
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DeomonList from '@/views/demonstration/deomonList/index_APP_TARGET';
|
||||
import DeomonList from '@/views/demonstration/deomonList/index';
|
||||
import Qcode from './Qcode';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import LangStorage from '@/utils/lang';
|
||||
|
@ -23,7 +23,7 @@ function handle(state, data) {
|
||||
case 'Simulation_DeviceStatus': // 仿真-设备状态消息
|
||||
state.equipmentStatus = msg;
|
||||
break;
|
||||
case 'Simulation_User': // 仿真-聊天界面用户进出仿真消息
|
||||
case 'Simulation_User': // 仿真-进出仿真消息
|
||||
handleSimulationUserinfo(state, msg); // 用户进出仿真消息
|
||||
break;
|
||||
case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息
|
||||
@ -82,8 +82,8 @@ function handle(state, data) {
|
||||
case 'JointTraining_User_Permit': // 综合演练室-用户获取权限消息
|
||||
state.userPermit = msg;
|
||||
break;
|
||||
case 'JointTraining_Room_Invite': // 综合演练室-房间邀请消息
|
||||
state.roomInvite = msg;
|
||||
case 'Simulation_Invite': // 综合演练-仿真邀请消息
|
||||
state.simulationInvite = msg;
|
||||
break;
|
||||
case 'Big_Screen_Simulation_DeviceStatus': // 大屏仿真状态数据
|
||||
state.equipmentStatus = msg;
|
||||
@ -240,7 +240,7 @@ const socket = {
|
||||
userOutRoom: {}, // 用户退出房间消息
|
||||
userInSimulation: {}, // 用户进入仿真消息
|
||||
userBackRoom: {}, // 用户从仿真返回房间消息
|
||||
roomInvite: {}, // 用户扫码信息
|
||||
simulationInvite: {}, // 用户扫码信息
|
||||
|
||||
permissionOver: {}, // 权限结束
|
||||
|
||||
@ -301,8 +301,8 @@ const socket = {
|
||||
handlePushMsgQueue(state, msg);
|
||||
},
|
||||
|
||||
setRoomInvite: (state, roomInvite) => {
|
||||
state.roomInvite = roomInvite;
|
||||
setSimulationInvite: (state, simulationInvite) => {
|
||||
state.simulationInvite = simulationInvite;
|
||||
},
|
||||
setRoomSubscribe:(state, roomIsSubscribe)=>{
|
||||
state.roomIsSubscribe = roomIsSubscribe;
|
||||
@ -352,8 +352,8 @@ const socket = {
|
||||
commit('setSimulationTextList', {});
|
||||
},
|
||||
|
||||
setRoomInvite: ({ commit }) => {
|
||||
commit('setRoomInvite', {});
|
||||
setSimulationInvite: ({ commit }) => {
|
||||
commit('setSimulationInvite', {});
|
||||
},
|
||||
|
||||
setMessage: ({ state }, data) => {
|
||||
|
@ -110,20 +110,19 @@ const user = {
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
SetProjecteDevice({ commit }, deviceVo) {
|
||||
commit('SET_PROJECTDEVICE', deviceVo);
|
||||
},
|
||||
// 获取用户信息
|
||||
GetInfo({ commit }, token) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo(token).then(response => {
|
||||
const user = response.data.userVO;
|
||||
const user = response.data;
|
||||
if (user.roles && user.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
commit('SET_ROLES', user.roles);
|
||||
} else {
|
||||
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_NICKNAME', user.nickname);
|
||||
commit('SET_ID', user.id);
|
||||
|
@ -22,8 +22,8 @@
|
||||
: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>
|
||||
<span v-if="data.state=='01'">{{ '['+data.map.name+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickname)) }}</span>
|
||||
<span v-else>{{ '['+data.map.name+']'+($t('global.trainingHasStart').replace('{name}', data.creator.nickname)) }}</span>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@ -43,8 +43,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getjointTrainListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew } from '@/api/jointTraining';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { getSimulationListCantainUser } from '@/api/jointSimulation';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
||||
@ -100,8 +99,11 @@ export default {
|
||||
this.pageLoading = true;
|
||||
this.dialogShow = true;
|
||||
this.loading = false;
|
||||
const resp = await getjointTrainListNew();
|
||||
this.trainingList = resp.data || [];
|
||||
this.trainingList = [];
|
||||
const resp = await getSimulationListCantainUser();
|
||||
if (resp.data) {
|
||||
this.trainingList = resp.data;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
@ -113,18 +115,9 @@ export default {
|
||||
},
|
||||
async handleJoinRoom(data) {
|
||||
try {
|
||||
const rest = await getPublishMapInfo(data.mapId);
|
||||
await getjointTrainingNew(data.group);
|
||||
if (data.state == '02') {
|
||||
this.subscribe(data.group);
|
||||
launchFullscreen();
|
||||
const query = { lineCode: rest.data.lineCode, mapId: data.mapId, group: data.group, drawWay: true };
|
||||
await putJointTrainingSimulationEntranceNew(data.group);
|
||||
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 });
|
||||
}
|
||||
launchFullscreen();
|
||||
const query = { lineCode: data.map.lineCode, mapId: data.map.id, group: data.group};
|
||||
this.$router.push({path:'/jointTrainingNew', query:query});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
@ -140,23 +133,23 @@ export default {
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
/deep/ {
|
||||
.el-dialog__body {
|
||||
padding: 0px 30px !important;
|
||||
}
|
||||
/deep/ {
|
||||
.el-dialog__body {
|
||||
padding: 0px 30px !important;
|
||||
}
|
||||
|
||||
.el-tree {
|
||||
overflow: hidden !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;
|
||||
}
|
||||
}
|
||||
.el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #e4e3e3 !important;
|
||||
}
|
||||
}
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
@ -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>
|
||||
|
||||
<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 { getToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
||||
|
||||
export default {
|
||||
name: 'DeomonList',
|
||||
@ -32,8 +27,8 @@ export default {
|
||||
dialogShow: false,
|
||||
group: '',
|
||||
roomName: '',
|
||||
state: '',
|
||||
mapId: '',
|
||||
lineCode: '',
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
@ -51,51 +46,20 @@ export default {
|
||||
doShow(data) {
|
||||
this.roomName = data.creator.nickName;
|
||||
this.group = data.group;
|
||||
this.state = data.state;
|
||||
this.mapId = data.mapId;
|
||||
this.mapId = data.map.id;
|
||||
this.lineCode = data.map.lineCode;
|
||||
this.dialogShow = true;
|
||||
this.loading = false;
|
||||
},
|
||||
doClose() {
|
||||
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() {
|
||||
try {
|
||||
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();
|
||||
const query = { lineCode: rest.data.lineCode, mapId: this.mapId, group: this.group, drawWay: drawWay };
|
||||
if (drawWay) {
|
||||
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 });
|
||||
}
|
||||
launchFullscreen();
|
||||
const query = { lineCode: this.lineCode, mapId: this.mapId, group: this.group};
|
||||
this.$router.push({path: `/jointTrainingNew`, query: query});
|
||||
this.dialogShow = false;
|
||||
} catch (e) {
|
||||
this.$messageBox(this.$t('tip.enterTrainingRoomFailed'));
|
||||
|
@ -110,7 +110,7 @@ import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
import Cookies from 'js-cookie';
|
||||
import md5 from 'js-md5';
|
||||
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 bgImg from '@/assets/bg1.jpg';
|
||||
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 } });
|
||||
}
|
||||
} else if (this.$route.query.projectDevice) {
|
||||
getInfo(getToken()).then(res => {
|
||||
getLoginInfo(getToken()).then(res => {
|
||||
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 };
|
||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
||||
|
@ -46,7 +46,7 @@
|
||||
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" />
|
||||
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
|
||||
<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" />
|
||||
</div>
|
||||
</div>
|
||||
@ -218,6 +218,11 @@ export default {
|
||||
'$store.state.map.map': function (val) {
|
||||
this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01';
|
||||
this.setStationList(val);
|
||||
},
|
||||
'$store.state.socket.simulationRoleList':function(val) {
|
||||
if (val && val.length) {
|
||||
this.checkIsKickOut(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
@ -360,7 +365,7 @@ export default {
|
||||
async getUserRole() {
|
||||
const res = await getSimulationUserInfo(this.group);
|
||||
const data = res.data || {};
|
||||
this.userRole = data.userRole || 'AUDIENCE';
|
||||
this.userRole = data.role || 'AUDIENCE';
|
||||
this.deviceCode = data.deviceCode;
|
||||
this.isAdmin = data.admin;
|
||||
this.ibpPart = data.ibpPart;
|
||||
@ -406,7 +411,7 @@ export default {
|
||||
resp = await this.getUserRole();
|
||||
}
|
||||
if (resp && resp.code == 200) {
|
||||
this.userRole = resp.data.userRole || 'AUDIENCE';
|
||||
this.userRole = resp.data.role || 'AUDIENCE';
|
||||
this.setSimulationPrdType();
|
||||
}
|
||||
await this.getTrainDetail();
|
||||
@ -619,6 +624,14 @@ export default {
|
||||
changeAdminMode(adminMode, swch) {
|
||||
this.adminMode = adminMode;
|
||||
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"
|
||||
:room="room"
|
||||
:members="members"
|
||||
:is-admin="isAdmin"
|
||||
:height="height"
|
||||
@message="messageInfo"
|
||||
/>
|
||||
@ -67,6 +68,14 @@ export default {
|
||||
components: {
|
||||
eMembers
|
||||
},
|
||||
props: {
|
||||
isAdmin: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
@ -134,6 +143,11 @@ export default {
|
||||
watch: {
|
||||
queryMember(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
},
|
||||
'$store.state.socket.simulationRoleList':function(val) {
|
||||
if (val && val.length) {
|
||||
this.handlerMemberOnOff(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -258,6 +272,23 @@ export default {
|
||||
falg = this.memberData[data.id].nickName.indexOf(value) !== -1;
|
||||
}
|
||||
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() {
|
||||
await clearSimulation(this.group);
|
||||
if (this.isAdmin) {
|
||||
await clearSimulation(this.group);
|
||||
}
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.backLoading = true;
|
||||
if (this.$route.query.projectDevice) {
|
||||
@ -319,7 +321,6 @@ export default {
|
||||
history.go(-1);
|
||||
exitFullscreen();
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
jumpjlmap3d() {
|
||||
|
@ -7,8 +7,7 @@
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { putJointTrainingUserkicked } from '@/api/chat';
|
||||
import { putJointTrainingUserkickedNew} from '@/api/jointTraining';
|
||||
import { kickOutMember } from '@/api/jointSimulation';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -73,11 +72,7 @@ export default {
|
||||
},
|
||||
async kicked() {
|
||||
try {
|
||||
if (this.drawWay === 'true' ) {
|
||||
await putJointTrainingUserkickedNew(this.clickUserId, this.$route.query.group);
|
||||
} else {
|
||||
await putJointTrainingUserkicked(this.clickUserId, this.$route.query.group);
|
||||
}
|
||||
await kickOutMember(this.$route.query.group, this.clickUserId);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
@ -46,6 +46,12 @@ export default {
|
||||
height: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
isAdmin: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -79,9 +85,8 @@ export default {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
|
||||
if (this.userId == this.room.creatorId) {
|
||||
this.clickUserId = `${obj.id || ''}`;
|
||||
if (this.isAdmin) {
|
||||
this.clickUserId = `${obj.userId || ''}`;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position, menu: DeviceMenu.JointRoom });
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user