import { InboxOutlined } from "@ant-design/icons"; import { ModalForm } from "@ant-design/pro-components/es"; import { Modal, Upload, message } from "antd"; import React, { forwardRef, useRef, useState } from "react"; export default (props) => { const { visible, setVisible, onFinish, onSuccess,uploadFile } = props; const [fileList, setFileList] = useState([]); const onChange = (info) => { const { status, response } = info.file; const newFileList = [...info.fileList]; setFileList(newFileList); if (status === "done") { onFinish(true); setVisible(false); setFileList([]); onSuccess(response); } else if (status === "error") { onFinish(true); setVisible(false); setFileList([]); } }; const beforeUpload = (file, fileList) => { let extension = file.name.split(".")[1] === "xlsx"; if (!extension) { message.warning("导入文件只能是xlsx格式!"); return false; } }; const onCancel = (e) => { setFileList([]); setVisible(false); }; return (

); };