Browse Source

feat: 周报月报滚动高度记录逻辑调整

cuiyalong 2 năm trước cách đây
mục cha
commit
37c8d256a3
2 tập tin đã thay đổi với 22 bổ sung2 xóa
  1. 11 1
      src/views/reportData/pageMonth.vue
  2. 11 1
      src/views/reportData/pageWeek.vue

+ 11 - 1
src/views/reportData/pageMonth.vue

@@ -1100,7 +1100,13 @@ export default {
     },
     beforeTabLeave (targetActiveName) {
       this.recordScrollTop(this.tabActiveName)
-      this.recoverScrollTop(targetActiveName)
+      if (targetActiveName === '1') {
+        // 恢复到默认位置
+        this.recoverScrollTop(targetActiveName)
+      } else if (targetActiveName === '2') {
+        // 滚动到顶部
+        this.scrollToTab()
+      }
       return true
     },
     // 采购排行榜查看全部
@@ -1265,6 +1271,10 @@ export default {
         line-height: 50px;
         font-size: 16px;
         color: #686868;
+        &.is-active,
+        &:hover {
+          color: #2CB7CA;
+        }
       }
       .el-tabs__nav-wrap {
         &::after {

+ 11 - 1
src/views/reportData/pageWeek.vue

@@ -449,7 +449,13 @@ export default {
     },
     beforeTabLeave (targetActiveName) {
       this.recordScrollTop(this.tabActiveName)
-      this.recoverScrollTop(targetActiveName)
+      if (targetActiveName === '1') {
+        // 恢复到默认位置
+        this.recoverScrollTop(targetActiveName)
+      } else if (targetActiveName === '2') {
+        // 滚动到顶部
+        this.scrollToTab()
+      }
       return true
     },
     /* 数据处理 */
@@ -807,6 +813,10 @@ export default {
         line-height: 50px;
         font-size: 16px;
         color: #686868;
+        &.is-active,
+        &:hover {
+          color: #2CB7CA;
+        }
       }
       .el-tabs__nav-wrap {
         &::after {