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) {