@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.
- package/__VLS_types.d.ts +124 -0
- package/api-services/i18n/index.d.ts +53 -0
- package/api-services/i18n/index.js +27 -0
- package/api-services/i18n/index.js.gz +0 -0
- package/api-services/index.d.ts +2 -0
- package/api-services/index.js +3141 -0
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.d.ts +2 -0
- package/api-services/modules/app-manage/index.js +2827 -0
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.d.ts +2 -0
- package/api-services/modules/authentication/index.js +2827 -0
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.d.ts +6 -0
- package/api-services/modules/bems/index.js +2831 -0
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.d.ts +2 -0
- package/api-services/modules/contract/index.js +2827 -0
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.d.ts +7 -0
- package/api-services/modules/duty-manage/index.js +2836 -0
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.d.ts +2 -0
- package/api-services/modules/enterpriseright/index.js +2827 -0
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.d.ts +37 -0
- package/api-services/modules/file/index.js +3059 -0
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.d.ts +2 -0
- package/api-services/modules/gateway-edge/index.js +2827 -0
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.d.ts +21 -0
- package/api-services/modules/index.js +3115 -0
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.d.ts +16 -0
- package/api-services/modules/iot/index.js +2841 -0
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.d.ts +3 -0
- package/api-services/modules/justauth/index.js +2828 -0
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.d.ts +2 -0
- package/api-services/modules/knowledge/index.js +2827 -0
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.d.ts +2 -0
- package/api-services/modules/link/index.js +2827 -0
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.d.ts +2 -0
- package/api-services/modules/permission/index.js +2827 -0
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.d.ts +14 -0
- package/api-services/modules/platformManage/index.js +2835 -0
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.d.ts +2 -0
- package/api-services/modules/portal/index.js +2827 -0
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.d.ts +2 -0
- package/api-services/modules/space-manage/index.js +2827 -0
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.d.ts +8 -0
- package/api-services/modules/super-admin/index.js +2830 -0
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.d.ts +6 -0
- package/api-services/modules/supplier/index.js +2829 -0
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.d.ts +2 -0
- package/api-services/modules/supplychain-manage/index.js +2827 -0
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.d.ts +2 -0
- package/api-services/modules/systemConfiguration/index.js +2827 -0
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.d.ts +2 -0
- package/api-services/modules/tool/index.js +2827 -0
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.d.ts +1 -0
- package/api-services/src/create-service/index.js +2827 -0
- package/api-services/src/create-service/index.js.gz +0 -0
- package/atob/index.d.ts +2 -0
- package/atob/index.js +11 -0
- package/common-info/getIframeUrl/index.d.ts +9 -0
- package/common-info/getIframeUrl/index.js +10 -0
- package/common-info/getInfoFromUrl/index.d.ts +8 -0
- package/common-info/getInfoFromUrl/index.js +84 -0
- package/common-info/getInfoFromUrl/index.js.gz +0 -0
- package/common-info/index.d.ts +61 -0
- package/common-info/index.js +171 -0
- package/common-info/index.js.gz +0 -0
- package/common-info/set-personal-info/index.d.ts +5 -0
- package/common-info/set-personal-info/index.js +1474 -0
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-info/type.d.ts +214 -0
- package/common-tools/arr-tools/index.d.ts +15 -0
- package/common-tools/arr-tools/index.js +8 -0
- package/common-tools/calc-text-width/index.d.ts +1 -0
- package/common-tools/calc-text-width/index.js +10 -0
- package/common-tools/date-format/index.d.ts +7 -0
- package/common-tools/date-format/index.js +19 -0
- package/common-tools/extract-file-name/index.d.ts +1 -0
- package/common-tools/extract-file-name/index.js +1466 -0
- package/common-tools/extract-file-name/index.js.gz +0 -0
- package/common-tools/get-file-extension/index.d.ts +6 -0
- package/common-tools/get-file-extension/index.js +7 -0
- package/common-tools/get-url-params/index.d.ts +46 -0
- package/common-tools/get-url-params/index.js +63 -0
- package/common-tools/get-url-params/index.js.gz +0 -0
- package/common-tools/handle-data/index.d.ts +6 -0
- package/common-tools/handle-data/index.js +4 -0
- package/common-tools/index.d.ts +14 -0
- package/common-tools/index.js +14 -0
- package/common-tools/nest-tree-format/index.d.ts +30 -0
- package/common-tools/nest-tree-format/index.js +24 -0
- package/common-tools/obj-tools/index.d.ts +7 -0
- package/common-tools/obj-tools/index.js +14 -0
- package/common-tools/platform-tools/index.d.ts +19 -0
- package/common-tools/platform-tools/index.js +19 -0
- package/common-tools/queue-promise/index.d.ts +6 -0
- package/common-tools/queue-promise/index.js +9 -0
- package/common-tools/setHtmlMinWH/index.d.ts +5 -0
- package/common-tools/setHtmlMinWH/index.js +7 -0
- package/common-tools/update-browser-title/index.d.ts +1 -0
- package/common-tools/update-browser-title/index.js +12 -0
- package/common-tools/update-fav-icon/index.d.ts +11 -0
- package/common-tools/update-fav-icon/index.js +22 -0
- package/config/index.d.ts +2 -0
- package/config/index.js +9 -0
- package/create-api-service/i18n/index.d.ts +33 -0
- package/create-api-service/i18n/index.js +15 -0
- package/create-api-service/index.d.ts +3 -0
- package/create-api-service/index.js +2827 -0
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/proxy-sso/index.d.ts +3 -0
- package/create-api-service/proxy-sso/index.js +21 -0
- package/create-api-service/sso/index.d.ts +21 -0
- package/create-api-service/sso/index.js +1845 -0
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/index.d.ts +12 -0
- package/curring-http/index.js +2002 -0
- package/curring-http/index.js.gz +0 -0
- package/curring-http/type.d.ts +89 -0
- package/dimple-canvas/index.d.ts +3 -0
- package/dimple-canvas/index.js +5 -0
- package/directive/auth/index.d.ts +8 -0
- package/directive/auth/index.js +62 -0
- package/directive/auth/index.js.gz +0 -0
- package/directive/clickOutside/index.d.ts +6 -0
- package/directive/clickOutside/index.js +27 -0
- package/directive/hoverInside/index.d.ts +6 -0
- package/directive/hoverInside/index.js +21 -0
- package/directive/index.d.ts +3 -0
- package/directive/index.js +8 -0
- package/directive/utils/index.d.ts +7 -0
- package/directive/utils/index.js +7 -0
- package/dom-check-in/index.d.ts +6 -0
- package/dom-check-in/index.js +8 -0
- package/dom-watcher/index.d.ts +25 -0
- package/dom-watcher/index.js +9 -0
- package/esm-map.json +146 -0
- package/hooks/popup-manager/use-zindex/index.d.ts +3 -0
- package/hooks/popup-manager/use-zindex/index.js +9 -0
- package/hooks/use-get-auth/apis.d.ts +4 -0
- package/hooks/use-get-auth/index.d.ts +9 -0
- package/hooks/use-get-auth/index.js +53 -0
- package/hooks/use-get-auth/index.js.gz +0 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/load-js/index.d.ts +3 -0
- package/load-js/index.js +12 -0
- package/nextTiken/index.d.ts +12 -0
- package/nextTiken/index.js +45 -0
- package/nextTiken/index.js.gz +0 -0
- package/oss/index.d.ts +2 -0
- package/oss/index.js +11 -0
- package/package.json +49 -0
- package/pinyin-first-character/index.d.ts +2 -0
- package/pinyin-first-character/index.js +25022 -0
- package/pinyin-first-character/index.js.gz +0 -0
- package/process-engine-info/index.d.ts +13 -0
- package/process-engine-info/index.js +15 -0
- package/pure-image-src/index.d.ts +2 -0
- package/pure-image-src/index.js +4 -0
- package/size-watcher/index.d.ts +6 -0
- package/size-watcher/index.js +20 -0
- package/style/index.d.ts +2 -0
- package/style/index.js +70 -0
- package/style/index.js.gz +0 -0
- package/style/math.d.ts +9 -0
- package/style/style.d.ts +31 -0
- package/token-tools/index.d.ts +21 -0
- package/token-tools/index.js +11 -0
- package/use-low-code/index.d.ts +1 -0
- package/use-low-code/index.js +69 -0
- package/use-low-code/index.js.gz +0 -0
- package/use-low-code/low-code-iframe.vue.d.ts +2 -0
- package/use-low-code/style.css +1 -0
- package/vue/hooks/use-model-value/index.d.ts +9 -0
- package/vue/hooks/use-model-value/index.js +10 -0
- package/vue/index.d.ts +1 -0
- package/vue/index.js +4 -0
- package/webSocket-service/index.d.ts +41 -0
- package/webSocket-service/index.js +83 -0
- package/webSocket-service/index.js.gz +0 -0
- package/webSocket-service/type.d.ts +28 -0
- package/with-install/index.d.ts +11 -0
- package/with-install/index.js +6 -0
|
Binary file
|
|
@@ -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,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,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
|
+
};
|
package/style/index.d.ts
ADDED
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
|
package/style/math.d.ts
ADDED
|
@@ -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 };
|
package/style/style.d.ts
ADDED
|
@@ -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 @@
|
|
|
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}
|
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,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
|
+
}
|