import { message, Checkbox, Radio } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, empty, onBeforeSaveHandleRecordLog, Format } from "../../utils/common";
import { connect } from 'dva';
import moment from 'moment';
/**
 * @return {string}
 */
// 编辑  事故事件上报
export default {
  onBeforeSaveHandleRecord(params) {
    params.record.TaskID = params.data.TaskID    //TaskID传递消息表ID
    params.record.STATUS = params.customParams;
    onBeforeSaveHandleRecordLog(params, 'OH004', '体检计划前端日志')
  },

  onBeforeEdit: ({ isNew, stateData, setFieldValue, login }) => {
    if (stateData.YEAR == null) {
      setFieldValue('YEAR', (new Date()).Format("yyyy"))
    }
    
    // if (isNew) {
    //   const temps = [];
    //   temps.push({ field: 'USER_ID', value: login.user.ID })
    //   temps.push({ field: 'Nav_User.NAME', value: login.user.NAME })
    //   temps.push({ field: 'TIME', value: (new Date()).Format("yyyy-MM-dd") })
    //   setFieldValueByBatch(temps);
    // }
  },

}
