From bb6f4595d87044d3995cd7f72d7b26013ee2bd39 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Thu, 13 Aug 2026 10:08:53 +0800 Subject: [PATCH] fix --- jjb.config.js | 4 +- .../EvalReportLibrary/index.js | 41 ++++++--------- .../Supervision/EvalReportDatabase/index.js | 50 ++++--------------- 3 files changed, 25 insertions(+), 70 deletions(-) diff --git a/jjb.config.js b/jjb.config.js index acaeda2..0dc50cd 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -12,9 +12,9 @@ module.exports = { // 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095 //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: "https://gbs-gateway.qhdsafety.com", + API_HOST: "https://gbs-gateway.qhdsafety.com", //API_HOST: "http://192.168.0.103", //huwei }, production: { diff --git a/src/pages/Container/SafetyEvalBusiness/EvalReportLibrary/index.js b/src/pages/Container/SafetyEvalBusiness/EvalReportLibrary/index.js index 7442489..0757989 100644 --- a/src/pages/Container/SafetyEvalBusiness/EvalReportLibrary/index.js +++ b/src/pages/Container/SafetyEvalBusiness/EvalReportLibrary/index.js @@ -28,6 +28,9 @@ import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { tools } from "@cqsjjb/jjb-common-lib"; import dayjs from "dayjs"; +import {EVAL_TYPE_OPTIONS} from '~/enumerate/constant'; +import {QUALIFICATION_INDUSTRY_OPTIONS} from '~/enumerate/enterpriseOptions'; + import "./index.less"; /** @@ -44,23 +47,7 @@ const { TextArea } = Input; const UPLOAD_ACTION = `${window.process?.env?.app?.API_HOST || ""}/safetyEval/file/upload`; -/** 评价类型(对齐原型文案;编码对齐 OpenAPI PRE/ACCEPT/STATUS) */ -const REPORT_EVAL_TYPE_OPTIONS = [ - { label: "安全预评价", value: "PRE" }, - { label: "安全验收评价", value: "ACCEPT" }, - { label: "安全现状评价", value: "STATUS" }, -]; -/** 所属行业(原型选项;编码仅 OpenAPI 示例给出 HAZCHEM,其余按命名约定) */ -const REPORT_INDUSTRY_OPTIONS = [ - { label: "危险化学品", value: "HAZCHEM" }, - { label: "金属非金属矿山", value: "METAL_NONMETAL_MINE" }, - { label: "金属冶炼", value: "METAL_SMELTING" }, - { label: "烟花爆竹", value: "FIREWORKS" }, - { label: "城镇燃气", value: "URBAN_GAS" }, - { label: "工贸", value: "INDUSTRY_TRADE" }, - { label: "其他", value: "OTHER" }, -]; /** 保密属性(OpenAPI 仅示例 NORMAL) */ const SECRET_LEVEL_OPTIONS = [ @@ -231,7 +218,7 @@ const EvalReportLibrary = (props) => { uploadForm.setFieldsValue({ reportYear: dayjs().year(), evalTypeCode: "PRE", - industryCode: "HAZCHEM", + secretLevelCode: "NORMAL", issueDate: dayjs(), submitToRegulator: 0, @@ -311,12 +298,12 @@ const EvalReportLibrary = (props) => { reportYear: values.reportYear, evalTypeCode: values.evalTypeCode, evalTypeName: getOptionLabel( - REPORT_EVAL_TYPE_OPTIONS, + EVAL_TYPE_OPTIONS, values.evalTypeCode, ), industryCode: values.industryCode, industryName: getOptionLabel( - REPORT_INDUSTRY_OPTIONS, + QUALIFICATION_INDUSTRY_OPTIONS, values.industryCode, ), evaluatedUnitName: values.evaluatedUnitName?.trim(), @@ -609,14 +596,14 @@ const EvalReportLibrary = (props) => { dataIndex: "evalTypeName", width: 120, render: (val, record) => - val || getOptionLabel(REPORT_EVAL_TYPE_OPTIONS, record.evalTypeCode), + val || getOptionLabel(EVAL_TYPE_OPTIONS, record.evalTypeCode), }, { title: "所属行业", dataIndex: "industryName", width: 120, render: (val, record) => - val || getOptionLabel(REPORT_INDUSTRY_OPTIONS, record.industryCode), + val || getOptionLabel(QUALIFICATION_INDUSTRY_OPTIONS, record.industryCode), }, { title: "被评价单位", @@ -838,7 +825,7 @@ const EvalReportLibrary = (props) => { label="评价类型" placeholder="全部" allowClear - options={REPORT_EVAL_TYPE_OPTIONS} + options={EVAL_TYPE_OPTIONS} /> , @@ -846,7 +833,7 @@ const EvalReportLibrary = (props) => { label="所属行业" placeholder="全部" allowClear - options={REPORT_INDUSTRY_OPTIONS} + options={QUALIFICATION_INDUSTRY_OPTIONS} /> , @@ -1006,12 +993,12 @@ const EvalReportLibrary = (props) => { - - @@ -1199,7 +1186,7 @@ const EvalReportLibrary = (props) => { {detailData.evalTypeName || getOptionLabel( - REPORT_EVAL_TYPE_OPTIONS, + EVAL_TYPE_OPTIONS, detailData.evalTypeCode, )} @@ -1211,7 +1198,7 @@ const EvalReportLibrary = (props) => { {detailData.industryName || getOptionLabel( - REPORT_INDUSTRY_OPTIONS, + QUALIFICATION_INDUSTRY_OPTIONS, detailData.industryCode, )} diff --git a/src/pages/Container/Supervision/EvalReportDatabase/index.js b/src/pages/Container/Supervision/EvalReportDatabase/index.js index c8eee5c..f188ea7 100644 --- a/src/pages/Container/Supervision/EvalReportDatabase/index.js +++ b/src/pages/Container/Supervision/EvalReportDatabase/index.js @@ -25,6 +25,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { tools } from "@cqsjjb/jjb-common-lib"; import { renderDocxBlob, fillDocxTemplate } from "~/utils/fillDocxTemplate"; import SpotCheckDetailModal from "./components/SpotCheckDetailModal"; +import PreviewUrlButton from "~/components/PreviewUrlButton"; import dayjs from "dayjs"; import "./index.less"; @@ -487,19 +488,6 @@ const EvalReportDatabase = (props) => { getData(pagination); }; - /** 下载指定 URL 的文件 */ - const handleFileDownload = (fileUrl, fileName) => { - if (!fileUrl) { - message.warning("文件地址不存在"); - return; - } - const hide = message.loading("正在下载...", 0); - downloadFileByUrl(fileUrl, fileName) - .then(() => message.success("下载已开始")) - .catch(() => message.error("下载失败,请稍后重试")) - .finally(() => hide()); - }; - const handleViewDetail = async (record) => { setDetailData(null); setDetailVisible(true); @@ -955,7 +943,7 @@ const EvalReportDatabase = (props) => { open={detailVisible} onCancel={() => setDetailVisible(false)} width={980} - destroyOnClose + destroyOnHide className="redb-modal" footer={ @@ -1026,21 +1014,13 @@ const EvalReportDatabase = (props) => { headers={["文件名称", "文件类型", "版本"]} rows={[ [ - - handleFileDownload( - detailData.fileUrl, - detailData.fileName || - detailData.reportName || - "正式安全评价报告.pdf", - ) - } + {detailData.fileName || detailData.reportName || "正式安全评价报告.pdf"} - , + , getFileExtLabel(detailData.fileName), "V1.0", ], @@ -1051,15 +1031,9 @@ const EvalReportDatabase = (props) => { [ - - handleFileDownload(f.url, f.name || "未命名文件") - } - > + {f.name || "未命名文件"} - , + , getFileExtLabel(f.name || f.url), ])} /> @@ -1068,15 +1042,9 @@ const EvalReportDatabase = (props) => { [ - - handleFileDownload(f.url, f.name || "未命名文件") - } - > + {f.name || "未命名文件"} - , + , getFileExtLabel(f.name || f.url), ])} />