优化HiddenInfo
parent
befc8453d2
commit
055afa0d83
|
|
@ -2,17 +2,28 @@ import { request } from "@cqsjjb/jjb-common-lib/http";
|
|||
import { Button, Descriptions, Divider, Space, Spin } from "antd";
|
||||
import dayjs from "dayjs";
|
||||
import { useEffect, useState } from "react";
|
||||
import { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "../../../enum/hidden/gwj";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "../../../enum/uploadFile/gwj";
|
||||
import useDownloadFile from "../../../hooks/useDownloadFile";
|
||||
import useGetFile from "../../../hooks/useGetFile";
|
||||
import useGetUrlQuery from "../../../hooks/useGetUrlQuery";
|
||||
import { getFileName, getFileSuffix, getLabelName } from "../../../utils";
|
||||
import HeaderBack from "../../HeaderBack";
|
||||
import VideoIcon from "../../Icon/VideoIcon";
|
||||
import PreviewImg from "../../PreviewImg";
|
||||
import PreviewPdf from "../../PreviewPdf";
|
||||
import Video from "../../Video";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import VideoIcon from "zy-react-library/components/Icon/VideoIcon";
|
||||
import PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
import PreviewPdf from "zy-react-library/components/PreviewPdf";
|
||||
import Video from "zy-react-library/components/Video";
|
||||
// import { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "../../../enum/hidden/gwj";
|
||||
// import { UPLOAD_FILE_TYPE_ENUM } from "../../../enum/uploadFile/gwj";
|
||||
// import useDownloadFile from "../../../hooks/useDownloadFile";
|
||||
// import useGetFile from "../../../hooks/useGetFile";
|
||||
// import useGetUrlQuery from "../../../hooks/useGetUrlQuery";
|
||||
// import { getFileName, getFileSuffix, getLabelName } from "../../../utils";
|
||||
// import HeaderBack from "../../HeaderBack";
|
||||
// import VideoIcon from "../../Icon/VideoIcon";
|
||||
// import PreviewImg from "../../PreviewImg";
|
||||
// import PreviewPdf from "../../PreviewPdf";
|
||||
// import Video from "../../Video";
|
||||
import { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "zy-react-library/enum/hidden/gwj";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
import useDownloadFile from "zy-react-library/hooks/useDownloadFile";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import { getFileName, getFileSuffix, getLabelName } from "zy-react-library/utils";
|
||||
|
||||
/**
|
||||
* 隐患查看组件(港务局版本)
|
||||
|
|
@ -72,7 +83,7 @@ function HiddenInfo(props) {
|
|||
if (info.hiddenRectifyUserCO[i].isRectificationScheme === 1 && info.hiddenRectifyUserCO[i].hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO[i].hiddenSchemeCO).length > 0) {
|
||||
const rectificationPlanImageFiles = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["8"],
|
||||
eqForeignKey: info.hiddenRectifyUserCO[i].hiddenSchemeId,
|
||||
eqForeignKey: info.hiddenRectifyUserCO[i].hiddenSchemeCO.hiddenSchemeId,
|
||||
});
|
||||
setRectificationPlanImageFiles(prevState => [...prevState, rectificationPlanImageFiles]);
|
||||
}
|
||||
|
|
@ -145,7 +156,7 @@ function HiddenInfo(props) {
|
|||
},
|
||||
{ label: "隐患位置描述", children: info.positionDesc },
|
||||
{ label: "隐患发现人", children: info.creatorName },
|
||||
{ label: "隐患发现时间", children: dayjs(info.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") },
|
||||
{ label: "隐患发现时间", children: dayjs(info.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") },
|
||||
{
|
||||
label: "整改类型",
|
||||
children: getLabelName({
|
||||
|
|
@ -156,7 +167,7 @@ function HiddenInfo(props) {
|
|||
{
|
||||
label: "是否相关方",
|
||||
children: getLabelName({
|
||||
list: [{ bianma: "1", name: "是" }, { bianma: "2", name: "否" }],
|
||||
list: [{ bianma: "1", name: "是" }, { bianma: "0", name: "否" }],
|
||||
status: info.isRelated,
|
||||
}),
|
||||
},
|
||||
|
|
@ -389,8 +400,8 @@ function HiddenInfo(props) {
|
|||
{ label: "整改人", children: item.userName },
|
||||
{ label: "整改时间", children: item.rectificationTime },
|
||||
{ label: "整改描述", children: item.descr },
|
||||
{ label: "投入资金", children: item.investmentFunds },
|
||||
{ label: "临时安全措施", children: info.tempSafeMeasure },
|
||||
...(item.investmentFunds ? [{ label: "投入资金", children: `${item.investmentFunds}元` }] : []),
|
||||
...(info.tempSafeMeasure ? [{ label: "临时安全措施", children: info.tempSafeMeasure }] : []),
|
||||
{ label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles[index]} /> },
|
||||
{ label: "整改方案", children: item.isRectificationScheme === 0 ? "无" : "有" },
|
||||
...((item.isRectificationScheme === 1 && item.hiddenSchemeCO && Object.keys(item.hiddenSchemeCO).length > 0)
|
||||
|
|
@ -431,10 +442,10 @@ function HiddenInfo(props) {
|
|||
{ label: "验收部门", children: item.deptName },
|
||||
{ label: "验收人", children: item.userName },
|
||||
{ label: "验收时间", children: item.rectificationTime },
|
||||
{ label: "验收打回意见", children: item.repulseCause },
|
||||
...(item.repulseCause ? [{ label: "验收打回意见", children: item.repulseCause }] : []),
|
||||
{ label: "是否合格", children: "合格" },
|
||||
{ label: "验收描述", children: item.descr },
|
||||
{ label: "验收图片", children: <PreviewImg files={acceptImageFiles[index]} /> },
|
||||
...(item.descr ? [{ label: "验收描述", children: item.descr }] : []),
|
||||
...((acceptImageFiles[index] && acceptImageFiles[index].length > 0) ? [{ label: "验收图片", children: <PreviewImg files={acceptImageFiles[index]} /> }] : []),
|
||||
]}
|
||||
/>
|
||||
))
|
||||
|
|
|
|||
Loading…
Reference in New Issue