riku
2024-09-02 02349238af964e19a46da93e20466a48d755a453
src/views/historymode/HistoryMode.vue
@@ -42,6 +42,7 @@
      @table-click="handelIndexChange"
      :factor-datas="factorDatas"
      :device-type="deviceType"
      :device-code="deviceCode"
    ></DataSheet>
  </div>
</template>
@@ -152,21 +153,28 @@
      mapUtil.setCenter(pr.p);
      // mapUtil.setFitSector(pr);
      // 2. 绘制对话框
      DialogUtil.openNewWindow(this.deviceCode, this.factorDatas, index, () => {
        // 移除扇形区域
        sector.clearSector();
      });
      DialogUtil.openNewWindow(
        this.deviceType,
        this.deviceCode,
        this.factorDatas,
        index,
        () => {
          // 移除扇形区域
          sector.clearSector();
        }
      );
    },
    onFetchData(type, data) {
    onFetchData(deviceType, data) {
      // todo 根据设备类型切换地图监测因子展示单选框、折线图复选框、数据表格复选框的因子类型
      this.deviceType = type;
      this.deviceType = deviceType;
      this.factorDatas.setData(data, this.drawMode, () => {
        this.factorDatas.refreshHeight(this.factorType);
        this.draw();
      });
    },
    fetchHistroyData(option) {
      const { deviceCode, type, timeArray } = option;
      const { deviceType, deviceCode, timeArray } = option;
      this.deviceType = deviceType;
      this.deviceCode = deviceCode;
      let startTime, endTime;
      if (timeArray && timeArray.length == 2) {
@@ -175,12 +183,13 @@
      }
      this.fetchData((page, pageSize) => {
        return fetchHistoryData({
          deviceType,
          deviceCode,
          startTime,
          endTime,
          page,
          perPage: pageSize
        }).then((res) => this.onFetchData(type, res.data));
        }).then((res) => this.onFetchData(deviceType, res.data));
      });
    }
    // fetchRealTimeData() {