From 63de1e2ae6d1197d28d4cf1f6c191e6effeb978b Mon Sep 17 00:00:00 2001
From: liuwh <liuwh@hugeinfo.com.cn>
Date: Thu, 05 Mar 2020 16:33:59 +0800
Subject: [PATCH] 修复

---
 SunshineIns/src/page/CareList.jsx |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/SunshineIns/src/page/CareList.jsx b/SunshineIns/src/page/CareList.jsx
index 1fa8e21..2f858bb 100644
--- a/SunshineIns/src/page/CareList.jsx
+++ b/SunshineIns/src/page/CareList.jsx
@@ -77,12 +77,23 @@
         this.setState({
             formData: data,
         });
-        this.getData();
+        this.setState({ loading: true })
+        Fetch.socialQuery({ ...data })
+            .then(res => {
+                console.log(res)
+                for (var i = 0; i < res.rows.length; i++) {
+                    res.rows[i]['index'] = i + 1;
+                }
+                this.setState({
+                    data: res.rows,
+                    loading: false,
+                });
+            });
     }
 
     getData = () => {
         const { formData } = this.state;
-        this.setState({loading:true})
+        this.setState({ loading: true })
         Fetch.socialQuery({ ...formData })
             .then(res => {
                 console.log(res)
@@ -91,7 +102,7 @@
                 }
                 this.setState({
                     data: res.rows,
-                    loading:false,
+                    loading: false,
                 });
             });
     }
@@ -158,7 +169,7 @@
             key: 'status',
             render: text => (
                 text == 0 ?
-                    <Badge style={{ backgroundColor: '#6C757C' }} count={'已结束'} /> : text == 1 ? <Badge count={'进行中'} style={{ backgroundColor: '#6C757C' }} />: text == 2 ? <Badge count={'进行中'} style={{ backgroundColor: '#6C757C' }} /> : <Badge count={'已结束'} style={{ backgroundColor: '#2ECC71' }} />
+                    <Badge style={{ backgroundColor: '#6C757C' }} count={'已结束'} /> : text == 1 ? <Badge count={'进行中'} style={{ backgroundColor: '#6C757C' }} /> : text == 2 ? <Badge count={'进行中'} style={{ backgroundColor: '#6C757C' }} /> : <Badge count={'已结束'} style={{ backgroundColor: '#2ECC71' }} />
             )
         }, {
             title: '创建时间',
@@ -175,7 +186,7 @@
             dataIndex: 'endTime',
             key: 'endTime',
             render: text => <span>{moment(text).format("YYYY-MM-DD HH:mm")}</span>
-        },{
+        }, {
             title: '操作',
             key: 'action',
             render: (text, record) => (
@@ -240,7 +251,7 @@
                                 keylistName: 'rangeTimelist',
                             },
                         ]} />
-                    <TableView columns={columns} data={data} pageSize='10' size='default' loading={loading}/>
+                    <TableView columns={columns} data={data} pageSize='10' size='default' loading={loading} />
                 </div>
             </div>
         );

--
Gitblit v1.8.0