import { message } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common";
import moment from 'moment';
import { Button, Row, Col, Form, Input, Select, Upload, Icon, Modal, Spin,Table } from 'antd';
/**
 * @return {string}
 */
// 编辑
export default {
  onBeforeSaveHandleRecord(params) {
    params.record.TaskID = params.data.TaskID    //TaskID传递消息表ID
    params.record.PUBLISH = params.customParams;
    // params.record.FORM_CODE = params.data.reloadKey.substring(0,params.data.reloadKey.indexOf("_"));
  },
  onBeforeEdit: ({ isNew,login, dispatch,stateData, setFieldValue,setFieldVisible }) => {
    if (isNew) {
        let json = initFilter(login.OrgId);
        dispatch({
            type: 'app/getDataByPost',
            url: 'PR/PRChangeIdentifyEvaluation/GetFileCode',
            payload: json,
          onComplete: (ret) => {
            if (ret) {
                setFieldValue("CODE",ret)
            }
          }
        });
        // setFieldVisible("RISK",false)
      }
      // else
      // {
      //   if(stateData.STATUS === 0)
      //   {
      //       setFieldVisible("RISK",false)
      //   }
      //   else
      //   {
      //       setFieldVisible("RISK",true)
      //   }
      // }
  }
}
