
import { Button, Popconfirm, message } from 'antd'
import FormPage from '../../components/FormPage';
import {initFilter} from "../../utils/common";

//用户列表页
export default {
  SyncBtn:({record,loadData,login,dispatch,btn,getSelectedRowKeys,clearSelectedRowKeys, getSelectedRecords})=> {
    
    let enable = true;
    const confirm = () => {
      message.loading('执行中..', 0)
      const json = {Keyword: record.ID, OrgId: login.OrgId,Parameter1:record.SYNC_PARAM};
      dispatch({
        type: 'app/getDataByPost',
        payload: json,
        url: record.INTERFACE_ADDRESS,
        onComplete: (ret) => {
          message.destroy();
          if (ret) {
            message.success('执行成功');
            loadData();
          }else{
            message.error('执行失败');
          }
        }
      })
    };
    return {
     // content: <Popconfirm title="是否确认同步?" onConfirm={confirm}>
      content:<Button type={'default'} icon={'right-square'} size="small" title={'立即同步'} onClick={() => confirm()} ></Button>
        //</Popconfirm>
    };
  }
}
