diff --git a/frontend/app/components/platform/DataResourceUploadModal.tsx b/frontend/app/components/platform/DataResourceUploadModal.tsx new file mode 100644 index 0000000..8f0f363 --- /dev/null +++ b/frontend/app/components/platform/DataResourceUploadModal.tsx @@ -0,0 +1,141 @@ +import { type FormEvent } from "react"; +import Icon from "../common/Icon"; +import type { Visibility } from "../../services/api"; + +type DataResourceUploadModalProps = { + open: boolean; + file: File | null; + resourceName: string; + visibility: Visibility; + description: string; + uploading: boolean; + parentPath: string; + targetPath: string; + onNameChange: (name: string) => void; + onVisibilityChange: (visibility: Visibility) => void; + onDescriptionChange: (description: string) => void; + onTargetPathChange: (path: string) => void; + onSubmit: (event: FormEvent) => void; + onClose: () => void; +}; + +export function DataResourceUploadModal({ + open, + file, + resourceName, + visibility, + description, + uploading, + parentPath, + targetPath, + onNameChange, + onVisibilityChange, + onDescriptionChange, + onTargetPathChange, + onSubmit, + onClose, +}: DataResourceUploadModalProps) { + if (!open) return null; + + const finalTarget = targetPath.trim(); + const finalPath = finalTarget + ? `${finalTarget}/${file?.name ?? ""}` + : file?.name ?? ""; + + return ( +
+
+
+
+ 数据资源 +

上传数据文件

+
+ +
+
+ + + + +