87 lines
2.5 KiB
Vue
87 lines
2.5 KiB
Vue
|
<template>
|
||
|
<div class="app-wrapper">
|
||
|
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||
|
<div class="examList" v-show="listShow" :style="{width: widthLeft+'px'}">
|
||
|
<demon-list ref="demonList" :height="height"></demon-list>
|
||
|
</div>
|
||
|
<drap-left :widthLeft="widthLeft" @drapWidth="drapWidth"></drap-left>
|
||
|
<transition>
|
||
|
<router-view></router-view>
|
||
|
</transition>
|
||
|
</el-scrollbar>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import { mapGetters } from 'vuex';
|
||
|
import demonList from './list/demonList';
|
||
|
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||
|
import drapLeft from '@/views/components/drapLeft/index';
|
||
|
import localStore from 'storejs';
|
||
|
|
||
|
export default {
|
||
|
name: 'Exam',
|
||
|
components: {
|
||
|
demonList,
|
||
|
drapLeft
|
||
|
},
|
||
|
mixins: [WindowResizeHandler],
|
||
|
data() {
|
||
|
return {
|
||
|
height: 0,
|
||
|
listShow: true,
|
||
|
widthLeft: 450,
|
||
|
}
|
||
|
},
|
||
|
computed: {
|
||
|
...mapGetters([
|
||
|
'lessonbar',
|
||
|
])
|
||
|
},
|
||
|
watch: {
|
||
|
'lessonbar.opened': function (val) {
|
||
|
this.listShow = val;
|
||
|
this.resizeHandler();
|
||
|
}
|
||
|
},
|
||
|
mounted() {
|
||
|
this.widthLeft = Number(localStore.get('LeftWidth'));
|
||
|
},
|
||
|
methods: {
|
||
|
resizeHandler() {
|
||
|
this.height = this._clientHeight;
|
||
|
// let width = 0;
|
||
|
// let height = 0;
|
||
|
// if (this.listShow) {
|
||
|
// width = this._clientWidth - 310;
|
||
|
// height = this._clientHeight - 120;
|
||
|
// } else {
|
||
|
// width = this._clientWidth - 10;
|
||
|
// height = this._clientHeight - 120;
|
||
|
// }
|
||
|
// this.$store.dispatch('config/resize', { width: width, height: height });
|
||
|
},
|
||
|
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 {
|
||
|
float: left;
|
||
|
}
|
||
|
</style>
|