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: ({ value, colInfo, setFieldValue }) => {
    if (colInfo.FIELD_NAME == "QUESTION_LEVEL") {
      if (value == 10) {
        //重大问题 设置为 是重大隐患  1
        //FIELD_NAME: "SERIOUS_RISK"
        setFieldValue("SERIOUS_RISK", '1');
      } else {
        //否则不是  0
        setFieldValue("SERIOUS_RISK", '0');
      }
    }
  },
}
