import { message } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common";
import moment from 'moment';
/**
 * @return {string}
 */
// 编辑
export default {
  onBeforeSaveHandleRecord(params) {
    params.record.TaskID = params.data.TaskID    //TaskID传递消息表ID
    params.record.PUBLISH = params.customParams;
  },
  onBeforeEdit(params) {
    const { isNew, data, stateData, setFieldValueByBatch, setFieldValue,setRowFieldVisible } = params ? params : {};
    if (!isNew) {
      if(stateData && stateData.Nav_Person)
      {
        let temp = stateData.Nav_Person?.filter(t=>t.USER_ID == null && t.RELATED_USER_ID !=null);
        if(temp.length > 0)
        {
          setRowFieldVisible("T_FO_TECH_DISCLOSURE_PERSON", { "Nav_User.NAME": false, "Nav_RelatedUser.NAME": true });
        }
        else
        {
          setRowFieldVisible("T_FO_TECH_DISCLOSURE_PERSON", { "Nav_User.NAME": true, "Nav_RelatedUser.NAME": false });
        }
      }
    }
    else
    {
      setRowFieldVisible("T_FO_TECH_DISCLOSURE_PERSON", { "Nav_User.NAME": true, "Nav_RelatedUser.NAME": false });
    }
  },
}
