import { message } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, empty } from "../../utils/common";
import { connect } from 'dva';
/**
 * @return {string}
 */
// 安全隐患待入库

export default {
  onBeforeSaveHandleRecord(params) {
    params.record.TaskID = params.data.TaskID    //TaskID传递消息表ID
    params.record.ORDERTYPE = params.customParams;
  },
  onBeforeEdit: ({ isNew, login, stateData, setFieldEditable, setFieldVisible, setFieldValue, dispatch, ListCheckRiskArea, updateSubTableData }) => {

    // 手动上报 有检查问题ID 检查问题 检查依据 不能修改



    // setFieldValue("DESCREPTION",stateData.Nav_SafeCheckDetail.REMARK_RESULT)
    // setFieldValue("DESCREPTION", stateData.Nav_SafeCheckDetail != null ? stateData.Nav_SafeCheckDetail.REMARK_RESULT : stateData.DESCREPTION)
  },

  onChange: ({ stateData, value, colInfo, getFieldValue, setFieldValue, dispatch, setFieldValueByBatch, getSubTableData, updateSubTableData }) => {
    if (colInfo != null && colInfo.FIELD_NAME == "Nav_CheckType.NAME") {
      var typeName = getFieldValue("Nav_CheckType.NAME")
      if (typeName == null || typeName == '') {
        // const temps = [];
        // temps.push({ field: 'Nav_CheckTypeLevel.Nav_Enums.NAME', value: null })
        // temps.push({ field: 'NAME', value: '' })
        // setFieldValueByBatch(temps);
        setFieldValue('Nav_CheckTypeLevel.Nav_Enums.NAME', '');
      }
    }
  },
}
