优化HiddenInfo

master
LiuJiaNan 2025-11-18 16:39:36 +08:00
parent 725b778df4
commit 0a225f3cfa
1 changed files with 34 additions and 24 deletions

View File

@ -1,5 +1,5 @@
import { request } from "@cqsjjb/jjb-common-lib/http"; import { request } from "@cqsjjb/jjb-common-lib/http";
import {Button, Descriptions, Divider, Space, Spin} from "antd"; import { Button, Descriptions, Divider, Space, Spin } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "../../../enum/hidden/gwj"; import { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "../../../enum/hidden/gwj";
@ -52,26 +52,36 @@ function HiddenInfo(props) {
setLoading(false); setLoading(false);
onGetData?.(res.data); onGetData?.(res.data);
}); });
const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: hiddenId || query[hiddenIdKey] }); const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: hiddenId || query[hiddenIdKey] });
setHiddenImageFiles(hiddenImageFiles); setHiddenImageFiles(hiddenImageFiles);
const hiddenVideoFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["102"], eqForeignKey: hiddenId || query[hiddenIdKey] }); const hiddenVideoFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["102"], eqForeignKey: hiddenId || query[hiddenIdKey] });
setHiddenVideoFiles(hiddenVideoFiles); setHiddenVideoFiles(hiddenVideoFiles);
const afterRectificationImageFiles = await getFile({
eqType: UPLOAD_FILE_TYPE_ENUM["4"], if (info.hiddenRectifyUserCO && Object.keys(info.hiddenRectifyUserCO).length > 0) {
eqForeignKey: hiddenId || query[hiddenIdKey], const afterRectificationImageFiles = await getFile({
}); eqType: UPLOAD_FILE_TYPE_ENUM["4"],
setAfterRectificationImageFiles(afterRectificationImageFiles); eqForeignKey: hiddenId || query[hiddenIdKey],
const rectificationPlanImageFiles = await getFile({ });
eqType: UPLOAD_FILE_TYPE_ENUM["8"], setAfterRectificationImageFiles(afterRectificationImageFiles);
eqForeignKey: hiddenId || query[hiddenIdKey],
}); if ((info.hiddenRectifyUserCO.isRectificationScheme === 1 && info.hiddenRectifyUserCO.hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO.hiddenSchemeCO).length > 0)) {
setRectificationPlanImageFiles(rectificationPlanImageFiles); const rectificationPlanImageFiles = await getFile({
const acceptImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["5"], eqForeignKey: hiddenId || query[hiddenIdKey] }); eqType: UPLOAD_FILE_TYPE_ENUM["8"],
setAcceptImageFiles(acceptImageFiles); eqForeignKey: hiddenId || query[hiddenIdKey],
});
setRectificationPlanImageFiles(rectificationPlanImageFiles);
}
}
if (info.isQualified === 1 && (info.hiddenAcceptUserCO && Object.keys(info.hiddenAcceptUserCO).length > 0)) {
const acceptImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["5"], eqForeignKey: hiddenId || query[hiddenIdKey] });
setAcceptImageFiles(acceptImageFiles);
}
}; };
useEffect(() => { useEffect(() => {
getData(); getData();
}, []); }, [props.id, props.hiddenId]);
return ( return (
<div> <div>
@ -89,18 +99,18 @@ function HiddenInfo(props) {
{ label: "隐患级别", children: info.hiddenLevelName }, { label: "隐患级别", children: info.hiddenLevelName },
{ label: "隐患状态", children: getLabelName({ list: HIDDEN_STATE_ENUM, status: info.state }) }, { label: "隐患状态", children: getLabelName({ list: HIDDEN_STATE_ENUM, status: info.state }) },
{ label: "隐患描述", children: info.hiddenDesc }, { label: "隐患描述", children: info.hiddenDesc },
{ label: "隐患部位", children: info.hiddenPart }, { label: "隐患部位", children: info.hiddenPartName },
...( ...(
(info.source === 2 || info.source === 3) && (info.hiddenCheckListCO && Object.keys(info.hiddenCheckListCO).length > 0) (info.source === 2 || info.source === 3) && (info.hiddenCheckListCO && Object.keys(info.hiddenCheckListCO).length > 0)
? [ ? [
{ label: "风险点(单元)", children: info.hiddenCheckListCO.listRiskPoints }, { label: "风险点(单元)", children: info.hiddenCheckListCO.listRiskPoints },
{ label: "辨识部位", children: info.hiddenCheckListCO.identifiedLocations }, { label: "辨识部位", children: info.hiddenCheckListCO.identifiedLocations },
{ label: "存在风险", children: info.hiddenCheckListCO.existingRisks }, { label: "存在风险", children: info.hiddenCheckListCO.existingRisks },
{ label: "风险分级", children: info.hiddenCheckListCO.riskLevel }, { label: "风险分级", children: info.hiddenCheckListCO.riskLevel },
{ label: "隐患清单", children: info.hiddenCheckListCO.listName }, { label: "隐患清单", children: info.hiddenCheckListCO.listName },
{ label: "检查内容", children: info.hiddenCheckListCO.inspectionContent }, { label: "检查内容", children: info.hiddenCheckListCO.inspectionContent },
] ]
: [] : []
), ),
{ {
label: "隐患上报位置(经纬度)", label: "隐患上报位置(经纬度)",