diff --git a/src/i18n/en.js b/src/i18n/en.js index f52fe61..914ef63 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -255,6 +255,7 @@ t.realtime.eqName = '设备名称' t.realtime.eqCode = '设备编码' t.realtime.productionSnapshotTime = '生产量记录时间' t.realtime.statusSnapshotTime = '状态记录时间' +t.realtime.refresh = 'Refresh data...' t.ws = {} diff --git a/src/i18n/zh-CN.js b/src/i18n/zh-CN.js index 4605c41..1762a8d 100644 --- a/src/i18n/zh-CN.js +++ b/src/i18n/zh-CN.js @@ -260,6 +260,7 @@ t.realtime.eqName = '设备名称' t.realtime.eqCode = '设备编码' t.realtime.productionSnapshotTime = '生产量记录时间' t.realtime.statusSnapshotTime = '状态记录时间' +t.realtime.refresh = '刷新数据' t.ws = {} diff --git a/src/views/modules/monitoring/realtimeEquipment.vue b/src/views/modules/monitoring/realtimeEquipment.vue index d3b3d06..2b98728 100644 --- a/src/views/modules/monitoring/realtimeEquipment.vue +++ b/src/views/modules/monitoring/realtimeEquipment.vue @@ -47,6 +47,7 @@ export default { }) this.intervalId = setInterval(() => { this.$message({ + message: this.$t('realtime.refresh'), type: 'warning', duration: 1500, onClose: () => { @@ -59,7 +60,11 @@ export default { }) }, 1000 * 60 * 5) }, - beforeDestroy() { + // beforeDestroy() { + // console.log('before destroyed...') + // if (this.intervalId) clearInterval(this.intervalId) + // }, + deactivated() { if (this.intervalId) clearInterval(this.intervalId) }, methods: { @@ -129,7 +134,7 @@ export default { { prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') }, { prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') }, { prop: obj.recordTime + '-scrapNum', label: i18n.t('realtime.data') }, - { prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate'), filter: val => val !== '-' ? `${val.toFixed(2)}%` : '-' } + { prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate'), filter: val => (val !== '-' ? `${val.toFixed(2)}%` : '-') } ] }) } diff --git a/src/views/modules/monitoring/realtimeProductLine.vue b/src/views/modules/monitoring/realtimeProductLine.vue index 7348835..eef1a0c 100644 --- a/src/views/modules/monitoring/realtimeProductLine.vue +++ b/src/views/modules/monitoring/realtimeProductLine.vue @@ -47,7 +47,7 @@ export default { this.intervalId = setInterval(() => { this.$message({ - message: this.$t('module.factory.realtime.productLine.refresh'), + message: this.$t('realtime.refresh'), type: 'warning', onClose: () => { this.clearData() @@ -60,7 +60,7 @@ export default { }, 1000 * 60 * 5) }, - beforeDestroy() { + deactivated() { if (this.intervalId) clearInterval(this.intervalId) }, diff --git a/src/views/modules/monitoring/realtimeQualityInspection.vue b/src/views/modules/monitoring/realtimeQualityInspection.vue index ff28cce..b82f109 100644 --- a/src/views/modules/monitoring/realtimeQualityInspection.vue +++ b/src/views/modules/monitoring/realtimeQualityInspection.vue @@ -43,15 +43,21 @@ export default { }) this.intervalId = setInterval(() => { - this.clearData() - this.fetchList().then(res => { - this.testData = res - this.handleData() + this.$message({ + message: this.$t('realtime.refresh'), + type: 'warning', + onClose: () => { + this.clearData() + this.fetchList().then(res => { + this.testData = res + this.handleData() + }) + } }) }, 1000 * 60 * 5) }, - beforeDestroy() { + deactivated() { if (this.intervalId) clearInterval(this.intervalId) },