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(params){
    const { isNew, isCopy, dispatch, login, setFieldValue,data, stateData ,getFieldValue} = params ? params : {};
   
      let json = initFilter(login.OrgId);
      extendRule(json, 'ID', 1, login.userId);
      extendInclude(json, 'Nav_Department');
      dispatch({
          type: 'app/getDataByPost',
          payload: json,
          url: 'FM/User/Get',
          onComplete: (ret) => {
              if(ret)
              {
                stateData.Nav_User.NAME=ret.NAME;
                // stateData.Nav_User.Nav_Department.NAME=ret.Nav_Department.NAME;
              }                   
          }
      });
      stateData.UPDATE_TIME=null;
      stateData.REASON=null;
      stateData.PROFILE=null;
      stateData.FORMULATE=null;
      stateData.NOTE=null;
  }
}
