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) {