@das-fed/upf-utils 6.4.0-dev.124

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 (203) hide show
  1. package/__VLS_types.d.ts +124 -0
  2. package/api-services/i18n/index.d.ts +53 -0
  3. package/api-services/i18n/index.js +27 -0
  4. package/api-services/i18n/index.js.gz +0 -0
  5. package/api-services/index.d.ts +2 -0
  6. package/api-services/index.js +3141 -0
  7. package/api-services/index.js.gz +0 -0
  8. package/api-services/modules/app-manage/index.d.ts +2 -0
  9. package/api-services/modules/app-manage/index.js +2827 -0
  10. package/api-services/modules/app-manage/index.js.gz +0 -0
  11. package/api-services/modules/authentication/index.d.ts +2 -0
  12. package/api-services/modules/authentication/index.js +2827 -0
  13. package/api-services/modules/authentication/index.js.gz +0 -0
  14. package/api-services/modules/bems/index.d.ts +6 -0
  15. package/api-services/modules/bems/index.js +2831 -0
  16. package/api-services/modules/bems/index.js.gz +0 -0
  17. package/api-services/modules/contract/index.d.ts +2 -0
  18. package/api-services/modules/contract/index.js +2827 -0
  19. package/api-services/modules/contract/index.js.gz +0 -0
  20. package/api-services/modules/duty-manage/index.d.ts +7 -0
  21. package/api-services/modules/duty-manage/index.js +2836 -0
  22. package/api-services/modules/duty-manage/index.js.gz +0 -0
  23. package/api-services/modules/enterpriseright/index.d.ts +2 -0
  24. package/api-services/modules/enterpriseright/index.js +2827 -0
  25. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  26. package/api-services/modules/file/index.d.ts +37 -0
  27. package/api-services/modules/file/index.js +3059 -0
  28. package/api-services/modules/file/index.js.gz +0 -0
  29. package/api-services/modules/gateway-edge/index.d.ts +2 -0
  30. package/api-services/modules/gateway-edge/index.js +2827 -0
  31. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  32. package/api-services/modules/index.d.ts +21 -0
  33. package/api-services/modules/index.js +3115 -0
  34. package/api-services/modules/index.js.gz +0 -0
  35. package/api-services/modules/iot/index.d.ts +16 -0
  36. package/api-services/modules/iot/index.js +2841 -0
  37. package/api-services/modules/iot/index.js.gz +0 -0
  38. package/api-services/modules/justauth/index.d.ts +3 -0
  39. package/api-services/modules/justauth/index.js +2828 -0
  40. package/api-services/modules/justauth/index.js.gz +0 -0
  41. package/api-services/modules/knowledge/index.d.ts +2 -0
  42. package/api-services/modules/knowledge/index.js +2827 -0
  43. package/api-services/modules/knowledge/index.js.gz +0 -0
  44. package/api-services/modules/link/index.d.ts +2 -0
  45. package/api-services/modules/link/index.js +2827 -0
  46. package/api-services/modules/link/index.js.gz +0 -0
  47. package/api-services/modules/permission/index.d.ts +2 -0
  48. package/api-services/modules/permission/index.js +2827 -0
  49. package/api-services/modules/permission/index.js.gz +0 -0
  50. package/api-services/modules/platformManage/index.d.ts +14 -0
  51. package/api-services/modules/platformManage/index.js +2835 -0
  52. package/api-services/modules/platformManage/index.js.gz +0 -0
  53. package/api-services/modules/portal/index.d.ts +2 -0
  54. package/api-services/modules/portal/index.js +2827 -0
  55. package/api-services/modules/portal/index.js.gz +0 -0
  56. package/api-services/modules/space-manage/index.d.ts +2 -0
  57. package/api-services/modules/space-manage/index.js +2827 -0
  58. package/api-services/modules/space-manage/index.js.gz +0 -0
  59. package/api-services/modules/super-admin/index.d.ts +8 -0
  60. package/api-services/modules/super-admin/index.js +2830 -0
  61. package/api-services/modules/super-admin/index.js.gz +0 -0
  62. package/api-services/modules/supplier/index.d.ts +6 -0
  63. package/api-services/modules/supplier/index.js +2829 -0
  64. package/api-services/modules/supplier/index.js.gz +0 -0
  65. package/api-services/modules/supplychain-manage/index.d.ts +2 -0
  66. package/api-services/modules/supplychain-manage/index.js +2827 -0
  67. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  68. package/api-services/modules/systemConfiguration/index.d.ts +2 -0
  69. package/api-services/modules/systemConfiguration/index.js +2827 -0
  70. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  71. package/api-services/modules/tool/index.d.ts +2 -0
  72. package/api-services/modules/tool/index.js +2827 -0
  73. package/api-services/modules/tool/index.js.gz +0 -0
  74. package/api-services/src/create-service/index.d.ts +1 -0
  75. package/api-services/src/create-service/index.js +2827 -0
  76. package/api-services/src/create-service/index.js.gz +0 -0
  77. package/atob/index.d.ts +2 -0
  78. package/atob/index.js +11 -0
  79. package/common-info/getIframeUrl/index.d.ts +9 -0
  80. package/common-info/getIframeUrl/index.js +10 -0
  81. package/common-info/getInfoFromUrl/index.d.ts +8 -0
  82. package/common-info/getInfoFromUrl/index.js +84 -0
  83. package/common-info/getInfoFromUrl/index.js.gz +0 -0
  84. package/common-info/index.d.ts +61 -0
  85. package/common-info/index.js +171 -0
  86. package/common-info/index.js.gz +0 -0
  87. package/common-info/set-personal-info/index.d.ts +5 -0
  88. package/common-info/set-personal-info/index.js +1474 -0
  89. package/common-info/set-personal-info/index.js.gz +0 -0
  90. package/common-info/type.d.ts +214 -0
  91. package/common-tools/arr-tools/index.d.ts +15 -0
  92. package/common-tools/arr-tools/index.js +8 -0
  93. package/common-tools/calc-text-width/index.d.ts +1 -0
  94. package/common-tools/calc-text-width/index.js +10 -0
  95. package/common-tools/date-format/index.d.ts +7 -0
  96. package/common-tools/date-format/index.js +19 -0
  97. package/common-tools/extract-file-name/index.d.ts +1 -0
  98. package/common-tools/extract-file-name/index.js +1466 -0
  99. package/common-tools/extract-file-name/index.js.gz +0 -0
  100. package/common-tools/get-file-extension/index.d.ts +6 -0
  101. package/common-tools/get-file-extension/index.js +7 -0
  102. package/common-tools/get-url-params/index.d.ts +46 -0
  103. package/common-tools/get-url-params/index.js +63 -0
  104. package/common-tools/get-url-params/index.js.gz +0 -0
  105. package/common-tools/handle-data/index.d.ts +6 -0
  106. package/common-tools/handle-data/index.js +4 -0
  107. package/common-tools/index.d.ts +14 -0
  108. package/common-tools/index.js +14 -0
  109. package/common-tools/nest-tree-format/index.d.ts +30 -0
  110. package/common-tools/nest-tree-format/index.js +24 -0
  111. package/common-tools/obj-tools/index.d.ts +7 -0
  112. package/common-tools/obj-tools/index.js +14 -0
  113. package/common-tools/platform-tools/index.d.ts +19 -0
  114. package/common-tools/platform-tools/index.js +19 -0
  115. package/common-tools/queue-promise/index.d.ts +6 -0
  116. package/common-tools/queue-promise/index.js +9 -0
  117. package/common-tools/setHtmlMinWH/index.d.ts +5 -0
  118. package/common-tools/setHtmlMinWH/index.js +7 -0
  119. package/common-tools/update-browser-title/index.d.ts +1 -0
  120. package/common-tools/update-browser-title/index.js +12 -0
  121. package/common-tools/update-fav-icon/index.d.ts +11 -0
  122. package/common-tools/update-fav-icon/index.js +22 -0
  123. package/config/index.d.ts +2 -0
  124. package/config/index.js +9 -0
  125. package/create-api-service/i18n/index.d.ts +33 -0
  126. package/create-api-service/i18n/index.js +15 -0
  127. package/create-api-service/index.d.ts +3 -0
  128. package/create-api-service/index.js +2827 -0
  129. package/create-api-service/index.js.gz +0 -0
  130. package/create-api-service/proxy-sso/index.d.ts +3 -0
  131. package/create-api-service/proxy-sso/index.js +21 -0
  132. package/create-api-service/sso/index.d.ts +21 -0
  133. package/create-api-service/sso/index.js +1845 -0
  134. package/create-api-service/sso/index.js.gz +0 -0
  135. package/curring-http/index.d.ts +12 -0
  136. package/curring-http/index.js +2002 -0
  137. package/curring-http/index.js.gz +0 -0
  138. package/curring-http/type.d.ts +89 -0
  139. package/dimple-canvas/index.d.ts +3 -0
  140. package/dimple-canvas/index.js +5 -0
  141. package/directive/auth/index.d.ts +8 -0
  142. package/directive/auth/index.js +62 -0
  143. package/directive/auth/index.js.gz +0 -0
  144. package/directive/clickOutside/index.d.ts +6 -0
  145. package/directive/clickOutside/index.js +27 -0
  146. package/directive/hoverInside/index.d.ts +6 -0
  147. package/directive/hoverInside/index.js +21 -0
  148. package/directive/index.d.ts +3 -0
  149. package/directive/index.js +8 -0
  150. package/directive/utils/index.d.ts +7 -0
  151. package/directive/utils/index.js +7 -0
  152. package/dom-check-in/index.d.ts +6 -0
  153. package/dom-check-in/index.js +8 -0
  154. package/dom-watcher/index.d.ts +25 -0
  155. package/dom-watcher/index.js +9 -0
  156. package/esm-map.json +146 -0
  157. package/hooks/popup-manager/use-zindex/index.d.ts +3 -0
  158. package/hooks/popup-manager/use-zindex/index.js +9 -0
  159. package/hooks/use-get-auth/apis.d.ts +4 -0
  160. package/hooks/use-get-auth/index.d.ts +9 -0
  161. package/hooks/use-get-auth/index.js +53 -0
  162. package/hooks/use-get-auth/index.js.gz +0 -0
  163. package/index.d.ts +2 -0
  164. package/index.js +2 -0
  165. package/load-js/index.d.ts +3 -0
  166. package/load-js/index.js +12 -0
  167. package/nextTiken/index.d.ts +12 -0
  168. package/nextTiken/index.js +45 -0
  169. package/nextTiken/index.js.gz +0 -0
  170. package/oss/index.d.ts +2 -0
  171. package/oss/index.js +11 -0
  172. package/package.json +49 -0
  173. package/pinyin-first-character/index.d.ts +2 -0
  174. package/pinyin-first-character/index.js +25022 -0
  175. package/pinyin-first-character/index.js.gz +0 -0
  176. package/process-engine-info/index.d.ts +13 -0
  177. package/process-engine-info/index.js +15 -0
  178. package/pure-image-src/index.d.ts +2 -0
  179. package/pure-image-src/index.js +4 -0
  180. package/size-watcher/index.d.ts +6 -0
  181. package/size-watcher/index.js +20 -0
  182. package/style/index.d.ts +2 -0
  183. package/style/index.js +70 -0
  184. package/style/index.js.gz +0 -0
  185. package/style/math.d.ts +9 -0
  186. package/style/style.d.ts +31 -0
  187. package/token-tools/index.d.ts +21 -0
  188. package/token-tools/index.js +11 -0
  189. package/use-low-code/index.d.ts +1 -0
  190. package/use-low-code/index.js +69 -0
  191. package/use-low-code/index.js.gz +0 -0
  192. package/use-low-code/low-code-iframe.vue.d.ts +2 -0
  193. package/use-low-code/style.css +1 -0
  194. package/vue/hooks/use-model-value/index.d.ts +9 -0
  195. package/vue/hooks/use-model-value/index.js +10 -0
  196. package/vue/index.d.ts +1 -0
  197. package/vue/index.js +4 -0
  198. package/webSocket-service/index.d.ts +41 -0
  199. package/webSocket-service/index.js +83 -0
  200. package/webSocket-service/index.js.gz +0 -0
  201. package/webSocket-service/type.d.ts +28 -0
  202. package/with-install/index.d.ts +11 -0
  203. package/with-install/index.js +6 -0
@@ -0,0 +1,13 @@
1
+ /**
2
+ * 子应用存储流程引擎需要的token信息
3
+ * @param data token信息
4
+ */
5
+ export declare const setProcessEngineToken: (data: Record<any, any>) => void;
6
+ /** 移除流程引擎token */
7
+ export declare const removeProcessEngineToken: () => void;
8
+ /**
9
+ * 子应用存储流程引擎需要的项目信息
10
+ * @param projectId 项目id
11
+ */
12
+ export declare const setProcessEngineProject: (projectId: string) => void;
13
+ export declare const removeProcessEngineProject: () => void;
@@ -0,0 +1,15 @@
1
+ const s = (e) => {
2
+ sessionStorage.setItem("hotentToken", e.accessToken || ""), sessionStorage.setItem("currentUser", JSON.stringify({ token: e.accessToken || "" }));
3
+ }, o = () => {
4
+ sessionStorage.removeItem("hotentToken"), sessionStorage.removeItem("currentUser");
5
+ }, t = (e) => {
6
+ sessionStorage.setItem("project", e);
7
+ }, n = () => {
8
+ sessionStorage.removeItem("project");
9
+ };
10
+ export {
11
+ n as removeProcessEngineProject,
12
+ o as removeProcessEngineToken,
13
+ t as setProcessEngineProject,
14
+ s as setProcessEngineToken
15
+ };
@@ -0,0 +1,2 @@
1
+ declare const pureImageSrc: (url: string) => any;
2
+ export { pureImageSrc };
@@ -0,0 +1,4 @@
1
+ const e = "oss", c = (n) => n.indexOf(`/${e}/`) === 0 ? n : null, l = (n) => n.indexOf("/") === 0 ? `/${e}${n}` : null, a = (n) => n.indexOf(`${e}/`) === 0 ? `/${n}` : null, d = (n) => `/${e}/${n}`, o = (...n) => (t) => n.reduce((r, u) => r !== null ? r : u(t), null), i = o(c, l, a, d), s = (n) => n ? i(n) : "";
2
+ export {
3
+ s as pureImageSrc
4
+ };
@@ -0,0 +1,6 @@
1
+ declare const SizeWatcher: (cb: (e: DOMRectReadOnly) => any, dom?: HTMLElement | null) => ResizeObserver;
2
+ declare const useSizeWatcher: () => {
3
+ el: any;
4
+ rect: any;
5
+ };
6
+ export { SizeWatcher, useSizeWatcher };
@@ -0,0 +1,20 @@
1
+ import { ref as r, onMounted as u } from "vue";
2
+ const i = (e, t) => {
3
+ const n = t || document.documentElement, o = new ResizeObserver((c) => {
4
+ const s = c[0];
5
+ e(s.contentRect);
6
+ });
7
+ return t !== null && o.observe(n), o;
8
+ }, h = () => {
9
+ const e = r(null), t = r({ bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0, toJSON: () => {
10
+ } });
11
+ return u(() => {
12
+ i((n) => {
13
+ t.value = n;
14
+ }, e.value), e.value;
15
+ }), { el: e, rect: t };
16
+ };
17
+ export {
18
+ i as SizeWatcher,
19
+ h as useSizeWatcher
20
+ };
@@ -0,0 +1,2 @@
1
+ export { hasClass, addClass, removeClass, getStyle, getCSS, createStyle, updateStyle } from './style';
2
+ export { curringMath } from './math';
package/style/index.js ADDED
@@ -0,0 +1,70 @@
1
+ /**
2
+ * @vue/shared v3.4.21
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/
6
+ process.env.NODE_ENV !== "production" && Object.freeze({});
7
+ process.env.NODE_ENV !== "production" && Object.freeze([]);
8
+ const u = (t) => {
9
+ const e = /* @__PURE__ */ Object.create(null);
10
+ return (r) => e[r] || (e[r] = t(r));
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) return !1;
13
+ if (e.includes(" ")) throw new Error("className should not contain space.");
14
+ return t.classList.contains(e);
15
+ }, y = (t, e) => {
16
+ !t || !e.trim() || t.classList.add(...a(e));
17
+ }, g = (t, e) => {
18
+ !t || !e.trim() || t.classList.remove(...a(e));
19
+ }, N = (t, e) => {
20
+ if (!t || !e) return "";
21
+ let r = p(e);
22
+ r === "float" && (r = "cssFloat");
23
+ try {
24
+ const n = t.style[r];
25
+ if (n) return n;
26
+ const s = window == null ? void 0 : window.getComputedStyle(t, "");
27
+ return s ? s[r] : "";
28
+ } catch {
29
+ return t.style[r];
30
+ }
31
+ }, d = (t = {}) => Object.keys(t).map((e) => `${e}:${t[e] !== "" ? t[e] : '""'}`).join(";"), E = (t, e) => {
32
+ if (!document.getElementById(t))
33
+ return new Promise((r, n) => {
34
+ const s = document.createElement("style");
35
+ s.rel = "text/css", s.id = t;
36
+ for (const i of e)
37
+ s.appendChild(document.createTextNode(`${i.className}{${d(i.style)}}`));
38
+ document.getElementsByTagName("head")[0].appendChild(s), s.onload = () => r("load success"), s.onerror = () => n("load error");
39
+ });
40
+ }, S = (t, e) => {
41
+ const r = document.getElementById(t);
42
+ if (r) {
43
+ r.innerHTML = "";
44
+ for (const n of e)
45
+ r.appendChild(document.createTextNode(`${n.className}{${d(n.style)}}`));
46
+ }
47
+ }, l = (t) => Number(t.toString().replace("px", "")), o = (t, e, r) => {
48
+ e = l(e), r = l(r);
49
+ let n;
50
+ return t === "add" && (n = e + r), t === "subtract" && (n = e - r), t === "multiply" && (n = e * r), t === "divide" && (n = e / r), e = null, r = null, n;
51
+ }, c = (t) => ({
52
+ add: (e) => c(o("add", t, e)),
53
+ subtract: (e) => c(o("subtract", t, e)),
54
+ multiply: (e) => c(o("multiply", t, e)),
55
+ divide: (e) => c(o("divide", t, e)),
56
+ res: () => {
57
+ const e = t + "px";
58
+ return t = null, e;
59
+ }
60
+ });
61
+ export {
62
+ y as addClass,
63
+ E as createStyle,
64
+ c as curringMath,
65
+ d as getCSS,
66
+ N as getStyle,
67
+ h as hasClass,
68
+ g as removeClass,
69
+ S as updateStyle
70
+ };
Binary file
@@ -0,0 +1,9 @@
1
+ /** css中px字符串的数学运算 */
2
+ declare const curringMath: (a: any) => {
3
+ add: (b: any) => /*elided*/ any;
4
+ subtract: (b: any) => /*elided*/ any;
5
+ multiply: (b: any) => /*elided*/ any;
6
+ divide: (b: any) => /*elided*/ any;
7
+ res: () => string;
8
+ };
9
+ export { curringMath };
@@ -0,0 +1,31 @@
1
+ import { CSSProperties } from 'vue';
2
+
3
+ export declare const classNameToArray: (cls?: string) => any;
4
+ export declare const hasClass: (el: Element, cls: string) => boolean;
5
+ export declare const addClass: (el: Element, cls: string) => void;
6
+ export declare const removeClass: (el: Element, cls: string) => void;
7
+ /**
8
+ * 获取 CSS 属性的值
9
+ * @param element dom元素
10
+ * @param styleName css prop
11
+ * @returns
12
+ */
13
+ export declare const getStyle: (element: HTMLElement, styleName: keyof CSSProperties) => string;
14
+ /**
15
+ * 根据style对象获取style文本进行设置
16
+ * @param {CSSStyleDeclaration} styleObj -样式对象
17
+ */
18
+ export declare const getCSS: (styleObj?: {}) => any;
19
+ /**
20
+ * 创建样式表
21
+ * @param {string} id 样式表id
22
+ * @param {[{className:string, style: CSSStyleDeclaration}]} data 样式对象
23
+ */
24
+ declare const createStyle: (id: string, data: any) => any;
25
+ /**
26
+ * 修改指定样式表
27
+ * @param id 样式表id
28
+ * @param data 样式对象
29
+ */
30
+ declare const updateStyle: (id: string, data: any) => void;
31
+ export { createStyle, updateStyle };
@@ -0,0 +1,21 @@
1
+ declare const accessTokenExpiredAtKey = "accessTokenExpiredAt";
2
+ declare const refreshTokenKey = "refreshToken";
3
+ declare const redirectUriKey = "redirectUri";
4
+ declare const accessTokenInfoKey = "tokenInfo";
5
+ /**
6
+ * 获取token
7
+ * @returns token
8
+ */
9
+ export declare const getAccessToken: () => string;
10
+ /**
11
+ * 获取tokenInfo相关信息
12
+ */
13
+ export declare const getAccessTokenInfo: (key: typeof accessTokenExpiredAtKey | typeof refreshTokenKey | typeof redirectUriKey | typeof accessTokenInfoKey) => any;
14
+ /**
15
+ * 存入token、tokenInfo
16
+ * @param token
17
+ * @param info
18
+ */
19
+ export declare const setAccessToken: (token: string, info?: any) => void;
20
+ export declare const removeAccessToken: () => void;
21
+ export {};
@@ -0,0 +1,11 @@
1
+ const o = "accessToken", r = "accessTokenExpiredAt", c = "refreshToken", s = "redirectUri", a = () => localStorage.getItem(o) ?? sessionStorage.getItem(o) ?? "", n = (e) => localStorage.getItem(e) ?? sessionStorage.getItem(e) ?? "", l = (e, t = {}) => {
2
+ localStorage.setItem(o, e), localStorage.setItem(r, t.accessTokenExpiredAt ?? "0"), localStorage.setItem(c, t.refreshToken ?? ""), t.redirectUri && localStorage.setItem(s, t.redirectUri);
3
+ }, g = () => {
4
+ localStorage.removeItem(o), localStorage.removeItem(r), localStorage.removeItem(c), localStorage.removeItem(s);
5
+ };
6
+ export {
7
+ a as getAccessToken,
8
+ n as getAccessTokenInfo,
9
+ g as removeAccessToken,
10
+ l as setAccessToken
11
+ };
@@ -0,0 +1 @@
1
+ export { default as LowCode } from './low-code-iframe.vue';
@@ -0,0 +1,69 @@
1
+ import { defineComponent as v, computed as u, onMounted as g, onBeforeUnmount as _, ref as L, createElementBlock as y, openBlock as h } from "vue";
2
+ const x = ["src"], b = /* @__PURE__ */ v({
3
+ __name: "low-code-iframe",
4
+ props: {
5
+ app: {},
6
+ query: {},
7
+ iframeLoading: { type: Boolean }
8
+ },
9
+ emits: ["emit-change", "update:iframeLoading"],
10
+ setup(n, { expose: c, emit: s }) {
11
+ const a = n, r = u(() => {
12
+ if (!a.app) return;
13
+ let e = "";
14
+ const o = "";
15
+ let t = a.query || {};
16
+ return a.app && (t.app = a.app), e = `${o}/api/node-low-code/v1/visitor/views/index?${new URLSearchParams(t).toString()}`, e;
17
+ }), l = s, d = u({
18
+ get: () => a.iframeLoading,
19
+ set: (e) => l("update:iframeLoading", e)
20
+ }), p = (e) => {
21
+ const { emitName: o = "", emitData: t = {} } = e.data || {};
22
+ o === "app-mounted" ? d.value = !1 : l("emit-change", o, t);
23
+ };
24
+ g(() => {
25
+ window.addEventListener("message", p, !1);
26
+ }), _(() => {
27
+ window.removeEventListener("message", p, !1);
28
+ });
29
+ const i = L(null), m = (e) => {
30
+ var o;
31
+ d.value || (o = i.value) != null && o.contentWindow && i.value.contentWindow.postMessage(e);
32
+ };
33
+ c({
34
+ onActivated: () => {
35
+ m({ type: "onActivated" });
36
+ },
37
+ onDeactivated: () => {
38
+ m({ type: "onDeactivated" });
39
+ }
40
+ });
41
+ const w = () => {
42
+ var o, t, f;
43
+ const { origin: e } = new URL(r.value || "", location.origin);
44
+ e && ((f = (t = (o = i.value) == null ? void 0 : o.contentWindow) == null ? void 0 : t.postMessage) == null || f.call(
45
+ t,
46
+ { type: "setProxSsoStatus", data: { visible: !0, parentHref: location.href } },
47
+ e
48
+ ));
49
+ };
50
+ return (e, o) => (h(), y("iframe", {
51
+ class: "low-code-iframe",
52
+ id: "low-code-iframe",
53
+ src: r.value,
54
+ frameborder: "0",
55
+ sandbox: "allow-same-origin allow-scripts allow-forms allow-modals allow-popups allow-downloads allow-top-navigation",
56
+ ref_key: "lowCodeRef",
57
+ ref: i,
58
+ onLoad: w
59
+ }, null, 40, x));
60
+ }
61
+ }), C = (n, c) => {
62
+ const s = n.__vccOpts || n;
63
+ for (const [a, r] of c)
64
+ s[a] = r;
65
+ return s;
66
+ }, B = /* @__PURE__ */ C(b, [["__scopeId", "data-v-c5870bec"]]);
67
+ export {
68
+ B as LowCode
69
+ };
Binary file
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ .low-code-iframe[data-v-c5870bec]{padding:0;margin:0;border:none;outline:none;height:100%;width:100%;min-height:100px;min-width:100px}
@@ -0,0 +1,9 @@
1
+ import { Ref } from 'vue';
2
+
3
+ /** 简化组件内使用modelValue时的watch过程 */
4
+ declare const useModelValue: (
5
+ /** 组件的props */
6
+ props: any,
7
+ /** 组件props需要使用modelValue的key */
8
+ propKey: string) => Ref;
9
+ export { useModelValue };
@@ -0,0 +1,10 @@
1
+ import { ref as o, watchEffect as u } from "vue";
2
+ const c = (e, t) => {
3
+ const l = o(e[t]);
4
+ return u(() => {
5
+ l.value = e[t];
6
+ }), l;
7
+ };
8
+ export {
9
+ c as useModelValue
10
+ };
package/vue/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { useModelValue } from '@das-fed/upf-utils/vue/hooks/use-model-value';
package/vue/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import { useModelValue as l } from "@das-fed/upf-utils/vue/hooks/use-model-value";
2
+ export {
3
+ l as useModelValue
4
+ };
@@ -0,0 +1,41 @@
1
+ import { socketConfig } from './type';
2
+
3
+ export declare class socketService {
4
+ /** websocket实例 */
5
+ $ws: any;
6
+ /** websocket地址 */
7
+ url: string;
8
+ /** 请求参数 */
9
+ params: Record<string, any>;
10
+ /** 是否正在重连,避免ws重复连接 */
11
+ lockReturn: boolean;
12
+ /** websocket开启时间 */
13
+ startTime: any;
14
+ /** 心跳检测 */
15
+ heartbeatInterval: any;
16
+ /** 发生错误时是否重连,默认开启 */
17
+ ifReconnect: boolean;
18
+ /** 重连定时器 */
19
+ reconnectId: any;
20
+ /** 重连次数,默认为3,-1 表示一直重连 */
21
+ reconnectNum: number;
22
+ /** 连接close关闭时是否重连,默认关闭 */
23
+ reconnectWhenClose: boolean;
24
+ /** 当前重连次数 */
25
+ currentReconnectNum: number;
26
+ constructor({ url, params, opened, close, error, message, ifReconnect, reconnectNum, reconnectWhenClose, }: socketConfig);
27
+ initWebSocket(): void;
28
+ open(): void;
29
+ opened(ws: any): void;
30
+ close(event: CloseEvent): void;
31
+ message(event: any): void;
32
+ afterMsg(msg: any): void;
33
+ error(err: any): any;
34
+ /** websocket重连 */
35
+ reconnect(): void;
36
+ /** 发送消息给服务器 */
37
+ send(message: any): void;
38
+ startHeartbeat(): void;
39
+ /** 断开连接 */
40
+ disconnect(): void;
41
+ }
@@ -0,0 +1,83 @@
1
+ import { getConfig as m } from "@das-fed/upf-utils/config";
2
+ import { getToken as f } from "@das-fed/upf-utils/common-info";
3
+ import { objectToUrlparams as d } from "@das-fed/upf-utils/common-tools";
4
+ const c = m(), h = () => {
5
+ let s = "";
6
+ return c.baseURL ? s = c.baseURL : s = location.origin, s.replace("https://", "wss://").replace("http://", "ws://") || "";
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
+ class R {
12
+ constructor({
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
+ reconnectWhenClose: u
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 = 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
+ else
26
+ throw new Error("url is required");
27
+ r && (this.opened = r), n && (this.close = n), i && (this.error = i), o && (this.afterMsg = o), this.initWebSocket();
28
+ }
29
+ initWebSocket() {
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 = () => {
33
+ this.open();
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);
40
+ };
41
+ }
42
+ open() {
43
+ this.currentReconnectNum = 0, this.startTime = (/* @__PURE__ */ new Date()).getTime(), this.opened(this.$ws), this.startHeartbeat();
44
+ }
45
+ opened(t) {
46
+ }
47
+ close(t) {
48
+ this.$ws.readyState === WebSocket.CLOSED && ((/* @__PURE__ */ new Date()).getTime(), this.reconnectWhenClose && this.reconnect(), clearInterval(this.heartbeatInterval));
49
+ }
50
+ message(t) {
51
+ const e = typeof t.data == "object" ? t.data : JSON.parse(t.data);
52
+ this.afterMsg(e);
53
+ }
54
+ afterMsg(t) {
55
+ }
56
+ error(t) {
57
+ return this.ifReconnect && this.reconnect(), t;
58
+ }
59
+ /** websocket重连 */
60
+ reconnect() {
61
+ this.lockReturn || (this.lockReturn = !0, this.currentReconnectNum++, !(this.currentReconnectNum > this.reconnectNum) && (this.reconnectId && clearTimeout(this.reconnectId), this.reconnectId = setTimeout(() => {
62
+ this.initWebSocket(), this.lockReturn = !1;
63
+ }, 3e3)));
64
+ }
65
+ /** 发送消息给服务器 */
66
+ send(t) {
67
+ var e;
68
+ ((e = this.$ws) == null ? void 0 : e.readyState) === WebSocket.OPEN && this.$ws.send(t);
69
+ }
70
+ // 启动心跳检测==>30s-5分钟内随机发一次心跳保持会话(时间区间内随机是为了降低突增流量的概率)
71
+ startHeartbeat() {
72
+ this.heartbeatInterval = setInterval(() => {
73
+ this.send("");
74
+ }, p(3e4, 3e5));
75
+ }
76
+ /** 断开连接 */
77
+ disconnect() {
78
+ this.$ws.close();
79
+ }
80
+ }
81
+ export {
82
+ R as socketService
83
+ };
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
+ }
@@ -0,0 +1,11 @@
1
+ import { Plugin } from 'vue';
2
+
3
+ /**
4
+ * 组件外部使用use时执行install,然后将组件注册为全局
5
+ */
6
+ export type SFCWithInstall<T> = T & Plugin;
7
+ /**
8
+ * 定义一个withInstall方法处理以下组件类型问题
9
+ * @param comp
10
+ */
11
+ export declare const withInstall: <T>(comp: T) => SFCWithInstall<T>;
@@ -0,0 +1,6 @@
1
+ const e = (n) => (n.install = function(t) {
2
+ t.component(n.name, n);
3
+ }, n);
4
+ export {
5
+ e as withInstall
6
+ };