import ConfirmButton from '../../components/common/ConfirmButton';
import { message } from "antd/lib/index";
import React from 'react';
import FormPage from '../../components/FormPage';


export default {
    sendToIdentifyUser: ({ record, close, loadData, getLoadParam, login, btn, dispatch }) => {
        const confirmRevert = () => {
            dispatch({
                type: 'app/getDataByGet',
                url: 'HM/HMCrucialTaskAnalysis/PublishToIdentify?ID='+record.ID,
                onComplete: (ret) => {
                    if (ret) {
                        message.success('执行成功');
                        loadData();
                    }
                }
            })
        };
        const isReturn = record.IS_PUBLISH >=1;
        return {
            content: <ConfirmButton isConfirm={true} confirmTitle="确认通知分析人?" onClick={confirmRevert}
                type={'default'} icon={'check-circle'} size="small" title={btn.LABEL} disabled={isReturn} />
        }
    },
    // btnViewApproval: ({ record, close, loadData, getLoadParam, login, btn, dispatch }) => {
    //     const closeF = () => {
    //         close();
    //         loadData();
    //     };

    //     const data = {
    //         id: record.ID,
    //         close: closeF,
    //     };
    //     let isReturn = record.AUDIT_STATUE == 0;
    //     return {
    //         content: <FormPage formCode={'WF005_DATAID'} data={data} />, isReturn
    //     }

    // },
};

