diff --git a/src/views/ibp/ibpDraft/ibpEdit/index.vue b/src/views/ibp/ibpDraft/ibpEdit/index.vue index 796fde695..2407e9ba3 100644 --- a/src/views/ibp/ibpDraft/ibpEdit/index.vue +++ b/src/views/ibp/ibpDraft/ibpEdit/index.vue @@ -2,7 +2,7 @@
- +
@@ -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: { diff --git a/src/views/ibp/index.vue b/src/views/ibp/index.vue index 1f4b34f4e..1007e014c 100644 --- a/src/views/ibp/index.vue +++ b/src/views/ibp/index.vue @@ -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); + } } };