Browse Source

Merge branch 'feature_20250904_历史拜访界面缓存优化' into uat(dev)

zhujindu 3 months ago
parent
commit
6ad62192d6

+ 13 - 13
src/views/historicalVisit/historAllVisit.vue

@@ -59,7 +59,7 @@
         </van-search>
       </div>
       <div class="lineGrey"></div>
-      <div v-if="refreshTotal" class="refreshBtn" @click="refresh">检测到 {{ refreshTotal }} 条更新,点击刷新</div>
+      <div v-if="refreshTotal" class="refreshBtn" @click="onSearch">检测到 {{ refreshTotal }} 条更新,点击刷新</div>
       <div v-if="refreshTotal" class="lineGrey"></div>
     </div>
     <!--        主体内容-->
@@ -264,17 +264,15 @@ export default {
       StaffShow: false,
       deptForm: { type: '', parentId: '' },
       pageNum: 1, // 当前页码  int类型
-      pageSize: 10, // 当前每页条数  int类型
+      pageSize: 20, // 当前每页条数  int类型
       userDeptLevel: null,
     };
   },
   activated() {
-    if(this.latestUpdateTime!=null){ 
-       this.getListTotalFn();
+    let type = this.$route.query.type;  
+    if(this.latestUpdateTime!=null && type == 1){ 
+      this.getListTotalFn();
     }
-    // setTimeout(() => {
-    //   this.onSearch();
-    // }, 1000);
   },
   created() {
     this.info();
@@ -310,13 +308,11 @@ export default {
         this.getDeptInfo('user');
       }, 2000);
     }
-    this.onSearch();
+    setTimeout(() => {
+      this.onSearch();
+    }, 1000);
   },
   methods: {
-    refresh(){
-      this.refreshTotal = 0;
-      this.onSearch();
-    },
     getListTotalFn(){
       getListTotal({
         startTime: this.startTime + ' 00:00:00', 
@@ -405,9 +401,13 @@ export default {
       this.onSearch();
     },
     onClickLeft() {
-      this.$router.go(-1);
+      this.$router.push({
+          path: '/My/index',
+      });
     },
     onSearch() {
+      this.refreshTotal = 0;
+      window.scrollTo(0, 0);
       this.pageNum = 1;
       this.list = [];
       this.getVisitsListFn();

+ 6 - 1
src/views/historicalVisit/historicalDetails.vue

@@ -434,7 +434,12 @@ export default {
           path: '/historicalVisit',
         });
       } else {
-        this.$router.go(-1);
+         this.$router.push({
+            path: '/historAllVisit',
+            query: {
+              type: 1,
+            },
+          });
       }
     },
   },

+ 1 - 1
src/views/week/index.vue

@@ -47,7 +47,7 @@
               <van-icon :name="storeselect" class="zicon" />
             </template>
           </van-cell>
-          <van-cell title="历史拜访" is-link to="/historAllVisit">
+          <van-cell title="历史拜访" is-link to="/historAllVisit?type=0">
             <template #icon>
               <van-icon :name="history" class="zicon" />
             </template>