From 980210de48d28a7645553c741b097311494fb960 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 11 十一月 2021 14:42:55 +0800
Subject: [PATCH] 2021-11-11

---
 src/tabviews/zshare/normalTable/index.jsx |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx
index 2db7a13..339d1f3 100644
--- a/src/tabviews/zshare/normalTable/index.jsx
+++ b/src/tabviews/zshare/normalTable/index.jsx
@@ -55,7 +55,8 @@
     columns: null,        // 鏄剧ず鍒�
     lineMarks: null,      // 琛屾爣璁�
     activeIndex: null,    // 鏍囪褰撳墠閫変腑琛�
-    rowspans: null        // 琛屽悎骞跺瓧娈典俊鎭�
+    rowspans: null,       // 琛屽悎骞跺瓧娈典俊鎭�
+    pageOptions: []
   }
 
   UNSAFE_componentWillMount () {
@@ -221,8 +222,17 @@
         rowspans = null
       }
     }
+
+    let size = (setting.pageSize || 10) + ''
+    let pageOptions = ['10', '25', '50', '100', '500', '1000']
+
+    if (!pageOptions.includes(size)) {
+      pageOptions.push(size)
+      pageOptions = pageOptions.sort((a, b) => a - b)
+    }
     
     this.setState({
+      pageOptions,
       columns: _columns,
       pageSize: pageSize ? pageSize : 10,
       lineMarks,
@@ -1156,7 +1166,7 @@
 
   render() {
     const { setting, pickup, statFValue } = this.props
-    const { selectedRowKeys, lineMarks, activeIndex } = this.state
+    const { selectedRowKeys, lineMarks, activeIndex, pageOptions } = this.state
 
     let components = {
       body: {}
@@ -1205,7 +1215,7 @@
       _pagination = {
         current: this.state.pageIndex,
         pageSize: this.state.pageSize,
-        pageSizeOptions: ['10', '25', '50', '100', '500', '1000'],
+        pageSizeOptions: pageOptions,
         showSizeChanger: true,
         total: this.props.total || 0,
         showTotal: (total, range) => `${range[0]}-${range[1]} ${this.props.dict['main.pagination.of']} ${total} ${this.props.dict['main.pagination.items']}`

--
Gitblit v1.8.0