11
董国庆
2026-01-29 9cd6d09f95e80c5bd1f5eb7f4b0ee96831b48d70
11
1个文件已修改
35 ■■■■■ 已修改文件
screen/src/view/accidentCase/index.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/view/accidentCase/index.vue
@@ -235,7 +235,9 @@
    return {
      dateTime: null,
      dateTime2: null,
      province: null,
      city: null,
      area: null,
      classifyId: null,
      content: "",
      dateTxt: "",
@@ -342,11 +344,26 @@
    // 城市选择变化
    handleCityChange(value) {
      // 重置所有地区字段
      this.province = null;
      this.city = null;
      this.area = null;
      if (value && value.length > 0) {
        // 取最后一级作为城市
        this.city = value[value.length - 1];
      } else {
        this.city = null;
        // 根据选择的级别,设置对应的字段
        if (value.length === 1) {
          // 只选择了省份
          this.province = value[0];
        } else if (value.length === 2) {
          // 选择了省份和城市
          this.province = value[0];
          this.city = value[1];
        } else if (value.length === 3) {
          // 选择了省份、城市和区县
          this.province = value[0];
          this.city = value[1];
          this.area = value[2];
        }
      }
      this.handleSearch();
    },
@@ -372,9 +389,15 @@
          pageSize: this.pageSize,
        };
        // 添加筛选条件
        // 添加筛选条件 - 根据选择的级别传递对应的参数
        if (this.province) {
          params.province = this.province;
        }
        if (this.city) {
          params.city = this.city;
        }
        if (this.area) {
          params.area = this.area;
        }
        if (this.classifyId) {
          params.classifyId = this.classifyId;
@@ -488,7 +511,9 @@
    // 清除城市选择
    handleClearCity() {
      this.cascaderValue = [];
      this.province = null;
      this.city = null;
      this.area = null;
      this.handleSearch();
    },