From df257dbb879e8722ccb5c9bfe825b5c2cf18b1a8 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Mon, 14 Aug 2023 17:36:53 +0800 Subject: [PATCH] =?UTF-8?q?bug#420=E6=88=BF=E5=B1=8B=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=90=8E=E9=A6=96=E9=A1=B5=E4=BF=A1=E6=81=AF=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=90=8C=E6=AD=A5,=E4=BB=8E=E9=A6=96=E9=A1=B5=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E5=B1=85=E6=B0=91=E5=88=86=E7=B1=BB=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF=E5=90=8E=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=9D=A1=E4=BB=B6=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/base/resi.vue | 23 +++++++++++------------ src/views/modules/home/index.vue | 9 +++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index 01c12acf4..3e3c6e9f7 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -558,7 +558,7 @@ export default { ic_resi_view_real_data: true, //显示脱敏信息 }, - + category: this.$route.query.category, searchForm:{} }; }, @@ -582,13 +582,13 @@ export default { async mounted () { this.searchH = this.$refs.myResiSearch.offsetHeight; - this.displayedBaobiaoBtn = await this.$refs.baobiao.existsTemplate({ elseParams: { categoryKeys: ["resi_info"], categoryKey: "resi_info", }, }); + this.getTableData() // this.getQueryConditions(); }, @@ -634,7 +634,6 @@ export default { const { categoryKey, agencyId, level } = this.$refs.myResiSearch.form; // 深复制对象 let _obj = JSON.parse(JSON.stringify(this.$refs.myResiSearch.form)); - // 处理 categoryKey if (Array.isArray(categoryKey) && categoryKey.length) { _obj.categoryKey = categoryKey.join(","); @@ -1613,15 +1612,15 @@ export default { watch: { $route: { handler: function (newVal, oldVal) { - if (newVal.name == "base-resi") { - this.getTableData({ - categoryKey: - this.$store.state.categoryStr.categoryCode || "", - pageNo: this.currentPage, - pageSize: this.pageSize, - }); - // this.$refs.myResiSearch.form.categoryKey.push(this.$store.state.categoryStr.categoryCode) - this.$store.commit("setCategoryCode", ""); + if (newVal.name == "base-resi" && oldVal.name == 'home') { + console.log(newVal); + if( newVal.query.category){ + this.$nextTick(()=>{ + this.$refs.myResiSearch.form.categoryKey = [] + this.$refs.myResiSearch.form.categoryKey.push(newVal.query.category) + this.handleSearchFrom() + }) + } } }, deep: true, diff --git a/src/views/modules/home/index.vue b/src/views/modules/home/index.vue index 2c7275c82..2fcb751e8 100644 --- a/src/views/modules/home/index.vue +++ b/src/views/modules/home/index.vue @@ -340,6 +340,15 @@ export default { this.searchStatus = "ini"; } }, + $route: { + handler: function (newVal, oldVal) { + if (newVal.name == "home") { + this.getApiData(); + } + }, + deep: true, + immediate: true, + }, }, mounted() { this.getApiData();