|
@@ -23,6 +23,11 @@ import { authFilesLookFu, urlChangeFu } from "@/utils/authFilesLook";
|
|
|
|
|
|
const { Dragger } = Upload;
|
|
|
|
|
|
+const A1OtopBtnArr = [
|
|
|
+ { id: 1, name: "上传文件夹" },
|
|
|
+ { id: 2, name: "上传文件" },
|
|
|
+];
|
|
|
+
|
|
|
type props = {
|
|
|
myUrl: string;
|
|
|
fromData: any;
|
|
@@ -32,6 +37,9 @@ type props = {
|
|
|
};
|
|
|
|
|
|
function A1OupFile({ myUrl, fromData, nowLoc, closeFu, upFileFu }: props) {
|
|
|
+ // 文件夹和文件的选择
|
|
|
+ const [isFiles, setIsFiles] = useState(1);
|
|
|
+
|
|
|
const [modal, contextHolder] = Modal.useModal();
|
|
|
|
|
|
const [fileList, setFileList] = useState<UploadFile[]>([]);
|
|
@@ -46,7 +54,7 @@ function A1OupFile({ myUrl, fromData, nowLoc, closeFu, upFileFu }: props) {
|
|
|
token: getTokenFu(),
|
|
|
},
|
|
|
// 支持上传文件夹
|
|
|
- directory: true,
|
|
|
+ directory: isFiles === 1,
|
|
|
data: fromData,
|
|
|
fileList,
|
|
|
//不要前面的图标
|
|
@@ -177,6 +185,19 @@ function A1OupFile({ myUrl, fromData, nowLoc, closeFu, upFileFu }: props) {
|
|
|
[] // 设置footer为空,去掉 取消 确定默认按钮
|
|
|
}
|
|
|
>
|
|
|
+ <div className="A1OtopBtn">
|
|
|
+ {A1OtopBtnArr.map((v) => (
|
|
|
+ <div key={v.id}>
|
|
|
+ <Button
|
|
|
+ onClick={() => setIsFiles(v.id)}
|
|
|
+ type={v.id === isFiles ? "primary" : "default"}
|
|
|
+ >
|
|
|
+ {v.name}
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+
|
|
|
<div className="A1OMain">
|
|
|
<Dragger {...FileProps}>
|
|
|
<p className="ant-upload-drag-icon">
|