2019-09-23 17:49:04 +08:00
|
|
|
<template>
|
|
|
|
<div class="app-wrapper">
|
|
|
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
|
|
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
|
|
|
<demon-list ref="demonList" :height="height" />
|
|
|
|
</div>
|
|
|
|
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
|
|
|
<transition>
|
2019-09-25 13:05:01 +08:00
|
|
|
<router-view :style="{ position:'relative', left:widthLeft+'px', width: (width - widthLeft)+'px'}" :product-list="productList" />
|
2019-09-23 17:49:04 +08:00
|
|
|
</transition>
|
|
|
|
</el-scrollbar>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import demonList from './demonList';
|
|
|
|
import drapLeft from '@/views/components/drapLeft/index';
|
|
|
|
import { launchFullscreen } from '@/utils/screen';
|
|
|
|
import localStore from 'storejs';
|
2019-09-24 15:54:59 +08:00
|
|
|
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
2019-09-23 17:49:04 +08:00
|
|
|
|
|
|
|
export default {
|
2019-09-25 14:52:21 +08:00
|
|
|
name: 'TrainingPlatform',
|
2019-09-23 17:49:04 +08:00
|
|
|
components: {
|
|
|
|
demonList,
|
|
|
|
drapLeft
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
listShow: true,
|
|
|
|
widthLeft: 450,
|
|
|
|
productList: []
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters([
|
|
|
|
'lessonbar'
|
|
|
|
]),
|
|
|
|
height() {
|
|
|
|
return this.$store.state.app.height - 50;
|
2019-09-25 13:05:01 +08:00
|
|
|
},
|
|
|
|
width() {
|
|
|
|
return this.$store.state.app.width;
|
2019-09-23 17:49:04 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
'lessonbar.opened': function (val) {
|
|
|
|
this.listShow = val;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
2019-09-24 15:54:59 +08:00
|
|
|
const againEnter = getSessionStorage('againEnter') || null;
|
|
|
|
if (!againEnter){
|
|
|
|
launchFullscreen();
|
|
|
|
setSessionStorage('againEnter',true);
|
|
|
|
}
|
|
|
|
|
2019-09-23 17:49:04 +08:00
|
|
|
this.widthLeft = Number(localStore.get('LeftWidth'));
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
refresh() {
|
|
|
|
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
|
|
|
|
},
|
|
|
|
drapWidth(width) {
|
|
|
|
this.widthLeft = Number(width);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
|
@import "src/styles/mixin.scss";
|
|
|
|
|
|
|
|
.app-wrapper {
|
|
|
|
@include clearfix;
|
|
|
|
position: relative;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.examList {
|
2019-09-25 13:05:01 +08:00
|
|
|
position: fixed;
|
|
|
|
top: 61px;
|
|
|
|
height: 100%;
|
2019-09-23 17:49:04 +08:00
|
|
|
}
|
|
|
|
</style>
|