This commit is contained in:
zyy 2020-07-13 14:37:43 +08:00
commit 321c59b155
14 changed files with 182 additions and 65 deletions

View File

@ -31,6 +31,11 @@ export default {
this.subscribeMessage(val);
}
},
'$store.state.socket.roomInvite': function (val) {
if (val.creator) {
this.subscribeMessage(val);
}
},
'$store.state.socket.beLogoutCount': async function(val) {
this.$store.dispatch('disconnect').then(()=>{
this.$alert(this.$t('tip.logoutTips'), this.$t('tip.hint'), {
@ -74,6 +79,7 @@ export default {
this.$refs.deomonTopic.doShow(res);
}
this.$store.dispatch('socket/setSimulationInvite');
this.$store.dispatch('socket/setRoomInvite');
}
},
subscribe() {

View File

@ -96,8 +96,8 @@ export default {
synthesisTrainingTitle: 'Synthesis Training Fast Entrance',
pleaseChooseRoom: 'You did not choose a room',
inviteJoinRoom: 'Invite you to join the synthesis training!',
trainingHasStart: "{name}'s room (starting)",
trainingNotStart: "{name}'s room (not starting)",
trainingHasStart: "{name}'s room",
trainingNotStart: "{name}'s room",
inputRoomNumber: 'Please enter the room number.',
chooseRoom: 'Choose Room',
codeError: 'The captcha is incorrect',

View File

@ -97,8 +97,8 @@ export default {
synthesisTrainingTitle: '综合演练快速入口',
pleaseChooseRoom: '您没有选择房间',
inviteJoinRoom: '邀请你加入综合演练!',
trainingHasStart: '{name}的房间(已开始)',
trainingNotStart: '{name}的房间(未开始)',
trainingHasStart: '{name}的房间',
trainingNotStart: '{name}的房间',
inputRoomNumber: '请输入房间号',
chooseRoom: '选择房间',
month: '月',

View File

@ -1,7 +1,7 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-cancel ref="menuCancel" />
<menu-bar v-if="isShowBar" ref="menuBar" :selected="selected" />
<menu-bar v-if="$store.state.training.prdType === '01'" ref="menuBar" :selected="selected" />
<!--<menu-station-stand ref="menuStationStand" :selected="selected" />-->
<!--<menu-switch ref="menuSwitch" :selected="selected" />-->
<!--<menu-signal ref="menuSignal" :selected="selected" />-->

View File

@ -84,14 +84,6 @@ export default {
oldClickObj: null, //
route: null, //
centralizedStationList: new Array(15).fill({}),
routeParamList: [
{ name: 'ATP进路', cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, operate: OperationEvent.Signal.arrangementRoute.menu, show: false },
{ name: '取消ATP', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, operate: OperationEvent.Signal.cancelTrainRoute.menu, show: false },
{ name: '联锁进路', cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, operate: OperationEvent.Signal.arrangementRoute.menu, show: false },
{ name: '取消联锁', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, operate: OperationEvent.Signal.cancelTrainRoute.menu, show: false },
{ name: '引导进路', cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, operate: OperationEvent.Signal.guide.menu, show: false },
{ name: '取消引导', cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE, operate: OperationEvent.Signal.humanTrainRoute.menu, show: false }
],
ciStationParamList: []
};
},
@ -167,6 +159,20 @@ export default {
{ name: '自排全关', cmdType: CMD.Section.CMD_SECTION_BLOCK, operate: OperationEvent.Signal.cancelTrainRoute.menu, show: false }, //
{ name: '关站信号', cmdType: CMD.Section.CMD_SECTION_BLOCK, operate: OperationEvent.Signal.cancelTrainRoute.menu, show: false } //
];
},
routeParamList() {
if (this.$store.state.training.prdType === '01') {
return [
{ name: 'ATP进路', cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, operate: OperationEvent.Signal.arrangementRoute.menu, show: false },
{ name: '取消ATP', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, operate: OperationEvent.Signal.cancelTrainRoute.menu, show: false },
{ name: '联锁进路', cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, operate: OperationEvent.Signal.arrangementRoute.menu, show: false },
{ name: '取消联锁', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, operate: OperationEvent.Signal.cancelTrainRoute.menu, show: false },
{ name: '引导进路', cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, operate: OperationEvent.Signal.guide.menu, show: false },
{ name: '取消引导', cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE, operate: OperationEvent.Signal.humanTrainRoute.menu, show: false }
];
} else if (this.$store.state.training.prdType === '02' ) {
return;
}
}
},
watch: {
@ -321,6 +327,9 @@ export default {
this.route = null;
this.routeList.forEach(item => {
if (item.startSignalCode == this.oldClickObj.code && item.endSignalCode == this.selected.code) {
const startSignal = this.$store.getters['map/getDeviceByCode'](item.startSignalCode);
const endSignal = this.$store.getters['map/getDeviceByCode'](item.endSignalCode);
console.log(startSignal, endSignal);
this.route = item;
}
});

View File

@ -1,6 +1,7 @@
<template>
<el-dialog v-dialogDrag title="选择仿真" :visible.sync="dialogShow" width="30%" center>
<el-input v-model="input" placeholder="请输入仿真号" />
<el-checkbox v-if="!isShow" v-model="isNewMap">是否新版地图房间</el-checkbox>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
<el-button v-loading="loading" :disabled="!input.length" type="primary" @click="comit">{{ $t('global.confirm') }}</el-button>
@ -10,6 +11,7 @@
<script>
import { jointSimulationByPermission } from '@/api/jointSimulation';
import { getPermissionJoint } from '@/api/chat';
export default {
name: 'Dashboard',
@ -17,7 +19,8 @@ export default {
return {
input: '',
dialogShow: false,
loading: false
loading: false,
isNewMap: true
};
},
computed: {
@ -35,7 +38,11 @@ export default {
async comit() {
try {
this.loading = true;
await jointSimulationByPermission(`${this.input}`);
if (this.isNewMap || this.isShow) {
await jointSimulationByPermission(`${this.input}`);
} else {
await getPermissionJoint(`${this.input}`);
}
this.dialogShow = false;
} catch (error) {
const errorMessage = this.isShow ? this.$t('tip.failedToAddNewRoom') : this.$t('error.scanningError');

View File

@ -87,6 +87,9 @@ function handle(state, data) {
case 'Simulation_Invite': // 综合演练-仿真邀请消息
state.simulationInvite = msg;
break;
case 'JointTraining_Room_Invite': // 综合演练室-房间邀请消息
state.roomInvite = msg;
break;
case 'Big_Screen_Simulation_DeviceStatus': // 大屏仿真状态数据
state.equipmentStatus = msg;
break;
@ -253,7 +256,8 @@ const socket = {
realDeviceInfo: 0, // 真实设备信息
beLogoutCount: 0, // 被登出
runPlanReloadCount: 0, // 仿真运行图变更
memberChangeCount: 0 // 仿真成员变更
memberChangeCount: 0, // 仿真成员变更
roomInvite: {}
},
getters: {
},
@ -298,6 +302,9 @@ const socket = {
setSimulationInvite: (state, simulationInvite) => {
state.simulationInvite = simulationInvite;
},
setRoomInvite: (state, roomInvite) => {
state.roomInvite = roomInvite;
},
setRoomSubscribe:(state, roomIsSubscribe)=>{
state.roomIsSubscribe = roomIsSubscribe;
},
@ -341,7 +348,9 @@ const socket = {
setSimulationInvite: ({ commit }) => {
commit('setSimulationInvite', {});
},
setRoomInvite: ({ commit }) => {
commit('setRoomInvite', {});
},
setMessage: ({ state }, data) => {
if (!state.message[data.key]) {
state.message[data.key] = [];

View File

@ -2,9 +2,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.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.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -22,8 +22,7 @@
:style="{height: height+'px'}"
>
<div slot-scope="{ node, data }" class="list-elem custom-tree-node">
<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>
<span>{{ '['+data.map.name+']'+($t('global.trainingHasStart').replace('{name}', data.creator.nickname)) }}</span>
<el-button
type="text"
size="mini"
@ -43,6 +42,8 @@
</template>
<script>
import { getjointTrainList, getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
import { getPublishMapInfo } from '@/api/jmap/map';
import { getSimulationListCantainUser } from '@/api/jointSimulation';
import { launchFullscreen } from '@/utils/screen';
import { getToken } from '@/utils/auth';
@ -115,9 +116,17 @@ export default {
},
async handleJoinRoom(data) {
try {
const rest = await getPublishMapInfo(data.map.id);
launchFullscreen();
const query = { lineCode: data.map.lineCode, mapId: data.map.id, group: data.group};
this.$router.push({path:'/jointTrainingNew', query:query});
if (rest.data.drawWay) {
const query = { lineCode: data.map.lineCode, mapId: data.map.id, group: data.group};
this.$router.push({path:'/jointTrainingNew', query:query});
} else {
await getjointTraining(data.group);
const query = { group: data.group, drawWay: rest.data.drawWay };
this.$router.push({ path: `/trainroom`, query: query });
}
} catch (e) {
console.error(e);
} finally {

View File

@ -19,6 +19,10 @@
<script>
import { launchFullscreen } from '@/utils/screen';
import { getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
import { getPublishMapInfo } from '@/api/jmap/map';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
// 仿
export default {
name: 'DeomonList',
@ -27,6 +31,7 @@ export default {
dialogShow: false,
group: '',
roomName: '',
state: '',
mapId: '',
lineCode: '',
loading: false
@ -46,20 +51,49 @@ export default {
doShow(data) {
this.roomName = data.creator.nickname;
this.group = data.group;
this.mapId = data.map.id;
this.lineCode = data.map.lineCode;
this.mapId = data.mapId || data.map.id;
this.lineCode = (data.map || {}).lineCode;
this.state = data.state;
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;
launchFullscreen();
const query = { lineCode: this.lineCode, mapId: this.mapId, group: this.group};
this.$router.push({path: `/jointTrainingNew`, query: query});
const rest = await getPublishMapInfo(this.mapId);
const drawWay = rest.data.drawWay;
if (drawWay) {
launchFullscreen();
const query = { lineCode: this.lineCode, mapId: this.mapId, group: this.group};
this.$router.push({path: `/jointTrainingNew`, query: query});
} 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 };
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;
} catch (e) {
this.$messageBox(this.$t('tip.enterTrainingRoomFailed'));

View File

@ -17,6 +17,8 @@
<el-button v-if="!isLocal" type="success" :disabled="disabled" @click="buy">{{ $t('global.buy') }}</el-button>
<el-button v-if="hasPermssion && !isComprehensive && !isLocal" type="primary" :disabled="disabled" @click="distribute">{{ $t('global.distributePermission') }}</el-button>
<el-button v-show="isStartDemon" :disabled="disabled" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button>
<el-button v-show="isCreateRoom" :disabled="disabled" type="primary" @click="start">{{ $t('demonstration.createRoom') }}</el-button>
<el-button v-show="isInRoom" :disabled="disabled" type="primary" @click="joinRoom">{{ $t('demonstration.enterRoom') }}</el-button>
</div>
</div>
</template>
@ -26,12 +28,13 @@ import { getPublishMapInfo } from '@/api/jmap/map';
import { getGoodsTryUse } from '@/api/management/goods';
import { PermissionType, UrlConfig } from '@/scripts/ConstDic';
import { launchFullscreen } from '@/utils/screen';
import { } from '@/scripts/ConstDic';
import { simulationNotify, schedulingNotify, createSimulationNew } from '@/api/simulation';
import LimitList from '@/views/components/limits/index';
import { getSubSystemDetail } from '@/api/trainingPlatform';
import { getSessionStorage } from '@/utils/auth';
import localStore from 'storejs';
import { postCreateRoom, getjointTraining } from '@/api/chat';
import { checkRoomExistNew } from '@/api/jointTraining';
export default {
name: 'ExamDetailList',
@ -57,6 +60,8 @@ export default {
prdType: '',
pmsList: []
},
jointShow: false,
jointGroup: '',
lineCode:'',
drawWay: false //
};
@ -82,13 +87,19 @@ export default {
return this.courseModel.prdType === '03';
},
isStartDemon() {
return this.hasPermssion || this.tryTime > 0;
return (this.hasPermssion || this.tryTime > 0) && !(this.courseModel.prdType === '03' && !this.drawWay);
},
mapId() {
return this.$route.query.mapId;
},
project() {
return getSessionStorage('project');
},
isCreateRoom() {
return this.courseModel.prdType === '03' && this.hasPermssion && !this.jointShow && !this.drawWay;
},
isInRoom() {
return this.courseModel.prdType === '03' && this.hasPermssion && this.jointShow && !this.drawWay;
}
},
watch: {
@ -139,6 +150,9 @@ export default {
PermissionType: PermissionType.SIMULATION
};
this.currentPrdType = resp.data.prdType;
if (resp.data.prdType === '03' && !this.drawWay) {
this.getJointTrainingList();
}
if (!this.courseModel.pmsList) {
this.tryUser = 1;
const paras = {
@ -167,6 +181,53 @@ export default {
refresh() {
this.loadInitData();
},
async getJointTrainingList() {
try {
if (this.mapId) {
const res = await checkRoomExistNew({mapId: this.mapId});
this.jointGroup = res.data;
this.jointShow = false;
if (res.data) {
this.jointShow = true;
}
}
} catch (error) {
console.error(error, '获取是否拥有综合演练房间');
}
},
async joinRoom() {
this.disabled = true;
await getjointTraining(this.jointGroup);
this.$store.dispatch('socket/setInRoom', true);
const query = { lineCode: this.courseModel.lineCode, group: this.jointGroup, drawWay: this.drawWay};
this.$router.push({ path: `/trainroom`, query: query });
},
async createRoom() {
try {
this.disabled = true;
const param = {
mapId: Number(this.mapId),
prdType: this.courseModel.prdType
};
const res = await postCreateRoom(param);
if (res && res.code == 200) {
const query = { lineCode: this.courseModel.lineCode, group: res.data, drawWay: this.drawWay };
this.$router.push({ path: `/trainroom`, query: query });
}
} catch (error) {
this.disabled = false;
if (error.code == 20001) {
this.$confirm(this.$t('tip.createRoomFailedHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {}).catch(() => {});
}
if (error.code == 500009) {
this.$messageBox(error.message);
}
}
},
async enterIntegratedSimulation() {
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
createSimulationNew(data).then(resp => {
@ -210,7 +271,8 @@ export default {
if (this.courseModel.prdType == '05') {
this.jumpScheduling();
} else if (this.courseModel.prdType == '03') {
this.enterIntegratedSimulation();
this.drawWay && this.enterIntegratedSimulation();
!this.drawWay && this.createRoom();
} else if (this.courseModel.prdType == '06') {
this.enterISCS();
} else if (this.courseModel.prdType == '07') {

View File

@ -50,7 +50,7 @@ export default {
},
methods:{
computedStyle(member) {
const userId = this.memberData[member.memberId].userId;
const userId = (this.memberData[member.memberId] || {}).userId;
if (userId && userId == this.userId) {
return {color: 'red'};
} else {

View File

@ -7,7 +7,7 @@
<script>
import PopMenu from '@/components/PopMenu';
import { DeviceMenu } from '@/scripts/ConstDic';
import { kickOutMember } from '@/api/jointSimulation';
import { putJointTrainingUserkicked } from '@/api/chat';
export default {
components: {
@ -17,18 +17,14 @@ export default {
clickUserId: {
type: String,
default: ''
},
menuDisabled: {
type: Boolean,
default: false
}
},
data() {
return {
// menu: [{
// label: this.$t('trainRoom.kickOutTheRoom'),
// handler: this.kicked
// }]
menu: [{
label: this.$t('trainRoom.kickOutTheRoom'),
handler: this.kicked
}]
};
},
computed: {
@ -40,13 +36,6 @@ export default {
},
drawWay() {
return this.$route.query.drawWay + '';
},
menu() {
return [{
label: this.$t('trainRoom.kickOutTheRoom'),
handler: this.kicked,
disabled: this.menuDisabled
}];
}
},
watch: {
@ -83,7 +72,7 @@ export default {
},
async kicked() {
try {
await kickOutMember(this.$route.query.group, this.clickUserId);
await putJointTrainingUserkicked(this.clickUserId, this.$route.query.group);
} catch (error) {
console.error(error);
}

View File

@ -16,13 +16,13 @@
@node-contextmenu="handleShowContextMenu"
>
<span slot-scope="{ node, data }">
<span v-if="node.data.online" style="color: green;">{{ data.nickName + (data.admin? '管理员':'') + (data.referee? '裁判员':'') + (data.deviceVO? ` -- (${data.deviceVO.code})`:'') }}</span>
<span v-else style="color: #ccc;">{{ data.nickName + (data.admin? '【管理员】':'') + (data.referee? '【裁判员】':'') + (data.deviceVO? ` -- (${data.deviceVO.code})`:'') }}</span>
<span v-if="node.data.inRoom" style="color: green;">{{ data.nickName }}</span>
<span v-else style="color: #ccc;">{{ data.nickName }}</span>
</span>
</el-tree>
</el-scrollbar>
</div>
<content-menu ref="menu" :click-user-id="clickUserId" :menu-disabled="menuDisabled" />
<content-menu ref="menu" :click-user-id="clickUserId" />
</div>
</template>
@ -46,19 +46,12 @@ export default {
height: {
type: Number,
required: true
},
isAdmin: {
type: Boolean,
default() {
return false;
}
}
},
data() {
return {
filterText: '',
clickUserId: '',
menuDisabled: false
clickUserId: ''
};
},
computed: {
@ -86,9 +79,8 @@ export default {
x: e.clientX,
y: e.clientY
};
if (this.isAdmin) {
this.clickUserId = `${obj.userId || ''}`;
this.menuDisabled = !!obj.deviceVO;
if (this.userId == this.room.creatorId) {
this.clickUserId = `${obj.id || ''}`;
this.$store.dispatch('menuOperation/setPopMenu', { position, menu: DeviceMenu.JointRoom });
}
}
@ -129,8 +121,8 @@ export default {
&--list {
background: #fff;
height: auto;
min-height: calc(100% - 200px);
max-height: calc(100% - 200px);
min-height: calc(100% - 40px);
max-height: calc(100% - 40px);
border-bottom: 1px #ccc solid;
&::-webkit-scrollbar {