From ca760b7f3a7b5dac93055ed851ff1631d6f472fb Mon Sep 17 00:00:00 2001 From: 王强 Date: Tue, 11 Oct 2022 09:18:14 +0800 Subject: [PATCH] 优化 通用组件-FeeweeUploadAttachment; --- src/components/FeeweeUploadAttachment/index.tsx | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------- 1 file changed, 52 insertions(+), 41 deletions(-) diff --git a/src/components/FeeweeUploadAttachment/index.tsx b/src/components/FeeweeUploadAttachment/index.tsx index 21e01be..e562992 100644 --- a/src/components/FeeweeUploadAttachment/index.tsx +++ b/src/components/FeeweeUploadAttachment/index.tsx @@ -1,7 +1,7 @@ /* * @Date: 2021-01-05 14:24:23 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-10-10 17:54:30 + * @LastEditTime: 2022-10-11 09:14:38 */ import React, { useEffect, useRef, useState } from "react"; import { message, Popover, Spin, Upload } from "antd"; @@ -221,7 +221,14 @@ export default function FeeweeUploadAttachment({ : props.listType === "picture" ? ListTypeOfPicture : ListTypeOfText; - return ; + return ( + + ); // return ( //
void; + disabled?: boolean; +} + const ListTypeOfText = ({ file, freezeItems = [], remove, -}: { - file: UploadFile; - freezeItems?: string[]; - remove: () => void; -}) => ( + disabled, +}: ItemRenderProps) => (
{file?.errMsg} ) : null} - + {!disabled ? ( + + ) : null} )} @@ -348,11 +361,8 @@ const ListTypeOfPictureCard = ({ file, freezeItems = [], remove, -}: { - file: UploadFile; - freezeItems?: string[]; - remove: () => void; -}) => ( + disabled, +}: ItemRenderProps) => (
- + {!disabled ? ( + + ) : null} )}
@@ -478,11 +490,8 @@ const ListTypeOfPicture = ({ file, freezeItems = [], remove, -}: { - file: UploadFile; - freezeItems?: string[]; - remove: () => void; -}) => ( + disabled, +}: ItemRenderProps) => (
{file?.errMsg} ) : null} - + {!disabled ? ( + + ) : null} )} -- libgit2 0.22.2