import React from "react";
import CheckRecord from "@/webPublic/FormInsertDiy/ExportComponent/CheckRecord"; // 查询类
import Apply from "@/webPublic/FormInsertDiy/AffairPage/ApplyPage"; // 申请
import BatchAudit from "@/webPublic/FormInsertDiy/AffairPage/AuditPage/BatchAudit"; // 批量审批
import Audit from "@/webPublic/FormInsertDiy/AffairPage/AuditPage/index.js"; // 审批
import Detail from "@/webPublic/FormInsertDiy/AffairPage/Detail"; //详情
import { Modal, message, notification, Popconfirm } from 'antd';

window.iframeParentComponent = {
  Modal,
  message,
  notification,
  Popconfirm
};

export default function ActiveMenuComponent({
                                              routerConfig,
                                              ...otherProps
                                            }) {
  const { component = "", appId } = routerConfig;

  switch (component) {
    case "CheckRecord": // 查询类应用
      return <CheckRecord workId={appId}
      />;
    case "Apply": // 申请类 详情是 iframe
      return <Apply
        workId={appId} {...otherProps}/>;
    case "Audit": // 审批类 详情是 iframe
      return <Audit
        workId={appId} {...otherProps}/>;
    case "BatchAudit": // 批量审批 详情是 iframe
      return <BatchAudit
        workId={appId} {...otherProps}/>;
    case "Detail": // 详情 iframe
      return <Detail
        {...otherProps} {...otherProps}/>;
    default:
      console.log(component, "没有找到此组件");
      return <div>暂无此功能</div>;
  }

}
