From 4d54b425f214bc534835ca17e6b7884e002f4fd8 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Mon, 10 Aug 2026 14:15:58 +0800 Subject: [PATCH] feat --- jjb.config.js | 4 +- src/components/FilePreviewModal/index.js | 108 ------------------ .../FilingForm/components/FilingUpload.jsx | 43 ------- 3 files changed, 2 insertions(+), 153 deletions(-) delete mode 100644 src/components/FilePreviewModal/index.js delete mode 100644 src/pages/Container/QualApplication/FilingForm/components/FilingUpload.jsx diff --git a/jjb.config.js b/jjb.config.js index 869cda1..5a25827 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -10,9 +10,9 @@ module.exports = { javaGitBranch: "dev", // 本地联调 safetyEval-service(context-path: /safetyEval,默认端口 8095) // 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095 - API_HOST: "http://localhost:80", + //API_HOST: "http://localhost:80", - // API_HOST: "http://192.168.0.134", + API_HOST: "http://192.168.0.134", // API_HOST: "http://192.168.0.150", //太浅 // API_HOST: "http://192.168.0.152", //API_HOST: "http://192.168.0.103", //huwei diff --git a/src/components/FilePreviewModal/index.js b/src/components/FilePreviewModal/index.js deleted file mode 100644 index b286844..0000000 --- a/src/components/FilePreviewModal/index.js +++ /dev/null @@ -1,108 +0,0 @@ -import { Image, Modal } from "antd"; - -function resolveUrl(raw) { - if (!raw) return ""; - const u = String(raw); - if (/^https?:\/\//i.test(u)) return u; - const base = window.fileUrl || ""; - return base ? `${base}${u}` : u; -} - -export function getFilePreviewType(url = "", fileName = "") { - const hint = `${fileName || ""} ${url || ""}`.toLowerCase(); - if (/\.(jpe?g|png|gif|webp|bmp)(\?|#|$)/i.test(hint)) { - return "image"; - } - return "other"; -} - -export function FilePreviewContent({ url, fileName, style }) { - const resolved = resolveUrl(url); - if (!resolved) { - return ( -
- 暂无上传文件 -
- ); - } - - const type = getFilePreviewType(resolved, fileName); - if (type === "image") { - return {fileName; - } - - return ( -
- 此文件类型不支持内嵌预览 - 请点击下方「新窗口打开」按钮在浏览器中查看 -
- ); -} - -export default function FilePreviewModal({ - open, - title = "文件预览", - fileName, - url, - width = 720, - onCancel, -}) { - const resolved = resolveUrl(url); - const isImageFile = resolved && /\.(jpe?g|png|gif|webp|bmp)(\?|#|$)/i.test(resolved.toLowerCase()); - - return ( - { - if (resolved) { - window.open(resolved, "_blank"); - } - onCancel?.(); - }} - > - {open && ( -
- {fileName && ( -
- {fileName} -
- )} - -
- )} -
- ); -} diff --git a/src/pages/Container/QualApplication/FilingForm/components/FilingUpload.jsx b/src/pages/Container/QualApplication/FilingForm/components/FilingUpload.jsx deleted file mode 100644 index 7f9e540..0000000 --- a/src/pages/Container/QualApplication/FilingForm/components/FilingUpload.jsx +++ /dev/null @@ -1,43 +0,0 @@ -import { Upload, Button, message } from "antd"; -import { UploadOutlined } from "@ant-design/icons"; -import { parseUploadFileList, resolveUploadFileId } from "~/utils/mockUpload"; - -export default function FilingUpload({ - value, - onChange, - disabled, - maxCount = 1, - accept, -}) { - const fileList = Array.isArray(value) ? value : parseUploadFileList(value); - - return ( - { - const ext = "." + file.name.split(".").pop().toLowerCase(); - if (ext === ".gif") { - message.error("不支持 GIF 格式图片上传"); - return Upload.LIST_IGNORE; - } - return true; - }} - onChange={(info) => { - if (disabled) return; - onChange?.(info.fileList); - }} - > - {(!fileList || fileList.length < maxCount) && ( - - )} - - ); -} - -export function resolveFilingUploadUrl(files) { - return resolveUploadFileId(files); -}