lb #6

Merged
gtz217 merged 10 commits from lb into develop 2022-09-29 09:38:37 +08:00
5 changed files with 22 additions and 9 deletions
Showing only changes of commit 13df2016b9 - Show all commits

View File

@ -255,6 +255,7 @@ t.realtime.eqName = '设备名称'
t.realtime.eqCode = '设备编码' t.realtime.eqCode = '设备编码'
t.realtime.productionSnapshotTime = '生产量记录时间' t.realtime.productionSnapshotTime = '生产量记录时间'
t.realtime.statusSnapshotTime = '状态记录时间' t.realtime.statusSnapshotTime = '状态记录时间'
t.realtime.refresh = 'Refresh data...'
t.ws = {} t.ws = {}

View File

@ -260,6 +260,7 @@ t.realtime.eqName = '设备名称'
t.realtime.eqCode = '设备编码' t.realtime.eqCode = '设备编码'
t.realtime.productionSnapshotTime = '生产量记录时间' t.realtime.productionSnapshotTime = '生产量记录时间'
t.realtime.statusSnapshotTime = '状态记录时间' t.realtime.statusSnapshotTime = '状态记录时间'
t.realtime.refresh = '刷新数据'
t.ws = {} t.ws = {}

View File

@ -47,6 +47,7 @@ export default {
}) })
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
this.$message({ this.$message({
message: this.$t('realtime.refresh'),
type: 'warning', type: 'warning',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
@ -59,7 +60,11 @@ export default {
}) })
}, 1000 * 60 * 5) }, 1000 * 60 * 5)
}, },
beforeDestroy() { // beforeDestroy() {
// console.log('before destroyed...')
// if (this.intervalId) clearInterval(this.intervalId)
// },
deactivated() {
if (this.intervalId) clearInterval(this.intervalId) if (this.intervalId) clearInterval(this.intervalId)
}, },
methods: { methods: {
@ -129,7 +134,7 @@ export default {
{ prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') }, { prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') },
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') }, { prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') },
{ prop: obj.recordTime + '-scrapNum', label: i18n.t('realtime.data') }, { 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)}%` : '-') }
] ]
}) })
} }

View File

@ -47,7 +47,7 @@ export default {
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
this.$message({ this.$message({
message: this.$t('module.factory.realtime.productLine.refresh'), message: this.$t('realtime.refresh'),
type: 'warning', type: 'warning',
onClose: () => { onClose: () => {
this.clearData() this.clearData()
@ -60,7 +60,7 @@ export default {
}, 1000 * 60 * 5) }, 1000 * 60 * 5)
}, },
beforeDestroy() { deactivated() {
if (this.intervalId) clearInterval(this.intervalId) if (this.intervalId) clearInterval(this.intervalId)
}, },

View File

@ -43,15 +43,21 @@ export default {
}) })
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
this.$message({
message: this.$t('realtime.refresh'),
type: 'warning',
onClose: () => {
this.clearData() this.clearData()
this.fetchList().then(res => { this.fetchList().then(res => {
this.testData = res this.testData = res
this.handleData() this.handleData()
}) })
}
})
}, 1000 * 60 * 5) }, 1000 * 60 * 5)
}, },
beforeDestroy() { deactivated() {
if (this.intervalId) clearInterval(this.intervalId) if (this.intervalId) clearInterval(this.intervalId)
}, },