From a874c2cb0b27ca11ac6f8a029bfaa83a3c9e114a Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Tue, 25 Aug 2026 17:55:37 +0800 Subject: [PATCH] fix --- src/api/safetyEvalBusiness/index.js | 18 ++ src/enumerate/constant/index.js | 44 +++ .../EvalReportLibrary/index.less | 2 +- .../ProjectFlow/ArchiveContent.js | 255 +++++++++++------- .../ProjectFlow/ArchiveSupplementModal.js | 85 ++++++ .../SafetyEvalBusiness/ProjectFlow/index.js | 1 - .../SafetyEvalBusiness/ProjectFlow/index.less | 31 +++ .../EvalProjectDatabase/ArchiveModal.js | 185 +++++++++++++ .../Supervision/EvalProjectDatabase/index.js | 13 +- .../EvalProjectDatabase/index.less | 52 +++- 10 files changed, 591 insertions(+), 95 deletions(-) create mode 100644 src/pages/Container/SafetyEvalBusiness/ProjectFlow/ArchiveSupplementModal.js create mode 100644 src/pages/Container/Supervision/EvalProjectDatabase/ArchiveModal.js diff --git a/src/api/safetyEvalBusiness/index.js b/src/api/safetyEvalBusiness/index.js index dcff078..6316d17 100644 --- a/src/api/safetyEvalBusiness/index.js +++ b/src/api/safetyEvalBusiness/index.js @@ -301,6 +301,18 @@ export const evalProcessControlFiles = declareRequest( "processControlFiles: [] | res.data || []", ); +/** 项目档案文件列表-机构端分页(分页参数 pageIndex/pageSize,总数 totalCount) */ +export const evalProjectArchiveFileOrgPage = declareRequest( + "evalProjectArchiveFileOrgLoading", + "Get > /safetyEval/eval-project-archive-file/org/page", +); + +/** 新增项目档案文件(机构补充上传) */ +export const evalProjectArchiveFileAdd = declareRequest( + "evalProjectArchiveFileAddLoading", + "Post > @/safetyEval/eval-project-archive-file", +); + // ===== 监管端-安评项目实时监控 ===== export const evalProjectMonitorStat = declareRequest( @@ -346,6 +358,12 @@ export const evalProjectArchivePage = declareRequest( "Get > /safetyEval/institution/eval-project/archive-supervision-page", ); +/** 项目档案文件列表(监管端,分页参数为 pageIndex/pageSize,总数 totalCount) */ +export const evalProjectArchiveFilePage = declareRequest( + "evalProjectArchiveFileLoading", + "Get > /safetyEval/eval-project-archive-file/monitor/page", +); + // ===== 机构端-安评报告库 ===== export const evalReportSummary = declareRequest( diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index 1dd61db..7c00460 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -784,3 +784,47 @@ export const QUESTION_TYPE_MAP = QUESTION_TYPE_OPTIONS.reduce( (acc, cur) => ({ ...acc, [cur.value]: cur.label }), {}, ); + +/** 项目档案类型(eval_project_archive_file.archive_type) */ +export const ARCHIVE_TYPE_OPTIONS = [ + { label: "项目风险分析", value: "RISK_ANALYSIS" }, + { label: "技术服务合同", value: "TECH_SERVICE_CONTRACT" }, + { label: "项目组织文件", value: "PROJECT_ORG_FILE" }, + { label: "实施计划", value: "IMPLEMENT_PLAN" }, + { label: "从业告知", value: "PRACTICE_NOTICE" }, + { label: "现场记录", value: "SITE_RECORD" }, + { label: "现场勘察资料", value: "SITE_SURVEY" }, + { label: "现场检查资料", value: "SITE_CHECK" }, + { label: "整改复查资料", value: "RECTIFICATION_REVIEW" }, + { label: "评价报告", value: "EVALUATION_REPORT" }, + { label: "审核记录", value: "REVIEW_RECORD" }, + { label: "过程控制文件", value: "PROCESS_CONTROL" }, + { label: "签发文件", value: "SIGN_ISSUE" }, + { label: "专家评审材料", value: "EXPERT_REVIEW" }, + { label: "项目附图", value: "PROJECT_ATTACHMENT" }, + { label: "报告修改材料", value: "REPORT_MODIFICATION" }, + { label: "往来文件", value: "CORRESPONDENCE" }, + { label: "其他", value: "OTHER" }, +]; + +export const ARCHIVE_TYPE_MAP = ARCHIVE_TYPE_OPTIONS.reduce( + (acc, cur) => ({ ...acc, [cur.value]: cur.label }), + {}, +); + +/** 档案文件来源(record_source:auto_process_record流程自动记录 / upload_additional_files补充上传) */ +export const ARCHIVE_RECORD_SOURCE_MAP = { + auto_process_record: "系统形成", + upload_additional_files: "机构补充上传", +}; + +/** 档案文件来源选项与徽标文案(机构端档案内容列表) */ +export const ARCHIVE_RECORD_SOURCE_OPTIONS = [ + { label: "流程自动记录", value: "auto_process_record" }, + { label: "补充上传", value: "upload_additional_files" }, +]; + +export const ARCHIVE_RECORD_SOURCE_BADGE_MAP = ARCHIVE_RECORD_SOURCE_OPTIONS.reduce( + (acc, cur) => ({ ...acc, [cur.value]: cur.label }), + {}, +); diff --git a/src/pages/Container/SafetyEvalBusiness/EvalReportLibrary/index.less b/src/pages/Container/SafetyEvalBusiness/EvalReportLibrary/index.less index 09cd6cc..bf0fa71 100644 --- a/src/pages/Container/SafetyEvalBusiness/EvalReportLibrary/index.less +++ b/src/pages/Container/SafetyEvalBusiness/EvalReportLibrary/index.less @@ -249,7 +249,7 @@ border-radius: 4px; background: #eff6ff; color: #475569; - font-size: 13px; + font-size: 14px; line-height: 1.65; strong { diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ArchiveContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ArchiveContent.js index 091d65e..0a1b326 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ArchiveContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ArchiveContent.js @@ -1,13 +1,10 @@ import React, { useState, useEffect } from "react"; import { - Tag, Button, - Card, Table, Input, Flex, - Popover, - Image, + Select, Row, Col, DatePicker, @@ -16,33 +13,43 @@ import { } from "antd"; import dayjs from "dayjs"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction"; import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace"; import { tools } from "@cqsjjb/jjb-common-lib"; import LayoutFooterPortal from "~/components/LayoutFooterPortal"; +import PreviewUrlButton from "~/components/PreviewUrlButton"; +import ArchiveSupplementModal from "./ArchiveSupplementModal"; +import { + + ARCHIVE_RECORD_SOURCE_OPTIONS, + ARCHIVE_RECORD_SOURCE_BADGE_MAP, +} from "~/enumerate/constant"; const { router } = tools; const ArchiveContent = ({ readOnly, ...props }) => { const projectId = router.query?.id; - const { processControlDetail, processControlFiles, evalProjectDetailData } = + const { processControlDetail, evalProjectDetailData } = props.safetyEvalBusiness || {}; const { processControl, archiveFlag } = processControlDetail || {}; - const [files, setFiles] = useState([]); const [archiveForm] = Form.useForm(); + const [archiveFiles, setArchiveFiles] = useState([]); + const [archiveTotal, setArchiveTotal] = useState(0); + const [archiveQuery, setArchiveQuery] = useState({ + pageIndex: 1, + pageSize: 10, + recordSource: "", + }); + const [supplementOpen, setSupplementOpen] = useState(false); const fetchDetail = () => { props.evalProcessControlDetail({ projectId }); }; - const fetchFiles = () => { - props.evalProcessControlFiles({ projectId }); - }; - useEffect(() => { if (projectId) { fetchDetail(); - fetchFiles(); } }, [projectId]); @@ -59,11 +66,26 @@ const ArchiveContent = ({ readOnly, ...props }) => { } }, [processControlDetail]); + const fetchArchiveFiles = () => { + props + .evalProjectArchiveFileOrgPage({ + projectId, + pageIndex: archiveQuery.pageIndex, + pageSize: archiveQuery.pageSize, + recordSource: archiveQuery.recordSource || undefined, + }) + .then((res) => { + if (res?.success !== false) { + setArchiveFiles(res?.data || []); + setArchiveTotal(res?.totalCount || 0); + } + }); + }; + useEffect(() => { - if (processControlFiles) { - setFiles(processControlFiles); - } - }, [processControlFiles]); + if (!projectId) return; + fetchArchiveFiles(); + }, [projectId, archiveQuery]); const isSignatureCompleted = processControl?.reviewerSignatureTaskStatus === "completed"; @@ -80,91 +102,127 @@ const ArchiveContent = ({ readOnly, ...props }) => { } }; - const isImage = (name) => - /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i.test(name || ""); + /** 解析文件地址:相对路径拼接 window.fileUrl */ + const resolveFileUrl = (raw) => { + if (!raw) return ""; + const u = String(raw); + return /^https?:\/\//i.test(u) ? u : `${window.fileUrl || ""}${u}`; + }; - const fileColumns = [ - { title: "流程名称", dataIndex: "processName", ellipsis: true }, - { title: "条目名称", dataIndex: "itemName", ellipsis: true }, + const handleDownload = (file) => { + const url = resolveFileUrl(file.fileUrl); + if (!url) return; + const a = document.createElement("a"); + a.href = url; + a.download = file.fileName || ""; + a.target = "_blank"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + }; + + const archiveColumns = [ { - title: "文件", - dataIndex: "projectDocUrl", - render: (val) => { - let fileList = []; - if (typeof val === "string") { - try { - fileList = JSON.parse(val); - } catch { - fileList = []; - } - } else if (Array.isArray(val)) { - fileList = val; - } - if (!fileList.length) return "-"; - return ( - - - {fileList.map((f, i) => { - const url = f.url || f.response?.url; - return isImage(f.name) ? ( - - {} - - ) : ( - window.open(url)} - > - {f.name || "查看文件"} - - ); - })} - - } - trigger="hover" - placement="topLeft" - > - e.preventDefault()} - style={{ cursor: "pointer" }} - > - {fileList.length}个附件 - - - - ); - }, + title: "序号", + width: 60, + render: (_, __, index) => + (archiveQuery.pageIndex - 1) * archiveQuery.pageSize + index + 1, + }, + { + title: "文件名称", + dataIndex: "fileName", + ellipsis: true, + render: (v) => v || "-", + }, + { + title: "档案类型", + dataIndex: "archiveType", + width: 130, + + }, + { + title: "来源/业务节点", + dataIndex: "recordSource", + width: 150, + render: (v, r) => ( + + + {ARCHIVE_RECORD_SOURCE_BADGE_MAP[v] || v || "-"} + + {r.businessNode || "-"} + + ), + }, + { + title: "形成/上传人员", + dataIndex: "createName", + width: 120, + render: (v) => v || "-", + }, + { + title: "形成时间", + dataIndex: "createTime", + width: 160, + align: "right", + render: (v) => v || "-", + }, + { + title: "操作", + width: 110, + render: (_, r) => ( + + 查看 + + + ), }, ]; return ( - -
- - 项目归档 - - - 项目过程文件清单,确认签字完成后归档入库 - -
+ + + + + + + + + +