From 6afdec0062dacbded57e166230eb22cc55ced0c1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 08 五月 2021 14:30:21 +0800
Subject: [PATCH] 2021-05-08

---
 src/tabviews/custom/components/card/table-card/index.jsx |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx
index 1ce92a1..4babfe6 100644
--- a/src/tabviews/custom/components/card/table-card/index.jsx
+++ b/src/tabviews/custom/components/card/table-card/index.jsx
@@ -27,7 +27,6 @@
     config: null,              // 鍥捐〃閰嶇疆淇℃伅
     loading: false,            // 鏁版嵁鍔犺浇鐘舵��
     search: null,              // 鎼滅储鏉′欢
-    preIndex: 0,               // 寮�濮嬬储寮�
     pageIndex: 1,              // 椤电爜
     total: 0,                  // 鎬绘暟
     sync: false,               // 鏄惁缁熶竴璇锋眰鏁版嵁
@@ -59,6 +58,7 @@
         item.key = index
         item.$$uuid = item[_config.setting.primaryKey] || ''
         item.$$BID = BID || ''
+        item.$Index = index + 1
         return item
       })
     }
@@ -138,6 +138,7 @@
         item.key = index
         item.$$uuid = item[config.setting.primaryKey] || ''
         item.$$BID = BID || ''
+        item.$Index = index + 1
         return item
       })
 
@@ -229,8 +230,7 @@
     if (config.setting.supModule && !BID) { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇�
       this.setState({
         data: [],
-        total: 0,
-        preIndex: 0
+        total: 0
       })
       return
     }
@@ -254,9 +254,9 @@
 
     let result = await Api.genericInterface(param)
     if (result.status) {
-      let _preIndex = 0
+      let start = 1
       if (config.setting.laypage) {
-        _preIndex = config.setting.pageSize * (pageIndex - 1)
+        start = config.setting.pageSize * (pageIndex - 1) + 1
       }
 
       this.setState({
@@ -264,10 +264,10 @@
           item.key = index
           item.$$uuid = item[config.setting.primaryKey] || ''
           item.$$BID = BID || ''
+          item.$Index = index + start
           return item
         }),
         total: result.total,
-        preIndex: _preIndex,
         loading: false
       })
     } else {
@@ -290,7 +290,7 @@
     })
   }
 
-  getLines = (data, seq) => {
+  getLines = (data) => {
     const { config } = this.state
 
     let line = []
@@ -321,7 +321,7 @@
       line.push(
         <Col key={index} span={24}>
           <div className="card-item-box" style={item.style}>
-            <CardCellComponent seq={seq} data={data} cards={config} cardCell={item} elements={item.elements}/>
+            <CardCellComponent data={data} cards={config} cardCell={item} elements={item.elements}/>
           </div>
         </Col>
       )
@@ -340,7 +340,7 @@
   }
 
   render() {
-    const { config, loading, data, BID, pageIndex, preIndex, total } = this.state
+    const { config, loading, data, BID, pageIndex, total } = this.state
 
     return (
       <div className="custom-table-card-box" style={{...config.style}}>
@@ -352,7 +352,7 @@
         }
         <NormalHeader config={config} BID={BID} menuType={this.props.menuType} refresh={this.refreshSearch} />
         {data && data.length > 0 ? <Row className="card-row-list" style={{height: config.wrap.contentHeight}}>
-          {data.map((item, index) => this.getLines(item, preIndex + index + 1))}
+          {data.map(item => this.getLines(item))}
         </Row> : null}
         {data && data.length === 0 ? <div className="card-row-list" style={{height: config.wrap.contentHeight}}>
           <Empty description={false}/>

--
Gitblit v1.8.0