实训平台 代码调整
This commit is contained in:
parent
7e0c3696ab
commit
8c054f492f
@ -28,11 +28,6 @@ export default {
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
path() {
|
||||
return window.location.pathname;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.simulationInvite': function (val) {
|
||||
if (val.creator) {
|
||||
@ -101,7 +96,8 @@ export default {
|
||||
},
|
||||
subscribe() {
|
||||
const token = getToken();
|
||||
if (token && this.$route.path != '/404' && !this.path.endsWith('login')) {
|
||||
const path = window.location.pathname;
|
||||
if (token && this.$route.path != '/404' && !path.endsWith('login')) {
|
||||
const header = { group: '', 'X-Token': token };
|
||||
this.$store.dispatch('subscribe', {header, type: getSessionStorage('project')});
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
v-dialogLoading="pageLoading"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
:title="$t('global.synthesisTrainingTitle')"
|
||||
:visible.sync="dialogShow"
|
||||
width="600px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
@ -17,7 +17,7 @@
|
||||
class="filter-tree"
|
||||
default-expand-all
|
||||
:data="trainingList"
|
||||
:props="defaultProps"
|
||||
:props="{label: 'roomName'}"
|
||||
:filter-node-method="filterNode"
|
||||
:style="{height: height+'px'}"
|
||||
>
|
||||
@ -44,8 +44,6 @@
|
||||
<script>
|
||||
import { getSimulationListCantainUser } from '@/api/jointSimulation';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
||||
|
||||
export default {
|
||||
name: 'DeomonList',
|
||||
@ -54,45 +52,16 @@ export default {
|
||||
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;
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
:title="$t('global.synthesisTrainingTitle')"
|
||||
:visible.sync="dialogShow"
|
||||
width="600px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
@ -36,16 +36,6 @@ export default {
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow;
|
||||
},
|
||||
title() {
|
||||
return this.$t('global.synthesisTrainingTitle');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(data) {
|
||||
this.roomName = data.creator.nickname;
|
||||
|
@ -387,10 +387,9 @@ export default {
|
||||
onSelected(em) {
|
||||
console.log(em);
|
||||
|
||||
|
||||
const path = window.location.href;
|
||||
if (path.includes("/practiceDisplay")){
|
||||
if(em.deviceType == "StationStand"){
|
||||
if (path.includes('/practiceDisplay')) {
|
||||
if (em.deviceType == 'StationStand') {
|
||||
// console.log(em.deviceType );
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/trafficplan',
|
||||
@ -400,12 +399,12 @@ export default {
|
||||
project: this.$route.query.project,
|
||||
noPreLogout: true,
|
||||
lineCode:this.$route.query.lineCode,
|
||||
deviceCode:em.deviceCode,
|
||||
deviceCode:em.deviceCode
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
}
|
||||
if(em.deviceType == "Train"){
|
||||
if (em.deviceType == 'Train') {
|
||||
// console.log(em.deviceType );
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/traffictrain',
|
||||
@ -415,12 +414,12 @@ export default {
|
||||
project: this.$route.query.project,
|
||||
noPreLogout: true,
|
||||
lineCode:this.$route.query.lineCode,
|
||||
deviceCode:em.deviceCode,
|
||||
deviceCode:em.deviceCode
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
this.$emit('onSelect', em);
|
||||
}
|
||||
|
||||
|
@ -4,14 +4,14 @@
|
||||
<span>{{ $t('global.mapList') }}</span>
|
||||
</div>
|
||||
<div class="left-map-list">
|
||||
<filter-city v-if="!getMapByCode" ref="filerCity" filter-empty :local-param-name="localParamName" @filterSelectChange="refresh" />
|
||||
<filter-city v-if="!getMapByCode" ref="filerCity" filter-empty local-param-name="training_cityCode" @filterSelectChange="refresh" />
|
||||
<el-input v-if="!getMapByCode" v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||
<div style="height: calc(100% - 76px); overflow: auto;">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeList"
|
||||
node-key="key"
|
||||
:props="defaultProps"
|
||||
:props="{children: 'children',label: 'name'}"
|
||||
highlight-current
|
||||
:span="22"
|
||||
:filter-node-method="filterNode"
|
||||
@ -52,20 +52,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
defaultShowKeys: [],
|
||||
filterText: '',
|
||||
treeList: [],
|
||||
selected: {},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
node: {
|
||||
},
|
||||
mapId: '',
|
||||
expandList: [],
|
||||
filterSelect: '',
|
||||
localParamName: 'training_cityCode'
|
||||
filterSelect: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -5,7 +5,7 @@
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view :product-list="productList" />
|
||||
<router-view />
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
@ -25,19 +25,12 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
widthLeft: 450,
|
||||
productList: []
|
||||
widthLeft: 450
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user.id;
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -51,9 +44,11 @@ export default {
|
||||
const againEnter = getSessionStorage('againEnter') || null;
|
||||
if (!againEnter) {
|
||||
launchFullscreen();
|
||||
const path = localStore.get('trainingPlatformRoute' + this.userId + this.project);
|
||||
const project = getSessionStorage('project');
|
||||
const userId = this.$store.state.user.id;
|
||||
const path = localStore.get('trainingPlatformRoute' + userId + project);
|
||||
if (path && path.startsWith('/trainingPlatform')) {
|
||||
localStore.set('orignalTrainingPlatformRoute' + this.userId + this.project, `/trainingPlatform/permission/${data[0].id}`);
|
||||
localStore.set('orignalTrainingPlatformRoute' + userId + project, `/trainingPlatform/permission/${data[0].id}`);
|
||||
this.$router.push(path);
|
||||
} else if (data && data[0]) {
|
||||
this.$router.push(`/trainingPlatform/permission/${data[0].id}`);
|
||||
|
Loading…
Reference in New Issue
Block a user