forked from gzzfw/frontEnd/gzDyh

dminyi
2024-09-03 c7835eac66cc4a322dd71a79610f5f4f351f304b
gz-customerSystem/src/components/ArcoUpload/index.jsx
@@ -1,3 +1,11 @@
/*
 * @Author: dminyi 1301963064@qq.com
 * @Date: 2024-09-02 19:56:05
 * @LastEditors: dminyi 1301963064@qq.com
 * @LastEditTime: 2024-09-03 11:34:07
 * @FilePath: \gzDyh\gz-customerSystem\src\components\ArcoUpload\index.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React, { useEffect, useState } from 'react'
import { Upload, Form } from '@arco-design/web-react';
import {
@@ -19,6 +27,14 @@
export default function ArcoUpload(props) {
  const [myFileList, setMyFileList] = useState([])
  const handleFileListChange = (fileList) => {
    setMyFileList(fileList);
    if (props.onFileListChange) {
      props.onFileListChange(fileList.length);
    }
  };
  useEffect(() => {
    if (props.editData) {
      console.log(props.editData[props.field]);
@@ -27,6 +43,7 @@
  }, [props.editData])
  return (
    <>
    <FormItem
      label={props.label}
      field={props.field}
@@ -65,10 +82,14 @@
          if (isDel && props.handleDelFile) {
            props.handleDelFile(response.data[0].id)
          }
          setMyFileList(fileList)
            // setMyFileList(fileList)
            handleFileListChange(fileList);
        }}
        {...props.params}//自定义
      />
    </FormItem>
    </>
  )
}