rt-sim-training-client/src/views/designPlatform/index.vue

85 lines
2.2 KiB
Vue
Raw Normal View History

2019-09-25 14:52:21 +08:00
<template>
2021-04-22 10:52:48 +08:00
<div class="designPlatform" :style="'padding-left:'+(widthLeft)+'px'">
<div class="designPubMapList" :style="{width: widthLeft+'px'}">
2020-04-15 15:42:47 +08:00
<demon-list ref="demonList" />
2021-04-22 10:52:48 +08:00
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
</div>
<transition>
2020-12-15 18:09:10 +08:00
<router-view :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 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 {
2019-10-30 13:58:34 +08:00
name: 'DesignPlatform',
components: {
demonList,
drapLeft
},
data() {
return {
2021-04-22 10:52:48 +08:00
widthLeft: Number(localStore.get('LeftWidth')) || 450
2019-10-30 13:58:34 +08:00
};
},
computed: {
width() {
return this.$store.state.app.width;
}
},
watch: {
widthLeft(val) {
this.setMapResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.resize();
}
},
mounted() {
const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter) {
launchFullscreen();
setSessionStorage('againEnter', true);
}
this.resize();
2020-09-09 10:28:56 +08:00
this.widthLeft = Number(localStore.get('LeftWidth')) || 450;
2019-10-30 13:58:34 +08:00
},
methods: {
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;
this.$store.dispatch('config/resize', { width: width });
},
setMapResize(LeftWidth) {
const widths = this.$store.state.app.width - 521 - LeftWidth;
this.$store.dispatch('config/resize', { width: widths });
}
2019-09-29 15:55:01 +08:00
2019-10-30 13:58:34 +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>
2021-04-22 10:52:48 +08:00
.designPlatform {
2019-09-25 14:52:21 +08:00
position: relative;
height: 100%;
width: 100%;
overflow: hidden;
}
2021-04-22 10:52:48 +08:00
.designPubMapList {
position:absolute;
left:0;
top:0;
2019-09-25 14:52:21 +08:00
height: 100%;
}
</style>