From e014b26ebba8e1f7c994fe75e88e70371ece25a3 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 24 Nov 2022 18:24:51 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E7=89=88):=20Tab?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=BD=AE=E6=92=AD=E6=97=B6=E9=97=B4=E5=92=8C?= =?UTF-8?q?=E8=BD=AE=E6=92=AD=E9=A1=BA=E5=BA=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/deWidget/DeTabs.vue | 2 +- frontend/src/components/widget/deWidget/TabStyle.vue | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/widget/deWidget/DeTabs.vue b/frontend/src/components/widget/deWidget/DeTabs.vue index 6e401c8166..60c25fda40 100644 --- a/frontend/src/components/widget/deWidget/DeTabs.vue +++ b/frontend/src/components/widget/deWidget/DeTabs.vue @@ -470,8 +470,8 @@ export default { let switchCount = 1 // 轮播定时器 this.timer = setInterval(() => { - switchCount++ const nowIndex = switchCount % this.element.options.tabList.length + switchCount++ this.activeTabName = this.element.options.tabList[nowIndex].name }, switchTime) } diff --git a/frontend/src/components/widget/deWidget/TabStyle.vue b/frontend/src/components/widget/deWidget/TabStyle.vue index c73831ad80..0813f2d94a 100644 --- a/frontend/src/components/widget/deWidget/TabStyle.vue +++ b/frontend/src/components/widget/deWidget/TabStyle.vue @@ -135,8 +135,9 @@ type="number" size="mini" :min="2" + :max="3600" class="hide-icon-number" - @change="styleChange" + @change="switchTimeChange" > @@ -180,6 +181,14 @@ export default { const current = this.$refs[pickKey] current && (current.showPicker = true) }, + switchTimeChange() { + if (!this.styleInfo.switchTime || this.styleInfo.switchTime < 2) { + this.styleInfo.switchTime = 2 + } else if (this.styleInfo.switchTime && this.styleInfo.switchTime > 3600) { + this.styleInfo.switchTime = 3600 + } + this.styleChange() + }, styleChange() { this.$store.commit('canvasChange') }