|
|
@@ -18,7 +18,7 @@ import history from "@/utils/history";
|
|
|
import React from "react";
|
|
|
import { getTokenFu } from "@/utils/storage";
|
|
|
import { MessageFu } from "@/utils/message";
|
|
|
-import { A1_APIOupFileIds, A1_APIremoveSure } from "@/store/action/A1Project";
|
|
|
+import { A1_APIOupFileIds, A1_APIremoveOut } from "@/store/action/A1Project";
|
|
|
import { authFilesLookFu, urlChangeFu } from "@/utils/authFilesLook";
|
|
|
|
|
|
const { Dragger } = Upload;
|
|
|
@@ -108,7 +108,7 @@ function A1OupFile({ myUrl, fromData, nowLoc, closeFu, upFileFu }: props) {
|
|
|
// console.log("-----还没有发请求删除", info);
|
|
|
const id = info.response.data.id;
|
|
|
// 已经上传完成,发请求删除
|
|
|
- const res = await A1_APIremoveSure([id + ""]);
|
|
|
+ const res = await A1_APIremoveOut(id);
|
|
|
|
|
|
if (res.code === 0) {
|
|
|
resolve(true);
|
|
|
@@ -150,6 +150,23 @@ function A1OupFile({ myUrl, fromData, nowLoc, closeFu, upFileFu }: props) {
|
|
|
}
|
|
|
}, [closeFu, fileList, upFileFu]);
|
|
|
|
|
|
+ // 点击取消 删除所有文件
|
|
|
+ const clickCloseFu = useCallback(async () => {
|
|
|
+ const arr: string[] = [];
|
|
|
+
|
|
|
+ fileList.forEach((v) => {
|
|
|
+ if (v.response && v.response.data) {
|
|
|
+ arr.push(v.response.data.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (arr.length > 0) {
|
|
|
+ const res = await A1_APIremoveOut(arr.join(","));
|
|
|
+
|
|
|
+ if (res.code === 0) closeFu();
|
|
|
+ } else closeFu();
|
|
|
+ }, [closeFu, fileList]);
|
|
|
+
|
|
|
return (
|
|
|
<Modal
|
|
|
wrapClassName={styles.A1OupFile}
|
|
|
@@ -225,7 +242,7 @@ function A1OupFile({ myUrl, fromData, nowLoc, closeFu, upFileFu }: props) {
|
|
|
title="放弃编辑后,信息将不会保存!"
|
|
|
okText="放弃"
|
|
|
cancelText="取消"
|
|
|
- onConfirm={closeFu}
|
|
|
+ onConfirm={clickCloseFu}
|
|
|
okButtonProps={{ loading: false }}
|
|
|
>
|
|
|
<Button>取消</Button>
|