@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
package/style/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.4.27
2
+ * @vue/shared v3.4.31
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -9,24 +9,20 @@ const u = (t) => {
9
9
  const e = /* @__PURE__ */ Object.create(null);
10
10
  return (r) => e[r] || (e[r] = t(r));
11
11
  }, m = /-(\w)/g, p = u((t) => t.replace(m, (e, r) => r ? r.toUpperCase() : "")), a = (t = "") => t.split(" ").filter((e) => !!e.trim()), h = (t, e) => {
12
- if (!t || !e)
13
- return !1;
14
- if (e.includes(" "))
15
- throw new Error("className should not contain space.");
12
+ if (!t || !e) return !1;
13
+ if (e.includes(" ")) throw new Error("className should not contain space.");
16
14
  return t.classList.contains(e);
17
15
  }, y = (t, e) => {
18
16
  !t || !e.trim() || t.classList.add(...a(e));
19
17
  }, g = (t, e) => {
20
18
  !t || !e.trim() || t.classList.remove(...a(e));
21
19
  }, N = (t, e) => {
22
- if (!t || !e)
23
- return "";
20
+ if (!t || !e) return "";
24
21
  let r = p(e);
25
22
  r === "float" && (r = "cssFloat");
26
23
  try {
27
24
  const n = t.style[r];
28
- if (n)
29
- return n;
25
+ if (n) return n;
30
26
  const s = window == null ? void 0 : window.getComputedStyle(t, "");
31
27
  return s ? s[r] : "";
32
28
  } catch {
Binary file
package/style/style.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties } from 'vue';
2
2
 
3
- export declare const classNameToArray: (cls?: string) => string[];
3
+ export declare const classNameToArray: (cls?: string) => any;
4
4
  export declare const hasClass: (el: Element, cls: string) => boolean;
5
5
  export declare const addClass: (el: Element, cls: string) => void;
6
6
  export declare const removeClass: (el: Element, cls: string) => void;
@@ -15,13 +15,13 @@ export declare const getStyle: (element: HTMLElement, styleName: keyof CSSProper
15
15
  * 根据style对象获取style文本进行设置
16
16
  * @param {CSSStyleDeclaration} styleObj -样式对象
17
17
  */
18
- export declare const getCSS: (styleObj?: {}) => string;
18
+ export declare const getCSS: (styleObj?: {}) => any;
19
19
  /**
20
20
  * 创建样式表
21
21
  * @param {string} id 样式表id
22
22
  * @param {[{className:string, style: CSSStyleDeclaration}]} data 样式对象
23
23
  */
24
- declare const createStyle: (id: string, data: any) => Promise<unknown>;
24
+ declare const createStyle: (id: string, data: any) => any;
25
25
  /**
26
26
  * 修改指定样式表
27
27
  * @param id 样式表id
@@ -6,7 +6,7 @@ export declare const getAccessToken: () => string;
6
6
  /**
7
7
  * 获取tokenInfo相关信息
8
8
  */
9
- export declare const getAccessTokenInfo: (key: 'accessTokenExpiredAt' | 'refreshToken' | 'redirectUri') => any;
9
+ export declare const getAccessTokenInfo: (key: "accessTokenExpiredAt" | "refreshToken" | "redirectUri") => any;
10
10
  /**
11
11
  * 存入token、tokenInfo
12
12
  * @param token
Binary file
@@ -9,8 +9,7 @@ const x = ["src"], b = /* @__PURE__ */ v({
9
9
  emits: ["emit-change", "update:iframeLoading"],
10
10
  setup(n, { expose: c, emit: s }) {
11
11
  const a = n, r = u(() => {
12
- if (!a.app)
13
- return;
12
+ if (!a.app) return;
14
13
  let e = "";
15
14
  const o = "";
16
15
  let t = a.query || {};
Binary file
@@ -1,3 +1,5 @@
1
+ import { Ref } from 'vue';
2
+
1
3
  /** 简化组件内使用modelValue时的watch过程 */
2
4
  declare const useModelValue: (props: any, propKey: string) => Ref;
3
5
  export { useModelValue };
@@ -1,66 +1,60 @@
1
1
  import { getConfig as m } from "@das-fed/utils/config";
2
2
  import { getToken as f } from "@das-fed/utils/common-info";
3
- import { objectToUrlparams as w } from "@das-fed/utils/common-tools";
3
+ import { objectToUrlparams as d } from "@das-fed/utils/common-tools";
4
4
  const c = m(), h = () => {
5
5
  let s = "";
6
6
  return c.baseURL ? s = c.baseURL : s = location.origin, s.replace("https://", "wss://").replace("http://", "ws://") || "";
7
- }, b = (s, e = {}) => {
8
- const t = w(e);
9
- return t ? h() + s + `?${t}` : h() + s;
10
- }, g = (s, e) => Math.floor(Math.random() * (e - s + 1)) + s;
7
+ }, w = (s, t = {}) => {
8
+ const e = d(t);
9
+ return e ? h() + s + `?${e}` : h() + s;
10
+ }, p = (s, t) => Math.floor(Math.random() * (t - s + 1)) + s;
11
11
  class R {
12
12
  constructor({
13
- url: e,
14
- params: t = {},
15
- opened: n,
16
- close: r,
17
- error: o,
18
- message: i,
19
- ifReconnect: l,
20
- reconnectNum: a,
13
+ url: t,
14
+ params: e = {},
15
+ opened: r,
16
+ close: n,
17
+ error: i,
18
+ message: o,
19
+ ifReconnect: a,
20
+ reconnectNum: l,
21
21
  reconnectWhenClose: u
22
22
  }) {
23
- if (this.$ws = null, this.url = "", this.params = {}, this.lockReturn = !1, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = !0, this.reconnectId = null, this.reconnectNum = 3, this.reconnectWhenClose = !1, this.currentReconnectNum = 0, this.$ws = null, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = l ?? !0, this.reconnectNum = a ?? 3, this.reconnectWhenClose = u ?? !1, this.lockReturn = !1, this.currentReconnectNum = 0, this.reconnectId = null, this.params = { ...t, access_token: f() }, e)
24
- this.url = e;
23
+ if (this.$ws = null, this.url = "", this.params = {}, this.lockReturn = !1, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = !0, this.reconnectId = null, this.reconnectNum = 3, this.reconnectWhenClose = !1, this.currentReconnectNum = 0, this.$ws = null, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = a ?? !0, this.reconnectNum = l ?? 3, this.reconnectWhenClose = u ?? !1, this.lockReturn = !1, this.currentReconnectNum = 0, this.reconnectId = null, this.params = { ...e, access_token: f() }, t)
24
+ this.url = t;
25
25
  else
26
26
  throw new Error("url is required");
27
- n && (this.opened = n), r && (this.close = r), o && (this.error = o), i && (this.afterMsg = i), this.initWebSocket();
27
+ r && (this.opened = r), n && (this.close = n), i && (this.error = i), o && (this.afterMsg = o), this.initWebSocket();
28
28
  }
29
29
  initWebSocket() {
30
- if (typeof WebSocket > "u")
31
- throw new Error("您的浏览器不支持websocket");
32
- const e = b(this.url, this.params);
33
- this.$ws = new WebSocket(e), this.$ws.onopen = () => {
30
+ if (typeof WebSocket > "u") throw new Error("您的浏览器不支持websocket");
31
+ const t = w(this.url, this.params);
32
+ this.$ws = new WebSocket(t), this.$ws.onopen = () => {
34
33
  this.open();
35
- }, this.$ws.onclose = (t) => {
36
- this.close(t);
37
- }, this.$ws.onmessage = (t) => {
38
- this.message(t);
39
- }, this.$ws.onerror = (t) => {
40
- this.error(t);
34
+ }, this.$ws.onclose = (e) => {
35
+ this.close(e);
36
+ }, this.$ws.onmessage = (e) => {
37
+ this.message(e);
38
+ }, this.$ws.onerror = (e) => {
39
+ this.error(e);
41
40
  };
42
41
  }
43
42
  open() {
44
- this.currentReconnectNum = 0, this.startTime = (/* @__PURE__ */ new Date()).getTime(), this.opened(this.$ws), this.startHeartbeat(), console.log(this.url + " =>websocket连接成功,可以开始通讯");
43
+ this.currentReconnectNum = 0, this.startTime = (/* @__PURE__ */ new Date()).getTime(), this.opened(this.$ws), this.startHeartbeat();
45
44
  }
46
- opened(e) {
47
- console.log(this.url + " =>websocket连接已打开:", e);
45
+ opened(t) {
48
46
  }
49
- close(e) {
50
- if (this.$ws.readyState === WebSocket.CLOSED) {
51
- const t = (/* @__PURE__ */ new Date()).getTime();
52
- this.reconnectWhenClose && this.reconnect(), clearInterval(this.heartbeatInterval), console.log(`${this.url}=>WebSocket连接已经关闭,连接总时长: ${t - this.startTime}ms`);
53
- }
47
+ close(t) {
48
+ this.$ws.readyState === WebSocket.CLOSED && ((/* @__PURE__ */ new Date()).getTime(), this.reconnectWhenClose && this.reconnect(), clearInterval(this.heartbeatInterval));
54
49
  }
55
- message(e) {
56
- const t = typeof e.data == "object" ? e.data : JSON.parse(e.data);
57
- this.afterMsg(t);
50
+ message(t) {
51
+ const e = typeof t.data == "object" ? t.data : JSON.parse(t.data);
52
+ this.afterMsg(e);
58
53
  }
59
- afterMsg(e) {
60
- console.log(this.url + " =>接收到websocket的消息:", e);
54
+ afterMsg(t) {
61
55
  }
62
- error(e) {
63
- return this.ifReconnect && this.reconnect(), e;
56
+ error(t) {
57
+ return this.ifReconnect && this.reconnect(), t;
64
58
  }
65
59
  /** websocket重连 */
66
60
  reconnect() {
@@ -69,24 +63,19 @@ class R {
69
63
  }, 3e3)));
70
64
  }
71
65
  /** 发送消息给服务器 */
72
- send(e) {
73
- var t;
74
- if (((t = this.$ws) == null ? void 0 : t.readyState) !== WebSocket.OPEN) {
75
- console.log(this.url + "=>websocket连接未建立,还不能发送消息");
76
- return;
77
- }
78
- this.$ws.send(e);
66
+ send(t) {
67
+ var e;
68
+ ((e = this.$ws) == null ? void 0 : e.readyState) === WebSocket.OPEN && this.$ws.send(t);
79
69
  }
80
70
  // 启动心跳检测==>30s-5分钟内随机发一次心跳保持会话(时间区间内随机是为了降低突增流量的概率)
81
71
  startHeartbeat() {
82
72
  this.heartbeatInterval = setInterval(() => {
83
- const e = "";
84
- this.send(e), console.log(this.url + "=>心跳检测发送消息:", e);
85
- }, g(3e4, 3e5));
73
+ this.send("");
74
+ }, p(3e4, 3e5));
86
75
  }
87
76
  /** 断开连接 */
88
77
  disconnect() {
89
- this.$ws.close(), console.log(this.url + " =>主动断开websocket连接");
78
+ this.$ws.close();
90
79
  }
91
80
  }
92
81
  export {
Binary file
@@ -0,0 +1,28 @@
1
+ export type socketConfig = {
2
+ /** 请求地址 */
3
+ url: string
4
+
5
+ /** 请求参数 */
6
+ params?: Record<string, any>
7
+
8
+ /** websocket连接成功回调 */
9
+ opened?: (event: any) => void
10
+
11
+ /** websocket关闭连接回调 */
12
+ close?: (event: any) => void
13
+
14
+ /** websocket接收到消息回调 */
15
+ message?: (event: any) => void
16
+
17
+ /** websocket连接异常回调 */
18
+ error?: (event: any) => void
19
+
20
+ /** 是否重连,默认开启 */
21
+ ifReconnect?: boolean
22
+
23
+ /** 连接close关闭时是否重连,默认关闭 */
24
+ reconnectWhenClose?: boolean
25
+
26
+ /** 重连次数,默认为3,-1 表示一直重连 */
27
+ reconnectNum?: number
28
+ }
@@ -8,4 +8,4 @@ export type SFCWithInstall<T> = T & Plugin;
8
8
  * 定义一个withInstall方法处理以下组件类型问题
9
9
  * @param comp
10
10
  */
11
- export declare const withInstall: <T>(comp: T) => any;
11
+ export declare const withInstall: <T>(comp: T) => SFCWithInstall<T>;
@@ -1,85 +0,0 @@
1
- /*! js-cookie v3.0.5 | MIT */
2
- function p(e) {
3
- for (var n = 1; n < arguments.length; n++) {
4
- var t = arguments[n];
5
- for (var i in t)
6
- e[i] = t[i];
7
- }
8
- return e;
9
- }
10
- var u = {
11
- read: function(e) {
12
- return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
13
- },
14
- write: function(e) {
15
- return encodeURIComponent(e).replace(
16
- /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
17
- decodeURIComponent
18
- );
19
- }
20
- };
21
- function g(e, n) {
22
- function t(o, f, r) {
23
- if (!(typeof document > "u")) {
24
- r = p({}, n, r), typeof r.expires == "number" && (r.expires = new Date(Date.now() + r.expires * 864e5)), r.expires && (r.expires = r.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
25
- var c = "";
26
- for (var s in r)
27
- r[s] && (c += "; " + s, r[s] !== !0 && (c += "=" + r[s].split(";")[0]));
28
- return document.cookie = o + "=" + e.write(f, o) + c;
29
- }
30
- }
31
- function i(o) {
32
- if (!(typeof document > "u" || arguments.length && !o)) {
33
- for (var f = document.cookie ? document.cookie.split("; ") : [], r = {}, c = 0; c < f.length; c++) {
34
- var s = f[c].split("="), d = s.slice(1).join("=");
35
- try {
36
- var a = decodeURIComponent(s[0]);
37
- if (r[a] = e.read(d, a), o === a)
38
- break;
39
- } catch {
40
- }
41
- }
42
- return o ? r[o] : r;
43
- }
44
- }
45
- return Object.create(
46
- {
47
- set: t,
48
- get: i,
49
- remove: function(o, f) {
50
- t(
51
- o,
52
- "",
53
- p({}, f, {
54
- expires: -1
55
- })
56
- );
57
- },
58
- withAttributes: function(o) {
59
- return g(this.converter, p({}, this.attributes, o));
60
- },
61
- withConverter: function(o) {
62
- return g(p({}, this.converter, o), this.attributes);
63
- }
64
- },
65
- {
66
- attributes: { value: Object.freeze(n) },
67
- converter: { value: Object.freeze(e) }
68
- }
69
- );
70
- }
71
- var l = g(u, { path: "/" });
72
- const m = () => {
73
- const e = new URL(location.href).searchParams, n = e.get("token") || e.get("accessToken") || e.get("accesstoken") || "";
74
- n && (console.log("从url上取token:", n), JSON.stringify({ access_token: n }), l.set("accessToken", n));
75
- }, v = () => {
76
- const e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}"), n = new URL(location.href).searchParams, t = n.get("project") || n.get("projectId") || "";
77
- if (!t)
78
- return;
79
- const i = n.get("projectParent") || n.get("projectParentId") || (e == null ? void 0 : e.parentId) || "", o = n.get("projectName") || (e == null ? void 0 : e.name) || "";
80
- console.log("从url上取project:", t), sessionStorage.setItem("project", t), sessionStorage.setItem("projectInfo", JSON.stringify({ ...e, id: t, name: o, parentId: i }));
81
- };
82
- export {
83
- v as getProjectInfoFromQuery,
84
- m as getTokenFromQuery
85
- };
@@ -1,20 +0,0 @@
1
- const f = (t, r) => {
2
- if (!t || !r || Object.keys(t).length !== Object.keys(r).length)
3
- return !1;
4
- for (let e in t) {
5
- if (r[e] === void 0)
6
- return !1;
7
- if (typeof r[e] == "function" || typeof t[e] == "function")
8
- throw new Error("type error");
9
- if (typeof r[e] != typeof t[e])
10
- return !1;
11
- if (typeof t[e] == "object")
12
- return f(t[e], r[e]);
13
- if (t[e] !== r[e])
14
- return !1;
15
- }
16
- return !0;
17
- };
18
- export {
19
- f as objEqual
20
- };
@@ -1,5 +0,0 @@
1
- /**
2
- * 自定义html最小宽高
3
- * @param layout minWidth、minHeight为空则为重置
4
- */
5
- export declare const setHtmlMinWH: (layout?: Record<'minWidth' | 'minHeight', string>) => void;
@@ -1,10 +0,0 @@
1
- /**
2
- * 设置平台的favIcon
3
- * @param favIcon 图标
4
- */
5
- export declare const updateFavIcon: (favIcon: string) => void;
6
- /**
7
- * 设置平台的favIcon,如果localStorage中没有则调用接口获取
8
- * @returns
9
- */
10
- export declare const setDasHtmlIcon: () => Promise<void>;
@@ -1,22 +0,0 @@
1
- import { getFavIcon as n } from "@das-fed/utils/common-info";
2
- import { pureImageSrc as m } from "@das-fed/utils/pure-image-src";
3
- import { systemConfiguration as s } from "@das-fed/utils/api-services/modules";
4
- const c = s.get("/visitor/appearance/with-default", (t) => (t.public = !0, t)), i = (t) => {
5
- const o = t || "./logo.svg";
6
- let e = document.querySelector('link[rel*="icon"]');
7
- e ? e == null || e.setAttribute("href", o) : (e = document.createElement("link"), e.rel = "icon", e.type = "image/svg+xml", e.href = o, document.getElementsByTagName("head")[0].appendChild(e));
8
- }, p = async () => {
9
- let t = n();
10
- if (!t) {
11
- const [o, e] = await c().run();
12
- if (o)
13
- return;
14
- const { browserLogoImgHost: a = "", browserLogoImg: r = "" } = e;
15
- t = r ? a + m(r) : "";
16
- }
17
- i(t);
18
- };
19
- export {
20
- p as setDasHtmlIcon,
21
- i as updateFavIcon
22
- };
@@ -1,29 +0,0 @@
1
- import { Graph, Shape, Node } from '@antv/x6';
2
-
3
- type ObjectTypeMap = {
4
- Rect: typeof Shape.Rect;
5
- Circle: typeof Shape.Circle;
6
- Ellipse: typeof Shape.Ellipse;
7
- Polygon: typeof Shape.Polygon;
8
- Polyline: typeof Shape.Polyline;
9
- Path: typeof Shape.Path;
10
- Image: typeof Shape.Image;
11
- HTML: typeof Shape.HTML;
12
- BackgroundImage: null;
13
- };
14
- declare const useAntvX6: (initOptions?: Graph.Options) => {
15
- canvasContainerEl: any;
16
- init: (container: HTMLDivElement) => void;
17
- waitInit: () => Promise<void>;
18
- canvas: any;
19
- onCanvasMounted: (cb: Function) => number;
20
- addObject: <T extends keyof ObjectTypeMap>(type: T, metadata?: Node.Metadata & {
21
- src?: string;
22
- }, options?: Model.AddOptions) => Promise<typeof Node>;
23
- removeObject: (key: string) => Promise<void>;
24
- zoom: (type?: 'in' | 'out', radio?: number) => Promise<void>;
25
- toJSON: () => Promise<any>;
26
- loadJSON: (data: any) => Promise<any>;
27
- remove: () => Promise<any>;
28
- };
29
- export { useAntvX6, Graph };