From 3a103e5c9319744b8b2ef7b7a0e64aa220112bc2 Mon Sep 17 00:00:00 2001 From: yujia Date: Fri, 19 Dec 2025 09:03:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewProjectReviewDetailsModal/index.js | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/components/ViewProjectReviewDetailsModal/index.js diff --git a/src/components/ViewProjectReviewDetailsModal/index.js b/src/components/ViewProjectReviewDetailsModal/index.js new file mode 100644 index 0000000..d63fcaf --- /dev/null +++ b/src/components/ViewProjectReviewDetailsModal/index.js @@ -0,0 +1,80 @@ +import { Button, Descriptions, Modal } from "antd"; +import { useEffect } from "react"; +import PreviewImg from "zy-react-library/components/PreviewImg"; +import PreviewPdf from "zy-react-library/components/PreviewPdf"; +import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; +import useGetFile from "zy-react-library/hooks/useGetFile"; +import { getFileSuffix } from "zy-react-library/utils"; + +const ViewProjectReviewDetailsModal = (props) => { + const { getFile } = useGetFile(); + const getData = async () => { + const file = await getFile({ + eqType: UPLOAD_FILE_TYPE_ENUM["151"], + eqForeignKey: props.data.projectFileId, + }); + props.data.files = file; + }; + const previewFile = () => { + const imgFiles = []; + const pdfFiles = []; + const files = props.data?.files || []; + for (let i = 0; i < files.length; i++) { + if (getFileSuffix(files[i].name) === "pdf") { + pdfFiles.push(files[i]); + } + else { + imgFiles.push(files[i]); + } + } + if (imgFiles.length > 0 && pdfFiles.length > 0) { + return ( + <> +
+
+ + ); + } + if (imgFiles.length > 0) { + return ; + } + if (pdfFiles.length > 0) { + return ; + } + }; + useEffect(() => { + getData(); + }, []); + return ( + 取消, + ]} + > + { + const start = props.data?.startValidityPeriod; + const end = props.data?.endValidityPeriod; + return start && end ? `${start}至${end}` : "-"; + })(), + }, + { label: "资质", children: previewFile() }, + ]} + /> + + ); +}; + +export default ViewProjectReviewDetailsModal;