From 13df2016b9be0ba3493b9b82be3f779d78c7c772 Mon Sep 17 00:00:00 2001 From: g7hoo Date: Tue, 27 Sep 2022 09:21:44 +0800 Subject: [PATCH 1/9] =?UTF-8?q?update=20=E5=AE=9E=E6=97=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=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) }, From a0253cc235e0117b642806847449dd697907583d Mon Sep 17 00:00:00 2001 From: g7hoo Date: Tue, 27 Sep 2022 15:32:38 +0800 Subject: [PATCH 2/9] =?UTF-8?q?add=20=E8=AE=BE=E5=A4=87=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E5=8F=82=E6=95=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 + .../monitoring/equipmentCurrentState.vue | 29 +++--- .../equipmentHistoricalParameters.vue | 97 +++++++++++++++++++ 4 files changed, 115 insertions(+), 13 deletions(-) create mode 100644 src/views/modules/monitoring/equipmentHistoricalParameters.vue diff --git a/src/i18n/en.js b/src/i18n/en.js index 914ef63..b3fd4f7 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -58,6 +58,7 @@ t.routes['设备分组'] = 'Equipment Groups' t.routes['设备信息'] = 'Equipment Details' t.routes['设备参数状态监控'] = 'Current Equipment State' t.routes['设备分组报警信息'] = 'Equipment Group Alarm' +t.routes['设备历史参数'] = 'Equipment Historical Parameters' t.routes['质量检测类型'] = 'Quality Inpection Types' t.routes['质量检测信息'] = 'Quality Inpection Details' diff --git a/src/i18n/zh-CN.js b/src/i18n/zh-CN.js index 1762a8d..707fa0d 100644 --- a/src/i18n/zh-CN.js +++ b/src/i18n/zh-CN.js @@ -59,6 +59,7 @@ t.routes['设备分组'] = '设备分组' t.routes['设备信息'] = '设备信息' t.routes['设备参数状态监控'] = '设备参数状态监控' t.routes['设备分组报警信息'] = '设备分组报警信息' +t.routes['设备历史参数'] = '设备历史参数' t.routes['质量检测类型'] = '质量检测类型' t.routes['质量检测信息'] = '质量检测信息' diff --git a/src/views/modules/monitoring/equipmentCurrentState.vue b/src/views/modules/monitoring/equipmentCurrentState.vue index fdc160c..3b73931 100644 --- a/src/views/modules/monitoring/equipmentCurrentState.vue +++ b/src/views/modules/monitoring/equipmentCurrentState.vue @@ -75,7 +75,14 @@ const tableConfigs = [ }, { prop: 'quantityTime', name: i18n.t('realtime.productionSnapshotTime'), filter: timeFilter }, { prop: 'statusTime', name: i18n.t('realtime.statusSnapshotTime'), filter: timeFilter }, - { prop: 'alarm', name: i18n.t('realtime.recentParamValue'), buttonContent: i18n.t('realtime.view'), subcomponent: TableTextComponent, actionName: 'view-alarm' } + { + prop: 'alarm', + name: i18n.t('realtime.recentParamValue'), + buttonContent: i18n.t('realtime.view'), + subcomponent: TableTextComponent, + emitFullData: true, + actionName: 'view-alarm' + } // { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } ] @@ -186,23 +193,19 @@ export default { selectionChangeHandle(val) { this.dataListSelections = val }, - handleOperations({ type, data: id }) { + handleOperations({ type, data }) { switch (type) { case 'view-alarm': - const { name, code } = this.dataList.find(item => item.id === id) + const { equipmentId: id } = data this.$router.push({ - name: 'monitoring-equipmentGroupAlarm', - params: { - groupName: name, - groupCode: code, - id - } + name: 'monitoring-equipmentHistoricalParameters', + params: { id } }) break - case 'edit': - return this.addOrUpdateHandle(id) - case 'delete': - return this.deleteHandle(id) + // case 'edit': + // return this.addOrUpdateHandle(id) + // case 'delete': + // return this.deleteHandle(id) } }, // 新增 / 修改 diff --git a/src/views/modules/monitoring/equipmentHistoricalParameters.vue b/src/views/modules/monitoring/equipmentHistoricalParameters.vue new file mode 100644 index 0000000..61ec2e3 --- /dev/null +++ b/src/views/modules/monitoring/equipmentHistoricalParameters.vue @@ -0,0 +1,97 @@ + + + From 5d32750d878ced61ab9cb2883f88a7f98ef576d8 Mon Sep 17 00:00:00 2001 From: g7hoo Date: Tue, 27 Sep 2022 15:52:03 +0800 Subject: [PATCH 3/9] =?UTF-8?q?update=20=E5=AE=9E=E6=97=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/monitoring/realtimeProductLine.vue | 2 +- src/views/modules/monitoring/realtimeQualityInspection.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/modules/monitoring/realtimeProductLine.vue b/src/views/modules/monitoring/realtimeProductLine.vue index eef1a0c..848238f 100644 --- a/src/views/modules/monitoring/realtimeProductLine.vue +++ b/src/views/modules/monitoring/realtimeProductLine.vue @@ -51,7 +51,7 @@ export default { type: 'warning', onClose: () => { this.clearData() - this.fetchList().then(res => { + this.fetchList().then(({ data: res }) => { this.testData = res this.handleData() }) diff --git a/src/views/modules/monitoring/realtimeQualityInspection.vue b/src/views/modules/monitoring/realtimeQualityInspection.vue index b82f109..955046d 100644 --- a/src/views/modules/monitoring/realtimeQualityInspection.vue +++ b/src/views/modules/monitoring/realtimeQualityInspection.vue @@ -48,7 +48,7 @@ export default { type: 'warning', onClose: () => { this.clearData() - this.fetchList().then(res => { + this.fetchList().then(({ data: res }) => { this.testData = res this.handleData() }) From 1caf68592a489abd0e8ba448f0bdc60c02b62ca4 Mon Sep 17 00:00:00 2001 From: g7hoo Date: Tue, 27 Sep 2022 15:59:35 +0800 Subject: [PATCH 4/9] update dialog --- src/components/base-dialog/addOrUpdate/index.vue | 9 ++++++++- src/views/modules/monitoring/product.vue | 2 +- src/views/modules/monitoring/workshopSectionDialog.vue | 8 +++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/base-dialog/addOrUpdate/index.vue b/src/components/base-dialog/addOrUpdate/index.vue index 4012aca..0f08321 100644 --- a/src/components/base-dialog/addOrUpdate/index.vue +++ b/src/components/base-dialog/addOrUpdate/index.vue @@ -1,5 +1,12 @@ diff --git a/src/views/modules/monitoring/workshopSectionDialog.vue b/src/views/modules/monitoring/workshopSectionDialog.vue index c82df8e..32f7182 100644 --- a/src/views/modules/monitoring/workshopSectionDialog.vue +++ b/src/views/modules/monitoring/workshopSectionDialog.vue @@ -1,5 +1,11 @@ @@ -52,16 +51,22 @@ const tableConfigs = [ { prop: 'code', name: i18n.t('prod.code') }, { prop: 'specifications', name: i18n.t('prod.spec') }, { prop: 'unitDictValue', name: i18n.t('unit'), filter: dictFilter(UnitDictTypeId) }, - { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['viewAttr', 'delete'] } + { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } + // { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'viewAttr', 'delete'] } ] const addOrUpdateConfigs = { type: 'dialog', // dialog | drawer | page infoUrl: '/monitoring/product', fields: [ - 'name', + // 'name', + { + name: 'name' + // label: i18n.t('pl.name') + }, { name: 'code', + // label: i18n.t('pl.code'), api: '/monitoring/product/getCode' }, { @@ -222,6 +227,8 @@ export default { // 表格操作事件管理 handleOperations({ type, data }) { switch (type) { + case 'edit': // <== 对照 tableConfig + return this.addOrEdit(data) case 'viewAttr': // <== 对照 tableConfig return this.addOrEdit(data) case 'delete': diff --git a/src/views/modules/monitoring/productionLine.vue b/src/views/modules/monitoring/productionLine.vue index c91a572..38916c0 100644 --- a/src/views/modules/monitoring/productionLine.vue +++ b/src/views/modules/monitoring/productionLine.vue @@ -54,10 +54,12 @@ const addOrUpdateConfigs = { type: 'dialog', infoUrl: '/monitoring/productionLine', fields: [ - 'name', - { name: 'code', api: '/monitoring/productionLine/getCode' }, + // 'name', + { name: 'name', label: i18n.t('pl.name') }, + { name: 'code', label: i18n.t('pl.code'), api: '/monitoring/productionLine/getCode' }, { name: 'factoryId', + required: true, label: i18n.t('factory.title'), type: 'select', placeholder: i18n.t('pl.factoryHints'), diff --git a/src/views/modules/monitoring/workShopSection.vue b/src/views/modules/monitoring/workShopSection.vue index a76dc8f..c70dd81 100644 --- a/src/views/modules/monitoring/workShopSection.vue +++ b/src/views/modules/monitoring/workShopSection.vue @@ -45,6 +45,7 @@ const tableConfigs = [ { prop: 'name', name: i18n.t('ws.name') }, { prop: 'code', name: i18n.t('ws.code') }, { prop: 'productionLineName', name: i18n.t('pl.title') }, + { prop: 'description', name: i18n.t('desc') }, { prop: 'remark', name: i18n.t('remark') }, { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } ] diff --git a/src/views/modules/monitoring/workshopSectionDialogAttrForm.vue b/src/views/modules/monitoring/workshopSectionDialogAttrForm.vue index a8b0e67..ac66350 100644 --- a/src/views/modules/monitoring/workshopSectionDialogAttrForm.vue +++ b/src/views/modules/monitoring/workshopSectionDialogAttrForm.vue @@ -5,7 +5,7 @@ - + Date: Wed, 28 Sep 2022 10:39:06 +0800 Subject: [PATCH 6/9] =?UTF-8?q?update=20table=20=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/base-dialog/AttrForm/index.vue | 2 ++ src/components/base-table/index.vue | 13 ++++++++++++- src/views/modules/monitoring/equipment.vue | 2 +- src/views/modules/monitoring/equipmentAlarmLog.vue | 2 +- .../modules/monitoring/equipmentCurrentState.vue | 2 +- src/views/modules/monitoring/equipmentGroup.vue | 2 +- .../modules/monitoring/equipmentGroupAlarm.vue | 8 ++++---- .../monitoring/equipmentHistoricalParameters.vue | 2 +- .../modules/monitoring/equipmentPlcConnect.vue | 2 +- src/views/modules/monitoring/equipmentPlcParam.vue | 2 +- src/views/modules/monitoring/equipmentQuantity.vue | 2 +- src/views/modules/monitoring/equipmentStatusLog.vue | 2 +- src/views/modules/monitoring/equipmentType.vue | 2 +- src/views/modules/monitoring/equipmentattr.vue | 2 +- src/views/modules/monitoring/factory.vue | 2 +- src/views/modules/monitoring/product.vue | 2 +- src/views/modules/monitoring/productionLine.vue | 2 +- .../modules/monitoring/qualityInspectionDet.vue | 2 +- .../modules/monitoring/qualityInspectionRecord.vue | 2 +- .../modules/monitoring/qualityInspectionType.vue | 2 +- src/views/modules/monitoring/reportCategory.vue | 2 +- src/views/modules/monitoring/reportDetail.vue | 2 +- .../modules/monitoring/reportSheetCategory.vue | 2 +- src/views/modules/monitoring/sysfile.vue | 2 +- src/views/modules/monitoring/sysfileType.vue | 2 +- src/views/modules/monitoring/workShopSection.vue | 2 +- .../modules/monitoring/workShopSectionEquipment.vue | 2 +- .../modules/monitoring/workshopSectionDialog.vue | 2 +- 28 files changed, 43 insertions(+), 30 deletions(-) diff --git a/src/components/base-dialog/AttrForm/index.vue b/src/components/base-dialog/AttrForm/index.vue index 26be59b..5e9f505 100644 --- a/src/components/base-dialog/AttrForm/index.vue +++ b/src/components/base-dialog/AttrForm/index.vue @@ -9,6 +9,8 @@ :is="require('../../base-table/index.vue').default" :table-head-configs="filterTableConfigs()" :data="dataList" + :page="pageIndex" + :size="pageSize" :max-height="calcMaxHeight(8)" @operate-event="handleOperations" /> diff --git a/src/components/base-table/index.vue b/src/components/base-table/index.vue index 44ec01c..e864e95 100644 --- a/src/components/base-table/index.vue +++ b/src/components/base-table/index.vue @@ -20,6 +20,9 @@ :header-align="head.align || 'center'" :align="head.align || 'center'" :width="head.width || 50" + :index="head.type === 'index' ? val => { + return val + 1 + (page - 1) * size + } : null" v-bind="head.more" > @@ -74,9 +77,17 @@ export default { spanMethod: { type: Function, default: () => { - () => [0, 0] + ;() => [0, 0] }, required: false + }, + page: { + type: Number, + default: 1 + }, + size: { + type: Number, + default: 10 } }, filters: { diff --git a/src/views/modules/monitoring/equipment.vue b/src/views/modules/monitoring/equipment.vue index 775299f..6761e37 100644 --- a/src/views/modules/monitoring/equipment.vue +++ b/src/views/modules/monitoring/equipment.vue @@ -11,7 +11,7 @@ - + - + - + - + - + import { calcMaxHeight } from '@/utils' -import { timeFilter } from '@/utils/filters' +import { timeFilter, dictFilter } from '@/utils/filters' // import AddOrUpdate from './equipmentGroupAlarm-add-or-update' import AddOrUpdate from '@/components/base-dialog/addOrUpdate' import i18n from '@/i18n' @@ -61,8 +61,8 @@ const tableConfigs = [ }, { prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter }, { prop: 'code', name: i18n.t('alarm.code') }, - { prop: 'typeDictValue', name: i18n.t('alarm.type') }, - { prop: 'gradeDictValue', name: i18n.t('alarm.level') }, + { prop: 'typeDictValue', name: i18n.t('alarm.type'), filter: dictFilter(dictEntries.alarmType.value) }, + { prop: 'gradeDictValue', name: i18n.t('alarm.level'), filter: dictFilter(dictEntries.alarmLevel.value) }, { prop: 'alarmContent', name: i18n.t('alarm.content') }, { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } ] diff --git a/src/views/modules/monitoring/equipmentHistoricalParameters.vue b/src/views/modules/monitoring/equipmentHistoricalParameters.vue index 61ec2e3..b9a0b63 100644 --- a/src/views/modules/monitoring/equipmentHistoricalParameters.vue +++ b/src/views/modules/monitoring/equipmentHistoricalParameters.vue @@ -6,7 +6,7 @@ > - + diff --git a/src/views/modules/monitoring/equipmentPlcConnect.vue b/src/views/modules/monitoring/equipmentPlcConnect.vue index 21d0ec5..1b508fe 100644 --- a/src/views/modules/monitoring/equipmentPlcConnect.vue +++ b/src/views/modules/monitoring/equipmentPlcConnect.vue @@ -10,7 +10,7 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + {{ $t('add') }}
- + Date: Wed, 28 Sep 2022 11:23:39 +0800 Subject: [PATCH 7/9] =?UTF-8?q?update=20=E6=9F=A5=E8=AF=A2=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/job/schedule-log.vue | 4 ++-- src/views/modules/job/schedule.vue | 4 ++-- src/views/modules/monitoring/equipment.vue | 4 ++-- src/views/modules/monitoring/equipmentAlarmLog.vue | 4 ++-- src/views/modules/monitoring/equipmentCurrentState.vue | 4 ++-- src/views/modules/monitoring/equipmentEfficiency.vue | 4 ++-- src/views/modules/monitoring/equipmentException.vue | 4 ++-- src/views/modules/monitoring/equipmentFile.vue | 4 ++-- src/views/modules/monitoring/equipmentGroup.vue | 4 ++-- src/views/modules/monitoring/equipmentGroupAlarm.vue | 4 ++-- .../modules/monitoring/equipmentHistoricalParameters.vue | 2 +- src/views/modules/monitoring/equipmentPlc.vue | 4 ++-- src/views/modules/monitoring/equipmentPlcConnect.vue | 4 ++-- src/views/modules/monitoring/equipmentPlcParam.vue | 4 ++-- src/views/modules/monitoring/equipmentQuantity.vue | 4 ++-- src/views/modules/monitoring/equipmentStatusLog.vue | 4 ++-- src/views/modules/monitoring/equipmentType.vue | 4 ++-- src/views/modules/monitoring/equipmentTypeFile.vue | 4 ++-- src/views/modules/monitoring/equipmentattr.vue | 4 ++-- src/views/modules/monitoring/factory.vue | 4 ++-- src/views/modules/monitoring/product.vue | 4 ++-- src/views/modules/monitoring/productArrt.vue | 4 ++-- src/views/modules/monitoring/productionLine.vue | 4 ++-- src/views/modules/monitoring/productionLineRecSch.vue | 4 ++-- src/views/modules/monitoring/qualityInspectionDet.vue | 4 ++-- src/views/modules/monitoring/qualityInspectionRecord.vue | 4 ++-- src/views/modules/monitoring/qualityInspectionType.vue | 4 ++-- src/views/modules/monitoring/reportCategory.vue | 4 ++-- src/views/modules/monitoring/reportDetail.vue | 4 ++-- src/views/modules/monitoring/reportSheet.vue | 4 ++-- src/views/modules/monitoring/reportSheetCategory.vue | 4 ++-- src/views/modules/monitoring/workShopSection.vue | 7 ++++--- src/views/modules/monitoring/workShopSectionEquipment.vue | 4 ++-- 33 files changed, 67 insertions(+), 66 deletions(-) diff --git a/src/views/modules/job/schedule-log.vue b/src/views/modules/job/schedule-log.vue index bf6b2c2..f76d0dc 100644 --- a/src/views/modules/job/schedule-log.vue +++ b/src/views/modules/job/schedule-log.vue @@ -1,11 +1,11 @@