包装线产线生产看板2分钟自动跳产线

Signed-off-by: Yangwl <1726150332@qq.com>
master
Yangwl 1 month ago
parent 95df62e99e
commit 9efaf5e388

@ -444,7 +444,9 @@ export default {
actProduction: [], actProduction: [],
ceshitable: [{}, {}, {}, {}, {}, {}], ceshitable: [{}, {}, {}, {}, {}, {}],
pollTimer: null, pollTimer: null,
timer: null timer: null,
currentIndex: 0,
rotationTimer: null
}; };
}, },
created() {}, created() {},
@ -462,11 +464,24 @@ export default {
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.getProductionNumberPLC(); this.getProductionNumberPLC();
}, 10000); }, 10000);
this.startRotation()
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.rotationTimer)
clearInterval(this.timer)
}, },
methods: { 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() { back() {
this.$router.push({ path: "/index" }); this.$router.push({ path: "/index" });
}, },

Loading…
Cancel
Save