From 4b275f2093954cc58bbc23e4fc67e67d6fe81c0b Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期日, 13 七月 2025 22:46:35 +0800
Subject: [PATCH] 2025.7.13 污染动态溯源

---
 src/model/FactorDatas.js |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/model/FactorDatas.js b/src/model/FactorDatas.js
index eba6446..f285080 100644
--- a/src/model/FactorDatas.js
+++ b/src/model/FactorDatas.js
@@ -1,6 +1,7 @@
 import { Factor } from './Factor';
 import calculate from '@/utils/map/calculate';
 import { Legend } from './Legend';
+import moment from 'moment';
 
 /**
  *
@@ -200,6 +201,20 @@
     });
   },
 
+  getByDate(s, e) {
+    const sTime = moment(s).format('YYYY-MM-DD HH:mm:ss');
+    const eTime = moment(e).format('YYYY-MM-DD HH:mm:ss');
+    const sIndex = this.times.findIndex((v) => {
+      return v == sTime;
+    });
+    const eIndex = this.times.findIndex((v) => {
+      return v == eTime;
+    });
+    if (sIndex != -1 && eIndex != -1) {
+      return this.getByIndex(sIndex, eIndex);
+    }
+  },
+
   // 鑾峰彇鏁版嵁闀垮害
   length: function () {
     return this.lnglats_GD.length;

--
Gitblit v1.9.3