| | |
| | | * @Company: hugeInfo |
| | | * @Author: ldh |
| | | * @Date: 2022-03-05 17:14:00 |
| | | * @LastEditTime: 2023-04-25 19:26:31 |
| | | * @LastEditors: lwh |
| | | * @LastEditTime: 2024-08-15 16:28:01 |
| | | * @LastEditors: dminyi 1301963064@qq.com |
| | | * @Version: 1.0.0 |
| | | * @Description: 公共上传组件 |
| | | * 附件类型对照 |
| | |
| | | import React, { useEffect, useState, useImperativeHandle } from 'react'; |
| | | import PropTypes from 'prop-types'; |
| | | import { Upload, Image } from 'antd'; |
| | | import { CloudUploadOutlined } from '@ant-design/icons'; |
| | | import { CloudUploadOutlined, PlusOutlined } from '@ant-design/icons'; |
| | | import * as $$ from '../../utils/utility'; |
| | | import { add } from '../../assets/images' |
| | | |
| | | const { Dragger } = Upload; |
| | | |
| | |
| | | * handleChangeFile, // 附件成功新增和成功删除触发事件,用于更新附件列表 |
| | | * formatType, // 附件格式类型,用于限制上传文件格式 |
| | | */ |
| | | const MyUpload = ({ ledgerType = false, type, accept, fileId, fileType, showFileList = true, fileList, handleChangeFile, myUploadRef, children, formatType = '格式支持PNG、JPG、PDF、DOC、DOCX、XLS、XLSX' }) => { |
| | | const MyUpload = ({ ledgerType = false, type, accept, fileId, fileType, showFileList = true, fileList, handleChangeFile, fileIcon, myUploadRef, children, formatType = '格式支持PNG、JPG、PDF、DOC、DOCX、XLS、XLSX' }) => { |
| | | let appUrl = $$.appUrl; |
| | | |
| | | // 单个预览图片控制 |
| | |
| | | ) : ( |
| | | <Dragger {...props}> |
| | | <p className="ant-upload-drag-icon"> |
| | | <CloudUploadOutlined /> |
| | | {fileIcon ? <PlusOutlined style={{ color: 'rgba(0, 0, 0, 0.65)' ,width:'24px'}} /> : |
| | | <CloudUploadOutlined />} |
| | | </p> |
| | | <p style={{ fontSize: '14px' }}>点击上传图标或拖拽文件至此区域上传</p> |
| | | <p className="ant-upload-hint">{formatType}</p> |