Compare commits

..

No commits in common. "44ad43f9b33b72583b57c3b614151ca8c751d5d0" and "f8a91ab810fd3bc046aa4d34a00aa41dd51b5d99" have entirely different histories.

4 changed files with 10 additions and 29 deletions

View File

@ -10,7 +10,6 @@ import { UPLOAD_FILE_TYPE_ENUM } from "../../../enum/uploadFile/gwj";
import useGetFile from "../../../hooks/useGetFile";
import { getLabelName } from "../../../utils";
import { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "../../../enum/hidden/gwj";
import useGetUrlQuery from "../../../hooks/useGetUrlQuery";
/**
* 隐患查看组件港务局版本
@ -40,27 +39,29 @@ function HiddenInfo(props) {
const [rectificationPlanImageFiles, setRectificationPlanImageFiles] = useState([]);
const [acceptImageFiles, setAcceptImageFiles] = useState([]);
const { getFile } = useGetFile();
const query = useGetUrlQuery();
const getData = async () => {
request(`/hidden/hidden/${id || query[idKey]}`, "get").then((res) => {
const urlParams = new URLSearchParams(window.location.search);
const queryId = urlParams.get(idKey);
const queryHiddenId = urlParams.get(hiddenIdKey);
request(`/hidden/hidden/${id || queryId}`, "get").then((res) => {
setInfo(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 || queryHiddenId });
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 || queryHiddenId });
setHiddenVideoFiles(hiddenVideoFiles);
const afterRectificationImageFiles = await getFile({
eqType: UPLOAD_FILE_TYPE_ENUM["4"],
eqForeignKey: hiddenId || query[hiddenIdKey],
eqForeignKey: hiddenId || queryHiddenId,
});
setAfterRectificationImageFiles(afterRectificationImageFiles);
const rectificationPlanImageFiles = await getFile({
eqType: UPLOAD_FILE_TYPE_ENUM["8"],
eqForeignKey: hiddenId || query[hiddenIdKey],
eqForeignKey: hiddenId || queryHiddenId,
});
setRectificationPlanImageFiles(rectificationPlanImageFiles);
const acceptImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["5"], eqForeignKey: hiddenId || query[hiddenIdKey] });
const acceptImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["5"], eqForeignKey: hiddenId || queryHiddenId });
setAcceptImageFiles(acceptImageFiles);
};
useEffect(() => {

View File

@ -1,4 +0,0 @@
/**
*
*/
export default function useGetUrlQuery(): Record<string, any>;

View File

@ -1,16 +0,0 @@
/**
* 获取路由参数
*/
function useGetUrlQuery() {
const urlQuery = new URLSearchParams(window.location.search);
// 直接返回包含所有参数的对象
const queryParams = {};
for (const [key, value] of urlQuery.entries()) {
queryParams[key] = value;
}
return queryParams;
}
export default useGetUrlQuery;

View File

@ -1,7 +1,7 @@
{
"name": "zy-react-library",
"private": false,
"version": "1.0.62",
"version": "1.0.61",
"type": "module",
"description": "",
"author": "LiuJiaNan",