@das-fed/utils 6.3.0-beta.1 → 6.3.0-beta.10

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 (168) hide show
  1. package/__VLS_types.d.ts +124 -0
  2. package/api-services/modules/{file.d.ts → file/index.d.ts} +4 -4
  3. package/api-services/modules/{file.js → file/index.js} +18 -36
  4. package/api-services/modules/file/index.js.gz +0 -0
  5. package/api-services/modules/index.js.gz +0 -0
  6. package/atob/index.d.ts +2 -2
  7. package/common-info/{getIframeUrl.js → getIframeUrl/index.js} +1 -2
  8. package/common-info/getInfoFromUrl/index.js +84 -0
  9. package/common-info/getInfoFromUrl/index.js.gz +0 -0
  10. package/common-info/index.d.ts +1 -1
  11. package/common-info/index.js +2 -4
  12. package/common-info/index.js.gz +0 -0
  13. package/common-info/{set-personal-info.d.ts → set-personal-info/index.d.ts} +1 -1
  14. package/common-info/{set-personal-info.js → set-personal-info/index.js} +10 -24
  15. package/common-info/set-personal-info/index.js.gz +0 -0
  16. package/common-info/type.d.ts +104 -0
  17. package/common-tools/{arr-tools.d.ts → arr-tools/index.d.ts} +1 -1
  18. package/common-tools/{date-format.js → date-format/index.js} +1 -2
  19. package/common-tools/{get-url-params.d.ts → get-url-params/index.d.ts} +1 -1
  20. package/common-tools/{get-url-params.js → get-url-params/index.js} +2 -4
  21. package/common-tools/get-url-params/index.js.gz +0 -0
  22. package/common-tools/{nest-tree-format.d.ts → nest-tree-format/index.d.ts} +1 -1
  23. package/common-tools/{nest-tree-format.js → nest-tree-format/index.js} +2 -4
  24. package/common-tools/obj-tools/index.js +14 -0
  25. package/common-tools/{platform-tools.js → platform-tools/index.js} +1 -2
  26. package/common-tools/{queue-promise.d.ts → queue-promise/index.d.ts} +1 -1
  27. package/common-tools/setHtmlMinWH/index.d.ts +5 -0
  28. package/common-tools/update-fav-icon/index.d.ts +11 -0
  29. package/common-tools/update-fav-icon/index.js +21 -0
  30. package/create-api-service/index.js +255 -295
  31. package/create-api-service/index.js.gz +0 -0
  32. package/create-api-service/{sso.d.ts → sso/index.d.ts} +5 -5
  33. package/create-api-service/{sso.js → sso/index.js} +421 -444
  34. package/create-api-service/sso/index.js.gz +0 -0
  35. package/curring-http/index.js +1626 -4809
  36. package/curring-http/index.js.gz +0 -0
  37. package/curring-http/type.d.ts +89 -0
  38. package/directive/{auth.js → auth/index.js} +2 -4
  39. package/directive/auth/index.js.gz +0 -0
  40. package/dom-check-in/index.js +5 -5
  41. package/dom-watcher/index.d.ts +1 -1
  42. package/esm-map.json +8 -0
  43. package/hooks/use-get-auth/index.d.ts +3 -3
  44. package/hooks/use-get-auth/index.js +4 -8
  45. package/hooks/use-get-auth/index.js.gz +0 -0
  46. package/load-js/index.d.ts +1 -1
  47. package/load-js/index.js +1 -2
  48. package/nextTiken/index.js +5 -10
  49. package/nextTiken/index.js.gz +0 -0
  50. package/oss/index.d.ts +1 -1
  51. package/oss/index.js +1 -2
  52. package/package.json +8 -3
  53. package/pinyin-first-character/index.js +45 -50
  54. package/pinyin-first-character/index.js.gz +0 -0
  55. package/style/index.js +5 -9
  56. package/style/index.js.gz +0 -0
  57. package/style/style.d.ts +3 -3
  58. package/token-tools/index.d.ts +1 -1
  59. package/token-tools/index.js.gz +0 -0
  60. package/use-low-code/index.js +1 -2
  61. package/use-low-code/index.js.gz +0 -0
  62. package/vue/hooks/{use-model-value.d.ts → use-model-value/index.d.ts} +2 -0
  63. package/webSocket-service/index.js +41 -52
  64. package/webSocket-service/index.js.gz +0 -0
  65. package/webSocket-service/type.d.ts +28 -0
  66. package/with-install/index.d.ts +1 -1
  67. package/common-info/getInfoFromUrl.js +0 -85
  68. package/common-tools/obj-tools.js +0 -20
  69. package/common-tools/setHtmlMinWH.d.ts +0 -5
  70. package/common-tools/update-fav-icon.d.ts +0 -10
  71. package/common-tools/update-fav-icon.js +0 -22
  72. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.d.ts +0 -29
  73. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js +0 -19925
  74. package/dimple-canvas/use-dimple-canvas/core/konva/index.d.ts +0 -54
  75. package/dimple-canvas/use-dimple-canvas/core/konva/index.js +0 -119
  76. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.d.ts +0 -101
  77. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.js +0 -17
  78. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.d.ts +0 -8
  79. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.js +0 -55
  80. package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.d.ts +0 -5
  81. package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.js +0 -14
  82. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.d.ts +0 -5
  83. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.js +0 -5
  84. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.d.ts +0 -5
  85. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.js +0 -181
  86. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.d.ts +0 -4
  87. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js +0 -7402
  88. package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.d.ts +0 -6
  89. package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.js +0 -13
  90. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.d.ts +0 -4
  91. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.js +0 -7
  92. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.d.ts +0 -8
  93. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.js +0 -193
  94. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.d.ts +0 -11
  95. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.js +0 -20
  96. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.d.ts +0 -5
  97. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.js +0 -52
  98. package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.d.ts +0 -2
  99. package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.js +0 -14
  100. package/dimple-canvas/use-dimple-canvas/index.d.ts +0 -9
  101. package/dimple-canvas/use-dimple-canvas/index.js +0 -10
  102. package/hooks/use-get-auth/apis.js +0 -8
  103. package/style/math.js +0 -17
  104. package/style/style.js +0 -61
  105. /package/api-services/modules/{app-manage.d.ts → app-manage/index.d.ts} +0 -0
  106. /package/api-services/modules/{app-manage.js → app-manage/index.js} +0 -0
  107. /package/api-services/modules/{authentication.d.ts → authentication/index.d.ts} +0 -0
  108. /package/api-services/modules/{authentication.js → authentication/index.js} +0 -0
  109. /package/api-services/modules/{bems.d.ts → bems/index.d.ts} +0 -0
  110. /package/api-services/modules/{bems.js → bems/index.js} +0 -0
  111. /package/api-services/modules/{contract.d.ts → contract/index.d.ts} +0 -0
  112. /package/api-services/modules/{contract.js → contract/index.js} +0 -0
  113. /package/api-services/modules/{duty-manage.d.ts → duty-manage/index.d.ts} +0 -0
  114. /package/api-services/modules/{duty-manage.js → duty-manage/index.js} +0 -0
  115. /package/api-services/modules/{enterpriseright.d.ts → enterpriseright/index.d.ts} +0 -0
  116. /package/api-services/modules/{enterpriseright.js → enterpriseright/index.js} +0 -0
  117. /package/api-services/modules/{gateway-edge.d.ts → gateway-edge/index.d.ts} +0 -0
  118. /package/api-services/modules/{gateway-edge.js → gateway-edge/index.js} +0 -0
  119. /package/api-services/modules/{iot.d.ts → iot/index.d.ts} +0 -0
  120. /package/api-services/modules/{iot.js → iot/index.js} +0 -0
  121. /package/api-services/modules/{justauth.d.ts → justauth/index.d.ts} +0 -0
  122. /package/api-services/modules/{justauth.js → justauth/index.js} +0 -0
  123. /package/api-services/modules/{knowledge.d.ts → knowledge/index.d.ts} +0 -0
  124. /package/api-services/modules/{knowledge.js → knowledge/index.js} +0 -0
  125. /package/api-services/modules/{link.d.ts → link/index.d.ts} +0 -0
  126. /package/api-services/modules/{link.js → link/index.js} +0 -0
  127. /package/api-services/modules/{permission.d.ts → permission/index.d.ts} +0 -0
  128. /package/api-services/modules/{permission.js → permission/index.js} +0 -0
  129. /package/api-services/modules/{platformManage.d.ts → platformManage/index.d.ts} +0 -0
  130. /package/api-services/modules/{platformManage.js → platformManage/index.js} +0 -0
  131. /package/api-services/modules/{portal.d.ts → portal/index.d.ts} +0 -0
  132. /package/api-services/modules/{portal.js → portal/index.js} +0 -0
  133. /package/api-services/modules/{space-manage.d.ts → space-manage/index.d.ts} +0 -0
  134. /package/api-services/modules/{space-manage.js → space-manage/index.js} +0 -0
  135. /package/api-services/modules/{super-admin.d.ts → super-admin/index.d.ts} +0 -0
  136. /package/api-services/modules/{super-admin.js → super-admin/index.js} +0 -0
  137. /package/api-services/modules/{supplier.d.ts → supplier/index.d.ts} +0 -0
  138. /package/api-services/modules/{supplier.js → supplier/index.js} +0 -0
  139. /package/api-services/modules/{supplychain-manage.d.ts → supplychain-manage/index.d.ts} +0 -0
  140. /package/api-services/modules/{supplychain-manage.js → supplychain-manage/index.js} +0 -0
  141. /package/api-services/modules/{systemConfiguration.d.ts → systemConfiguration/index.d.ts} +0 -0
  142. /package/api-services/modules/{systemConfiguration.js → systemConfiguration/index.js} +0 -0
  143. /package/api-services/modules/{tool.d.ts → tool/index.d.ts} +0 -0
  144. /package/api-services/modules/{tool.js → tool/index.js} +0 -0
  145. /package/api-services/src/{create-service.d.ts → create-service/index.d.ts} +0 -0
  146. /package/api-services/src/{create-service.js → create-service/index.js} +0 -0
  147. /package/common-info/{getIframeUrl.d.ts → getIframeUrl/index.d.ts} +0 -0
  148. /package/common-info/{getInfoFromUrl.d.ts → getInfoFromUrl/index.d.ts} +0 -0
  149. /package/common-tools/{arr-tools.js → arr-tools/index.js} +0 -0
  150. /package/common-tools/{date-format.d.ts → date-format/index.d.ts} +0 -0
  151. /package/common-tools/{handle-data.d.ts → handle-data/index.d.ts} +0 -0
  152. /package/common-tools/{handle-data.js → handle-data/index.js} +0 -0
  153. /package/common-tools/{obj-tools.d.ts → obj-tools/index.d.ts} +0 -0
  154. /package/common-tools/{platform-tools.d.ts → platform-tools/index.d.ts} +0 -0
  155. /package/common-tools/{queue-promise.js → queue-promise/index.js} +0 -0
  156. /package/common-tools/{setHtmlMinWH.js → setHtmlMinWH/index.js} +0 -0
  157. /package/create-api-service/{proxy-sso.d.ts → proxy-sso/index.d.ts} +0 -0
  158. /package/create-api-service/{proxy-sso.js → proxy-sso/index.js} +0 -0
  159. /package/directive/{auth.d.ts → auth/index.d.ts} +0 -0
  160. /package/directive/{clickOutside.d.ts → clickOutside/index.d.ts} +0 -0
  161. /package/directive/{clickOutside.js → clickOutside/index.js} +0 -0
  162. /package/directive/{hoverInside.d.ts → hoverInside/index.d.ts} +0 -0
  163. /package/directive/{hoverInside.js → hoverInside/index.js} +0 -0
  164. /package/directive/{utils.d.ts → utils/index.d.ts} +0 -0
  165. /package/directive/{utils.js → utils/index.js} +0 -0
  166. /package/hooks/popup-manager/{use-zindex.d.ts → use-zindex/index.d.ts} +0 -0
  167. /package/hooks/popup-manager/{use-zindex.js → use-zindex/index.js} +0 -0
  168. /package/vue/hooks/{use-model-value.js → use-model-value/index.js} +0 -0
Binary file
@@ -0,0 +1,89 @@
1
+ import { AxiosInstance, AxiosRequestConfig, AxiosError } from 'axios';
2
+ import { Ref } from 'vue';
3
+
4
+
5
+ /** 请求工具配置项 */
6
+ export type CurringConfig = AxiosRequestConfig & {
7
+ /** 请求实例 */
8
+ axiosInstance?: AxiosInstance
9
+
10
+ /** 请求方法 */
11
+ method?: Method
12
+
13
+ /** 请求的body数据 */
14
+ data?: any
15
+
16
+ /** 请求的query数据 */
17
+ params?: any
18
+
19
+ /** 接口地址前缀 */
20
+ urlPrefix?: string
21
+
22
+ /** 标记为公共接口,不需要鉴权,默认为false */
23
+ public?: boolean
24
+
25
+ /** 请求成功执行的回调 */
26
+ onSuccess?: (res: any, config: CurringConfig) => Promise<any>
27
+
28
+ /** 请求失败执行的回调 */
29
+ onError?: (error: any, config: CurringConfig) => Promise<any>
30
+
31
+ /** 自定义处理请求失败执行的回调 */
32
+ onCustomError?: (error: any, config: CurringConfig) => Promise<any>
33
+
34
+ /** 不管请求成功或失败都会执行的回调 */
35
+ finally?: (config: CurringConfig) => any
36
+
37
+ /** 每次请求之前都会执行的函数 */
38
+ beforeRun?: (config: CurringConfig) => Promise<CurringConfig>
39
+
40
+ /** 自定义错误信息 */
41
+ customErrorMessage?: (
42
+ /** 原始错误信息 */
43
+ message: string,
44
+
45
+ /** 原始错误对象 */
46
+ error: any,
47
+ ) => string | null | undefined
48
+
49
+ /** 忽略错误提示 */
50
+ ignoreErrorMessage?: boolean
51
+
52
+ /** 接口401是否重定向到登录页 */
53
+ noRedireLogin?: boolean
54
+
55
+ /** 开启CSRF安全选项 */
56
+ csrf?: boolean
57
+ }
58
+
59
+ export type Method = 'get' | 'post' | 'put' | 'delete' | 'patch'
60
+
61
+ export type CurringConfigFun = (config: CurringConfig) => CurringConfig | Promise<CurringConfig>
62
+
63
+ export type CurringRes = {
64
+ /** 请求时返回的接口数据 */
65
+ data: Ref<any>
66
+
67
+ /** 请求时的错误信息 */
68
+ error: Ref<any>
69
+
70
+ /** 请求时的loading */
71
+ loading: Ref<boolean>
72
+
73
+ /** 发起请求 返回格式 [ error, data ] */
74
+ run: (payload?: any, config?: CurringConfig) => CurringRunRes
75
+
76
+ /** 取消请求控制器 */
77
+ abortController: Ref<AbortController | null>
78
+ }
79
+
80
+ /** 返回为数组 [error, data], 请求成功error为null,请求失败data为null */
81
+ export type CurringRunRes = Promise<
82
+ [
83
+ /** 请求返回的错误信息,请求成功时为null,请求失败时为错误信息 */
84
+ error: { code: string | number; msg: string; error: AxiosError } | null,
85
+
86
+ /** 请求返回的接口数据,请求成功时为后端数据,请求失败时为null */
87
+ data: any | null,
88
+ ]
89
+ >
@@ -2,8 +2,7 @@ import { getUrlParams as i, flatTree as P } from "@das-fed/utils/common-tools";
2
2
  import { getSubApps as v, getPageAuth as o } from "@das-fed/utils/common-info";
3
3
  import { getEl as h } from "@das-fed/utils/directive/utils";
4
4
  const A = (e, t) => {
5
- if (!e || !t)
6
- return !1;
5
+ if (!e || !t) return !1;
7
6
  if (typeof t == "string")
8
7
  return !!e.find((s) => s.code === t);
9
8
  {
@@ -51,8 +50,7 @@ const A = (e, t) => {
51
50
  });
52
51
  else {
53
52
  const a = m(t.oldValue), n = l;
54
- if (a === n)
55
- return;
53
+ if (a === n) return;
56
54
  h(e, r).then((c) => {
57
55
  n ? b(c, s) : g(c, s);
58
56
  });
Binary file
@@ -1,8 +1,8 @@
1
- const o = (e) => {
2
- const r = window.event;
3
- let t = Number(r.clientX), n = Number(r.clientY), i = Number(e.getBoundingClientRect().left), u = Number(i + e.clientWidth), l = Number(e.getBoundingClientRect().top), c = Number(l + e.clientHeight);
4
- return console.log(t, i, u, n, l, c), t > i && t < u && n > l && n < c;
1
+ const d = (e) => {
2
+ const t = window.event;
3
+ let i = Number(t.clientX), n = Number(t.clientY), l = Number(e.getBoundingClientRect().left), u = Number(l + e.clientWidth), r = Number(e.getBoundingClientRect().top), c = Number(r + e.clientHeight);
4
+ return i > l && i < u && n > r && n < c;
5
5
  };
6
6
  export {
7
- o as domCheckIn
7
+ d as domCheckIn
8
8
  };
@@ -21,5 +21,5 @@ interface Config {
21
21
  * @param config 配置
22
22
  * @returns
23
23
  */
24
- declare const DomWatcher: (cb: (list: MutationRecord[]) => void, dom: HTMLElement, config?: Config) => MutationObserver;
24
+ declare const DomWatcher: (cb: (list: MutationRecord[]) => void, dom: HTMLElement, config?: Config) => any;
25
25
  export { DomWatcher };
package/esm-map.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "SFCWithInstall": "/with-install/index",
3
+ "withInstall": "/with-install/index",
4
+ "vAuth": "/directive/auth/index",
5
+ "vHoverInside": "/directive/hoverInside/index",
6
+ "vClickOutside": "/directive/clickOutside/index",
7
+ "getEl": "/directive/utils/index"
8
+ }
@@ -1,9 +1,9 @@
1
1
  export declare const useGetAuth: () => {
2
- getApplication: (code?: string, appName?: 'superadmin' | 'enterpriseadmin') => Promise<any>;
3
- getMenu: (code: string, menuCode?: string, path?: string, appName?: 'superadmin' | 'enterpriseadmin') => Promise<any>;
2
+ getApplication: (code?: string, appName?: "superadmin" | "enterpriseadmin") => unknown;
3
+ getMenu: (code: string, menuCode?: string, path?: string, appName?: "superadmin" | "enterpriseadmin") => unknown;
4
4
  getAuth: (options: {
5
5
  applicationCode: string;
6
6
  menuCode: string;
7
7
  code: string;
8
- }, appName?: 'superadmin' | 'enterpriseadmin') => Promise<any>;
8
+ }, appName?: "superadmin" | "enterpriseadmin") => unknown;
9
9
  };
@@ -7,8 +7,7 @@ const v = T.get("/appcategory"), B = y.get("/appcategory"), C = U.get("/permissi
7
7
  let t = null, s = {};
8
8
  await A(), i === "superadmin" ? t = B().run : (s = { userType: 1 }, t = v().run);
9
9
  const [a, l] = await t(s);
10
- if (a || !l || !l.length)
11
- return null;
10
+ if (a || !l || !l.length) return null;
12
11
  const f = l.map((o) => o.apps).flat();
13
12
  return r ? f.find((o) => o.code === r) : f;
14
13
  }, g = async (r, i, t, s = "enterpriseadmin") => {
@@ -22,8 +21,7 @@ const v = T.get("/appcategory"), B = y.get("/appcategory"), C = U.get("/permissi
22
21
  const [f, e] = await a(l);
23
22
  if (f || !e || !e.length)
24
23
  return i || t ? void 0 : [];
25
- if (!i && !t)
26
- return e;
24
+ if (!i && !t) return e;
27
25
  const o = e != null && e.length ? e.filter((n) => n.routeUrl) : [], m = e != null && e.length ? e.filter((n) => !n.routeUrl && n.children).map((n) => n.children).flat() : [], p = [...o, ...m];
28
26
  let u;
29
27
  if (i)
@@ -40,10 +38,8 @@ const v = T.get("/appcategory"), B = y.get("/appcategory"), C = U.get("/permissi
40
38
  getAuth: async (r, i = "enterpriseadmin") => {
41
39
  var p;
42
40
  const t = (r == null ? void 0 : r.applicationCode) ?? "", s = (r == null ? void 0 : r.menuCode) ?? "", a = (r == null ? void 0 : r.code) ?? "";
43
- if (JSON.parse(sessionStorage.getItem("permission-btn") || "{}")[s])
44
- return M(null, { applicationCode: t, menuCode: s, code: a });
45
- if (!await d(t, i))
46
- return !1;
41
+ if (JSON.parse(sessionStorage.getItem("permission-btn") || "{}")[s]) return M(null, { applicationCode: t, menuCode: s, code: a });
42
+ if (!await d(t, i)) return !1;
47
43
  const e = await g(t, s, i);
48
44
  return !e || !(e != null && e.children) || !((p = e.children) != null && p.length) ? !1 : !!w(e.children).find((u) => {
49
45
  let c = (u == null ? void 0 : u.originalCode) ?? u.code;
Binary file
@@ -1,3 +1,3 @@
1
1
  /** 使用promise加载js的工具 */
2
- declare const loadJs: (src: string) => Promise<unknown>;
2
+ declare const loadJs: (src: string) => any;
3
3
  export { loadJs };
package/load-js/index.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { getConfig as r } from "@das-fed/utils/config";
2
2
  const c = (t) => {
3
3
  let { baseURL: i, publicPath: n = "" } = r();
4
- if (document.getElementById(t))
5
- return;
4
+ if (document.getElementById(t)) return;
6
5
  const e = document.createElement("script");
7
6
  return t.startsWith("/") && (t = `${i}/${n}/${t}`), t = t.replace(/\/\//g, "/").replace(/\/\//g, "/").replace("http:/", "http://").replace("https:/", "https://"), e.src = t, e.id = t, document.body.appendChild(e), new Promise((o, p) => {
8
7
  e.onload = o, e.onerror = p;
@@ -2,32 +2,28 @@ import { getToken as r, getProjectInfo as c, getPersonalInfo as s, getTenantInfo
2
2
  const k = () => new Promise((n) => {
3
3
  const e = () => {
4
4
  const t = r();
5
- if (t)
6
- return n(t);
5
+ if (t) return n(t);
7
6
  setTimeout(() => e(), 50);
8
7
  };
9
8
  e();
10
9
  }), m = () => new Promise((n) => {
11
10
  const e = () => {
12
11
  const t = c().id ? c().id : "";
13
- if (t)
14
- return n(t);
12
+ if (t) return n(t);
15
13
  setTimeout(() => e(), 50);
16
14
  };
17
15
  e();
18
16
  }), T = () => new Promise((n) => {
19
17
  const e = () => {
20
18
  const t = r(), o = c().id ? c().id : "";
21
- if (t && o)
22
- return n(!0);
19
+ if (t && o) return n(!0);
23
20
  setTimeout(() => e(), 50);
24
21
  };
25
22
  e();
26
23
  }), f = () => new Promise((n) => {
27
24
  const e = () => {
28
25
  const t = s();
29
- if (t != null && t.id)
30
- return n(t);
26
+ if (t != null && t.id) return n(t);
31
27
  setTimeout(() => e(), 50);
32
28
  };
33
29
  e();
@@ -35,8 +31,7 @@ const k = () => new Promise((n) => {
35
31
  const e = () => {
36
32
  var o;
37
33
  const t = i();
38
- if ((o = t == null ? void 0 : t.tenant) != null && o.id)
39
- return n(t);
34
+ if ((o = t == null ? void 0 : t.tenant) != null && o.id) return n(t);
40
35
  setTimeout(() => e(), 50);
41
36
  };
42
37
  e();
Binary file
package/oss/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const oss: (urlName: any) => string;
1
+ declare const oss: (urlName: any) => any;
2
2
  export { oss };
package/oss/index.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { getConfig as o } from "@das-fed/utils/config";
2
2
  const n = (r) => {
3
3
  let t = r;
4
- if (!t)
5
- return t;
4
+ if (!t) return t;
6
5
  t.startsWith("/") || (t = `/${t}`), new URL(t, import.meta.url);
7
6
  let { baseURL: e } = o();
8
7
  return `${e}/oss/resource/front-end/auto-upload/pc${t}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "6.3.0-beta.1",
3
+ "version": "6.3.0-beta.10",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -9,31 +9,36 @@
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
11
  "@antv/x6": "^2.18.1",
12
+ "@das-fed/utils": "6.3.0-beta.10",
12
13
  "@vue/shared": "^3.4.21",
13
14
  "@vueuse/core": "^9.6.0",
14
15
  "axios": "^1.6.7",
15
16
  "dayjs": "^1.11.10",
16
17
  "konva": "^9.3.6",
18
+ "lodash-es": "^4.17.21",
17
19
  "nanoid": "3.2.0",
18
20
  "pinyin-pro": "^3.19.6",
19
21
  "vue": "^3.4.21"
20
22
  },
21
23
  "devDependencies": {
24
+ "@das-fed/cli": "6.3.0-beta.10",
25
+ "@types/lodash-es": "^4.17.12",
22
26
  "@vitejs/plugin-vue": "^5.0.4",
23
27
  "@vitejs/plugin-vue-jsx": "^3.1.0",
24
28
  "ant-design-vue": "3.2.20",
25
29
  "consola": "^3.2.3",
26
30
  "element-plus": "2.4.2",
31
+ "execa": "^9.3.0",
27
32
  "fast-glob": "^3.3.2",
28
33
  "fs-extra": "^11.2.0",
29
34
  "js-cookie": "^3.0.5",
30
- "lodash": "^4.17.21",
35
+ "minimist": "^1.2.8",
31
36
  "qs": "^6.11.2",
32
37
  "vite": "^5.1.6",
33
38
  "vite-plugin-dts": "^3.7.3"
34
39
  },
35
40
  "peerDependencies": {
36
- "@das-fed/utils": ">=1.0.0"
41
+ "vue": ">=3.4.21"
37
42
  },
38
43
  "publishConfig": {
39
44
  "access": "public",
@@ -1,4 +1,4 @@
1
- const W = /^[\uD800-\uDBFF]$/, B = /^[\uDC00-\uDFFF]$/, H = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
1
+ const A = /^[\uD800-\uDBFF]$/, B = /^[\uDC00-\uDFFF]$/, H = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
2
2
  var a;
3
3
  (function(n) {
4
4
  n[n.Unknown = 1e-13] = "Unknown", n[n.Rule = 1e-12] = "Rule", n[n.DICT = 2e-8] = "DICT", n[n.Surname = 1] = "Surname", n[n.Custom = 1] = "Custom";
@@ -9,14 +9,15 @@ const j = {
9
9
  Custom: 100
10
10
  };
11
11
  function d(n) {
12
- return n.replace(H, "_").length;
12
+ var i;
13
+ return n.length - (((i = n.match(H)) === null || i === void 0 ? void 0 : i.length) || 0);
13
14
  }
14
15
  function w(n) {
15
16
  const i = [];
16
17
  let g = 0;
17
18
  for (; g < n.length; ) {
18
- const h = n.charAt(g);
19
- W.test(h) && B.test(n.charAt(g + 1)) ? (i.push(n.substring(g, g + 2)), g += 2) : (i.push(h), g += 1);
19
+ const h = n[g];
20
+ A.test(h) && B.test(n[g + 1]) ? (i.push(n.substring(g, g + 2)), g += 2) : (i.push(h), g += 1);
20
21
  }
21
22
  return i;
22
23
  }
@@ -4433,7 +4434,7 @@ const k = {
4433
4434
  ],
4434
4435
  "xián xuán": ["伭"],
4435
4436
  "nú nǔ": ["伮"],
4436
- "bǎi": ["伯"],
4437
+ "bǎi": ["伯"],
4437
4438
  "gū gù": ["估"],
4438
4439
  nǐ: ["伱", "你", "儞", "孴", "拟", "擬", "旎", "晲", "狔", "苨", "薿", "隬"],
4439
4440
  "nì ní": ["伲"],
@@ -18868,7 +18869,7 @@ function hn(n, i, g) {
18868
18869
  if (gn.indexOf(n) === -1)
18869
18870
  return r(n);
18870
18871
  if (i === g && i && r(i) !== i)
18871
- return m(r(n));
18872
+ return q(r(n));
18872
18873
  if (g && !nn[n].includes(g)) {
18873
18874
  const h = r(g);
18874
18875
  if (h !== g) {
@@ -19009,7 +19010,7 @@ const p = {
19009
19010
  花: "huā",
19010
19011
  方: "fāng",
19011
19012
  俞: "yú",
19012
- 任: "rèn",
19013
+ 任: "rén",
19013
19014
  袁: "yuán",
19014
19015
  柳: "liǔ",
19015
19016
  酆: "fēng",
@@ -19381,8 +19382,8 @@ const p = {
19381
19382
  撒: "sǎ",
19382
19383
  甯: "nìng",
19383
19384
  六: "lù",
19384
- 啜: "chuài"
19385
- // https://baike.baidu.com/item/%E5%95%9C%E5%A7%93/9563772
19385
+ 啜: "chuài",
19386
+ 行: "xíng"
19386
19387
  }, zn = Object.keys(p).map((n) => ({
19387
19388
  zh: n,
19388
19389
  pinyin: p[n],
@@ -19652,6 +19653,7 @@ const p = {
19652
19653
  委屈: "wěi qu",
19653
19654
  为期: "wéi qī",
19654
19655
  伯伯: "bó bo",
19656
+ 伯子: "bǎi zi",
19655
19657
  圈子: "quān zi",
19656
19658
  见识: "jiàn shi",
19657
19659
  笼罩: "lǒng zhào",
@@ -21467,10 +21469,7 @@ const p = {
21467
21469
  逐一: "zhú yī",
21468
21470
  周一: "zhōu yī",
21469
21471
  初一: "chū yī",
21470
- 高一: "gāo yī",
21471
- 大一: "dà yī",
21472
21472
  研一: "yán yī",
21473
- 守一: "shǒu yī",
21474
21473
  归一: "guī yī",
21475
21474
  假一: "jiǎ yī",
21476
21475
  闻一: "wén yī",
@@ -21504,11 +21503,8 @@ const p = {
21504
21503
  一八: "yī bā",
21505
21504
  一九: "yī jiǔ",
21506
21505
  一又: "yī yòu",
21507
- // TODO: 添加更多为(二声)的词
21508
- 一更: "yī gēng",
21509
21506
  一饼: "yī bǐng",
21510
21507
  一楼: "yī lóu",
21511
- 一期: "yī qī",
21512
21508
  为例: "wéi lì",
21513
21509
  为准: "wéi zhǔn",
21514
21510
  沧海: "cāng hǎi",
@@ -21535,8 +21531,6 @@ const p = {
21535
21531
  空难: "kōng nàn",
21536
21532
  喜欢: "xǐ huan",
21537
21533
  朝朝: "zhāo zhāo",
21538
- 行行: "háng háng",
21539
- 哪行: "nǎ háng",
21540
21534
  不行: "bù xíng",
21541
21535
  轧轧: "yà yà",
21542
21536
  弯曲: "wān qū",
@@ -21552,7 +21546,8 @@ const p = {
21552
21546
  九曲: "jiǔ qū",
21553
21547
  曲折: "qū zhé",
21554
21548
  曲肱: "qū gōng",
21555
- 曲意: "qū yì"
21549
+ 曲意: "qū yì",
21550
+ 仡佬: "gē lǎo"
21556
21551
  }, on = Object.keys(C).map((n) => ({
21557
21552
  zh: n,
21558
21553
  pinyin: C[n],
@@ -21583,7 +21578,6 @@ const p = {
21583
21578
  运输量: "yùn shū liàng",
21584
21579
  发脾气: "fā pí qi",
21585
21580
  士大夫: "shì dà fū",
21586
- 仡佬族: "gē lǎo zú",
21587
21581
  鸭绿江: "yā lù jiāng",
21588
21582
  压根儿: "yà gēn er",
21589
21583
  对得起: "duì de qǐ",
@@ -21617,6 +21611,7 @@ const p = {
21617
21611
  充其量: "chōng qí liàng",
21618
21612
  靠得住: "kào de zhù",
21619
21613
  车行道: "chē xíng dào",
21614
+ 人行道: "rén xíng dào",
21620
21615
  中郎将: "zhōng láng jiàng",
21621
21616
  照明弹: "zhào míng dàn",
21622
21617
  烟幕弹: "yān mù dàn",
@@ -23013,7 +23008,6 @@ const p = {
23013
23008
  将取固予: "jiāng qǔ gù yǔ",
23014
23009
  将门有将: "jiàng mén yǒu jiàng",
23015
23010
  将夺固与: "jiāng duó gù yǔ",
23016
- 将伯之助: "qiāng bó zhī zhù",
23017
23011
  槛花笼鹤: "jiàn huā lóng hè",
23018
23012
  鉴影度形: "jiàn yǐng duó xíng",
23019
23013
  渐不可长: "jiàn bù kě zhǎng",
@@ -23486,9 +23480,10 @@ const p = {
23486
23480
  一路公交: "yī lù gōng jiāo",
23487
23481
  一路汽车: "yī lù qì chē",
23488
23482
  一路巴士: "yī lù bā shì",
23489
- 不行一行: "bù xíng yì háng",
23490
23483
  朝朝朝落: "zhāo cháo zhāo luò",
23491
- 曲意逢迎: "qū yì féng yíng"
23484
+ 曲意逢迎: "qū yì féng yíng",
23485
+ 一行不行: "yì háng bù xíng",
23486
+ 行行不行: "háng háng bù xíng"
23492
23487
  }, ln = Object.keys(Z).map((n) => ({
23493
23488
  zh: n,
23494
23489
  pinyin: Z[n],
@@ -23523,7 +23518,7 @@ const p = {
23523
23518
  function N(n, i) {
23524
23519
  return n && (n.decimal < i.decimal || n.decimal === i.decimal && n.probability > i.probability) ? n : i;
23525
23520
  }
23526
- function F(n) {
23521
+ function v(n) {
23527
23522
  n.probability < 1e-300 && (n.probability *= 1e300, n.decimal += 1);
23528
23523
  }
23529
23524
  function tn(n) {
@@ -23541,18 +23536,18 @@ function jn(n, i) {
23541
23536
  patterns: z.patterns,
23542
23537
  concatPattern: u
23543
23538
  };
23544
- F(y), g[l] = N(g[l], y), u = n[--h];
23539
+ v(y), g[l] = N(g[l], y), u = n[--h];
23545
23540
  }
23546
23541
  const o = {
23547
23542
  probability: 1e-13 * z.probability,
23548
23543
  decimal: 0,
23549
23544
  patterns: z.patterns
23550
23545
  };
23551
- F(o), g[s] = N(g[s], o), g[s].concatPattern && (g[s].patterns = g[s].patterns.concat(g[s].concatPattern), g[s].concatPattern = void 0, delete g[s + 1]);
23546
+ v(o), g[s] = N(g[s], o), g[s].concatPattern && (g[s].patterns = g[s].patterns.concat(g[s].concatPattern), g[s].concatPattern = void 0, delete g[s + 1]);
23552
23547
  }
23553
23548
  return g[0].patterns.reverse();
23554
23549
  }
23555
- function O(n, i) {
23550
+ function F(n, i) {
23556
23551
  return n && n.count <= i.count ? n : i;
23557
23552
  }
23558
23553
  function dn(n) {
@@ -23569,13 +23564,13 @@ function xn(n, i) {
23569
23564
  patterns: z.patterns,
23570
23565
  concatPattern: u
23571
23566
  };
23572
- g[l] = O(g[l], y), u = n[--h];
23567
+ g[l] = F(g[l], y), u = n[--h];
23573
23568
  }
23574
23569
  const o = {
23575
23570
  count: 1 + z.count,
23576
23571
  patterns: z.patterns
23577
23572
  };
23578
- g[s] = O(g[s], o), g[s].concatPattern && (g[s].patterns = g[s].patterns.concat(g[s].concatPattern), g[s].concatPattern = void 0, delete g[s + 1]);
23573
+ g[s] = F(g[s], o), g[s].concatPattern && (g[s].patterns = g[s].patterns.concat(g[s].concatPattern), g[s].concatPattern = void 0, delete g[s + 1]);
23579
23574
  }
23580
23575
  return g[0].patterns.reverse();
23581
23576
  }
@@ -23593,18 +23588,18 @@ function rn(n) {
23593
23588
  }
23594
23589
  return i.reverse();
23595
23590
  }
23596
- var _;
23591
+ var O;
23597
23592
  (function(n) {
23598
23593
  n[n.ReverseMaxMatch = 1] = "ReverseMaxMatch", n[n.MaxProbability = 2] = "MaxProbability", n[n.MinTokenization = 3] = "MinTokenization";
23599
- })(_ || (_ = {}));
23600
- class v {
23594
+ })(O || (O = {}));
23595
+ class _ {
23601
23596
  constructor(i, g = "", h = "") {
23602
23597
  this.children = /* @__PURE__ */ new Map(), this.fail = null, this.patterns = [], this.parent = i, this.prefix = g, this.key = h;
23603
23598
  }
23604
23599
  }
23605
23600
  class en {
23606
23601
  constructor() {
23607
- this.dictMap = /* @__PURE__ */ new Map(), this.queues = [], this.root = new v(null);
23602
+ this.dictMap = /* @__PURE__ */ new Map(), this.queues = [], this.root = new _(null);
23608
23603
  }
23609
23604
  build(i) {
23610
23605
  this.buildTrie(i), this.buildFailPointer();
@@ -23617,7 +23612,7 @@ class en {
23617
23612
  for (let s = 0; s < h.length; s++) {
23618
23613
  let z = h[s];
23619
23614
  if (!u.children.has(z)) {
23620
- const o = new v(u, h.slice(0, s).join(""), z);
23615
+ const o = new _(u, h.slice(0, s).join(""), z);
23621
23616
  u.children.set(z, o), this.addNodeToQueues(o);
23622
23617
  }
23623
23618
  u = u.children.get(z);
@@ -23701,7 +23696,7 @@ const wn = [
23701
23696
  ...zn
23702
23697
  ], R = new en();
23703
23698
  R.build(wn);
23704
- const qn = new $(), mn = () => qn, r = (n) => {
23699
+ const mn = new $(), qn = () => mn, r = (n) => {
23705
23700
  const i = x.get(n);
23706
23701
  return i ? i.split(" ")[0] : n;
23707
23702
  }, fn = (n, i, g, h) => {
@@ -23746,8 +23741,8 @@ const qn = new $(), mn = () => qn, r = (n) => {
23746
23741
  }
23747
23742
  }
23748
23743
  return i;
23749
- }, m = (n) => n.replace(/(ā|á|ǎ|à)/g, "a").replace(/(ō|ó|ǒ|ò)/g, "o").replace(/(ē|é|ě|è)/g, "e").replace(/(ī|í|ǐ|ì)/g, "i").replace(/(ū|ú|ǔ|ù)/g, "u").replace(/(ǖ|ǘ|ǚ|ǜ)/g, "ü").replace(/(n̄|ń|ň|ǹ)/g, "n").replace(/(m̄|ḿ|m̌|m̀)/g, "m").replace(/(ê̄|ế|ê̌|ề)/g, "ê"), A = (n, i = "off") => {
23750
- const g = mn();
23744
+ }, q = (n) => n.replace(/(ā|á|ǎ|à)/g, "a").replace(/(ō|ó|ǒ|ò)/g, "o").replace(/(ē|é|ě|è)/g, "e").replace(/(ī|í|ǐ|ì)/g, "i").replace(/(ū|ú|ǔ|ù)/g, "u").replace(/(ǖ|ǘ|ǚ|ǜ)/g, "ü").replace(/(n̄|ń|ň|ǹ)/g, "n").replace(/(m̄|ḿ|m̌|m̀)/g, "m").replace(/(ê̄|ế|ê̌|ề)/g, "ê"), U = (n, i = "off") => {
23745
+ const g = qn();
23751
23746
  let h = x.get(n) ? x.get(n).split(" ") : [];
23752
23747
  if (g.get(n))
23753
23748
  h = g.get(n).split(" ");
@@ -23757,7 +23752,7 @@ const qn = new $(), mn = () => qn, r = (n) => {
23757
23752
  }
23758
23753
  return h;
23759
23754
  }, pn = (n, i = "off") => {
23760
- let g = A(n, i);
23755
+ let g = U(n, i);
23761
23756
  return g.length > 0 ? g.map((h) => ({
23762
23757
  origin: n,
23763
23758
  result: h,
@@ -23771,7 +23766,7 @@ const qn = new $(), mn = () => qn, r = (n) => {
23771
23766
  originPinyin: n
23772
23767
  }
23773
23768
  ];
23774
- }, q = (n) => {
23769
+ }, m = (n) => {
23775
23770
  const i = n.split(" "), g = [], h = [];
23776
23771
  for (let u of i)
23777
23772
  for (let s of Q)
@@ -23786,25 +23781,25 @@ const qn = new $(), mn = () => qn, r = (n) => {
23786
23781
  // 声母
23787
23782
  };
23788
23783
  }, e = (n) => {
23789
- const { final: i } = q(n);
23784
+ const { final: i } = m(n);
23790
23785
  let g = "", h = "", u = "";
23791
- return K.indexOf(m(i)) !== -1 ? (g = i[0], h = i[1], u = i.slice(2)) : (h = i[0] || "", u = i.slice(1) || ""), { head: g, body: h, tail: u };
23786
+ return K.indexOf(q(i)) !== -1 ? (g = i[0], h = i[1], u = i.slice(2)) : (h = i[0] || "", u = i.slice(1) || ""), { head: g, body: h, tail: u };
23792
23787
  }, f = (n) => {
23793
23788
  const i = /(ā|ō|ē|ī|ū|ǖ|n̄|m̄|ê̄)/, g = /(á|ó|é|í|ú|ǘ|ń|ḿ|ế)/, h = /(ǎ|ǒ|ě|ǐ|ǔ|ǚ|ň|m̌|ê̌)/, u = /(à|ò|è|ì|ù|ǜ|ǹ|m̀|ề)/, s = /(a|o|e|i|u|ü|ê)/, z = /(n|m)$/, o = [];
23794
23789
  return n.split(" ").forEach((y) => {
23795
23790
  i.test(y) ? o.push("1") : g.test(y) ? o.push("2") : h.test(y) ? o.push("3") : u.test(y) ? o.push("4") : s.test(y) || z.test(y) ? o.push("0") : o.push("");
23796
23791
  }), o.join(" ");
23797
23792
  }, an = (n, i) => {
23798
- const g = m(n).split(" "), h = f(i).split(" "), u = [];
23793
+ const g = q(n).split(" "), h = f(i).split(" "), u = [];
23799
23794
  return g.forEach((s, z) => {
23800
23795
  u.push(`${s}${h[z]}`);
23801
23796
  }), u.join(" ");
23802
- }, U = (n) => {
23797
+ }, W = (n) => {
23803
23798
  const i = [];
23804
23799
  return n.split(" ").forEach((h) => {
23805
23800
  i.push(h[0]);
23806
23801
  }), i.join(" ");
23807
- }, kn = (n) => typeof n != "string" ? (console.error("The first param of pinyin is error: " + n + ' is not assignable to type "string".'), !1) : !0, Pn = (n, i) => {
23802
+ }, kn = (n) => typeof n == "string", Pn = (n, i) => {
23808
23803
  let g = i.nonZh;
23809
23804
  if (g === "removed")
23810
23805
  return n.filter((h) => h.isZh);
@@ -23827,17 +23822,17 @@ const qn = new $(), mn = () => qn, r = (n) => {
23827
23822
  break;
23828
23823
  case "initial":
23829
23824
  n.forEach((g) => {
23830
- g.result = g.isZh ? q(g.result).initial : "";
23825
+ g.result = g.isZh ? m(g.result).initial : "";
23831
23826
  });
23832
23827
  break;
23833
23828
  case "final":
23834
23829
  n.forEach((g) => {
23835
- g.result = g.isZh ? q(g.result).final : "";
23830
+ g.result = g.isZh ? m(g.result).final : "";
23836
23831
  });
23837
23832
  break;
23838
23833
  case "first":
23839
23834
  n.forEach((g) => {
23840
- g.result = U(g.result);
23835
+ g.result = W(g.result);
23841
23836
  });
23842
23837
  break;
23843
23838
  case "finalHead":
@@ -23862,7 +23857,7 @@ const qn = new $(), mn = () => qn, r = (n) => {
23862
23857
  break;
23863
23858
  case "none":
23864
23859
  n.forEach((g) => {
23865
- g.isZh && (g.result = m(g.result));
23860
+ g.isZh && (g.result = q(g.result));
23866
23861
  });
23867
23862
  break;
23868
23863
  case "num": {
@@ -23885,14 +23880,14 @@ const qn = new $(), mn = () => qn, r = (n) => {
23885
23880
  });
23886
23881
  }
23887
23882
  return i.type === "array" ? n.map((h) => h.result) : i.type === "all" ? n.map((h) => {
23888
- const u = h.isZh ? h.result : "", { initial: s, final: z } = q(u), { head: o, body: l, tail: y } = e(u);
23883
+ const u = h.isZh ? h.result : "", { initial: s, final: z } = m(u), { head: o, body: l, tail: y } = e(u);
23889
23884
  let c = [];
23890
- return u !== "" && (c = [u].concat(A(h.origin, i.surname).filter((t) => t !== u))), {
23885
+ return u !== "" && (c = [u].concat(U(h.origin, i.surname).filter((t) => t !== u))), {
23891
23886
  origin: h.origin,
23892
23887
  pinyin: u,
23893
23888
  initial: s,
23894
23889
  final: z,
23895
- first: h.isZh ? U(h.result) : "",
23890
+ first: h.isZh ? W(h.result) : "",
23896
23891
  finalHead: o,
23897
23892
  finalBody: l,
23898
23893
  finalTail: y,