diff --git a/src/views/kanban/Packagingline/index2.vue b/src/views/kanban/Packagingline/index2.vue index 0b28297..05e7c4f 100644 --- a/src/views/kanban/Packagingline/index2.vue +++ b/src/views/kanban/Packagingline/index2.vue @@ -444,7 +444,9 @@ export default { actProduction: [], ceshitable: [{}, {}, {}, {}, {}, {}], pollTimer: null, - timer: null + timer: null, + currentIndex: 0, + rotationTimer: null }; }, created() {}, @@ -462,11 +464,24 @@ export default { this.timer = setInterval(() => { this.getProductionNumberPLC(); }, 10000); + this.startRotation() }, beforeDestroy() { - + clearInterval(this.rotationTimer) + clearInterval(this.timer) }, methods: { + startRotation() { + this.rotationTimer = setInterval(() => { + if(this.dictDatatype?.length > 0) { + this.currentIndex = (this.currentIndex + 1) % this.dictDatatype.length + console.log(this.currentIndex + 1); + // console.log(this.dictDatatype); + this.selectxtclasses = this.dictDatatype[this.currentIndex].equCode + this.selectline2(this.selectxtclasses) // 触发change事件 + } + }, 120000) + }, back() { this.$router.push({ path: "/index" }); },