2019-09-23 17:49:04 +08:00
|
|
|
<template>
|
2019-10-22 13:40:42 +08:00
|
|
|
<div class="app-wrapper">
|
2019-10-31 13:57:17 +08:00
|
|
|
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
|
|
|
<demon-list ref="demonList" :height="height" @goRoutePath="goRoutePath" />
|
|
|
|
</div>
|
|
|
|
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
|
|
|
<transition>
|
|
|
|
<router-view :product-list="productList" />
|
|
|
|
</transition>
|
2019-10-22 13:40:42 +08:00
|
|
|
</div>
|
2019-09-23 17:49:04 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-10-22 13:40:42 +08:00
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import demonList from './demonList';
|
|
|
|
import drapLeft from '@/views/components/drapLeft/index';
|
|
|
|
import { launchFullscreen } from '@/utils/screen';
|
|
|
|
import localStore from 'storejs';
|
|
|
|
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
2019-09-23 17:49:04 +08:00
|
|
|
|
2019-10-22 13:40:42 +08:00
|
|
|
export default {
|
2019-10-29 15:06:15 +08:00
|
|
|
name: 'TrainingPlatform',
|
|
|
|
components: {
|
|
|
|
demonList,
|
|
|
|
drapLeft
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
listShow: true,
|
|
|
|
widthLeft: 450,
|
|
|
|
productList: []
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters([
|
|
|
|
'lessonbar'
|
|
|
|
]),
|
|
|
|
height() {
|
|
|
|
return this.$store.state.app.height - 50;
|
|
|
|
},
|
|
|
|
width() {
|
|
|
|
return this.$store.state.app.width;
|
|
|
|
},
|
|
|
|
userId() {
|
|
|
|
return this.$store.state.user.id;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
'lessonbar.opened': function (val) {
|
|
|
|
this.listShow = val;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.widthLeft = Number(localStore.get('LeftWidth')) ? Number(localStore.get('LeftWidth')) : 450;
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
refresh() {
|
|
|
|
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
|
|
|
|
},
|
|
|
|
drapWidth(width) {
|
|
|
|
this.widthLeft = Number(width);
|
|
|
|
},
|
|
|
|
goRoutePath(data) {
|
|
|
|
const againEnter = getSessionStorage('againEnter') || null;
|
|
|
|
if (!againEnter) {
|
|
|
|
launchFullscreen();
|
|
|
|
const path = localStore.get('trainingPlatformRoute' + this.userId);
|
|
|
|
if (path && path.startsWith('/trainingPlatform')) {
|
|
|
|
this.$router.push(path);
|
|
|
|
} else if (data && data[0]) {
|
|
|
|
this.$router.push(`/trainingPlatform/permission/${data[0].id}`);
|
|
|
|
}
|
|
|
|
setSessionStorage('againEnter', true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-22 13:40:42 +08:00
|
|
|
};
|
2019-09-23 17:49:04 +08:00
|
|
|
</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
|
|
|
height: 100%;
|
2019-10-31 13:57:17 +08:00
|
|
|
float: left;
|
2019-09-23 17:49:04 +08:00
|
|
|
}
|
2019-10-24 11:20:00 +08:00
|
|
|
/deep/ .scrollbar-wrapper{
|
|
|
|
overflow-x: hidden;
|
|
|
|
}
|
|
|
|
/deep/ .el-scrollbar__bar.is-horizontal {
|
|
|
|
display: none;
|
|
|
|
}
|
2019-09-23 17:49:04 +08:00
|
|
|
</style>
|