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 @@