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("_"));
  },
  updateCheckUser: ({ row, pageCode, record, colInfo, resetFields, stateData, saveHeadRecord, saveRowRecord, getSelectedRecords, setState }) => {
    let DetailCheck = getSelectedRecords();
    if (DetailCheck && DetailCheck.length > 1) {
      let checkDepartFirst = DetailCheck[0].Nav_Department;
      let checkDepartIdFirst = DetailCheck[0].DEPARTMENT_ID;
      let checkUserFirst = DetailCheck[0].Nav_User;
      let checkUserIdFirst = DetailCheck[0].USER_ID;
      //更新行数据
      let tmp = [];
      for (let i = 0; i < DetailCheck.length; i++) {
          DetailCheck[i].Nav_Department = checkDepartFirst;
          DetailCheck[i].DEPARTMENT_ID = checkDepartIdFirst;
          DetailCheck[i].Nav_User = checkUserFirst;
          DetailCheck[i].USER_ID = checkUserIdFirst;
          tmp.push(DetailCheck[i]);
      }
      stateData.Nav_Details = tmp;
      setState({ data: stateData });
    }
  },
}
