forked from nsjcy/frontEnd/nsjcy

liuwh
2020-06-09 5a887acf1924950715086633d329db045223b5c4
SunshineIns/src/page/CareList.jsx
@@ -142,13 +142,13 @@
        }, this.getData);
    }
    reboot = (e,status) => {
    reboot = (e, status) => {
        this.setState({ loading: true })
        Fetch.socialUpdate(e, status).then(res => {
            if (res.code == 0) {
                console.log(res)
                this.setState({ loading: false })
                message.success(status==0?'重启任务成功':'暂停任务成功');
                message.success(status == 0 ? '重启任务成功' : '暂停任务成功');
                this.getData();
            } else {
                this.setState({ loading: false })
@@ -215,7 +215,7 @@
                    {
                        record.status == 0 ?
                            <React.Fragment>
                                <a onClick={() => this.showModal(record.id)}>编辑</a>
                                <a onClick={() => this.showModal(record.id)}>查看</a>
                                <Divider type="vertical" />
                                <Popconfirm
                                    title="确认删除任务吗?"
@@ -229,19 +229,11 @@
                                </Popconfirm>
                                <a onClick={() => this.reboot(record.id, 99)}>暂停</a>
                            </React.Fragment> :
                            record.status == 1 ?
                                <React.Fragment>
                                    <a onClick={() => this.showModal(record.id)}>查看</a>
                                    <Divider type="vertical" />
                                    <a onClick={() => this.showModal(record.id)}>结束任务</a>
                                    <Divider type="vertical" />
                                    <a onClick={() => this.reboot(record.id, 99)}>暂停</a>
                                </React.Fragment> :
                                <React.Fragment>
                                    <a onClick={() => this.showModal(record.id)}>查看</a>
                                    <Divider type="vertical" />
                                    <a onClick={() => this.reboot(record.id, 0)}>重启</a>
                                </React.Fragment>
                            <React.Fragment>
                                <a onClick={() => this.showModal(record.id)}>查看</a>
                                <Divider type="vertical" />
                                <a onClick={() => this.reboot(record.id, 0)}>重启</a>
                            </React.Fragment>
                    }
                </span>
            ),