From 42f42dc88214f283b43c422f37e10ab45c5c5578 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 12 三月 2025 17:32:13 +0800
Subject: [PATCH] 1. 新增绘图模式的切换 2. 新增行政区划的切换展示

---
 src/model/Factor.js |   41 +++++++++++++++++++++++++----------------
 1 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/src/model/Factor.js b/src/model/Factor.js
index b9983b1..5a720c1 100644
--- a/src/model/Factor.js
+++ b/src/model/Factor.js
@@ -60,24 +60,33 @@
   this.standardMin = -1; //鐩戞祴鍥犲瓙绫诲瀷瀵瑰簲鐨勬爣鍑嗘渶灏忓��
   this.standardMax = -1; //鐩戞祴鍥犲瓙绫诲瀷瀵瑰簲鐨勬爣鍑嗘渶澶у��
 
-  // this.legendType = Legend.S_TYPE; //鍥句緥妯″紡
-  this.legendType = Legend.D_TYPE; //鍥句緥妯″紡
+  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;
   }
 }
 

--
Gitblit v1.9.3