From df49215177f98f6ae4b36d78ba2d6d081f12e2c4 Mon Sep 17 00:00:00 2001 From: Ycc Date: Thu, 28 Aug 2025 14:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E5=92=8C=E4=B8=8B=E8=BD=BD=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ImageUploader.jsx | 44 +++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/src/components/ImageUploader.jsx b/src/components/ImageUploader.jsx index 2c8067c..e5e031e 100644 --- a/src/components/ImageUploader.jsx +++ b/src/components/ImageUploader.jsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { Upload, List, Button, Space } from "antd"; -import { UploadOutlined, FileTextOutlined } from "@ant-design/icons"; +import { Upload, List, Button, Space,Popconfirm } from "antd"; +import { UploadOutlined, FileTextOutlined,DeleteOutlined } from "@ant-design/icons"; import { Image } from "antd"; import { fetchJSON } from "@/utils/request"; import { HT3_HOST } from "@/config"; @@ -116,9 +116,9 @@ export const ImageUploader = props => { props.onChange(newImages); } setFileList(newImages); - console.log("删除成功"); + //console.log("删除成功"); } else { - console.error("删除失败"); + //console.error("删除失败"); } }; @@ -164,9 +164,39 @@ export const ImageUploader = props => { setPreviewOpen(true); }; + const handleRemove = () => { + return false; + }; + return ( <> - + { + return ( + { + handleDelete(file); + }} + onCancel={() => setFileList([...fileList])} + okText="是" + cancelText="否"> + + + ); + }, + }}>
Upload
@@ -218,8 +248,8 @@ export const ImageViewer = props => { ) : ( - );