import { message } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common";
import moment from 'moment';
import { Button, Row, Col, Form, Input, Select, Upload, Icon, Modal, Spin,Table } from 'antd';
/**
 * @return {string}
 */
// 编辑
export default {
  onBeforeSaveHandleRecord(params) {
    params.record.TaskID = params.data.TaskID    //TaskID传递消息表ID
    params.record.PUBLISH = params.customParams;
    // params.record.FORM_CODE = params.data.reloadKey.substring(0,params.data.reloadKey.indexOf("_"));
  },
  onBeforeEdit(params) {
    const { isNew,stateData,saveRowRecord,setFieldValue,setFieldVisible,setFieldValueByBatch} = params ? params : {};
    if(!isNew)
    {
    //   let temps = [];
      let detail={
        ID:guid(),
      USER_ID:stateData.Nav_User?.ID,
      Nav_User:stateData.Nav_User,
    }
    if(stateData && stateData.Nav_MonitorUser)
    {
      stateData.Nav_MonitorUser.push(detail)
    }
    //   let user = stateData.Nav_MonitorUser.push(detail)
    //   temps.push({ field: 'Nav_Department.NAME', value:stateData.Nav_Department?.NAME })
    //   temps.push({ field: 'Nav_User.NAME', value:stateData.Nav_User?.NAME })
    //   temps.push({ field: 'Nav_MonitorUser', value: user })
    //   setFieldValueByBatch(temps);
      // setFieldValue("Nav_Department.NAME", stateData.Nav_Department?.NAME)
      // setFieldValue("Nav_User.NAME", stateData.Nav_User?.NAME)
    }
  }
}
