forked from gzzfw/frontEnd/gzDyh

dminyi
2024-08-15 ae22a9f162196c6c7ba2085c3e246dc9101c48e4
gz-customerSystem/src/components/MyUpload/index.jsx
@@ -2,8 +2,8 @@
 * @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: 公共上传组件
 * 附件类型对照
@@ -22,8 +22,9 @@
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;
@@ -41,7 +42,7 @@
 * 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;
  // 单个预览图片控制
@@ -163,7 +164,8 @@
      ) : (
        <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>