Merge pull request #3941 from dataease/pr@dev@fix_tab-move

fix(仪表板): 修复仪表板中其他组件拖入Tab组件页面不可用问题
This commit is contained in:
Junjun 2022-11-30 10:12:44 +08:00 committed by GitHub
commit 8a7b655cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,9 +202,7 @@
</el-dialog> </el-dialog>
<text-attr <text-attr
v-if="showAttr && curComponent.canvasId === activeCanvasId" v-if="showAttr && curComponent.canvasId === activeCanvasId && isEdit"
&&
is-edit
:canvas-id="curComponent.canvasId" :canvas-id="curComponent.canvasId"
:scroll-left="scrollLeft" :scroll-left="scrollLeft"
:scroll-top="scrollTop" :scroll-top="scrollTop"
@ -466,15 +464,20 @@ export default {
} }
}, },
initCarousel() { initCarousel() {
this.timer && clearInterval(this.timer) const _this = this
if (this.element.style.carouselEnable) { _this.timer && clearInterval(_this.timer)
const switchTime = (this.element.style.switchTime || 5) * 1000 if (_this.element.style.carouselEnable) {
const switchTime = (_this.element.style.switchTime || 5) * 1000
let switchCount = 1 let switchCount = 1
// //
this.timer = setInterval(() => { _this.timer = setInterval(() => {
const nowIndex = switchCount % this.element.options.tabList.length const nowIndex = switchCount % _this.element.options.tabList.length
switchCount++ switchCount++
this.activeTabName = this.element.options.tabList[nowIndex].name _this.activeTabName = _this.element.options.tabList[nowIndex].name
const targetRef = _this.$refs['canvasTabRef-' + _this.activeTabName]
if (targetRef) {
targetRef[0].restore()
}
}, switchTime) }, switchTime)
} }
}, },