rt-sim-training-client/src/views/demonstration/deomonTopic/index.vue

87 lines
2.3 KiB
Vue
Raw Normal View History

2019-07-26 13:32:43 +08:00
<template>
2019-08-08 11:29:03 +08:00
<el-dialog
v-dialogDrag
:title="title"
:visible.sync="show"
width="600px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
2019-08-29 17:16:33 +08:00
<div style="height: 80px; line-height: 80px; font-size: 16px; padding-left: 10px;">{{ roomName }}{{ $t('global.inviteJoinRoom') }}</div>
2019-08-08 11:29:03 +08:00
<span slot="footer" class="dialog-footer">
2019-11-14 13:59:33 +08:00
<el-button v-loading="loading" type="primary" @click="handleJoin">{{ $t('global.confirm') }}</el-button>
2019-08-29 17:16:33 +08:00
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
2019-08-08 11:29:03 +08:00
</span>
</el-dialog>
2019-07-26 13:32:43 +08:00
</template>
<script>
2019-08-08 11:29:03 +08:00
import { launchFullscreen } from '@/utils/screen';
2019-07-26 13:32:43 +08:00
2019-08-08 11:29:03 +08:00
export default {
name: 'DeomonList',
data() {
return {
dialogShow: false,
group: '',
roomName: '',
2019-11-14 13:59:33 +08:00
mapId: '',
2020-06-30 18:35:57 +08:00
lineCode: '',
2019-11-14 13:59:33 +08:00
loading: false
};
},
computed: {
show() {
return this.dialogShow;
},
title() {
return this.$t('global.synthesisTrainingTitle');
}
},
mounted() {
},
methods: {
doShow(data) {
2020-07-01 18:52:29 +08:00
this.roomName = data.creator.nickname;
this.group = data.group;
2020-06-30 18:35:57 +08:00
this.mapId = data.map.id;
this.lineCode = data.map.lineCode;
this.dialogShow = true;
2019-11-14 13:59:33 +08:00
this.loading = false;
},
doClose() {
this.dialogShow = false;
},
async handleJoin() {
2019-11-14 13:59:33 +08:00
try {
this.loading = true;
2020-06-30 18:35:57 +08:00
launchFullscreen();
const query = { lineCode: this.lineCode, mapId: this.mapId, group: this.group};
this.$router.push({path: `/jointTrainingNew`, query: query});
2019-11-14 13:59:33 +08:00
this.dialogShow = false;
} catch (e) {
2020-03-23 16:00:28 +08:00
this.$messageBox(this.$t('tip.enterTrainingRoomFailed'));
2019-11-14 13:59:33 +08:00
console.error(e);
} finally {
this.loading = false;
2020-03-23 16:00:28 +08:00
this.dialogShow = false;
}
}
}
2019-08-08 11:29:03 +08:00
};
2019-07-26 13:32:43 +08:00
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ {
.el-dialog__body {
padding: 0px 30px !important;
}
.el-tree-node.is-current>.el-tree-node__content {
background-color: #e4e3e3 !important;
}
}
2019-08-08 11:29:03 +08:00
</style>