zy-react-library 1.1.1 → 1.1.2

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.
Files changed (75) hide show
  1. package/README.md +5 -1
  2. package/components/Cascader/Area/index.js +11 -11
  3. package/components/Cascader/Basic/index.js +23 -30
  4. package/components/Cascader/Dictionary/index.js +42 -42
  5. package/components/Cascader/Industry/index.js +12 -11
  6. package/components/Editor/index.js +43 -63
  7. package/components/FormBuilder/FormBuilder.js +97 -87
  8. package/components/FormBuilder/FormItemsRenderer.js +579 -581
  9. package/components/FormBuilder/index.js +5 -3
  10. package/components/HeaderBack/index.js +39 -32
  11. package/components/HiddenInfo/gwj/index.js +507 -439
  12. package/components/Icon/AddIcon/index.js +6 -6
  13. package/components/Icon/BackIcon/index.js +6 -6
  14. package/components/Icon/DeleteIcon/index.js +6 -6
  15. package/components/Icon/DownloadIcon/index.js +6 -6
  16. package/components/Icon/EditIcon/index.js +6 -6
  17. package/components/Icon/ExportIcon/index.js +6 -6
  18. package/components/Icon/ImportIcon/index.js +6 -6
  19. package/components/Icon/LocationIcon/index.js +6 -6
  20. package/components/Icon/PrintIcon/index.js +6 -6
  21. package/components/Icon/ResetIcon/index.js +6 -6
  22. package/components/Icon/SearchIcon/index.js +6 -6
  23. package/components/Icon/VideoIcon/index.js +6 -6
  24. package/components/Icon/ViewIcon/index.js +6 -6
  25. package/components/ImportFile/index.js +94 -91
  26. package/components/LeftTree/Area/index.js +15 -15
  27. package/components/LeftTree/Basic/index.js +54 -65
  28. package/components/LeftTree/Department/Gwj/index.js +29 -32
  29. package/components/LeftTree/Dictionary/index.js +42 -42
  30. package/components/Map/MapSelector.js +280 -254
  31. package/components/Map/index.js +90 -77
  32. package/components/Page/index.js +43 -34
  33. package/components/Pdf/index.js +92 -90
  34. package/components/PreviewImg/index.js +26 -32
  35. package/components/PreviewPdf/index.js +78 -86
  36. package/components/Search/index.js +147 -141
  37. package/components/Select/Basic/index.js +70 -76
  38. package/components/Select/Dictionary/index.js +42 -42
  39. package/components/Select/Personnel/Gwj/index.js +45 -49
  40. package/components/SelectCreate/index.js +33 -40
  41. package/components/SelectTree/Area/index.js +11 -17
  42. package/components/SelectTree/Basic/index.js +105 -102
  43. package/components/SelectTree/Department/Gwj/index.js +40 -46
  44. package/components/SelectTree/Dictionary/index.js +42 -42
  45. package/components/SelectTree/HiddenLevel/Gwj/index.js +33 -35
  46. package/components/SelectTree/HiddenPart/Gwj/index.js +16 -19
  47. package/components/SelectTree/Industry/index.js +12 -18
  48. package/components/Signature/index.js +68 -62
  49. package/components/Table/index.js +77 -73
  50. package/components/Table/index.less +7 -1
  51. package/components/TooltipPreviewImg/index.js +28 -27
  52. package/components/Upload/index.js +229 -275
  53. package/components/Video/AliPlayer.js +182 -160
  54. package/components/Video/index.js +71 -90
  55. package/css/common.less +4 -0
  56. package/enum/dictionary/index.js +5 -3
  57. package/enum/formItemRender/index.js +37 -35
  58. package/enum/hidden/gwj/index.js +65 -26
  59. package/enum/uploadFile/gwj/index.js +166 -84
  60. package/hooks/useDeleteFile/index.js +24 -30
  61. package/hooks/useDictionary/index.js +28 -30
  62. package/hooks/useDownloadBlob/index.js +78 -77
  63. package/hooks/useDownloadFile/index.js +76 -79
  64. package/hooks/useGetFile/index.js +32 -32
  65. package/hooks/useGetUrlQuery/index.js +1 -2
  66. package/hooks/useGetUserInfo/index.js +19 -26
  67. package/hooks/useIdle/index.js +9 -11
  68. package/hooks/useImportFile/index.js +30 -28
  69. package/hooks/useIsExistenceDuplicateSelection/index.js +25 -18
  70. package/hooks/useTable/index.js +49 -38
  71. package/hooks/useUploadFile/index.js +142 -147
  72. package/hooks/useUrlQueryCriteria/index.js +20 -13
  73. package/package.json +14 -1
  74. package/regular/index.js +34 -39
  75. package/utils/index.js +515 -511
@@ -1,79 +1,80 @@
1
- import { message } from "antd";
2
- import dayjs from "dayjs";
3
- import { useState } from "react";
4
-
1
+ import { message } from 'antd';
2
+ import dayjs from 'dayjs';
3
+ import { useState } from 'react';
4
+
5
5
  /**
6
6
  * 下载Blob流文件
7
- */
8
- export default function useDownloadBlob(returnType = "object") {
9
- // loading状态
10
- const [loading, setLoading] = useState(false);
11
- // 用于跟踪进行中的请求数量(不暴露给外部)
12
- let requestCount = 0;
13
-
14
- // 下载Blob流文件
15
- const downloadBlob = (url, options) => {
16
- // 增加请求数量并设置loading状态
17
- requestCount++;
18
- if (requestCount > 0) {
19
- setLoading(true);
20
- }
21
-
22
- return new Promise((resolve, reject) => {
23
- if (!url)
24
- return reject(new Error("请传入 url"));
25
-
26
- const { name = "", type = "", params = {} } = options;
27
- const finalUrl = new URL((process.env.app.API_HOST || window.__JJB_ENVIRONMENT__.API_HOST) + url);
28
- Object.entries(params).forEach(([key, value]) => {
29
- finalUrl.searchParams.append(key, value);
30
- });
31
- fetch(finalUrl, {
32
- method: "GET",
33
- mode: "cors",
34
- headers: {
35
- "Content-Type": "application/json",
36
- "token": window.sessionStorage["token"],
37
- },
38
- })
39
- .then((response) => {
40
- if (!response.ok) {
41
- console.error("网络响应异常");
42
- return;
43
- }
44
- return response.blob();
45
- })
46
- .then((blob) => {
47
- const finalBlob = new Blob([blob], {
48
- type: type || "application/vnd.ms-excel",
49
- });
50
- const downloadElement = document.createElement("a");
51
- const href = window.URL.createObjectURL(finalBlob);
52
- downloadElement.style.display = "none";
53
- downloadElement.href = href;
54
- downloadElement.download
55
- = name || dayjs().format("YYYY-MM-DD HH:mm:ss");
56
- document.body.appendChild(downloadElement);
57
- downloadElement.click();
58
- document.body.removeChild(downloadElement);
59
- window.URL.revokeObjectURL(href);
60
- resolve({ data: finalBlob });
61
- })
62
- .catch((err) => {
63
- message.error("导出失败");
64
- reject(err);
65
- })
66
- .finally(() => {
67
- // 减少请求数量并在没有进行中的请求时设置loading为false
68
- requestCount--;
69
- if (requestCount <= 0) {
70
- setLoading(false);
71
- }
72
- });
73
- });
74
- };
75
-
76
- if (returnType === "array")
77
- return [loading, downloadBlob];
78
- return { loading, downloadBlob };
79
- }
7
+ */
8
+ function useDownloadBlob(returnType = "object") {
9
+ // loading状态
10
+ const [loading, setLoading] = useState(false);
11
+ // 用于跟踪进行中的请求数量(不暴露给外部)
12
+ let requestCount = 0;
13
+
14
+ // 下载Blob流文件
15
+ const downloadBlob = (url, options) => {
16
+ // 增加请求数量并设置loading状态
17
+ requestCount++;
18
+ if (requestCount > 0) {
19
+ setLoading(true);
20
+ }
21
+ return new Promise((resolve, reject) => {
22
+ if (!url) return reject(new Error("请传入 url"));
23
+ const {
24
+ name = "",
25
+ type = "",
26
+ params = {}
27
+ } = options;
28
+ const finalUrl = new URL((process.env.app.API_HOST || window.__JJB_ENVIRONMENT__.API_HOST) + url);
29
+ Object.entries(params).forEach(([key, value]) => {
30
+ finalUrl.searchParams.append(key, value);
31
+ });
32
+ fetch(finalUrl, {
33
+ method: "GET",
34
+ mode: "cors",
35
+ headers: {
36
+ "Content-Type": "application/json",
37
+ "token": window.sessionStorage["token"]
38
+ }
39
+ }).then(response => {
40
+ if (!response.ok) {
41
+ console.error("网络响应异常");
42
+ return;
43
+ }
44
+ return response.blob();
45
+ }).then(blob => {
46
+ const finalBlob = new Blob([blob], {
47
+ type: type || "application/vnd.ms-excel"
48
+ });
49
+ const downloadElement = document.createElement("a");
50
+ const href = window.URL.createObjectURL(finalBlob);
51
+ downloadElement.style.display = "none";
52
+ downloadElement.href = href;
53
+ downloadElement.download = name || dayjs().format("YYYY-MM-DD HH:mm:ss");
54
+ document.body.appendChild(downloadElement);
55
+ downloadElement.click();
56
+ document.body.removeChild(downloadElement);
57
+ window.URL.revokeObjectURL(href);
58
+ resolve({
59
+ data: finalBlob
60
+ });
61
+ }).catch(err => {
62
+ message.error("导出失败");
63
+ reject(err);
64
+ }).finally(() => {
65
+ // 减少请求数量并在没有进行中的请求时设置loading为false
66
+ requestCount--;
67
+ if (requestCount <= 0) {
68
+ setLoading(false);
69
+ }
70
+ });
71
+ });
72
+ };
73
+ if (returnType === "array") return [loading, downloadBlob];
74
+ return {
75
+ loading,
76
+ downloadBlob
77
+ };
78
+ }
79
+
80
+ export { useDownloadBlob as default };
@@ -1,81 +1,78 @@
1
- import { message, Modal } from "antd";
2
- import { useState } from "react";
3
- import { getFileName, getFileSuffix, getFileUrl } from "../../utils";
4
-
1
+ import { Modal, message } from 'antd';
2
+ import { useState } from 'react';
3
+ import { getFileUrl, getFileSuffix, getFileName } from '../../utils/index.js';
4
+
5
5
  /**
6
6
  * 下载文件
7
- */
8
- export default function useDownloadFile(returnType = "object") {
9
- // loading状态
10
- const [loading, setLoading] = useState(false);
11
- // 用于跟踪进行中的请求数量(不暴露给外部)
12
- let requestCount = 0;
13
-
14
- // 下载文件
15
- const downloadFile = (options) => {
16
- // 增加请求数量并设置loading状态
17
- requestCount++;
18
- if (requestCount > 0) {
19
- setLoading(true);
20
- }
21
-
22
- const { url, name: fileName } = options;
23
- if (!url) {
24
- console.error("请传入 url");
25
- return;
26
- }
27
-
28
- Modal.confirm({
29
- title: "提示",
30
- content: "确定要下载此文件吗?",
31
- onOk: () => {
32
- const fileUrl = getFileUrl();
33
- let name = fileName;
34
-
35
- if (name) {
36
- if (!getFileSuffix(name) && getFileSuffix(url)) {
37
- name = `${name}.${getFileSuffix(url)}`;
38
- }
39
- }
40
- else {
41
- name = getFileName(url);
42
- }
43
-
44
- fetch(!url.includes(fileUrl) ? fileUrl + url : url)
45
- .then(res => res.blob())
46
- .then((blob) => {
47
- const a = document.createElement("a");
48
- document.body.appendChild(a);
49
- a.style.display = "none";
50
- const urlObject = window.URL.createObjectURL(blob);
51
- a.href = urlObject;
52
- a.download = `${name}`;
53
- a.click();
54
- document.body.removeChild(a);
55
- window.URL.revokeObjectURL(urlObject);
56
- })
57
- .catch(() => {
58
- message.error("下载失败");
59
- })
60
- .finally(() => {
61
- // 减少请求数量并在没有进行中的请求时设置loading为false
62
- requestCount--;
63
- if (requestCount <= 0) {
64
- setLoading(false);
65
- }
66
- });
67
- },
68
- onCancel: () => {
69
- // 减少请求数量并在没有进行中的请求时设置loading为false
70
- requestCount--;
71
- if (requestCount <= 0) {
72
- setLoading(false);
73
- }
74
- },
75
- });
76
- };
77
-
78
- if (returnType === "array")
79
- return [loading, downloadFile];
80
- return { loading, downloadFile };
81
- }
7
+ */
8
+ function useDownloadFile(returnType = "object") {
9
+ // loading状态
10
+ const [loading, setLoading] = useState(false);
11
+ // 用于跟踪进行中的请求数量(不暴露给外部)
12
+ let requestCount = 0;
13
+
14
+ // 下载文件
15
+ const downloadFile = options => {
16
+ // 增加请求数量并设置loading状态
17
+ requestCount++;
18
+ if (requestCount > 0) {
19
+ setLoading(true);
20
+ }
21
+ const {
22
+ url,
23
+ name: fileName
24
+ } = options;
25
+ if (!url) {
26
+ console.error("请传入 url");
27
+ return;
28
+ }
29
+ Modal.confirm({
30
+ title: "提示",
31
+ content: "确定要下载此文件吗?",
32
+ onOk: () => {
33
+ const fileUrl = getFileUrl();
34
+ let name = fileName;
35
+ if (name) {
36
+ if (!getFileSuffix(name) && getFileSuffix(url)) {
37
+ name = `${name}.${getFileSuffix(url)}`;
38
+ }
39
+ } else {
40
+ name = getFileName(url);
41
+ }
42
+ fetch(!url.includes(fileUrl) ? fileUrl + url : url).then(res => res.blob()).then(blob => {
43
+ const a = document.createElement("a");
44
+ document.body.appendChild(a);
45
+ a.style.display = "none";
46
+ const urlObject = window.URL.createObjectURL(blob);
47
+ a.href = urlObject;
48
+ a.download = `${name}`;
49
+ a.click();
50
+ document.body.removeChild(a);
51
+ window.URL.revokeObjectURL(urlObject);
52
+ }).catch(() => {
53
+ message.error("下载失败");
54
+ }).finally(() => {
55
+ // 减少请求数量并在没有进行中的请求时设置loading为false
56
+ requestCount--;
57
+ if (requestCount <= 0) {
58
+ setLoading(false);
59
+ }
60
+ });
61
+ },
62
+ onCancel: () => {
63
+ // 减少请求数量并在没有进行中的请求时设置loading为false
64
+ requestCount--;
65
+ if (requestCount <= 0) {
66
+ setLoading(false);
67
+ }
68
+ }
69
+ });
70
+ };
71
+ if (returnType === "array") return [loading, downloadFile];
72
+ return {
73
+ loading,
74
+ downloadFile
75
+ };
76
+ }
77
+
78
+ export { useDownloadFile as default };
@@ -1,7 +1,7 @@
1
- import { request } from "@cqsjjb/jjb-common-lib/http";
2
- import { useState } from "react";
3
- import { UPLOAD_FILE_TYPE_ENUM } from "../../enum/uploadFile/gwj";
4
- import { addingPrefixToFile } from "../../utils";
1
+ import { request } from '@cqsjjb/jjb-common-lib/http';
2
+ import { useState } from 'react';
3
+ import { UPLOAD_FILE_TYPE_ENUM } from '../../enum/uploadFile/gwj/index.js';
4
+ import { addingPrefixToFile } from '../../utils/index.js';
5
5
 
6
6
  /**
7
7
  * 获取文件
@@ -13,7 +13,7 @@ function useGetFile(returnType = "object") {
13
13
  let requestCount = 0;
14
14
 
15
15
  // 获取文件
16
- const getFile = (options) => {
16
+ const getFile = options => {
17
17
  if (!options) {
18
18
  console.error("请传入 options");
19
19
  return;
@@ -24,10 +24,11 @@ function useGetFile(returnType = "object") {
24
24
  if (requestCount > 0) {
25
25
  setLoading(true);
26
26
  }
27
-
28
27
  return new Promise((resolve, reject) => {
29
- const { eqType, eqForeignKey } = options;
30
-
28
+ const {
29
+ eqType,
30
+ eqForeignKey
31
+ } = options;
31
32
  if (!eqType) {
32
33
  console.error("请传入 options.eqType");
33
34
  return;
@@ -38,37 +39,36 @@ function useGetFile(returnType = "object") {
38
39
  console.error("传入的 eqType 不在 UPLOAD_FILE_TYPE_ENUM 中");
39
40
  return;
40
41
  }
41
-
42
42
  if (eqForeignKey === undefined || eqForeignKey === null) {
43
43
  console.error("请传入 options.eqForeignKey");
44
44
  return;
45
45
  }
46
46
 
47
47
  // 发送请求
48
- request(
49
- "/basicInfo/imgFiles/listAll",
50
- "get",
51
- { eqType, eqForeignKey },
52
- )
53
- .then((res) => {
54
- resolve(addingPrefixToFile(res.data).map(item => ({ ...item, type: undefined })));
55
- })
56
- .catch((err) => {
57
- reject(err);
58
- })
59
- .finally(() => {
60
- // 减少请求数量并在没有进行中的请求时设置loading为false
61
- requestCount--;
62
- if (requestCount <= 0) {
63
- setLoading(false);
64
- }
65
- });
48
+ request("/basicInfo/imgFiles/listAll", "get", {
49
+ eqType,
50
+ eqForeignKey
51
+ }).then(res => {
52
+ resolve(addingPrefixToFile(res.data).map(item => ({
53
+ ...item,
54
+ type: undefined
55
+ })));
56
+ }).catch(err => {
57
+ reject(err);
58
+ }).finally(() => {
59
+ // 减少请求数量并在没有进行中的请求时设置loading为false
60
+ requestCount--;
61
+ if (requestCount <= 0) {
62
+ setLoading(false);
63
+ }
64
+ });
66
65
  });
67
66
  };
68
-
69
- if (returnType === "array")
70
- return [loading, getFile];
71
- return { loading, getFile };
67
+ if (returnType === "array") return [loading, getFile];
68
+ return {
69
+ loading,
70
+ getFile
71
+ };
72
72
  }
73
73
 
74
- export default useGetFile;
74
+ export { useGetFile as default };
@@ -9,8 +9,7 @@ function useGetUrlQuery() {
9
9
  for (const [key, value] of urlQuery.entries()) {
10
10
  queryParams[key] = value;
11
11
  }
12
-
13
12
  return queryParams;
14
13
  }
15
14
 
16
- export default useGetUrlQuery;
15
+ export { useGetUrlQuery as default };
@@ -1,5 +1,5 @@
1
- import { request } from "@cqsjjb/jjb-common-lib/http";
2
- import { useState } from "react";
1
+ import { request } from '@cqsjjb/jjb-common-lib/http';
2
+ import { useState } from 'react';
3
3
 
4
4
  /**
5
5
  * 获取用户信息
@@ -17,33 +17,26 @@ function useGetUserInfo(returnType = "object") {
17
17
  if (requestCount > 0) {
18
18
  setLoading(true);
19
19
  }
20
-
21
20
  return new Promise((resolve, reject) => {
22
21
  // 发送请求
23
- request(
24
- "/basicInfo/user/getInfo",
25
- "get",
26
- {},
27
- )
28
- .then((res) => {
29
- resolve(res.data);
30
- })
31
- .catch((err) => {
32
- reject(err);
33
- })
34
- .finally(() => {
35
- // 减少请求数量并在没有进行中的请求时设置loading为false
36
- requestCount--;
37
- if (requestCount <= 0) {
38
- setLoading(false);
39
- }
40
- });
22
+ request("/basicInfo/user/getInfo", "get", {}).then(res => {
23
+ resolve(res.data);
24
+ }).catch(err => {
25
+ reject(err);
26
+ }).finally(() => {
27
+ // 减少请求数量并在没有进行中的请求时设置loading为false
28
+ requestCount--;
29
+ if (requestCount <= 0) {
30
+ setLoading(false);
31
+ }
32
+ });
41
33
  });
42
34
  };
43
-
44
- if (returnType === "array")
45
- return [loading, getUserInfo];
46
- return { loading, getUserInfo };
35
+ if (returnType === "array") return [loading, getUserInfo];
36
+ return {
37
+ loading,
38
+ getUserInfo
39
+ };
47
40
  }
48
41
 
49
- export default useGetUserInfo;
42
+ export { useGetUserInfo as default };
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from "react";
1
+ import { useState, useEffect } from 'react';
2
2
 
3
3
  /**
4
4
  * 检测用户是否处于空闲状态
@@ -6,11 +6,9 @@ import { useEffect, useState } from "react";
6
6
  function useIdle(options = {}) {
7
7
  const {
8
8
  timeout = 10000,
9
- events = ["mousemove", "mousedown", "resize", "keydown", "touchstart", "wheel"],
9
+ events = ["mousemove", "mousedown", "resize", "keydown", "touchstart", "wheel"]
10
10
  } = options;
11
-
12
11
  const [isIdle, setIsIdle] = useState(false);
13
-
14
12
  useEffect(() => {
15
13
  let idleTimer;
16
14
 
@@ -40,28 +38,28 @@ function useIdle(options = {}) {
40
38
  // 如果当前是空闲状态,用户操作后重置为活跃状态
41
39
  if (isIdle) {
42
40
  setActive();
43
- }
44
- else {
41
+ } else {
45
42
  // 如果当前是活跃状态,重置计时器
46
43
  resetTimer();
47
44
  }
48
45
  };
49
46
 
50
47
  // 添加事件监听器
51
- events.forEach((event) => {
52
- window.addEventListener(event, handleUserActivity, { passive: true });
48
+ events.forEach(event => {
49
+ window.addEventListener(event, handleUserActivity, {
50
+ passive: true
51
+ });
53
52
  });
54
53
 
55
54
  // 清理函数
56
55
  return () => {
57
56
  clearTimeout(idleTimer);
58
- events.forEach((event) => {
57
+ events.forEach(event => {
59
58
  window.removeEventListener(event, handleUserActivity);
60
59
  });
61
60
  };
62
61
  }, [timeout, events, isIdle]);
63
-
64
62
  return isIdle;
65
63
  }
66
64
 
67
- export default useIdle;
65
+ export { useIdle as default };
@@ -1,10 +1,10 @@
1
- import { request } from "@cqsjjb/jjb-common-lib/http";
2
- import { useState } from "react";
1
+ import { request } from '@cqsjjb/jjb-common-lib/http';
2
+ import { useState } from 'react';
3
3
 
4
4
  /**
5
5
  * 导入文件
6
6
  */
7
- export default function useImportFile(returnType = "object") {
7
+ function useImportFile(returnType = "object") {
8
8
  // loading状态
9
9
  const [loading, setLoading] = useState(false);
10
10
  // 用于跟踪进行中的请求数量(不暴露给外部)
@@ -17,43 +17,45 @@ export default function useImportFile(returnType = "object") {
17
17
  if (requestCount > 0) {
18
18
  setLoading(true);
19
19
  }
20
-
21
20
  return new Promise((resolve, reject) => {
22
- if (!url)
23
- return reject(new Error("请传入 url"));
24
-
25
- const { files = [], params = {} } = options;
21
+ if (!url) return reject(new Error("请传入 url"));
22
+ const {
23
+ files = [],
24
+ params = {}
25
+ } = options;
26
26
  const formData = new FormData();
27
27
 
28
28
  // 将文件添加到formData中
29
- files.forEach((f) => {
29
+ files.forEach(f => {
30
30
  f.originFileObj && formData.append("file", f.originFileObj);
31
31
  });
32
32
 
33
33
  // 将额外携带的参数添加到formData中
34
- Object.keys(params).forEach((key) => {
34
+ Object.keys(params).forEach(key => {
35
35
  formData.append(key, params[key]);
36
36
  });
37
37
 
38
38
  // 发送请求
39
- request(url, "post", formData, { "Content-Type": "multipart/form-data" })
40
- .then((res) => {
41
- resolve(res);
42
- })
43
- .catch((err) => {
44
- reject(err);
45
- })
46
- .finally(() => {
47
- // 减少请求数量并在没有进行中的请求时设置loading为false
48
- requestCount--;
49
- if (requestCount <= 0) {
50
- setLoading(false);
51
- }
52
- });
39
+ request(url, "post", formData, {
40
+ "Content-Type": "multipart/form-data"
41
+ }).then(res => {
42
+ resolve(res);
43
+ }).catch(err => {
44
+ reject(err);
45
+ }).finally(() => {
46
+ // 减少请求数量并在没有进行中的请求时设置loading为false
47
+ requestCount--;
48
+ if (requestCount <= 0) {
49
+ setLoading(false);
50
+ }
51
+ });
53
52
  });
54
53
  };
55
-
56
- if (returnType === "array")
57
- return [loading, importFile];
58
- return { loading, importFile };
54
+ if (returnType === "array") return [loading, importFile];
55
+ return {
56
+ loading,
57
+ importFile
58
+ };
59
59
  }
60
+
61
+ export { useImportFile as default };