2019-10-30 13:58:34 +08:00
|
|
|
<template>
|
2019-11-07 18:46:17 +08:00
|
|
|
<div class="app-wrapper">
|
2019-11-11 18:28:21 +08:00
|
|
|
<map-create ref="mapCreate" :line-code="lineCode" @refresh="refresh1" />
|
2020-04-15 15:06:51 +08:00
|
|
|
<div class="examList" :style="{width: widthLeft+'px'}">
|
2020-04-15 15:42:47 +08:00
|
|
|
<demon-list ref="demonList" @createMap="createMap" />
|
2019-10-30 13:58:34 +08:00
|
|
|
</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';
|
2019-10-30 18:25:13 +08:00
|
|
|
import MapCreate from './mapmanage/create';
|
2019-10-30 13:58:34 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'DesignPlatform',
|
|
|
|
components: {
|
|
|
|
demonList,
|
|
|
|
drapLeft,
|
|
|
|
MapCreate
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
widthLeft: Number(localStore.get('LeftWidth')) || 450,
|
|
|
|
productList: [],
|
2019-11-11 18:28:21 +08:00
|
|
|
lineCode: ''
|
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();
|
|
|
|
this.widthLeft = Number(localStore.get('LeftWidth'));
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
refresh() {
|
|
|
|
this.$refs && this.$refs.demonList && this.$refs.demonList.loadInitData();
|
|
|
|
},
|
|
|
|
drapWidth(width) {
|
|
|
|
this.widthLeft = Number(width);
|
|
|
|
},
|
|
|
|
createMap() {
|
|
|
|
this.$refs.mapCreate.show();
|
|
|
|
},
|
|
|
|
refresh1() {
|
|
|
|
this.$refs.demonList.loadInitData();
|
|
|
|
},
|
|
|
|
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 });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
|
@import "src/styles/mixin.scss";
|
|
|
|
|
|
|
|
.app-wrapper {
|
2019-11-07 18:46:17 +08:00
|
|
|
@include clearfix;
|
2019-10-30 13:58:34 +08:00
|
|
|
position: relative;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.examList {
|
|
|
|
float: left;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
</style>
|