diff --git a/src/views/kanban/Packagingline/index2.vue b/src/views/kanban/Packagingline/index2.vue index 0636115..43fb109 100644 --- a/src/views/kanban/Packagingline/index2.vue +++ b/src/views/kanban/Packagingline/index2.vue @@ -451,27 +451,30 @@ export default { // this.getdatalist(this.selectxt) this.selectfactoryCodelist(); this.gettime(); - this.startRotation() + // this.startRotation() this.timer = setInterval(() => { this.getProductionNumberPLC(); }, 10000); + }, 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事件 - } - }, 60000) - }, + // 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事件 + // } + // }, 60000) + // }, + + back() { this.$router.push({ path: "/index" }); }, @@ -513,7 +516,11 @@ export default { }).then((response) => { if (response) { this.dictDatatype = response; - _this.selectxtclasses = _this.dictDatatype[0].equCode; + if (_this.$route.query.equCode){ + _this.selectxtclasses = _this.$route.query.equCode; + }else { + _this.selectxtclasses = _this.dictDatatype[0].equCode; + } _this.getdatalist(); // _this.getDeviceRefreshTime(); } @@ -592,6 +599,9 @@ export default { //PLC产量信息 getProductionNumberPLC(){ const _this = this; + if (!_this.selectxtclasses){ + return; + } getProductionNumberPLC({ equCode: _this.selectxtclasses, factoryCode: "ds_" + _this.selectxt,