From 3d3ffa9d5fbaa7a2995f11ef531cbabd1e58e757 Mon Sep 17 00:00:00 2001 From: liujun Date: Sat, 3 Feb 2024 13:55:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=98=B2=E5=9F=BA=E7=A1=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fireUtilReport/components/fireRecord.vue | 2 +- .../fireUtilReport/components/recordInfo.vue | 6 +++--- .../fireUtilReport/components/recordList.vue | 17 ++++++++++------- src/views/firefighting/fireUtilReport/index.vue | 3 ++- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/views/firefighting/fireUtilReport/components/fireRecord.vue b/src/views/firefighting/fireUtilReport/components/fireRecord.vue index 541eb93..9e35016 100644 --- a/src/views/firefighting/fireUtilReport/components/fireRecord.vue +++ b/src/views/firefighting/fireUtilReport/components/fireRecord.vue @@ -282,7 +282,7 @@ export default { }, goDetail(id, FIRE_RECORD_ID) { - this.setActiveName('RecordInfo') + this.setActiveName('RecordList') const info = this.getInfo() info.FIRE_CHECK_ID = id info.FIRE_RECORD_ID = FIRE_RECORD_ID diff --git a/src/views/firefighting/fireUtilReport/components/recordInfo.vue b/src/views/firefighting/fireUtilReport/components/recordInfo.vue index f5ab0a5..9de9304 100644 --- a/src/views/firefighting/fireUtilReport/components/recordInfo.vue +++ b/src/views/firefighting/fireUtilReport/components/recordInfo.vue @@ -243,8 +243,8 @@ export default { created() { this.FIRE_CHECK_ID = this.getInfo().FIRE_CHECK_ID this.FIRE_RECORD_ID = this.getInfo().FIRE_RECORD_ID - this.SHOW_OR_EDIT = this.$parent.SHOW_OR_EDIT - this.recordBase = Object.assign({}, this.$parent.row) + this.SHOW_OR_EDIT = this.getInfo().SHOW_OR_EDIT + this.recordBase = Object.assign({}, this.getInfo().row) this.getData() this.getSignImgs(this.FIRE_RECORD_ID) }, @@ -310,7 +310,7 @@ export default { this.$refs.information.init(id) }, back() { - this.$parent.activeName = 'RecordList' + this.setActiveName('RecordList') }, // 获取详情 getData() { diff --git a/src/views/firefighting/fireUtilReport/components/recordList.vue b/src/views/firefighting/fireUtilReport/components/recordList.vue index c10fe85..c7620a0 100644 --- a/src/views/firefighting/fireUtilReport/components/recordList.vue +++ b/src/views/firefighting/fireUtilReport/components/recordList.vue @@ -125,6 +125,7 @@ export default { this.getList() this.hasButton() }, + inject: ['setActiveName', 'getInfo', 'setInfo'], methods: { getRowKey(row) { return row.CHECKRECORD_ID @@ -142,7 +143,7 @@ export default { { STARTTIME: this.dates[0], ENDTIME: this.dates[1], - FIRE_CHECK_ID: this.$parent.FIRE_CHECK_ID, + FIRE_CHECK_ID: this.getInfo().FIRE_CHECK_ID, KEYWORDS: this.KEYWORDS, STATUS: this.STATUS } @@ -198,15 +199,17 @@ export default { }, // 检查记录 goCheck(row, id, FIRE_RECORD_ID) { - this.$parent.FIRE_CHECK_ID = id - this.$parent.FIRE_RECORD_ID = FIRE_RECORD_ID - this.$parent.SHOW_OR_EDIT = 'SHOW' - this.$parent.row = row - this.$parent.activeName = 'RecordInfo' + const info = this.getInfo() + info.FIRE_CHECK_ID = id + info.FIRE_RECORD_ID = FIRE_RECORD_ID + info.SHOW_OR_EDIT = 'SHOW' + info.row = row + this.setInfo(info) + this.setActiveName('RecordInfo') }, // 返回 back() { - this.$parent.activeName = 'List' + this.setActiveName('FireRecord') }, hasButton: function() { var keys = 'checkrecord:add,checkrecord:del,checkrecord:edit,toExcel' diff --git a/src/views/firefighting/fireUtilReport/index.vue b/src/views/firefighting/fireUtilReport/index.vue index 5a49d71..ddde339 100644 --- a/src/views/firefighting/fireUtilReport/index.vue +++ b/src/views/firefighting/fireUtilReport/index.vue @@ -6,9 +6,10 @@ import List from './components/list' import FireRecord from './components/fireRecord.vue' import FireList from './components/fireList.vue' import RecordInfo from './components/recordInfo.vue' +import RecordList from './components/recordList.vue' export default { components: { - List, FireRecord, FireList, RecordInfo + List, FireRecord, FireList, RecordInfo, RecordList }, data() { return {