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

121 lines
3.9 KiB
Vue
Raw Normal View History

2019-09-25 14:52:21 +08:00
<template>
<div class="app-wrapper">
<el-scrollbar wrap-class="scrollbar-wrapper">
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" :height="height" :width="widthLeft"/>
2019-09-25 14:52:21 +08:00
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
2019-09-26 17:41:58 +08:00
<!-- position:'relative', -->
<!-- :style="{left:widthLeft+'px', width: (width - widthLeft)+'px'}" -->
<router-view :product-list="productList" :style="{width:(width - widthLeft)+'px',display:'inline-block'}"/>
2019-09-25 14:52:21 +08:00
</transition>
</el-scrollbar>
</div>
</template>
<script>
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-26 15:51:22 +08:00
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
2019-09-25 14:52:21 +08:00
export default {
name: 'DesignPlatform',
components: {
demonList,
2019-09-26 15:51:22 +08:00
drapLeft,
MapCreate
2019-09-25 14:52:21 +08:00
},
data() {
return {
listShow: true,
2019-09-26 17:41:58 +08:00
widthLeft: Number(localStore.get('LeftWidth')) || 450,
2019-09-26 15:51:22 +08:00
productList: [],
skinCode: '',
2019-09-25 14:52:21 +08:00
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height - 50;
},
width() {
return this.$store.state.app.width;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
2019-09-26 17:41:58 +08:00
},
widthLeft(val) {
this.setMapResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.resize();
2019-09-25 14:52:21 +08:00
}
},
mounted() {
const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter){
launchFullscreen();
setSessionStorage('againEnter',true);
}
2019-09-26 17:41:58 +08:00
this.resize();
2019-09-25 14:52:21 +08:00
this.widthLeft = Number(localStore.get('LeftWidth'));
},
methods: {
refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
},
drapWidth(width) {
this.widthLeft = Number(width);
2019-09-26 15:51:22 +08:00
},
2019-09-29 15:55:01 +08:00
2019-09-26 15:51:22 +08:00
refresh1() {
},
mapSelected(data) {
if (data && this.editModel) {
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
}
},
2019-09-26 17:41:58 +08:00
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
},
setMapResize(LeftWidth) {
const widths = this.$store.state.app.width - 521 - LeftWidth;
const heights = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: widths, height: heights });
}
2019-09-29 15:55:01 +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
// position: fixed;
// top: 61px;
float: left;
2019-09-25 14:52:21 +08:00
height: 100%;
}
</style>