优化MapSelector、PersonnelSelect、HiddenInfo
parent
75c3bea0e9
commit
81a01ba476
|
|
@ -63,19 +63,18 @@ function HiddenInfo(props) {
|
|||
setHiddenVideoFiles(hiddenVideoFiles);
|
||||
|
||||
if (info.hiddenRectifyUserCO && info.hiddenRectifyUserCO.length > 0) {
|
||||
const afterRectificationImageFiles = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["4"],
|
||||
eqForeignKey: hiddenId || query[hiddenIdKey],
|
||||
});
|
||||
setAfterRectificationImageFiles(afterRectificationImageFiles);
|
||||
|
||||
for (let i = 0; i < info.hiddenRectifyUserCO.length; i++) {
|
||||
if ((info.hiddenRectifyUserCO[i].isRectificationScheme === 1 && info.hiddenRectifyUserCO[i].hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO[i].hiddenSchemeCO).length > 0)) {
|
||||
const afterRectificationImageFiles = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["4"],
|
||||
eqForeignKey: info.hiddenRectifyUserCO[i].hiddenUserId,
|
||||
});
|
||||
setAfterRectificationImageFiles(prevState => [...prevState, afterRectificationImageFiles]);
|
||||
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: hiddenId || query[hiddenIdKey],
|
||||
eqForeignKey: info.hiddenRectifyUserCO[i].hiddenSchemeId,
|
||||
});
|
||||
setRectificationPlanImageFiles(prevState => [...prevState, ...rectificationPlanImageFiles]);
|
||||
setRectificationPlanImageFiles(prevState => [...prevState, rectificationPlanImageFiles]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -86,7 +85,7 @@ function HiddenInfo(props) {
|
|||
eqType: UPLOAD_FILE_TYPE_ENUM["5"],
|
||||
eqForeignKey: hiddenId || query[hiddenIdKey],
|
||||
});
|
||||
setAcceptImageFiles(prevState => [...prevState, ...acceptImageFiles]);
|
||||
setAcceptImageFiles(prevState => [...prevState, acceptImageFiles]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -392,7 +391,7 @@ function HiddenInfo(props) {
|
|||
{ label: "整改描述", children: item.descr },
|
||||
{ label: "投入资金", children: item.investmentFunds },
|
||||
{ label: "临时安全措施", children: info.tempSafeMeasure },
|
||||
{ label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles} /> },
|
||||
{ label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles[index]} /> },
|
||||
{ label: "整改方案", children: item.isRectificationScheme === 0 ? "无" : "有" },
|
||||
...((item.isRectificationScheme === 1 && item.hiddenSchemeCO && Object.keys(item.hiddenSchemeCO).length > 0)
|
||||
? [
|
||||
|
|
|
|||
|
|
@ -93,6 +93,17 @@ const MapSelector = (props) => {
|
|||
}
|
||||
};
|
||||
|
||||
// 清空
|
||||
const handleLocalClear = () => {
|
||||
setLocalSearch("");
|
||||
if (mapInstanceRef.current) {
|
||||
const local = new window.BMapGL.LocalSearch(mapInstanceRef.current, {
|
||||
renderOptions: { map: mapInstanceRef.current },
|
||||
});
|
||||
local.search("");
|
||||
}
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const handleClose = () => {
|
||||
setLocalSearch("");
|
||||
|
|
@ -191,10 +202,13 @@ const MapSelector = (props) => {
|
|||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label=" " colon={false}>
|
||||
<Form.Item label=" " colon={false} style={{ textAlign: "right" }}>
|
||||
<Button type="primary" onClick={handleLocalSearch}>
|
||||
搜索
|
||||
</Button>
|
||||
<Button onClick={handleLocalClear}>
|
||||
重置
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ export interface PersonnelSelectProps extends Omit<BasicSelectProps, "data" | "p
|
|||
isNeedPostId?: boolean;
|
||||
/** 是否需要部门id,默认 true */
|
||||
isNeedDepartmentId?: boolean;
|
||||
/** 返回值是否存在主账号 */
|
||||
noMain?: 1 | "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ function PersonnelSelect(props) {
|
|||
isNeedCorpInfoId = false,
|
||||
isNeedDepartmentId = true,
|
||||
isNeedPostId = false,
|
||||
noMain = "",
|
||||
...restProps
|
||||
} = props;
|
||||
|
||||
|
|
@ -27,13 +28,13 @@ function PersonnelSelect(props) {
|
|||
if (isNeedPostId && !params.postId)
|
||||
return;
|
||||
|
||||
const { data } = await request("/basicInfo/user/listAll", "get", params);
|
||||
const { data } = await request("/basicInfo/user/listAll", "get", { ...params, noMain });
|
||||
setData(data);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getData();
|
||||
}, [JSON.stringify(params), isNeedCorpInfoId, isNeedDepartmentId, isNeedPostId]);
|
||||
}, [JSON.stringify(params), isNeedCorpInfoId, isNeedDepartmentId, isNeedPostId, noMain]);
|
||||
|
||||
return (
|
||||
<BasicSelect data={data} placeholder={placeholder} {...restProps} />
|
||||
|
|
|
|||
Loading…
Reference in New Issue