import { message } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, empty, showFiles } from "../../utils/common";
import { connect } from 'dva';
import config from "../../config.js"
/**
 * @return {string}
 */
// 编辑  制定任务
export default {
  onBeforeSaveHandleRecord(params) {
    params.record.TaskID = params.data.TaskID    //TaskID传递消息表ID
    params.record.STATUS_APPROVE = params.customParams;
    // onBeforeSaveHandleRecordLog(params, 'DM010', '设备点检')
  },

  handleRenderRowControl(params) {
    if (params?.stateData.Nav_ListDetail != undefined && params.stateData.Nav_ListDetail.length > 0) {
      if (params.colConfig.field === 'Nav_Plan.Nav_Files') {
        if (params.record.Nav_Plan.Nav_Files.length > 0) {
          return showFiles(params.record.Nav_Plan.Nav_Files, config.serviceHost)
        } else {
          return <><a></a></>
        }
      }
    }
  },
}