优化HiddenInfo
parent
725b778df4
commit
0a225f3cfa
|
|
@ -52,26 +52,36 @@ function HiddenInfo(props) {
|
|||
setLoading(false);
|
||||
onGetData?.(res.data);
|
||||
});
|
||||
|
||||
const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: hiddenId || query[hiddenIdKey] });
|
||||
setHiddenImageFiles(hiddenImageFiles);
|
||||
const hiddenVideoFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["102"], eqForeignKey: hiddenId || query[hiddenIdKey] });
|
||||
setHiddenVideoFiles(hiddenVideoFiles);
|
||||
|
||||
if (info.hiddenRectifyUserCO && Object.keys(info.hiddenRectifyUserCO).length > 0) {
|
||||
const afterRectificationImageFiles = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["4"],
|
||||
eqForeignKey: hiddenId || query[hiddenIdKey],
|
||||
});
|
||||
setAfterRectificationImageFiles(afterRectificationImageFiles);
|
||||
|
||||
if ((info.hiddenRectifyUserCO.isRectificationScheme === 1 && info.hiddenRectifyUserCO.hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO.hiddenSchemeCO).length > 0)) {
|
||||
const rectificationPlanImageFiles = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["8"],
|
||||
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(() => {
|
||||
getData();
|
||||
}, []);
|
||||
}, [props.id, props.hiddenId]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
|
@ -89,7 +99,7 @@ function HiddenInfo(props) {
|
|||
{ label: "隐患级别", children: info.hiddenLevelName },
|
||||
{ label: "隐患状态", children: getLabelName({ list: HIDDEN_STATE_ENUM, status: info.state }) },
|
||||
{ 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)
|
||||
? [
|
||||
|
|
|
|||
Loading…
Reference in New Issue