From 1a08525fe39ea67325725c75dcf0397b9fdb710f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 03 六月 2021 16:57:13 +0800
Subject: [PATCH] 2021-06-03

---
 src/tabviews/custom/components/card/data-card/index.jsx |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index 26ab796..90e0085 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -86,7 +86,7 @@
         item.key = index
         item.$$uuid = item[_config.setting.primaryKey] || ''
         item.$$BID = BID || ''
-        item.$Index = index + 1
+        item.$Index = index + 1 + ''
         return item
       })
     }
@@ -147,7 +147,7 @@
         item.key = index
         item.$$uuid = item[config.setting.primaryKey] || ''
         item.$$BID = BID || ''
-        item.$Index = index + 1
+        item.$Index = index + 1 + ''
         return item
       })
 
@@ -182,7 +182,15 @@
 
     if (config.uuid !== menuId) return
 
-    this.loadData(btn)                                                         // 鏁版嵁鍒锋柊
+    if (!btn || btn.resetPageIndex !== 'false') {
+      this.setState({
+        pageIndex: 1
+      }, () => {
+        this.loadData()
+      })
+    } else {
+      this.loadData()
+    }
 
     if (btn.syncComponentId && btn.syncComponentId !== config.uuid && btn.syncComponentId !== config.setting.supModule) {
       MKEmitter.emit('reloadData', btn.syncComponentId)                        // 鍚岀骇鏍囩鍒锋柊
@@ -193,6 +201,20 @@
     } else if (position === 'popclose') {                                      // 鏍囩鍏抽棴鍒锋柊
       config.setting.supModule && MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty'))
       btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId)
+    }
+  }
+
+  reloadData = (btn) => {
+    if (!btn || btn.resetPageIndex !== 'false') {
+      this.setState({
+        pageIndex: 1
+      }, () => {
+        this.loadmaindata(true, 'true')
+        this.getStatFieldsValue()
+      })
+    } else {
+      this.loadmaindata(true, 'false')
+      this.getStatFieldsValue()
     }
   }
 
@@ -214,7 +236,7 @@
 
     if (!config.setting.supModule || config.setting.supModule !== MenuID) return
     if (id !== this.state.BID) {
-      this.setState({ BID: id, BData: data }, () => {
+      this.setState({ BID: id, BData: data, pageIndex: 1 }, () => {
         this.loadData()
       })
     }
@@ -304,7 +326,7 @@
           item.key = index
           item.$$uuid = item[config.setting.primaryKey] || ''
           item.$$BID = BID || ''
-          item.$Index = index + start
+          item.$Index = index + start + ''
           return item
         }),
         total: result.total,

--
Gitblit v1.8.0