From a7fe1e31e41bd32949c82238780836f87521b2c6 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Mon, 10 Aug 2026 14:34:25 +0800 Subject: [PATCH 1/4] fix --- .../QualificationReview/FilingTabs/index.js | 26 +++++++++----- .../BasicInfo/RegisteredOrg/Detail/index.js | 35 ++++++++++++------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/src/pages/Container/QualificationReview/FilingTabs/index.js b/src/pages/Container/QualificationReview/FilingTabs/index.js index e13a42d..b0a615d 100644 --- a/src/pages/Container/QualificationReview/FilingTabs/index.js +++ b/src/pages/Container/QualificationReview/FilingTabs/index.js @@ -3,7 +3,6 @@ import { Button, Image, Input, Modal, Select, Table, Tabs, Tag } from "antd"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { NS_QUAL_REVIEW } from "~/enumerate/namespace"; import StaffViewModal from "~/components/StaffViewModal"; -import FilePreviewModal from "~/components/FilePreviewModal"; import PreviewUrlButton from "~/components/PreviewUrlButton/index"; import { QUALIFICATION_INDUSTRY_OPTIONS, QUALIFICATION_INDUSTRY_OPTIONS_MAP } from "~/enumerate/enterpriseOptions"; import { CAPABILITY_MAP } from "~/enumerate/constant"; @@ -128,7 +127,7 @@ const FilingTabs = ({ }) => { const [viewId, setViewId] = useState(""); const [equipRecord, setEquipRecord] = useState(null); - const [previewFile, setPreviewFile] = useState(null); + const [previewImage, setPreviewImage] = useState(""); const personnelRows = useMemo( () => @@ -174,7 +173,15 @@ const FilingTabs = ({ })); }, [detail.businessScope]); - const openPreview = (file) => setPreviewFile(file || null); + const openPreview = (file) => { + const url = file?.url; + if (!url) return; + if (/\.(jpe?g|png|gif|webp|bmp)(\?|#|$)/i.test(`${file.name || ""} ${url}`.toLowerCase())) { + setPreviewImage(url); + } else { + window.open(url, "_blank"); + } + }; /** 人员表格列(管理/评价师共用基础) */ const basePersonCols = (withScope) => [ @@ -526,12 +533,13 @@ const FilingTabs = ({ setEquipRecord(null)} /> - setPreviewFile(null)} + !v && setPreviewImage(""), + }} + style={{ display: "none" }} /> ); diff --git a/src/pages/Container/Supervision/BasicInfo/RegisteredOrg/Detail/index.js b/src/pages/Container/Supervision/BasicInfo/RegisteredOrg/Detail/index.js index 377fc0e..cee90d8 100644 --- a/src/pages/Container/Supervision/BasicInfo/RegisteredOrg/Detail/index.js +++ b/src/pages/Container/Supervision/BasicInfo/RegisteredOrg/Detail/index.js @@ -1,5 +1,6 @@ import { Button, + Image, Input, Spin, Table, @@ -15,7 +16,6 @@ import { fetchRegisteredOrgQualificationGroups, } from "~/utils/regulatorOrgInfo"; import { QUALIFICATION_INDUSTRY_OPTIONS_MAP } from "~/enumerate/enterpriseOptions"; -import FilePreviewModal from "~/components/FilePreviewModal"; import StaffViewModal from "~/components/StaffViewModal"; const LIST_PATH = "/container/supervision/basicInfo/registeredOrg/list"; @@ -129,10 +129,20 @@ function RegisteredOrgDetailPage(props) { const [info, setInfo] = useState({}); const [personnel, setPersonnel] = useState([]); const [materials, setMaterials] = useState([]); - const [previewFile, setPreviewFile] = useState(null); + const [previewImage, setPreviewImage] = useState(""); const [viewPersonnelId, setViewPersonnelId] = useState(""); const mockEnabled = getOrgMockEnabled(); + const openPreview = (file) => { + const url = file?.url; + if (!url) return; + if (/\.(jpe?g|png|gif|webp|bmp)(\?|#|$)/i.test(`${file.name || ""} ${url}`.toLowerCase())) { + setPreviewImage(url); + } else { + window.open(url, "_blank"); + } + }; + useEffect(() => { if (!id) { setOrgLoading(false); @@ -320,7 +330,7 @@ function RegisteredOrgDetailPage(props) { size="small" onClick={() => { const first = (info.attachmentUrl || [])[0]; - setPreviewFile({ + openPreview({ name: first.name || "营业执照", url: first.url || (typeof first === "string" ? first : ""), }); @@ -456,7 +466,7 @@ function RegisteredOrgDetailPage(props) { title: "操作", width: 80, render: (_, record) => ( - ), @@ -520,7 +530,7 @@ function RegisteredOrgDetailPage(props) {
{commitment.legalRepSignatureUrl ? ( - ) : ( @@ -557,7 +567,7 @@ function RegisteredOrgDetailPage(props) { title: "操作", width: 110, render: (_, record) => ( - ), @@ -591,12 +601,13 @@ function RegisteredOrgDetailPage(props) { /> )} - setPreviewFile(null)} + !v && setPreviewImage(""), + }} + style={{ display: "none" }} /> ); From 4f4fbd04623d06220e654eb488e98ac00d0e9ad8 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Mon, 10 Aug 2026 14:35:54 +0800 Subject: [PATCH 2/4] fix --- .../Container/EnterpriseInfo/PersonnelInfo/List/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js index daec355..9854414 100644 --- a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js +++ b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js @@ -991,6 +991,8 @@ function StaffFormModal({ From a5b3a2ae18d2238b25ebcf95cc48015c6cb19e55 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Mon, 10 Aug 2026 15:31:16 +0800 Subject: [PATCH 3/4] feat --- .../FilingForm/components/BasicInfoStep.jsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/pages/Container/QualApplication/FilingForm/components/BasicInfoStep.jsx b/src/pages/Container/QualApplication/FilingForm/components/BasicInfoStep.jsx index efd556c..d6567e0 100644 --- a/src/pages/Container/QualApplication/FilingForm/components/BasicInfoStep.jsx +++ b/src/pages/Container/QualApplication/FilingForm/components/BasicInfoStep.jsx @@ -1,3 +1,4 @@ +import { useMemo } from "react"; import { Form, Input, InputNumber, Row, Col, Select, Checkbox } from "antd"; import { CHONGQING_DISTRICTS, @@ -7,6 +8,16 @@ import { FILING_UNIT_TYPE_OPTIONS } from "~/enumerate/qualFilingOptions"; import AttachmentUpload from "~/components/AttachmentUpload"; export default function BasicInfoStep({ form, disabled, mode }) { + const industryOptions = useMemo(() => { + const orgInfo = JSON.parse(sessionStorage.getItem("orgInfo") || "{}"); + const codes = orgInfo?.safetyIndustryCategoryCode; + if (Array.isArray(codes) && codes.length > 0) { + return QUALIFICATION_INDUSTRY_OPTIONS.filter((item) => + codes.includes(item.value), + ); + } + return QUALIFICATION_INDUSTRY_OPTIONS; + }, []); return (
@@ -17,7 +28,7 @@ export default function BasicInfoStep({ form, disabled, mode }) { rules={[{ required: !disabled, message: "请选择业务范围" }]} > @@ -76,7 +87,7 @@ export default function BasicInfoStep({ form, disabled, mode }) { {mode!=='application' && - + } From 8b74f1691ca019ee74177b3c7fd1d02e89b5f591 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Mon, 10 Aug 2026 16:18:22 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E9=A1=B5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Container/Layout/index.jsx | 32 ++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/pages/Container/Layout/index.jsx b/src/pages/Container/Layout/index.jsx index 49e82ce..7e0fe5e 100644 --- a/src/pages/Container/Layout/index.jsx +++ b/src/pages/Container/Layout/index.jsx @@ -26,12 +26,26 @@ const { Text } = Typography; const TABS_KEY = "sim_layout_tabs"; const ACTIVE_KEY = "sim_layout_active"; +/* ---- 路径规范化:统一补全 /safetyEval 前缀,避免同一路由生成多个标签 ---- */ +const normalizePath = (path) => { + if (!path) return path; + return path.startsWith("/safetyEval") ? path : `/safetyEval${path}`; +}; + /* ---- sessionStorage 持久化 ---- */ function loadState() { try { - const tabs = JSON.parse(sessionStorage.getItem(TABS_KEY) || "[]"); - const activeKey = sessionStorage.getItem(ACTIVE_KEY) || ""; - return { tabs, activeKey }; + const rawTabs = JSON.parse(sessionStorage.getItem(TABS_KEY) || "[]"); + const tabs = rawTabs.map((t) => ({ ...t, key: normalizePath(t.key) })); + // 路由去重:相同路由只保留一个标签 + const seen = new Set(); + const deduped = tabs.filter((t) => { + if (seen.has(t.key)) return false; + seen.add(t.key); + return true; + }); + const activeKey = normalizePath(sessionStorage.getItem(ACTIVE_KEY) || ""); + return { tabs: deduped, activeKey }; } catch { return { tabs: [], activeKey: "" }; } @@ -45,12 +59,12 @@ function saveState(tabs, activeKey) { export default function SimulatedLayout({ children, history }) { const [collapsed, setCollapsed] = useState(false); const [state, setState] = useState(loadState); - const [currentPath, setCurrentPath] = useState(window.location.pathname); + const [currentPath, setCurrentPath] = useState(() => normalizePath(window.location.pathname)); // 监听路由变化,更新 currentPath useEffect(() => { const unlisten = history?.listen?.((location) => { - setCurrentPath(location.pathname || window.location.pathname); + setCurrentPath(normalizePath(location.pathname || window.location.pathname)); }); return () => unlisten?.(); }, [history]); @@ -80,10 +94,10 @@ export default function SimulatedLayout({ children, history }) { }, []); const navigateTo = useCallback((path) => { - if (path !== currentPath) { - history.replace(path.replace(/^\/safetyEval/, "")); - // history.listen 可能不存在,手动同步 currentPath - setCurrentPath(window.location.pathname); + const normalized = normalizePath(path); + if (normalized !== currentPath) { + history.replace(normalized.replace(/^\/safetyEval/, "")); + setCurrentPath(normalized); } }, [currentPath, history]);