ibp布局调整

This commit is contained in:
fan 2019-09-03 10:10:09 +08:00
parent 24a7a0204a
commit 1ee0aeb785
2 changed files with 34 additions and 11 deletions

View File

@ -2,7 +2,7 @@
<transition name="el-zoom-in-center">
<div class="mapPaint">
<div class="map-view">
<ibp-plate ref="ibpPlate" />
<ibp-plate ref="ibpPlate" :size="size"/>
</div>
<div class="map-draft">
<ibp-operate ref="ibpOperate" />
@ -27,7 +27,11 @@ export default {
autoSaveTask: null,
selected: null,
mapInfo: { name: '' },
timeDemon: null
timeDemon: null,
size: {
width: this.$store.state.app.width-521,
height: this.$store.state.app.height-60
},
};
},
watch: {

View File

@ -32,9 +32,18 @@ export default {
},
showBackButton: true,
initZrender: false,
initTime: ''
initTime: '',
started: false
};
},
props: {
size: {
type: Object,
default() {
return null;
}
}
},
computed: {
...mapGetters([
'canvasWidth',
@ -51,16 +60,22 @@ export default {
}
},
'$store.state.app.windowSizeCount': function() {
const width = this.$store.state.app.width;
const height = this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width- 521, height: height - 60 });
const width = this.size ? this.size.width : this.$store.state.app.width;
const height = this.size ? this.size.height :this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width, height: height});
},
'$store.state.training.initTime': function (initTime) {
this.initTime = initTime;
if (this.$ibp) {
this.initClockTime(initTime);
}
}
},
'$store.state.training.started': function (started) {
this.started = started;
if (this.$ibp){
this.setClockStart(started);
}
}
},
mounted() {
this.setWindowSize();
@ -116,9 +131,9 @@ export default {
},
setWindowSize() {
this.$nextTick(() => {
const width = this.$store.state.app.width;
const height = this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width- 521, height: height - 60 });
const width = this.size ? this.size.width : this.$store.state.app.width;
const height = this.size ? this.size.height :this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width, height: height });
});
},
back() {
@ -141,7 +156,11 @@ export default {
//
initClockTime(initTime) {
this.$ibp.initClockTime(initTime);
}
},
//
setClockStart(started) {
this.$ibp.setClockStart(started);
}
}
};
</script>