From 0a36d001d1be497d50e30b43abb9e02d36037f6e Mon Sep 17 00:00:00 2001
From: 徐旺旺 <11530253@qq.com>
Date: 星期四, 13 五月 2021 18:27:30 +0800
Subject: [PATCH] 分页

---
 src/components/helpers/WfsHelper.js |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/src/components/helpers/WfsHelper.js b/src/components/helpers/WfsHelper.js
index 9f9b781..fb69871 100644
--- a/src/components/helpers/WfsHelper.js
+++ b/src/components/helpers/WfsHelper.js
@@ -6,11 +6,21 @@
   this.filters = []
   this.typeNames = []
   this.url = WFS_URL
+  this.page = 1
+  this.pageSize = 10
   this.params = {
     REQUEST: 'getfeature',
     OUTPUTFORMAT: 'application/json',
-    maxFeatures: 20000,
+    maxFeatures: 10,
     version: '1.0.0'
+  }
+
+  this.setTypeName = (typeName) => {
+    this.typeNames = typeName
+  }
+
+  this.clearFilter = () => {
+    this.filters = []
   }
 
   this.addTypeName = (typeName) => {
@@ -89,6 +99,16 @@
     }
     return url + this.getUrlParams()
   }
+
+  this.setPage = (page) => {
+    const startIndex = page * this.pageSize
+    this.params.startIndex = startIndex
+    this.page = page
+  }
+
+  this.setPageSize = (pageSize) => {
+    this.pageSize = pageSize
+  }
 }
 
 export default WfsHelper

--
Gitblit v1.8.0