d0ed6ed859
实训平台 缓存跳转代码调整
86 lines
2.3 KiB
Vue
86 lines
2.3 KiB
Vue
<template>
|
|
<div class="app-wrapper">
|
|
<div class="examList" :style="{width: widthLeft+'px'}">
|
|
<demon-list ref="demonList" @goRoutePath="goRoutePath" />
|
|
</div>
|
|
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
|
<transition>
|
|
<router-view :product-list="productList" />
|
|
</transition>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
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';
|
|
|
|
export default {
|
|
name: 'TrainingPlatform',
|
|
components: {
|
|
demonList,
|
|
drapLeft
|
|
},
|
|
data() {
|
|
return {
|
|
widthLeft: 450,
|
|
productList: []
|
|
};
|
|
},
|
|
computed: {
|
|
width() {
|
|
return this.$store.state.app.width;
|
|
},
|
|
userId() {
|
|
return this.$store.state.user.id;
|
|
}
|
|
},
|
|
mounted() {
|
|
this.widthLeft = Number(localStore.get('LeftWidth')) ? Number(localStore.get('LeftWidth')) : 450;
|
|
},
|
|
methods: {
|
|
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')) {
|
|
localStore.set('orignalTrainingPlatformRoute' + this.userId, `/trainingPlatform/permission/${data[0].id}`);
|
|
this.$router.push(path);
|
|
} else if (data && data[0]) {
|
|
this.$router.push(`/trainingPlatform/permission/${data[0].id}`);
|
|
}
|
|
setSessionStorage('againEnter', true);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
</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 {
|
|
height: 100%;
|
|
float: left;
|
|
}
|
|
/deep/ .scrollbar-wrapper{
|
|
overflow-x: hidden;
|
|
}
|
|
/deep/ .el-scrollbar__bar.is-horizontal {
|
|
display: none;
|
|
}
|
|
</style>
|