From 1ee0aeb785615f582c32dd186f458b355fe2a445 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 3 Sep 2019 10:10:09 +0800 Subject: [PATCH] =?UTF-8?q?ibp=E5=B8=83=E5=B1=80=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ibp/ibpDraft/ibpEdit/index.vue | 8 +++-- src/views/ibp/index.vue | 37 ++++++++++++++++++------ 2 files changed, 34 insertions(+), 11 deletions(-) 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); + } } };