riku
2025-07-16 c23ac06446a9a1edc41cc13723e5d0b8eabdfd63
src/model/Factor.js
@@ -61,22 +61,32 @@
  this.standardMax = -1; //监测因子类型对应的标准最大值
  this.legendType = Legend.S_TYPE; //图例模式
  // this.legendType = Legend.D_TYPE; //图例模式
  if (options != undefined) {
    this.datas = options.datas;
    this.heights = options.heights;
    this.min = options.min;
    this.max = options.max;
    this.originMin = options.originMin;
    this.originMax = options.originMax;
  if (typeof options === 'object') {
    for (const key in options) {
      if (Object.prototype.hasOwnProperty.call(options, key)) {
        const value = options[key];
        this[key] = value;
      }
    }
    this.factorName = options.factorName;
    this.factorId = options.factorId;
    this.colors = options.colors;
    this.bottomColors = options.bottomColors;
    this.bottomColor = options.bottomColor;
    this.standardMin = options.standardMin;
    this.standardMax = options.standardMax;
    // this.datas = options.datas;
    // this.heights = options.heights;
    // this.min = options.min;
    // this.max = options.max;
    // this.originMin = options.originMin;
    // this.originMax = options.originMax;
    // this.factorName = options.factorName;
    // this.factorId = options.factorId;
    // this.colors = options.colors;
    // this.bottomColors = options.bottomColors;
    // this.bottomColor = options.bottomColor;
    // this.standardMin = options.standardMin;
    // this.standardMax = options.standardMax;
    // this.legendType = options.legendType;
  }
}
@@ -127,7 +137,7 @@
    this.heights = [];
    this.colors = [];
    this.datas.forEach((d) => {
      const h = getFactorHeight(d.factorId, d.factorData, [this.min, this.max]);
      let h = getFactorHeight(d.factorId, d.factorData, [this.min, this.max]);
      if (d.factorData == -1) {
        h = -1;
      }