From a2d1b9886b00b5f4d4722c3379d3bd4f2f94b421 Mon Sep 17 00:00:00 2001
From: LAPTOP-RI7D261L\Mr Ke <545800322@qq.com>
Date: Mon, 09 Mar 2020 17:02:35 +0800
Subject: [PATCH] Merge branch 'master' of http://120.79.193.119:9090/r/nsjcy/frontEnd/nsjcy

---
 SunshineIns/src/page/CareList.jsx |   49 +++++++++++++++++++++++++++++++------------------
 1 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/SunshineIns/src/page/CareList.jsx b/SunshineIns/src/page/CareList.jsx
index 1fa8e21..2b2fa4e 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,28 +186,30 @@
             dataIndex: 'endTime',
             key: 'endTime',
             render: text => <span>{moment(text).format("YYYY-MM-DD HH:mm")}</span>
-        },{
+        }, {
             title: '操作',
             key: 'action',
             render: (text, record) => (
                 <span>
-                    <a onClick={() => this.showModal(record.id)}>编辑</a>
-                    <Divider type="vertical" />
-                    <Popconfirm
-                        title="确认删除任务吗?"
-                        id={record.id}
-                        onConfirm={e => this.confirm(record.id)}
-                        okText="确定"
-                        cancelText="取消"
-                    >
-                        <a href="#">删除</a>
-                    </Popconfirm>
                     {
                         record.status == 1 ?
                             <React.Fragment>
                                 <Divider type="vertical" />
                                 <a onClick={() => this.showModal(record.id)}>结束任务</a>
-                            </React.Fragment> : ''
+                            </React.Fragment> :
+                            <React.Fragment>
+                                <a onClick={() => this.showModal(record.id)}>编辑</a>
+                                <Divider type="vertical" />
+                                <Popconfirm
+                                    title="确认删除任务吗?"
+                                    id={record.id}
+                                    onConfirm={e => this.confirm(record.id)}
+                                    okText="确定"
+                                    cancelText="取消"
+                                >
+                                    <a href="#">删除</a>
+                                </Popconfirm>
+                            </React.Fragment>
                     }
                 </span>
             ),
@@ -240,7 +253,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