2019-09-25 14:52:21 +08:00
|
|
|
<template>
|
2019-10-17 18:27:49 +08:00
|
|
|
<div class="app-wrapper">
|
2019-10-28 17:51:59 +08:00
|
|
|
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
|
|
|
<demon-list ref="demonList" :width="widthLeft" />
|
|
|
|
</div>
|
|
|
|
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
|
|
|
<transition>
|
|
|
|
<router-view :product-list="productList" :width-left="widthLeft" />
|
|
|
|
</transition>
|
2019-10-17 18:27:49 +08:00
|
|
|
</div>
|
2019-09-25 14:52:21 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-10-17 18:27:49 +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-25 14:52:21 +08:00
|
|
|
|
2019-10-17 18:27:49 +08:00
|
|
|
export default {
|
|
|
|
name: 'DesignPlatform',
|
|
|
|
components: {
|
|
|
|
demonList,
|
|
|
|
drapLeft
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
listShow: true,
|
|
|
|
widthLeft: Number(localStore.get('LeftWidth')) || 450,
|
|
|
|
productList: [],
|
|
|
|
skinCode: '',
|
|
|
|
currentWidth: ''
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters([
|
|
|
|
'lessonbar'
|
|
|
|
]),
|
|
|
|
width() {
|
|
|
|
return this.$store.state.app.width;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
'lessonbar.opened': function (val) {
|
|
|
|
this.listShow = val;
|
|
|
|
},
|
|
|
|
widthLeft(val) {
|
|
|
|
this.setMapResize(val);
|
|
|
|
},
|
|
|
|
'$store.state.app.windowSizeCount': function() {
|
|
|
|
this.resize();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.currentWidth=this.$store.state.app.width - this.widthLeft;
|
|
|
|
const againEnter = getSessionStorage('againEnter') || null;
|
|
|
|
if (!againEnter) {
|
|
|
|
launchFullscreen();
|
|
|
|
setSessionStorage('againEnter', true);
|
|
|
|
}
|
|
|
|
this.resize();
|
|
|
|
this.widthLeft = Number(localStore.get('LeftWidth'));
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
refresh() {
|
2019-10-21 11:15:15 +08:00
|
|
|
this.$refs && this.$refs.demonList && this.$refs.demonList.loadInitData();
|
2019-10-17 18:27:49 +08:00
|
|
|
},
|
|
|
|
drapWidth(width) {
|
|
|
|
this.widthLeft = Number(width);
|
|
|
|
},
|
|
|
|
resize() {
|
|
|
|
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
|
|
|
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
2019-10-28 11:07:33 +08:00
|
|
|
// const height = this.$store.state.app.height - 90;
|
|
|
|
this.$store.dispatch('config/resize', { width: width });
|
2019-10-17 18:27:49 +08:00
|
|
|
},
|
|
|
|
setMapResize(LeftWidth) {
|
|
|
|
this.currentWidth=this.$store.state.app.width - this.widthLeft;
|
|
|
|
const widths = this.$store.state.app.width - 521 - LeftWidth;
|
2019-10-28 11:07:33 +08:00
|
|
|
// const heights = this.$store.state.app.height - 90;
|
|
|
|
this.$store.dispatch('config/resize', { width: widths });
|
2019-10-17 18:27:49 +08:00
|
|
|
}
|
2019-09-29 15:55:01 +08:00
|
|
|
|
2019-10-17 18:27:49 +08:00
|
|
|
}
|
|
|
|
};
|
2019-09-25 14:52:21 +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-26 17:41:58 +08:00
|
|
|
float: left;
|
2019-09-25 14:52:21 +08:00
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
</style>
|