From f9587ea0bb7a837adccdae952802da70b9edc25c Mon Sep 17 00:00:00 2001 From: song Date: Tue, 1 Mar 2022 17:57:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=96=B0=E9=97=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/News/addOrEdit.vue | 12 +++++++----- src/components/News/index.vue | 8 +++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/News/addOrEdit.vue b/src/components/News/addOrEdit.vue index 3af7049..dc1b827 100644 --- a/src/components/News/addOrEdit.vue +++ b/src/components/News/addOrEdit.vue @@ -178,11 +178,13 @@ if(!this.formLabelAlign.publishTime){ this.formLabelAlign.publishTime = new Date() } - if(!code) return - this.formLabelAlign.showPage.splice(0, 1, code.slice(0, 2)) - this.formLabelAlign.showPage.splice(1, 1, code) - if(code === '0204'){ - this.formLabelAlign.showPage = ['02', '0203'] + if(this.showAdd){ + if(!code) return + this.formLabelAlign.showPage.splice(0, 1, code.slice(0, 2)) + this.formLabelAlign.showPage.splice(1, 1, code) + if(code === '0204'){ + this.formLabelAlign.showPage = ['02', '0203'] + } } }, diff --git a/src/components/News/index.vue b/src/components/News/index.vue index 2307822..0bace29 100644 --- a/src/components/News/index.vue +++ b/src/components/News/index.vue @@ -147,7 +147,8 @@ showAdd: true, detailContent: null, keys: [], - loading: true + loading: true, + options: {} } }, @@ -160,6 +161,7 @@ * 获取详情列表 */ getList(options) { + this.options = options; const { pageNum, pageSize, showPage } = this; const params = { pageNum, @@ -291,7 +293,7 @@ this.showModal = false if(type){ this.keys = [] - this.getList() + this.getList(this.options) } }, @@ -310,7 +312,7 @@ DELETE_DETAIL(params).then((res) => { if(res.code === 200){ Alert.success('删除成功'); - this.getList() + this.getList(this.options) }else{ Alert.fail(res.msg || '删除失败'); }