优化HiddenInfo

master
LiuJiaNan 2025-12-22 13:38:31 +08:00
parent 68a24253e9
commit 116ff08b5b
1 changed files with 54 additions and 43 deletions

View File

@ -64,12 +64,15 @@ function HiddenInfo(props) {
if (info.hiddenRectifyUserCO && info.hiddenRectifyUserCO.length > 0) { if (info.hiddenRectifyUserCO && info.hiddenRectifyUserCO.length > 0) {
for (let i = 0; i < info.hiddenRectifyUserCO.length; i++) { for (let i = 0; i < info.hiddenRectifyUserCO.length; i++) {
if (info.hiddenRectifyUserCO[i].hiddenUserId) {
const afterRectificationImageFiles = await getFile({ const afterRectificationImageFiles = await getFile({
eqType: UPLOAD_FILE_TYPE_ENUM["4"], eqType: UPLOAD_FILE_TYPE_ENUM["4"],
eqForeignKey: info.hiddenRectifyUserCO[i].hiddenUserId, eqForeignKey: info.hiddenRectifyUserCO[i].hiddenUserId,
}); });
setAfterRectificationImageFiles(prevState => [...prevState, afterRectificationImageFiles]); setAfterRectificationImageFiles(prevState => [...prevState, afterRectificationImageFiles]);
}
if (info.hiddenRectifyUserCO[i].isRectificationScheme === 1 && info.hiddenRectifyUserCO[i].hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO[i].hiddenSchemeCO).length > 0) { if (info.hiddenRectifyUserCO[i].isRectificationScheme === 1 && info.hiddenRectifyUserCO[i].hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO[i].hiddenSchemeCO).length > 0) {
if (info.hiddenRectifyUserCO[i].hiddenSchemeCO.hiddenSchemeId) {
const rectificationPlanImageFiles = await getFile({ const rectificationPlanImageFiles = await getFile({
eqType: UPLOAD_FILE_TYPE_ENUM["8"], eqType: UPLOAD_FILE_TYPE_ENUM["8"],
eqForeignKey: info.hiddenRectifyUserCO[i].hiddenSchemeCO.hiddenSchemeId, eqForeignKey: info.hiddenRectifyUserCO[i].hiddenSchemeCO.hiddenSchemeId,
@ -78,6 +81,7 @@ function HiddenInfo(props) {
} }
} }
} }
}
if (info.isQualified === 1 && (info.hiddenAcceptUserCO && info.hiddenAcceptUserCO.length > 0)) { if (info.isQualified === 1 && (info.hiddenAcceptUserCO && info.hiddenAcceptUserCO.length > 0)) {
for (let i = 0; i < info.hiddenAcceptUserCO.length; i++) { for (let i = 0; i < info.hiddenAcceptUserCO.length; i++) {
@ -126,7 +130,7 @@ 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.hiddenPartName }, ...(info.hiddenPartName ? [{ 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)
? [ ? [
@ -139,11 +143,11 @@ function HiddenInfo(props) {
] ]
: [] : []
), ),
{ ...(info.longitude ? [{
label: "隐患上报位置(经纬度)", label: "隐患上报位置(经纬度)",
children: [info.longitude && `经度:${info.longitude}`, info.latitude && `纬度:${info.latitude}`].filter(Boolean).join(" "), children: [info.longitude && `经度:${info.longitude}`, info.latitude && `纬度:${info.latitude}`].filter(Boolean).join(" "),
}, }] : []),
{ label: "隐患位置描述", children: info.positionDesc }, ...(info.positionDesc ? [{ label: "隐患位置描述", children: info.positionDesc }] : []),
{ label: "隐患发现人", children: info.creatorName }, { 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") },
{ {
@ -213,18 +217,18 @@ function HiddenInfo(props) {
column={1} column={1}
styles={{ label: { width: 200 } }} styles={{ label: { width: 200 } }}
items={[ items={[
{ label: "隐患级别", children: item.hiddenLevelName }, ...(item.hiddenLevelName ? [{ label: "隐患级别", children: item.hiddenLevelName }] : []),
{ label: "隐患确认人", children: item.userName }, ...(item.userName ? [{ label: "隐患确认人", children: item.userName }] : []),
{ label: "隐患确认时间", children: item.rectificationTime }, ...(item.rectificationTime ? [{ label: "隐患确认时间", children: item.rectificationTime }] : []),
{ label: "整改负责人部门", children: item.rectifyDeptName }, ...(item.rectifyDeptName ? [{ label: "整改负责人部门", children: item.rectifyDeptName }] : []),
{ label: "整改负责人", children: item.rectifyUserName }, ...(item.rectifyUserName ? [{ label: "整改负责人", children: item.rectifyUserName }] : []),
{ label: "整改完成期限", children: item.rectificationDeadline }, ...(item.rectificationDeadline ? [{ label: "整改完成期限", children: item.rectificationDeadline }] : []),
{ label: "验收部门", children: item.checkDeptName }, ...(item.checkDeptName ? [{ label: "验收部门", children: item.checkDeptName }] : []),
{ label: "验收人", children: item.checkUserName }, ...(item.checkUserName ? [{ label: "验收人", children: item.checkUserName }] : []),
...(item.repulseCause ...(item.repulseCause
? [ ? [
{ label: "打回意见", children: item.repulseCause }, ...(item.repulseCause ? [{ label: "打回意见", children: item.repulseCause }] : []),
{ label: "打回时间", children: item.rectificationTime }, ...(item.rectificationTime ? [{ label: "打回时间", children: item.rectificationTime }] : []),
] ]
: []), : []),
]} ]}
@ -246,13 +250,13 @@ function HiddenInfo(props) {
column={1} column={1}
styles={{ label: { width: 200 } }} styles={{ label: { width: 200 } }}
items={[ items={[
{ label: "申请延期日期", children: item.createTime }, ...(item.createTime ? [{ label: "申请延期日期", children: item.createTime }] : []),
{ label: "延期日期", children: item.delayTime }, ...(item.delayTime ? [{ label: "延期日期", children: item.delayTime }] : []),
{ label: "审核人", children: item.updateName }, ...(item.updateName ? [{ label: "审核人", children: item.updateName }] : []),
...(item.state === 3 ...(item.state === 3
? [ ? [
{ label: "处置方案", children: item.disposalPlan }, ...(item.disposalPlan ? [{ label: "处置方案", children: item.disposalPlan }] : []),
{ ...(item.disposalFile ? [{
label: "处置方案附件", label: "处置方案附件",
children: ( children: (
getFileSuffix(item.disposalFile) === "pdf" getFileSuffix(item.disposalFile) === "pdf"
@ -265,12 +269,12 @@ function HiddenInfo(props) {
size="small" size="small"
onClick={() => downloadFile(item.disposalFile)} onClick={() => downloadFile(item.disposalFile)}
> >
预览 下载
</Button> </Button>
</Space> </Space>
) )
), ),
}, }] : []),
] ]
: []), : []),
{ {
@ -313,15 +317,15 @@ function HiddenInfo(props) {
items={[ items={[
...((item.state === 3 || item.state === 4) ...((item.state === 3 || item.state === 4)
? [ ? [
{ label: "审核人", children: item.updateName }, ...(item.updateName ? [{ label: "审核人", children: item.updateName }] : []),
{ label: "审核时间", children: item.updateTime }, ...(item.updateTime ? [{ label: "审核时间", children: item.updateTime }] : []),
] ]
: []), : []),
{ label: "无法整改原因", children: item.examine }, { label: "无法整改原因", children: item.examine },
...(item.state === 3 ...(item.state === 3
? [ ? [
{ label: "处置方案", children: item.disposalPlan }, ...(item.disposalPlan ? [{ label: "处置方案", children: item.disposalPlan }] : []),
{ ...(item.disposalFile ? [{
label: "处置方案附件", label: "处置方案附件",
children: ( children: (
getFileSuffix(item.disposalFile) === "pdf" getFileSuffix(item.disposalFile) === "pdf"
@ -334,12 +338,12 @@ function HiddenInfo(props) {
size="small" size="small"
onClick={() => downloadFile(item.disposalFile)} onClick={() => downloadFile(item.disposalFile)}
> >
预览 下载
</Button> </Button>
</Space> </Space>
) )
), ),
}, }] : []),
{ {
label: "是否更换整改负责人", label: "是否更换整改负责人",
children: item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0 ? "是" : "否", children: item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0 ? "是" : "否",
@ -382,14 +386,21 @@ function HiddenInfo(props) {
column={1} column={1}
styles={{ label: { width: 200 } }} styles={{ label: { width: 200 } }}
items={[ items={[
{ label: "整改部门", children: item.deptName }, ...(item.deptName ? [{ label: "整改部门", children: item.deptName }] : []),
{ label: "整改人", children: item.userName }, ...(item.userName ? [{ label: "整改人", children: item.userName }] : []),
{ label: "整改时间", children: item.rectificationTime }, ...(item.rectificationTime ? [{ label: "整改时间", children: item.rectificationTime }] : []),
{ label: "整改描述", children: item.descr }, ...(item.descr ? [{ label: "整改描述", children: item.descr }] : []),
...(item.investmentFunds ? [{ label: "投入资金", children: `${item.investmentFunds}` }] : []), ...(item.investmentFunds ? [{ label: "投入资金", children: `${item.investmentFunds}` }] : []),
...(info.tempSafeMeasure ? [{ label: "临时安全措施", children: info.tempSafeMeasure }] : []), ...(info.tempSafeMeasure ? [{ label: "临时安全措施", children: info.tempSafeMeasure }] : []),
{ label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles[index]} /> }, { label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles[index]} /> },
{ label: "整改方案", children: item.isRectificationScheme === 0 ? "无" : "有" }, {
label: "整改方案", children: (
<>
{item.isRectificationScheme === 0 && <span></span>}
{item.isRectificationScheme === 1 && <span></span>}
</>
)
},
...((item.isRectificationScheme === 1 && item.hiddenSchemeCO && Object.keys(item.hiddenSchemeCO).length > 0) ...((item.isRectificationScheme === 1 && item.hiddenSchemeCO && Object.keys(item.hiddenSchemeCO).length > 0)
? [ ? [
{ label: "治理标准", children: item.hiddenSchemeCO.governStanDards }, { label: "治理标准", children: item.hiddenSchemeCO.governStanDards },
@ -429,7 +440,7 @@ function HiddenInfo(props) {
{ label: "验收人", children: item.userName }, { label: "验收人", children: item.userName },
{ label: "验收时间", children: item.rectificationTime }, { label: "验收时间", children: item.rectificationTime },
...(item.repulseCause ? [{ label: "验收打回意见", children: item.repulseCause }] : []), ...(item.repulseCause ? [{ label: "验收打回意见", children: item.repulseCause }] : []),
{ label: "是否合格", children: "合格" }, { label: "是否合格", children: item.rectificationTime ? "合格" : "" },
...(item.descr ? [{ label: "验收描述", children: item.descr }] : []), ...(item.descr ? [{ label: "验收描述", children: item.descr }] : []),
...((acceptImageFiles[index] && acceptImageFiles[index].length > 0) ? [{ label: "验收图片", children: <PreviewImg files={acceptImageFiles[index]} /> }] : []), ...((acceptImageFiles[index] && acceptImageFiles[index].length > 0) ? [{ label: "验收图片", children: <PreviewImg files={acceptImageFiles[index]} /> }] : []),
]} ]}