This commit is contained in:
zyy 2020-07-24 11:01:33 +08:00
commit 584f65d285
5 changed files with 35 additions and 10 deletions

View File

@ -44,11 +44,14 @@ class ETrainDepart extends Group {
hideMode() { hideMode() {
this.trainDepart && this.trainDepart.hide(); this.trainDepart && this.trainDepart.hide();
this.time && clearInterval(this.time); // if (this.time) {
// clearInterval(this.time);
// this.timeStart = 30;
// }
} }
showMode() { showMode() {
this.timeStart = 30; // this.timeStart = 30;
this.create(`0${this.timeStart}`); this.create(`0${this.timeStart}`);
this.trainDepart.show(); this.trainDepart.show();
setTimeout(() => { setTimeout(() => {
@ -67,6 +70,7 @@ class ETrainDepart extends Group {
} }
} else { } else {
clearInterval(this.time); clearInterval(this.time);
this.timeStart = 30;
} }
}, 1000); }, 1000);
} }

View File

@ -36,14 +36,11 @@ export default {
userRole: { userRole: {
type: String, type: String,
required: true required: true
},
offsetBottom:{
type: Number,
required: true
} }
}, },
data() { data() {
return { return {
offsetBottom:15,
scriptTip:'', scriptTip:'',
isHasCoversition:false, isHasCoversition:false,
conversitionId:'', conversitionId:'',
@ -67,7 +64,14 @@ export default {
} }
}, },
watch:{ watch:{
'$store.state.map.mapViewLoadedCount': function (val) { // '$store.state.config.menuBarLoadedCount': function (val) {
this.$nextTick(() => {
this.offsetBottom = 15;
const menuBottom = document.getElementById('menuButton');
this.offsetBottom = this.offsetBottom + (menuBottom ? menuBottom.offsetHeight || 0 : 0);
});
},
'$store.state.map.mapViewLoadedCount': function (val) { // 仿
getSimulationMemberList(this.group).then(resp => { getSimulationMemberList(this.group).then(resp => {
let lastData = JSON.stringify(resp.data); let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<demon-chat ref="chatbox" :group="group" :user-role="userRole" :offset-bottom="offsetBottom" /> <demon-chat ref="chatbox" :group="group" :user-role="userRole" />
<div class="display-card" :style="{top: offset+'px'}"> <div class="display-card" :style="{top: offset+'px'}">
<el-row> <el-row>
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span> <span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>

View File

@ -122,11 +122,11 @@ export default {
// 线 // 线
clearAllTimer() { clearAllTimer() {
if (this.ierval) { if (this.ierval) {
clearTimeout(this.ierval); clearInterval(this.ierval);
this.ierval = null; this.ierval = null;
} }
if (this.checkLine) { if (this.checkLine) {
clearTimeout(this.checkLine); clearInterval(this.checkLine);
this.checkLine = null; this.checkLine = null;
} }
}, },

View File

@ -111,6 +111,7 @@ export default {
break; break;
} }
data = data.parent; data = data.parent;
if (!data) { break; }
} }
if ( obj.type === 'Map') { if ( obj.type === 'Map') {
this.mapId = obj.id; this.mapId = obj.id;
@ -181,6 +182,8 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
const checkId = localStore.get('trainingPlatformCheckId' + filterSelect + this.userId + this.project) || null; const checkId = localStore.get('trainingPlatformCheckId' + filterSelect + this.userId + this.project) || null;
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId); this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
checkId && this.findTree(this.treeList, checkId);
!checkId && this.treeList && this.treeList.length && this.clickEvent(this.treeList[0], {data: this.treeList[0]});
this.loading = false; this.loading = false;
}); });
} catch (error) { } catch (error) {
@ -188,6 +191,19 @@ export default {
this.$message.error(this.$t('error.refreshFailed')); this.$message.error(this.$t('error.refreshFailed'));
} }
}, },
/* 根据localstorage缓存的trainingPlatformCheckId跳转右侧显示页面 */
findTree(treeList, checkId, data) {
treeList && treeList.length && treeList.forEach(item =>{
if (item.type === 'Map') {
data = item;
}
if (checkId === item.key) {
this.clickEvent(item, {data: data});
} else {
this.findTree(item.children, checkId, data);
}
});
},
nodeExpand(obj, node, ele) { nodeExpand(obj, node, ele) {
const key = obj.id + obj.type; const key = obj.id + obj.type;
this.expandList = this.expandList.filter(item => item !== key); this.expandList = this.expandList.filter(item => item !== key);
@ -200,6 +216,7 @@ export default {
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList); localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList);
}, },
getExpandList(filterSelect) { getExpandList(filterSelect) {
this.expandList = [];
let expand = localStore.get('trainIngPlatformExpandList' + filterSelect + this.userId + this.project); let expand = localStore.get('trainIngPlatformExpandList' + filterSelect + this.userId + this.project);
expand = expand ? (expand + '').split(',') : ''; expand = expand ? (expand + '').split(',') : '';
if (expand instanceof Array) { if (expand instanceof Array) {