|
@@ -148,14 +148,17 @@
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
},
|
|
},
|
|
|
onUnload() {
|
|
onUnload() {
|
|
|
|
|
+ console.log('onUnload~~~homenew')
|
|
|
this.stopTimer()
|
|
this.stopTimer()
|
|
|
uni.$off('scancodedate')
|
|
uni.$off('scancodedate')
|
|
|
},
|
|
},
|
|
|
onHide() {
|
|
onHide() {
|
|
|
|
|
+ console.log('onHide~~~homenew')
|
|
|
this.stopTimer()
|
|
this.stopTimer()
|
|
|
uni.$off('scancodedate')
|
|
uni.$off('scancodedate')
|
|
|
},
|
|
},
|
|
|
- beforeDestroy() {
|
|
|
|
|
|
|
+ destroyed() {
|
|
|
|
|
+ console.log('destroyed~~~homenew')
|
|
|
this.stopTimer()
|
|
this.stopTimer()
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -230,8 +233,10 @@
|
|
|
// 停止定时轮询
|
|
// 停止定时轮询
|
|
|
stopTimer() {
|
|
stopTimer() {
|
|
|
console.log('stopTimer')
|
|
console.log('stopTimer')
|
|
|
- this._destroyed = true
|
|
|
|
|
- clearTimeout(this.timer)
|
|
|
|
|
|
|
+ if (this.timer) {
|
|
|
|
|
+ clearInterval(this.timer)
|
|
|
|
|
+ this.timer = null
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 刷新 manage 子组件数据(供父组件 tab 切换时调用)
|
|
// 刷新 manage 子组件数据(供父组件 tab 切换时调用)
|
|
|
refreshManage() {
|
|
refreshManage() {
|
|
@@ -265,6 +270,17 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
init() {
|
|
init() {
|
|
|
|
|
+ this.refreshAll()
|
|
|
|
|
+ // 启动循环定时器(页面退出时由 stopTimer 关闭)
|
|
|
|
|
+ if (!this.timer) {
|
|
|
|
|
+ this.timer = setInterval(() => {
|
|
|
|
|
+ console.log('timer~~~homeNew~~~~')
|
|
|
|
|
+ this.refreshAll()
|
|
|
|
|
+ }, 12000)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 刷新所有数据
|
|
|
|
|
+ refreshAll() {
|
|
|
this.getStatistics()
|
|
this.getStatistics()
|
|
|
this.$refs.navigationRef && this.$refs.navigationRef.getCount()
|
|
this.$refs.navigationRef && this.$refs.navigationRef.getCount()
|
|
|
this.$refs.equipmentRef && this.$refs.equipmentRef.getData()
|
|
this.$refs.equipmentRef && this.$refs.equipmentRef.getData()
|
|
@@ -273,12 +289,6 @@
|
|
|
(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(() => {
|
|
|
|
|
- console.log('init timeout')
|
|
|
|
|
- if (this._destroyed) return
|
|
|
|
|
- this.init()
|
|
|
|
|
- }, 12000)
|
|
|
|
|
},
|
|
},
|
|
|
// 获取工单统计数
|
|
// 获取工单统计数
|
|
|
getStatistics() {
|
|
getStatistics() {
|