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.PUBLISH = params.customParams;
  },
  onSubChange: ({ row, pageCode, record, colInfo, dispatch, stateData, props }) => {
    let departmentid = ''
    let rowNO = record.ROW_NO
    if (record != null && record.DEPARTMENT_ID != null) {
      departmentid = record.DEPARTMENT_ID
    }
    let releaseRange = stateData.Nav_ReleaseRange
    if (releaseRange != null && releaseRange.length > 1) {
      for (let i = 0; i < releaseRange.length; i++) {
        if (rowNO != i + 1 && releaseRange[i].DEPARTMENT_ID == departmentid) {
          message.error('选择部门不能重复！')
          return false
        }
      }
    }
  }
}
