From 736fc698eeb4f61f47d8888d5bc7dd148c08de3e Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Tue, 15 Aug 2023 18:48:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=B7=B3=E8=BD=AC=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E4=BF=A1=E6=81=AF=E4=BC=A0=E5=8F=82=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BAparams?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/base/resi.vue | 22 +++++++++++----------- src/views/modules/home/index.vue | 9 +++++---- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index 08d345356..c6190af1b 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -582,8 +582,6 @@ export default { categoryKey: "resi_info", }, }); - this.getTableData() - // this.getQueryConditions(); }, methods: { @@ -1362,20 +1360,22 @@ export default { watch: { $route: { handler: function (newVal, oldVal) { - if (newVal.name == "base-resi" && oldVal.name == 'home') { - console.log(newVal); - if( newVal.query.category){ + if (newVal.name == "base-resi") { this.$nextTick(()=>{ - this.$refs.myResiSearch.form.categoryKey = [] - this.$refs.myResiSearch.form.categoryKey.push(newVal.query.category) - this.handleSearchFrom() + if( newVal.params.category){ + this.$refs.myResiSearch.form.categoryKey = [] + this.$refs.myResiSearch.form.categoryKey.push(newVal.params.category) + this.handleSearchFrom() + }else{ + this.$refs.myResiSearch.form.categoryKey = [] + this.getTableData() + } }) - } } }, deep: true, - immediate: true, - }, + immediate: true + } }, }; diff --git a/src/views/modules/home/index.vue b/src/views/modules/home/index.vue index 2fcb751e8..64d235ec3 100644 --- a/src/views/modules/home/index.vue +++ b/src/views/modules/home/index.vue @@ -363,11 +363,12 @@ export default { }, handleClickCategory(item) { this.$router.push({ - path: "/main/base-resi", - query: { - category: item.code, - }, + name: "base-resi", + params: { + category: item.code + } }); + }, handleClickNotice(item) {