| | |
| | | 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 = () => { |
| | |
| | | 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: '创建时间', |
| | |
| | | key: 'action', |
| | | render: (text, record) => ( |
| | | <span> |
| | | { |
| | | record.status == 1 ? |
| | | <React.Fragment> |
| | | <Divider type="vertical" /> |
| | | <a onClick={() => this.showModal(record.id)}>结束任务</a> |
| | | </React.Fragment> : |
| | | <React.Fragment> |
| | | <a onClick={() => this.showModal(record.id)}>编辑</a> |
| | | <Divider type="vertical" /> |
| | | <Popconfirm |
| | |
| | | > |
| | | <a href="#">删除</a> |
| | | </Popconfirm> |
| | | { |
| | | record.status == 1 ? |
| | | <React.Fragment> |
| | | <Divider type="vertical" /> |
| | | <a onClick={() => this.showModal(record.id)}>结束任务</a> |
| | | </React.Fragment> : '' |
| | | </React.Fragment> |
| | | } |
| | | </span> |
| | | ), |