From 13df2016b9be0ba3493b9b82be3f779d78c7c772 Mon Sep 17 00:00:00 2001 From: g7hoo Date: Tue, 27 Sep 2022 09:21:44 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=AE=9E=E6=97=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/en.js | 1 + src/i18n/zh-CN.js | 1 + .../modules/monitoring/realtimeEquipment.vue | 9 +++++++-- .../modules/monitoring/realtimeProductLine.vue | 4 ++-- .../monitoring/realtimeQualityInspection.vue | 16 +++++++++++----- 5 files changed, 22 insertions(+), 9 deletions(-) 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) },