Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
321c59b155
@ -31,6 +31,11 @@ export default {
|
|||||||
this.subscribeMessage(val);
|
this.subscribeMessage(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'$store.state.socket.roomInvite': function (val) {
|
||||||
|
if (val.creator) {
|
||||||
|
this.subscribeMessage(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
'$store.state.socket.beLogoutCount': async function(val) {
|
'$store.state.socket.beLogoutCount': async function(val) {
|
||||||
this.$store.dispatch('disconnect').then(()=>{
|
this.$store.dispatch('disconnect').then(()=>{
|
||||||
this.$alert(this.$t('tip.logoutTips'), this.$t('tip.hint'), {
|
this.$alert(this.$t('tip.logoutTips'), this.$t('tip.hint'), {
|
||||||
@ -74,6 +79,7 @@ export default {
|
|||||||
this.$refs.deomonTopic.doShow(res);
|
this.$refs.deomonTopic.doShow(res);
|
||||||
}
|
}
|
||||||
this.$store.dispatch('socket/setSimulationInvite');
|
this.$store.dispatch('socket/setSimulationInvite');
|
||||||
|
this.$store.dispatch('socket/setRoomInvite');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
subscribe() {
|
subscribe() {
|
||||||
|
@ -96,8 +96,8 @@ export default {
|
|||||||
synthesisTrainingTitle: 'Synthesis Training Fast Entrance',
|
synthesisTrainingTitle: 'Synthesis Training Fast Entrance',
|
||||||
pleaseChooseRoom: 'You did not choose a room',
|
pleaseChooseRoom: 'You did not choose a room',
|
||||||
inviteJoinRoom: 'Invite you to join the synthesis training!',
|
inviteJoinRoom: 'Invite you to join the synthesis training!',
|
||||||
trainingHasStart: "{name}'s room (starting)",
|
trainingHasStart: "{name}'s room",
|
||||||
trainingNotStart: "{name}'s room (not starting)",
|
trainingNotStart: "{name}'s room",
|
||||||
inputRoomNumber: 'Please enter the room number.',
|
inputRoomNumber: 'Please enter the room number.',
|
||||||
chooseRoom: 'Choose Room',
|
chooseRoom: 'Choose Room',
|
||||||
codeError: 'The captcha is incorrect',
|
codeError: 'The captcha is incorrect',
|
||||||
|
@ -97,8 +97,8 @@ export default {
|
|||||||
synthesisTrainingTitle: '综合演练快速入口',
|
synthesisTrainingTitle: '综合演练快速入口',
|
||||||
pleaseChooseRoom: '您没有选择房间',
|
pleaseChooseRoom: '您没有选择房间',
|
||||||
inviteJoinRoom: '邀请你加入综合演练!',
|
inviteJoinRoom: '邀请你加入综合演练!',
|
||||||
trainingHasStart: '{name}的房间(已开始)',
|
trainingHasStart: '{name}的房间',
|
||||||
trainingNotStart: '{name}的房间(未开始)',
|
trainingNotStart: '{name}的房间',
|
||||||
inputRoomNumber: '请输入房间号',
|
inputRoomNumber: '请输入房间号',
|
||||||
chooseRoom: '选择房间',
|
chooseRoom: '选择房间',
|
||||||
month: '月',
|
month: '月',
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="menus" :style="{width: width + 'px'}">
|
<div class="menus" :style="{width: width + 'px'}">
|
||||||
<menu-cancel ref="menuCancel" />
|
<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-station-stand ref="menuStationStand" :selected="selected" />-->
|
||||||
<!--<menu-switch ref="menuSwitch" :selected="selected" />-->
|
<!--<menu-switch ref="menuSwitch" :selected="selected" />-->
|
||||||
<!--<menu-signal ref="menuSignal" :selected="selected" />-->
|
<!--<menu-signal ref="menuSignal" :selected="selected" />-->
|
||||||
|
@ -84,14 +84,6 @@ export default {
|
|||||||
oldClickObj: null, // 上一次点击对象
|
oldClickObj: null, // 上一次点击对象
|
||||||
route: null, // 进路对象
|
route: null, // 进路对象
|
||||||
centralizedStationList: new Array(15).fill({}),
|
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: []
|
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 }, // 流程未处理
|
||||||
{ 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: {
|
watch: {
|
||||||
@ -321,6 +327,9 @@ export default {
|
|||||||
this.route = null;
|
this.route = null;
|
||||||
this.routeList.forEach(item => {
|
this.routeList.forEach(item => {
|
||||||
if (item.startSignalCode == this.oldClickObj.code && item.endSignalCode == this.selected.code) {
|
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;
|
this.route = item;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-dialogDrag title="选择仿真" :visible.sync="dialogShow" width="30%" center>
|
<el-dialog v-dialogDrag title="选择仿真" :visible.sync="dialogShow" width="30%" center>
|
||||||
<el-input v-model="input" placeholder="请输入仿真号" />
|
<el-input v-model="input" placeholder="请输入仿真号" />
|
||||||
|
<el-checkbox v-if="!isShow" v-model="isNewMap">是否新版地图房间</el-checkbox>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
<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>
|
<el-button v-loading="loading" :disabled="!input.length" type="primary" @click="comit">{{ $t('global.confirm') }}</el-button>
|
||||||
@ -10,6 +11,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { jointSimulationByPermission } from '@/api/jointSimulation';
|
import { jointSimulationByPermission } from '@/api/jointSimulation';
|
||||||
|
import { getPermissionJoint } from '@/api/chat';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Dashboard',
|
name: 'Dashboard',
|
||||||
@ -17,7 +19,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
input: '',
|
input: '',
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false
|
loading: false,
|
||||||
|
isNewMap: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -35,7 +38,11 @@ export default {
|
|||||||
async comit() {
|
async comit() {
|
||||||
try {
|
try {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
if (this.isNewMap || this.isShow) {
|
||||||
await jointSimulationByPermission(`${this.input}`);
|
await jointSimulationByPermission(`${this.input}`);
|
||||||
|
} else {
|
||||||
|
await getPermissionJoint(`${this.input}`);
|
||||||
|
}
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const errorMessage = this.isShow ? this.$t('tip.failedToAddNewRoom') : this.$t('error.scanningError');
|
const errorMessage = this.isShow ? this.$t('tip.failedToAddNewRoom') : this.$t('error.scanningError');
|
||||||
|
@ -87,6 +87,9 @@ function handle(state, data) {
|
|||||||
case 'Simulation_Invite': // 综合演练-仿真邀请消息
|
case 'Simulation_Invite': // 综合演练-仿真邀请消息
|
||||||
state.simulationInvite = msg;
|
state.simulationInvite = msg;
|
||||||
break;
|
break;
|
||||||
|
case 'JointTraining_Room_Invite': // 综合演练室-房间邀请消息
|
||||||
|
state.roomInvite = msg;
|
||||||
|
break;
|
||||||
case 'Big_Screen_Simulation_DeviceStatus': // 大屏仿真状态数据
|
case 'Big_Screen_Simulation_DeviceStatus': // 大屏仿真状态数据
|
||||||
state.equipmentStatus = msg;
|
state.equipmentStatus = msg;
|
||||||
break;
|
break;
|
||||||
@ -253,7 +256,8 @@ const socket = {
|
|||||||
realDeviceInfo: 0, // 真实设备信息
|
realDeviceInfo: 0, // 真实设备信息
|
||||||
beLogoutCount: 0, // 被登出
|
beLogoutCount: 0, // 被登出
|
||||||
runPlanReloadCount: 0, // 仿真运行图变更
|
runPlanReloadCount: 0, // 仿真运行图变更
|
||||||
memberChangeCount: 0 // 仿真成员变更
|
memberChangeCount: 0, // 仿真成员变更
|
||||||
|
roomInvite: {}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
},
|
},
|
||||||
@ -298,6 +302,9 @@ const socket = {
|
|||||||
setSimulationInvite: (state, simulationInvite) => {
|
setSimulationInvite: (state, simulationInvite) => {
|
||||||
state.simulationInvite = simulationInvite;
|
state.simulationInvite = simulationInvite;
|
||||||
},
|
},
|
||||||
|
setRoomInvite: (state, roomInvite) => {
|
||||||
|
state.roomInvite = roomInvite;
|
||||||
|
},
|
||||||
setRoomSubscribe:(state, roomIsSubscribe)=>{
|
setRoomSubscribe:(state, roomIsSubscribe)=>{
|
||||||
state.roomIsSubscribe = roomIsSubscribe;
|
state.roomIsSubscribe = roomIsSubscribe;
|
||||||
},
|
},
|
||||||
@ -341,7 +348,9 @@ const socket = {
|
|||||||
setSimulationInvite: ({ commit }) => {
|
setSimulationInvite: ({ commit }) => {
|
||||||
commit('setSimulationInvite', {});
|
commit('setSimulationInvite', {});
|
||||||
},
|
},
|
||||||
|
setRoomInvite: ({ commit }) => {
|
||||||
|
commit('setRoomInvite', {});
|
||||||
|
},
|
||||||
setMessage: ({ state }, data) => {
|
setMessage: ({ state }, data) => {
|
||||||
if (!state.message[data.key]) {
|
if (!state.message[data.key]) {
|
||||||
state.message[data.key] = [];
|
state.message[data.key] = [];
|
||||||
|
@ -2,9 +2,9 @@ export function getBaseUrl() {
|
|||||||
let BASE_API;
|
let BASE_API;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// 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.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.41:9000'; // 张赛
|
||||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||||
|
@ -22,8 +22,7 @@
|
|||||||
: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.map.name+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickname)) }}</span>
|
<span>{{ '['+data.map.name+']'+($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,6 +42,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getjointTrainList, getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
|
||||||
|
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||||
import { getSimulationListCantainUser } from '@/api/jointSimulation';
|
import { getSimulationListCantainUser } from '@/api/jointSimulation';
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
import { launchFullscreen } from '@/utils/screen';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
@ -115,9 +116,17 @@ export default {
|
|||||||
},
|
},
|
||||||
async handleJoinRoom(data) {
|
async handleJoinRoom(data) {
|
||||||
try {
|
try {
|
||||||
|
const rest = await getPublishMapInfo(data.map.id);
|
||||||
launchFullscreen();
|
launchFullscreen();
|
||||||
|
if (rest.data.drawWay) {
|
||||||
const query = { lineCode: data.map.lineCode, mapId: data.map.id, group: data.group};
|
const query = { lineCode: data.map.lineCode, mapId: data.map.id, group: data.group};
|
||||||
this.$router.push({path:'/jointTrainingNew', query:query});
|
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) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
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 {
|
export default {
|
||||||
name: 'DeomonList',
|
name: 'DeomonList',
|
||||||
@ -27,6 +31,7 @@ export default {
|
|||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
group: '',
|
group: '',
|
||||||
roomName: '',
|
roomName: '',
|
||||||
|
state: '',
|
||||||
mapId: '',
|
mapId: '',
|
||||||
lineCode: '',
|
lineCode: '',
|
||||||
loading: false
|
loading: false
|
||||||
@ -46,20 +51,49 @@ 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.mapId = data.map.id;
|
this.mapId = data.mapId || data.map.id;
|
||||||
this.lineCode = data.map.lineCode;
|
this.lineCode = (data.map || {}).lineCode;
|
||||||
|
this.state = data.state;
|
||||||
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) {
|
||||||
launchFullscreen();
|
launchFullscreen();
|
||||||
const query = { lineCode: this.lineCode, mapId: this.mapId, group: this.group};
|
const query = { lineCode: this.lineCode, mapId: this.mapId, group: this.group};
|
||||||
this.$router.push({path: `/jointTrainingNew`, query: query});
|
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;
|
this.dialogShow = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$messageBox(this.$t('tip.enterTrainingRoomFailed'));
|
this.$messageBox(this.$t('tip.enterTrainingRoomFailed'));
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
<el-button v-if="!isLocal" type="success" :disabled="disabled" @click="buy">{{ $t('global.buy') }}</el-button>
|
<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-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="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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -26,12 +28,13 @@ import { getPublishMapInfo } from '@/api/jmap/map';
|
|||||||
import { getGoodsTryUse } from '@/api/management/goods';
|
import { getGoodsTryUse } from '@/api/management/goods';
|
||||||
import { PermissionType, UrlConfig } from '@/scripts/ConstDic';
|
import { PermissionType, UrlConfig } from '@/scripts/ConstDic';
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
import { launchFullscreen } from '@/utils/screen';
|
||||||
import { } from '@/scripts/ConstDic';
|
|
||||||
import { simulationNotify, schedulingNotify, createSimulationNew } from '@/api/simulation';
|
import { simulationNotify, schedulingNotify, createSimulationNew } from '@/api/simulation';
|
||||||
import LimitList from '@/views/components/limits/index';
|
import LimitList from '@/views/components/limits/index';
|
||||||
import { getSubSystemDetail } from '@/api/trainingPlatform';
|
import { getSubSystemDetail } from '@/api/trainingPlatform';
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
|
import { postCreateRoom, getjointTraining } from '@/api/chat';
|
||||||
|
import { checkRoomExistNew } from '@/api/jointTraining';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ExamDetailList',
|
name: 'ExamDetailList',
|
||||||
@ -57,6 +60,8 @@ export default {
|
|||||||
prdType: '',
|
prdType: '',
|
||||||
pmsList: []
|
pmsList: []
|
||||||
},
|
},
|
||||||
|
jointShow: false,
|
||||||
|
jointGroup: '',
|
||||||
lineCode:'',
|
lineCode:'',
|
||||||
drawWay: false // 是否新版地图
|
drawWay: false // 是否新版地图
|
||||||
};
|
};
|
||||||
@ -82,13 +87,19 @@ export default {
|
|||||||
return this.courseModel.prdType === '03';
|
return this.courseModel.prdType === '03';
|
||||||
},
|
},
|
||||||
isStartDemon() {
|
isStartDemon() {
|
||||||
return this.hasPermssion || this.tryTime > 0;
|
return (this.hasPermssion || this.tryTime > 0) && !(this.courseModel.prdType === '03' && !this.drawWay);
|
||||||
},
|
},
|
||||||
mapId() {
|
mapId() {
|
||||||
return this.$route.query.mapId;
|
return this.$route.query.mapId;
|
||||||
},
|
},
|
||||||
project() {
|
project() {
|
||||||
return getSessionStorage('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: {
|
watch: {
|
||||||
@ -139,6 +150,9 @@ export default {
|
|||||||
PermissionType: PermissionType.SIMULATION
|
PermissionType: PermissionType.SIMULATION
|
||||||
};
|
};
|
||||||
this.currentPrdType = resp.data.prdType;
|
this.currentPrdType = resp.data.prdType;
|
||||||
|
if (resp.data.prdType === '03' && !this.drawWay) {
|
||||||
|
this.getJointTrainingList();
|
||||||
|
}
|
||||||
if (!this.courseModel.pmsList) {
|
if (!this.courseModel.pmsList) {
|
||||||
this.tryUser = 1;
|
this.tryUser = 1;
|
||||||
const paras = {
|
const paras = {
|
||||||
@ -167,6 +181,53 @@ export default {
|
|||||||
refresh() {
|
refresh() {
|
||||||
this.loadInitData();
|
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() {
|
async enterIntegratedSimulation() {
|
||||||
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
|
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
|
||||||
createSimulationNew(data).then(resp => {
|
createSimulationNew(data).then(resp => {
|
||||||
@ -210,7 +271,8 @@ export default {
|
|||||||
if (this.courseModel.prdType == '05') {
|
if (this.courseModel.prdType == '05') {
|
||||||
this.jumpScheduling();
|
this.jumpScheduling();
|
||||||
} else if (this.courseModel.prdType == '03') {
|
} else if (this.courseModel.prdType == '03') {
|
||||||
this.enterIntegratedSimulation();
|
this.drawWay && this.enterIntegratedSimulation();
|
||||||
|
!this.drawWay && this.createRoom();
|
||||||
} else if (this.courseModel.prdType == '06') {
|
} else if (this.courseModel.prdType == '06') {
|
||||||
this.enterISCS();
|
this.enterISCS();
|
||||||
} else if (this.courseModel.prdType == '07') {
|
} else if (this.courseModel.prdType == '07') {
|
||||||
|
@ -50,7 +50,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
computedStyle(member) {
|
computedStyle(member) {
|
||||||
const userId = this.memberData[member.memberId].userId;
|
const userId = (this.memberData[member.memberId] || {}).userId;
|
||||||
if (userId && userId == this.userId) {
|
if (userId && userId == this.userId) {
|
||||||
return {color: 'red'};
|
return {color: 'red'};
|
||||||
} else {
|
} else {
|
||||||
|
@ -7,7 +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 { kickOutMember } from '@/api/jointSimulation';
|
import { putJointTrainingUserkicked } from '@/api/chat';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -17,18 +17,14 @@ export default {
|
|||||||
clickUserId: {
|
clickUserId: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
|
||||||
menuDisabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// menu: [{
|
menu: [{
|
||||||
// label: this.$t('trainRoom.kickOutTheRoom'),
|
label: this.$t('trainRoom.kickOutTheRoom'),
|
||||||
// handler: this.kicked
|
handler: this.kicked
|
||||||
// }]
|
}]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -40,13 +36,6 @@ export default {
|
|||||||
},
|
},
|
||||||
drawWay() {
|
drawWay() {
|
||||||
return this.$route.query.drawWay + '';
|
return this.$route.query.drawWay + '';
|
||||||
},
|
|
||||||
menu() {
|
|
||||||
return [{
|
|
||||||
label: this.$t('trainRoom.kickOutTheRoom'),
|
|
||||||
handler: this.kicked,
|
|
||||||
disabled: this.menuDisabled
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -83,7 +72,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async kicked() {
|
async kicked() {
|
||||||
try {
|
try {
|
||||||
await kickOutMember(this.$route.query.group, this.clickUserId);
|
await putJointTrainingUserkicked(this.clickUserId, this.$route.query.group);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
@node-contextmenu="handleShowContextMenu"
|
@node-contextmenu="handleShowContextMenu"
|
||||||
>
|
>
|
||||||
<span slot-scope="{ node, data }">
|
<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-if="node.data.inRoom" style="color: green;">{{ data.nickName }}</span>
|
||||||
<span v-else style="color: #ccc;">{{ data.nickName + (data.admin? '【管理员】':'') + (data.referee? '【裁判员】':'') + (data.deviceVO? ` -- (${data.deviceVO.code})`:'') }}</span>
|
<span v-else style="color: #ccc;">{{ data.nickName }}</span>
|
||||||
</span>
|
</span>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<content-menu ref="menu" :click-user-id="clickUserId" :menu-disabled="menuDisabled" />
|
<content-menu ref="menu" :click-user-id="clickUserId" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -46,19 +46,12 @@ export default {
|
|||||||
height: {
|
height: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
},
|
|
||||||
isAdmin: {
|
|
||||||
type: Boolean,
|
|
||||||
default() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
filterText: '',
|
filterText: '',
|
||||||
clickUserId: '',
|
clickUserId: ''
|
||||||
menuDisabled: false
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -86,9 +79,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.menuDisabled = !!obj.deviceVO;
|
|
||||||
this.$store.dispatch('menuOperation/setPopMenu', { position, menu: DeviceMenu.JointRoom });
|
this.$store.dispatch('menuOperation/setPopMenu', { position, menu: DeviceMenu.JointRoom });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,8 +121,8 @@ export default {
|
|||||||
&--list {
|
&--list {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
height: auto;
|
height: auto;
|
||||||
min-height: calc(100% - 200px);
|
min-height: calc(100% - 40px);
|
||||||
max-height: calc(100% - 200px);
|
max-height: calc(100% - 40px);
|
||||||
border-bottom: 1px #ccc solid;
|
border-bottom: 1px #ccc solid;
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
|
Loading…
Reference in New Issue
Block a user