Merge remote-tracking branch 'remotes/origin/dev' into test

This commit is contained in:
ival 2019-11-08 20:04:32 +08:00
commit 62097db613
7 changed files with 60 additions and 40 deletions

View File

@ -4,8 +4,8 @@ export function getBaseUrl() {
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 杜闪
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
} else {

View File

@ -105,7 +105,7 @@ export default {
launchFullscreen();
await putJointTrainingSimulationEntrance(this.group);
const rest = await getPublishMapInfo(this.mapId);
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group, subSystem: this.$route.query.subSystem };
const query = { skinCode: rest.data.lineCode, mapId: this.mapId, group: this.group, subSystem: this.$route.query.subSystem };
this.$router.push({ path: `/jointTraining`, query: query });
} else if (this.state == '01') {
const query = { group: this.group };

View File

@ -59,7 +59,7 @@ export default {
launchFullscreen();
await putJointTrainingSimulationEntrance(this.group);
const rest = await getPublishMapInfo(this.mapId);
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group };
const query = { skinCode: rest.data.lineCode, mapId: this.mapId, group: this.group };
this.$router.push({ path: `/jointTraining`, query: query });
} else if (this.state == '01') {
const query = { group: this.group };

View File

@ -103,6 +103,9 @@ export default {
},
right() {
return this.$store.state.config.width / 2 - 55;
},
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
}
},
watch: {
@ -130,11 +133,13 @@ export default {
this.handleRoomInfo(val);
}
},
'$store.state.socket.chatContent': function (val) { //
if (val.type === 'userRoomKickOut' && val.oneself) {
this.$router.push({ path: `/` });
this.messageInfo(this.$t('tip.beKickedOut'), 'warning');
}
'$store.state.socket.roleList': function (val) { //
val.forEach(elem => {
if (elem.id == this.userId && !elem.userRole) {
this.$router.push({ path: `/` });
this.messageInfo(this.$t('tip.beKickedOut'), 'warning');
}
});
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
@ -369,7 +374,9 @@ export default {
this.drivingShow = false;
this.panelShow = true;
this.ibpShow = false;
this.$refs.ibpPlate.ibpDestroy();
if (this.$refs && this.$refs.ibpPlate) {
this.$refs.ibpPlate.ibpDestroy();
}
},
messageInfo(message, type) {
this.$message({

View File

@ -94,8 +94,8 @@ export default {
},
'$store.state.socket.roleList': function (val) {
if (val && val.length) {
this.addrolesList(val);
this.$nextTick(() => {
this.addrolesList(val);
this.$store.dispatch('config/updateMenuBar');
});
}

View File

@ -344,9 +344,6 @@ export default {
this.loading = true;
const res = await putJointTrainingSimulation(this.group);
this.mapId = res.data.mapId;
if (res.data.state == '01') {
this.starting = false;
}
this.loading = false;
},
async handleExit() {

View File

@ -163,15 +163,15 @@ export default {
const index = this.members.findIndex(elem => { return user.id == elem.id; });
if (user.userRole) {
if (index >= 0) {
this.checkUserState(user, this.members[index]);
this.members.splice(index, 1, Object.assign(this.members[index], this.transformUser(user)));
this.checkUserState(user, 'upd');
} else {
this.checkUserState(user, null);
this.members.push(this.transformUser(user));
this.checkUserState(user, 'add');
}
} else {
this.checkUserState(user, this.members[index]);
this.members.splice(index, 1);
this.checkUserState(user, 'del');
}
});
},
@ -189,39 +189,55 @@ export default {
//
this.$store.dispatch('socket/setJointRoomInfo');
},
async checkUserState(user, operate) {
switch (operate) {
case 'add':
this.$store.dispatch('socket/setChatContent', {roomTip: `${user.nickName}进入房间`});
break;
case 'upd':
if (!user.inRoom) {
this.$store.dispatch('socket/setChatContent', {roomTip: `${user.nickName}退出房间`});
async checkUserState(user, old) {
const message = {
join: true,
id: user.id,
userName: user.nickName,
userRole: user.userRole,
name: user.name,
roomTip: '',
chatInfo: true,
inSimulation: user.inSimulation,
inRoom: user.inRoom,
session: 'session',
oneself: user.id === this.$store.state.user.id
};
if (old) {
if (old.userRole) {
if (!user.inRoom) {
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}退出房间`});
if (this.userId == user.id) {
this.jumpOutRoom();
}
}
if (!old.inRoom && user.inRoom) {
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}进入房间`});
}
if (user.inSimulation) {
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}进入仿真`});
if (this.userId == user.id) {
this.jumpInSimulation();
}
}
} else {
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}被提出房间`});
if (this.userId == user.id) {
this.jumpOutRoom();
}
}
if (user.inSimulation) {
this.$store.dispatch('socket/setChatContent', {roomTip: `${user.nickName}进入仿真`});
if (this.userId == user.id) {
this.jumpInSimulation();
}
}
break;
case 'del':
this.$store.dispatch('socket/setChatContent', {roomTip: `${user.nickName}被提出房间`});
if (this.userId == user.id) {
this.jumpOutRoom();
}
break;
} else {
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}进入房间`});
}
},
async jumpInSimulation() {
const room = this.room;
await putJointTrainingSimulationEntrance(room.group);
const rest = await getPublishMapInfo(room.mapId);
const query = { skinCode: rest.data.skinCode, mapId: room.mapId, group: room.group, subSystem: this.$route.query.subSystem };
const query = { skinCode: rest.data.lineCode, mapId: room.mapId, group: room.group, subSystem: this.$route.query.subSystem };
this.$router.replace({ path: `/jointTraining`, query: query });
launchFullscreen();
//