zy-react-library 1.0.61 → 1.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
- import { tools } from "@cqsjjb/jjb-common-lib";
2
1
  import { request } from "@cqsjjb/jjb-common-lib/http";
3
2
  import { Descriptions, Divider } from "antd";
4
3
  import dayjs from "dayjs";
@@ -11,8 +10,7 @@ import { UPLOAD_FILE_TYPE_ENUM } from "../../../enum/uploadFile/gwj";
11
10
  import useGetFile from "../../../hooks/useGetFile";
12
11
  import { getLabelName } from "../../../utils";
13
12
  import { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "../../../enum/hidden/gwj";
14
-
15
- const { query } = tools.router;
13
+ import useGetUrlQuery from "../../../hooks/useGetUrlQuery";
16
14
 
17
15
  /**
18
16
  * 隐患查看组件(港务局版本)
@@ -42,6 +40,7 @@ function HiddenInfo(props) {
42
40
  const [rectificationPlanImageFiles, setRectificationPlanImageFiles] = useState([]);
43
41
  const [acceptImageFiles, setAcceptImageFiles] = useState([]);
44
42
  const { getFile } = useGetFile();
43
+ const query = useGetUrlQuery();
45
44
 
46
45
  const getData = async () => {
47
46
  request(`/hidden/hidden/${id || query[idKey]}`, "get").then((res) => {
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 获取路由参数
3
+ */
4
+ export default function useGetUrlQuery(): Record<string, any>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 获取路由参数
3
+ */
4
+ function useGetUrlQuery() {
5
+ const urlQuery = new URLSearchParams(window.location.search);
6
+
7
+ // 直接返回包含所有参数的对象
8
+ const queryParams = {};
9
+ for (const [key, value] of urlQuery.entries()) {
10
+ queryParams[key] = value;
11
+ }
12
+
13
+ return queryParams;
14
+ }
15
+
16
+ export default useGetUrlQuery;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.0.61",
4
+ "version": "1.0.63",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",