2019-07-26 13:32:43 +08:00
|
|
|
<template>
|
2019-08-08 10:16:14 +08:00
|
|
|
<el-dialog
|
|
|
|
v-dialogDrag
|
2019-11-14 13:59:33 +08:00
|
|
|
v-dialogLoading="pageLoading"
|
2020-11-25 13:31:36 +08:00
|
|
|
:title="$t('global.synthesisTrainingTitle')"
|
|
|
|
:visible.sync="dialogShow"
|
2019-08-08 10:16:14 +08:00
|
|
|
width="600px"
|
|
|
|
:before-close="doClose"
|
|
|
|
:z-index="2000"
|
2021-04-21 17:55:41 +08:00
|
|
|
class="synthesisTrain"
|
2019-08-08 10:16:14 +08:00
|
|
|
:modal="false"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
>
|
2021-04-21 17:55:41 +08:00
|
|
|
<div class="synthesisTrainTree">
|
|
|
|
<div v-for="(training,index) in trainingList" :key="index" class="synthesisTrainBody">
|
|
|
|
<span>{{ '['+training.map.name+']'+($t('global.trainingHasStart').replace('{name}', training.creator.nickname)) }}</span>
|
|
|
|
<el-button
|
|
|
|
type="text"
|
|
|
|
size="mini"
|
|
|
|
class="synthesisTrainBtn"
|
|
|
|
@click="handleJoinRoom(training)"
|
|
|
|
>进入</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-08-19 14:02:20 +08:00
|
|
|
<span
|
2019-08-19 20:27:23 +08:00
|
|
|
slot="footer"
|
2019-08-19 14:02:20 +08:00
|
|
|
class="dialog-footer"
|
|
|
|
>
|
2020-04-01 09:07:42 +08:00
|
|
|
<el-button v-loading="loading" type="primary" @click="handleJoin">{{ $t('global.joinNewRoom') }}</el-button>
|
2019-08-19 14:02:20 +08:00
|
|
|
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
2019-08-08 10:16:14 +08:00
|
|
|
</span>
|
|
|
|
</el-dialog>
|
2019-07-26 13:32:43 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-06-30 18:35:57 +08:00
|
|
|
import { getSimulationListCantainUser } from '@/api/jointSimulation';
|
2019-08-08 10:16:14 +08:00
|
|
|
import { launchFullscreen } from '@/utils/screen';
|
2019-07-26 13:32:43 +08:00
|
|
|
|
2019-08-08 10:16:14 +08:00
|
|
|
export default {
|
2019-10-31 17:30:24 +08:00
|
|
|
name: 'DeomonList',
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
dialogShow: false,
|
|
|
|
trainingList: [],
|
2019-11-14 13:59:33 +08:00
|
|
|
loading: false,
|
|
|
|
pageLoading: false
|
2019-10-31 17:30:24 +08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
2019-11-14 13:59:33 +08:00
|
|
|
async doShow() {
|
2019-10-31 17:30:24 +08:00
|
|
|
try {
|
2019-11-14 13:59:33 +08:00
|
|
|
this.pageLoading = true;
|
|
|
|
this.dialogShow = true;
|
|
|
|
this.loading = false;
|
2020-06-30 18:35:57 +08:00
|
|
|
this.trainingList = [];
|
|
|
|
const resp = await getSimulationListCantainUser();
|
|
|
|
if (resp.data) {
|
|
|
|
this.trainingList = resp.data;
|
|
|
|
}
|
2019-11-14 13:59:33 +08:00
|
|
|
} catch (e) {
|
|
|
|
console.error(e);
|
|
|
|
} finally {
|
|
|
|
this.pageLoading = false;
|
2019-10-31 17:30:24 +08:00
|
|
|
}
|
|
|
|
},
|
2019-11-14 13:59:33 +08:00
|
|
|
async doClose() {
|
2019-10-31 17:30:24 +08:00
|
|
|
this.dialogShow = false;
|
|
|
|
},
|
2020-03-31 18:50:16 +08:00
|
|
|
async handleJoinRoom(data) {
|
2019-11-14 13:59:33 +08:00
|
|
|
try {
|
2020-06-30 18:35:57 +08:00
|
|
|
launchFullscreen();
|
2020-10-26 11:07:49 +08:00
|
|
|
const query = { lineCode: data.map.lineCode, mapId: data.map.id, group: data.group};
|
|
|
|
this.$router.push({path:'/jointTrainingNew', query:query});
|
2019-11-14 13:59:33 +08:00
|
|
|
} catch (e) {
|
|
|
|
console.error(e);
|
|
|
|
} finally {
|
|
|
|
this.loading = false;
|
2019-10-31 17:30:24 +08:00
|
|
|
}
|
2020-03-31 18:50:16 +08:00
|
|
|
},
|
|
|
|
handleJoin() {
|
|
|
|
this.$emit('enterQcode');
|
|
|
|
this.dialogShow = false;
|
2019-10-31 17:30:24 +08:00
|
|
|
}
|
|
|
|
}
|
2019-08-08 10:16:14 +08:00
|
|
|
};
|
2019-07-26 13:32:43 +08:00
|
|
|
</script>
|
|
|
|
|
2021-04-21 17:55:41 +08:00
|
|
|
<style rel="stylesheet/scss" lang="scss">
|
|
|
|
.synthesisTrainTree{height:120px;overflow:auto;}
|
|
|
|
.synthesisTrainBody{height: 30px;line-height: 30px;cursor: pointer;padding:0px 10px;font-size: 14px;}
|
|
|
|
.synthesisTrainBody:hover{background-color: #e4e3e3}
|
|
|
|
.synthesisTrain .el-dialog__body{padding: 0px 30px}
|
|
|
|
.synthesisTrainBtn{float:right}
|
2019-08-08 10:16:14 +08:00
|
|
|
</style>
|