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, 'CM002', '年度应急演练计划前端日志')
  },

  onBeforeEdit: ({ isNew, setFieldValueByBatch, setFieldEditable,login }) => {
    if (isNew) {
      const temps = [];
      temps.push({ field: 'YEAR', value: (new Date()).Format("yyyy") })
      temps.push({ field: 'DEPARTMENT_ID', value: login.user.Nav_Department.ID })
      temps.push({ field: 'Nav_Department.NAME', value: login.user.Nav_Department.NAME })
      setFieldValueByBatch(temps);

      setFieldEditable("YEAR",false);
      setFieldEditable("Nav_Department.NAME",false);
    }
  },
}
