From 4ad325c02c05a55a7edba9d79968610929480bb6 Mon Sep 17 00:00:00 2001 From: lb Date: Mon, 28 Aug 2023 14:56:56 +0800 Subject: [PATCH] =?UTF-8?q?done=20=E8=AE=BE=E5=A4=87=E5=88=86=E7=BB=84?= =?UTF-8?q?=E6=8A=A5=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DialogForm/index.vue | 6 +- src/utils/dict.js | 5 +- src/views/base/equipmentGroup/index.vue | 28 +++++- src/views/base/equipmentGroupAlarm/index.vue | 92 +++++++++++++++++--- 4 files changed, 111 insertions(+), 20 deletions(-) diff --git a/src/components/DialogForm/index.vue b/src/components/DialogForm/index.vue index 03b58d7e..c459b29d 100644 --- a/src/components/DialogForm/index.vue +++ b/src/components/DialogForm/index.vue @@ -126,8 +126,9 @@ export default { }, form: { get() { - if (this.dataLoaded) return this.dataForm; - else return {} + // if (this.dataLoaded) return this.dataForm; + // else return {} + return this.dataForm; }, set(val) { console.log('set form', val); @@ -228,6 +229,7 @@ export default { })) ); } else if (opt.input) { + console.log('setting code: ', response.data) // 处理输入框数据 this.form[opt.prop] = response.data; } diff --git a/src/utils/dict.js b/src/utils/dict.js index aa6c9f58..8c299355 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -88,7 +88,10 @@ export const DICT_TYPE = { PRODUCT_TYPE: 'product_type', // ============== ENERGY - 能源模块 ============= - ENERGY_UNIT: 'energy_unit' + ENERGY_UNIT: 'energy_unit', + + // ============== ENERGY - 能源模块 ============= + EQU_ALARM_LEVEL: 'equ_alarm_level' } /** diff --git a/src/views/base/equipmentGroup/index.vue b/src/views/base/equipmentGroup/index.vue index 88763a0b..ae10d52a 100644 --- a/src/views/base/equipmentGroup/index.vue +++ b/src/views/base/equipmentGroup/index.vue @@ -88,7 +88,7 @@ export default { { prop: 'code', label: '检测分组编码', align: 'center' }, { prop: 'remark', label: '备注', align: 'center' }, { - action: 'show-alert', + _action: 'equipment-group-show-alert', label: '报警', align: 'center', subcomponent: { @@ -103,8 +103,9 @@ export default { click: function () { console.log('inejctdata', _this.injectData); _this.$emit('emitData', { - action: _this.injectData.action, - value: _this.injectData.id, + action: _this.injectData._action, + // value: _this.injectData.id, + value: _this.injectData, }); }, }, @@ -202,6 +203,27 @@ export default { this.getList(); }, methods: { + /** 覆盖 handleEmitFun 的默认实现 */ + handleEmitFun({ action, value }) { + const { + id: equipmentGroupId, + name: equipmentGroupName, + code: equipmentGroupCode, + } = value; + switch (action) { + case 'equipment-group-show-alert': + // this.$router.push({ path: '/equipment/base/equipment-group-alarm' }); + this.$router.push({ + name: 'EquipmentGroupAlarm', + params: { + equipmentGroupId, + equipmentGroupCode, + equipmentGroupName, + }, + }); + break; + } + }, /** 查询列表 */ getList() { this.loading = true; diff --git a/src/views/base/equipmentGroupAlarm/index.vue b/src/views/base/equipmentGroupAlarm/index.vue index 80486857..01fd0821 100644 --- a/src/views/base/equipmentGroupAlarm/index.vue +++ b/src/views/base/equipmentGroupAlarm/index.vue @@ -1,8 +1,10 @@