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;
  },
  onBeforeEdit: ({ isNew, pageCode, login, dispatch, app, updateSubTableData, stateData, setFieldVisible, getFieldValue, setFieldEditable, setFieldValue }) => {
    let s = 0;
    var status = getFieldValue('STATUS');
    if (!isNew && status !== undefined) {
      s = status;
    }
    if (isNew) {
      setFieldVisible("CHECK_OPINION", false);
    } else {
      setFieldVisible("EXTERNAL_SUPPORT", getFieldValue('IS_HELP'));
      setFieldVisible("CHECK_OPINION", s > 0);
      setFieldEditable("OVERHAUL_TIME", s == 0);
      setFieldEditable("OPINION", s == 0);
      setFieldEditable("DESCRIPTION", s == 0);
      setFieldEditable("Nav_Files", s == 0);
      setFieldEditable("EXTERNAL_SUPPORT", s == 0);

    }
  },
}
