| | |
| | | /* |
| | | * @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 { |
| | |
| | | |
| | | 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]); |
| | |
| | | }, [props.editData]) |
| | | |
| | | return ( |
| | | <> |
| | | <FormItem |
| | | label={props.label} |
| | | field={props.field} |
| | |
| | | if (isDel && props.handleDelFile) { |
| | | props.handleDelFile(response.data[0].id) |
| | | } |
| | | setMyFileList(fileList) |
| | | // setMyFileList(fileList) |
| | | handleFileListChange(fileList); |
| | | }} |
| | | {...props.params}//自定义 |
| | | /> |
| | | </FormItem> |
| | | |
| | | </> |
| | | |
| | | ) |
| | | } |