|
@@ -148,11 +148,16 @@
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
},
|
|
},
|
|
|
onUnload() {
|
|
onUnload() {
|
|
|
|
|
+ this.stopTimer()
|
|
|
uni.$off('scancodedate')
|
|
uni.$off('scancodedate')
|
|
|
},
|
|
},
|
|
|
onHide() {
|
|
onHide() {
|
|
|
|
|
+ this.stopTimer()
|
|
|
uni.$off('scancodedate')
|
|
uni.$off('scancodedate')
|
|
|
},
|
|
},
|
|
|
|
|
+ beforeDestroy() {
|
|
|
|
|
+ this.stopTimer()
|
|
|
|
|
+ },
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.init()
|
|
this.init()
|
|
|
this.getHomeData()
|
|
this.getHomeData()
|
|
@@ -220,16 +225,16 @@
|
|
|
})
|
|
})
|
|
|
this.getNoticeDocumentList()
|
|
this.getNoticeDocumentList()
|
|
|
},
|
|
},
|
|
|
- onHide() {
|
|
|
|
|
- clearTimeout(this.timer);
|
|
|
|
|
- },
|
|
|
|
|
- onUnload() {
|
|
|
|
|
- clearTimeout(this.timer);
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
-
|
|
|
|
|
|
|
+ // 停止定时轮询
|
|
|
|
|
+ stopTimer() {
|
|
|
|
|
+ console.log('stopTimer')
|
|
|
|
|
+ this._destroyed = true
|
|
|
|
|
+ clearTimeout(this.timer)
|
|
|
|
|
+ },
|
|
|
// 刷新 manage 子组件数据(供父组件 tab 切换时调用)
|
|
// 刷新 manage 子组件数据(供父组件 tab 切换时调用)
|
|
|
refreshManage() {
|
|
refreshManage() {
|
|
|
this.$refs.manageRef?.refreshData()
|
|
this.$refs.manageRef?.refreshData()
|
|
@@ -270,7 +275,10 @@
|
|
|
(this.$refs.mouldRef.getBoatInventoryCountList(),
|
|
(this.$refs.mouldRef.getBoatInventoryCountList(),
|
|
|
this.$refs.mouldRef.getModeInventoryCountList())
|
|
this.$refs.mouldRef.getModeInventoryCountList())
|
|
|
this.$refs.sparePartRef && this.$refs.sparePartRef.getData()
|
|
this.$refs.sparePartRef && this.$refs.sparePartRef.getData()
|
|
|
|
|
+ if (this._destroyed) return
|
|
|
this.timer = setTimeout(() => {
|
|
this.timer = setTimeout(() => {
|
|
|
|
|
+ console.log('init timeout')
|
|
|
|
|
+ if (this._destroyed) return
|
|
|
this.init()
|
|
this.init()
|
|
|
}, 12000)
|
|
}, 12000)
|
|
|
},
|
|
},
|