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();