董国庆
2026-01-30 148f624343b09e7ad1938edf13474093013a7282
切换tab不变条件
1个文件已修改
31 ■■■■■ 已修改文件
screen/src/view/hiddenDanger/index.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/view/hiddenDanger/index.vue
@@ -628,6 +628,10 @@
      startDateTxt: "",
      endDateTxt: "",
      // 保存从路由获取的时间参数,用于切换tab时保留
      routeStartTime: null,
      routeEndTime: null,
      // 下拉选项
      projectList: [], // 项目列表
      reformedOptions: [], // 整改状态选项
@@ -720,6 +724,8 @@
          this.searchForm.startTime = moment(newVal).format(
            "YYYY-MM-DD HH:mm:ss"
          );
          // 更新保存的路由时间
          this.routeStartTime = this.searchForm.startTime;
          // 选择时间后自动请求
          this.handleSelectChange();
        } else {
@@ -737,6 +743,8 @@
          this.searchForm.endTime = moment(newVal).format(
            "YYYY-MM-DD HH:mm:ss"
          );
          // 更新保存的路由时间
          this.routeEndTime = this.searchForm.endTime;
          // 选择时间后自动请求
          this.handleSelectChange();
        } else {
@@ -767,10 +775,12 @@
    // 接收从 home 页面传递过来的时间参数并回填
    if (this.$route.query.startTime) {
      this.routeStartTime = this.$route.query.startTime;
      this.startDateTime = new Date(this.$route.query.startTime);
      this.searchForm.startTime = this.$route.query.startTime;
    }
    if (this.$route.query.endTime) {
      this.routeEndTime = this.$route.query.endTime;
      this.endDateTime = new Date(this.$route.query.endTime);
      this.searchForm.endTime = this.$route.query.endTime;
    }
@@ -839,12 +849,23 @@
        reformed: null,
        type: this.currentType,
        level: null,
        startTime: null,
        endTime: null,
        startTime: this.routeStartTime || null, // 保留路由传递的开始时间
        endTime: this.routeEndTime || null, // 保留路由传递的结束时间
        content: "",
      };
      this.startDateTime = null;
      this.endDateTime = null;
      // 保留时间选择器的值
      if (this.routeStartTime) {
        this.startDateTime = new Date(this.routeStartTime);
      } else {
        this.startDateTime = null;
      }
      if (this.routeEndTime) {
        this.endDateTime = new Date(this.routeEndTime);
      } else {
        this.endDateTime = null;
      }
    },
    // 加载项目列表
@@ -953,10 +974,12 @@
        this.startDateTime = null;
        this.startDateTxt = "";
        this.searchForm.startTime = null;
        this.routeStartTime = null; // 清除保存的路由时间
      } else {
        this.endDateTime = null;
        this.endDateTxt = "";
        this.searchForm.endTime = null;
        this.routeEndTime = null; // 清除保存的路由时间
      }
      this.handleSelectChange();
    },