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

//参与流程
export default {
  onLoadParam:({loadParam,login})=> {
    loadParam['Keyword'] = login.userId;
    loadParam['Parameter1'] = '2';
  },
  btnPermit:({record,close,loadData,login,dispatch})=> {
    const closeF=()=>{
      close();
      loadData();
    };
    const regClick=async function (){
      await dispatch({
        type: 'custom/save',
        payload: {
          ['flowPermitEdit'+(record? record.ID:'')]:true
        },
      });
    };
    const data={
      id:(record? record.ID:''),
      close:closeF,
      flowPermitEdit:login.flowPermitEdit,
      isShow:true,
    };
    return {
      content: <FormPage formCode={'PF009'} data={data}/>,
      click: regClick
    }
  },
  btnEdit:({record,close,loadData,login,dispatch})=> {
    const closeF=()=>{
      close();
      loadData();
    };

    const data={
      id:(record? record.ID:''),
      close:closeF,
    };
    return {
      content: <FormPage formCode={'PF044'} data={data}/>,
    }
  }

}
