riku
2025-05-09 977e332a5338942df338728dbfb77a359e35bd0b
src/views/historymode/HistoryMode.vue
@@ -92,6 +92,8 @@
      factorType: defaultOptions(TYPE0).value,
      // 监测数据
      factorDatas: new FactorDatas(),
      // 污染溯源结果
      pollutionData: undefined,
      // 决定绘制3D图形时是否与原图像合并
      merge: false,
      // 决定绘制完3D图形后地图视角是否自动回中
@@ -110,7 +112,9 @@
  watch: {
    factorType(nValue, oValue) {
      if (nValue != oValue && this.status == 0) {
        Layer.clear();
        this.draw();
        this.drawHighlightPollution();
      }
    }
  },
@@ -194,12 +198,21 @@
        }
      );
    },
    drawHighlightPollution() {
      this.pollutionData.forEach((e) => {
        if (this.factorType == e.factorId + '') {
          const fDatas = this.factorDatas.getByDate(e.startDate, e.endDate);
          Layer.drawHighLight3DLayer(fDatas, fDatas.factor[this.factorType]);
        }
      });
    },
    onFetchData(deviceType, data) {
      if (this.isUnmounted) return;
      // todo 根据设备类型切换地图监测因子展示单选框、折线图复选框、数据表格复选框的因子类型
      this.deviceType = deviceType;
      this.factorDatas.setData(data, this.drawMode, () => {
        this.factorDatas.refreshHeight(this.factorType);
        Layer.clear();
        this.draw();
      });
    },
@@ -227,14 +240,8 @@
    handleClick() {
      const { missionCode } = this.mission;
      dataAnalysisApi.pollutionTrace(missionCode).then((res) => {
        res.data.forEach((e) => {
          const fDatas = new FactorDatas();
          fDatas.setData(e.dataVoList, this.drawMode, () => {
            fDatas.refreshHeight(this.factorType);
            Layer.drawHighLight3DLayer(fDatas, fDatas.factor[this.factorType]);
            console.log(e.dataVoList);
          });
        });
        this.pollutionData = res.data;
        this.drawHighlightPollution();
      });
    }
  },