From 10e454eb2a40ded93e08ad81793e0422d1127599 Mon Sep 17 00:00:00 2001 From: g7hoo Date: Thu, 8 Sep 2022 15:47:08 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=AE=BE=E5=A4=87=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=9B=91=E6=8E=A7=EF=BC=8C=E5=B0=86=E2=80=98?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=BF=91=E6=9C=9F=E5=80=BC=E2=80=99=E5=AF=BC?= =?UTF-8?q?=E5=90=91=E2=80=9C=E8=8E=B7=E5=8F=96=E8=AE=BE=E5=A4=87=E7=9A=84?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E5=8F=82=E6=95=B0=E5=80=BC=E2=80=9D(?= =?UTF-8?q?=E6=9A=82=E6=9C=AA=E5=AE=9E=E7=8E=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base-table/components/detailComponent.js | 4 +- src/i18n/en.js | 4 +- src/i18n/zh-CN.js | 4 +- .../monitoring/equipmentCurrentState.vue | 52 +++++++++++++++---- 4 files changed, 49 insertions(+), 15 deletions(-) diff --git a/src/components/base-table/components/detailComponent.js b/src/components/base-table/components/detailComponent.js index 4062f9a..96f60db 100644 --- a/src/components/base-table/components/detailComponent.js +++ b/src/components/base-table/components/detailComponent.js @@ -24,7 +24,7 @@ export default { } }, render: function (h) { - // console.log(this) - return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 }, on: { click: this.emitClick } }, this.injectData.buttonContent || this.defaultText)]) + // console.log('button content:', this.injectData) + return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 }, on: { click: this.emitClick } }, this.injectData.head?.buttonContent || this.defaultText)]) } } \ No newline at end of file diff --git a/src/i18n/en.js b/src/i18n/en.js index 221f782..5be8b88 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -241,8 +241,8 @@ t.realtime.goodrate = 'Passed Rate' t.realtime.runState = '是否运行' t.realtime.state = '状态' t.realtime.hasFault = '是否故障' -t.realtime.alarmRecords = '报警记录' -t.realtime.viewAlarmRecords = '查看报警记录' +t.realtime.recentParamValue = '参数近期值' +t.realtime.view = '查看' t.realtime.input = '投入数' t.realtime.output = '产出数' t.realtime.eqName = '设备名称' diff --git a/src/i18n/zh-CN.js b/src/i18n/zh-CN.js index 7ec3a57..6acd25b 100644 --- a/src/i18n/zh-CN.js +++ b/src/i18n/zh-CN.js @@ -246,8 +246,8 @@ t.realtime.goodrate = '良品率' t.realtime.runState = '是否运行' t.realtime.state = '状态' t.realtime.hasFault = '是否故障' -t.realtime.alarmRecords = '报警记录' -t.realtime.viewAlarmRecords = '查看报警记录' +t.realtime.recentParamValue = '参数近期值' +t.realtime.view = '查看' t.realtime.input = '投入数' t.realtime.output = '产出数' t.realtime.eqName = '设备名称' diff --git a/src/views/modules/monitoring/equipmentCurrentState.vue b/src/views/modules/monitoring/equipmentCurrentState.vue index 54f666b..fdc160c 100644 --- a/src/views/modules/monitoring/equipmentCurrentState.vue +++ b/src/views/modules/monitoring/equipmentCurrentState.vue @@ -2,10 +2,14 @@
- + + + - + + + {{ $t('query') }} @@ -48,12 +52,30 @@ const tableConfigs = [ { prop: 'equipmentCode', name: i18n.t('realtime.eqCode') }, { prop: 'inputNum', name: i18n.t('realtime.input') }, { prop: 'outputNum', name: i18n.t('realtime.output') }, - { prop: 'run', name: i18n.t('realtime.runState') }, - { prop: 'status', name: i18n.t('realtime.state') }, - { prop: 'error', name: i18n.t('realtime.hasFault') }, + { + prop: 'run', + name: i18n.t('realtime.runState'), + filter: val => { + if (val !== null && val !== undefined) return val ? '是' : '否' + } + }, + { + prop: 'status', + name: i18n.t('realtime.state'), + filter: val => { + if (val !== null && val !== undefined) return ['正常', '计划停机', '故障'][+val] + } + }, + { + prop: 'error', + name: i18n.t('realtime.hasFault'), + filter: val => { + if (val !== null && val !== undefined) return val ? '是' : '否' + } + }, { prop: 'quantityTime', name: i18n.t('realtime.productionSnapshotTime'), filter: timeFilter }, { prop: 'statusTime', name: i18n.t('realtime.statusSnapshotTime'), filter: timeFilter }, - { prop: 'alarm', name: i18n.t('realtime.alarmRecords'), buttonContent: i18n.t('realtime.viewAlarmRecords'), subcomponent: TableTextComponent, actionName: 'view-alarm' } + { prop: 'alarm', name: i18n.t('realtime.recentParamValue'), buttonContent: i18n.t('realtime.view'), subcomponent: TableTextComponent, actionName: 'view-alarm' } // { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } ] @@ -95,6 +117,7 @@ export default { }, activated() { this.getEqList() + this.getLineList() this.getDataList() }, methods: { @@ -112,7 +135,18 @@ export default { }) }, // 产线 - getLineList() {}, + getLineList() { + this.$http({ + url: this.$http.adornUrl('/monitoring/productionLine/list'), + method: 'get' + }).then(({ data }) => { + if (data && data.code === 0) { + this.lineList = data.data + } else { + this.lineList = [] + } + }) + }, // 获取数据列表 getDataList() { this.addOrUpdateVisible = false @@ -123,8 +157,8 @@ export default { params: this.$http.adornParams({ page: this.pageIndex, limit: this.pageSize, - equipmentId: this.dataForm.key, - lineId: this.dataForm.key + equipmentId: this.dataForm.equipmentId, + lineId: this.dataForm.lineId }) }).then(({ data }) => { if (data && data.code === 0) {