@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.
- package/__VLS_types.d.ts +124 -0
- package/api-services/modules/{file.d.ts → file/index.d.ts} +4 -4
- package/api-services/modules/{file.js → file/index.js} +18 -36
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/index.js.gz +0 -0
- package/atob/index.d.ts +2 -2
- package/common-info/{getIframeUrl.js → getIframeUrl/index.js} +1 -2
- package/common-info/getInfoFromUrl/index.js +84 -0
- package/common-info/getInfoFromUrl/index.js.gz +0 -0
- package/common-info/index.d.ts +1 -1
- package/common-info/index.js +2 -4
- package/common-info/index.js.gz +0 -0
- package/common-info/{set-personal-info.d.ts → set-personal-info/index.d.ts} +1 -1
- package/common-info/{set-personal-info.js → set-personal-info/index.js} +10 -24
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-info/type.d.ts +104 -0
- package/common-tools/{arr-tools.d.ts → arr-tools/index.d.ts} +1 -1
- package/common-tools/{date-format.js → date-format/index.js} +1 -2
- package/common-tools/{get-url-params.d.ts → get-url-params/index.d.ts} +1 -1
- package/common-tools/{get-url-params.js → get-url-params/index.js} +2 -4
- package/common-tools/get-url-params/index.js.gz +0 -0
- package/common-tools/{nest-tree-format.d.ts → nest-tree-format/index.d.ts} +1 -1
- package/common-tools/{nest-tree-format.js → nest-tree-format/index.js} +2 -4
- package/common-tools/obj-tools/index.js +14 -0
- package/common-tools/{platform-tools.js → platform-tools/index.js} +1 -2
- package/common-tools/{queue-promise.d.ts → queue-promise/index.d.ts} +1 -1
- package/common-tools/setHtmlMinWH/index.d.ts +5 -0
- package/common-tools/update-fav-icon/index.d.ts +11 -0
- package/common-tools/update-fav-icon/index.js +21 -0
- package/create-api-service/index.js +255 -295
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/{sso.d.ts → sso/index.d.ts} +5 -5
- package/create-api-service/{sso.js → sso/index.js} +421 -444
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/index.js +1626 -4809
- package/curring-http/index.js.gz +0 -0
- package/curring-http/type.d.ts +89 -0
- package/directive/{auth.js → auth/index.js} +2 -4
- package/directive/auth/index.js.gz +0 -0
- package/dom-check-in/index.js +5 -5
- package/dom-watcher/index.d.ts +1 -1
- package/esm-map.json +8 -0
- package/hooks/use-get-auth/index.d.ts +3 -3
- package/hooks/use-get-auth/index.js +4 -8
- package/hooks/use-get-auth/index.js.gz +0 -0
- package/load-js/index.d.ts +1 -1
- package/load-js/index.js +1 -2
- package/nextTiken/index.js +5 -10
- package/nextTiken/index.js.gz +0 -0
- package/oss/index.d.ts +1 -1
- package/oss/index.js +1 -2
- package/package.json +8 -3
- package/pinyin-first-character/index.js +45 -50
- package/pinyin-first-character/index.js.gz +0 -0
- package/style/index.js +5 -9
- package/style/index.js.gz +0 -0
- package/style/style.d.ts +3 -3
- package/token-tools/index.d.ts +1 -1
- package/token-tools/index.js.gz +0 -0
- package/use-low-code/index.js +1 -2
- package/use-low-code/index.js.gz +0 -0
- package/vue/hooks/{use-model-value.d.ts → use-model-value/index.d.ts} +2 -0
- package/webSocket-service/index.js +41 -52
- package/webSocket-service/index.js.gz +0 -0
- package/webSocket-service/type.d.ts +28 -0
- package/with-install/index.d.ts +1 -1
- package/common-info/getInfoFromUrl.js +0 -85
- package/common-tools/obj-tools.js +0 -20
- package/common-tools/setHtmlMinWH.d.ts +0 -5
- package/common-tools/update-fav-icon.d.ts +0 -10
- package/common-tools/update-fav-icon.js +0 -22
- package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.d.ts +0 -29
- package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js +0 -19925
- package/dimple-canvas/use-dimple-canvas/core/konva/index.d.ts +0 -54
- package/dimple-canvas/use-dimple-canvas/core/konva/index.js +0 -119
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.d.ts +0 -101
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.js +0 -17
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.d.ts +0 -8
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.js +0 -55
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.d.ts +0 -5
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.js +0 -14
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.d.ts +0 -5
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.js +0 -5
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.d.ts +0 -5
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.js +0 -181
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.d.ts +0 -4
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js +0 -7402
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.d.ts +0 -6
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.js +0 -13
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.d.ts +0 -4
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.js +0 -7
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.d.ts +0 -8
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.js +0 -193
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.d.ts +0 -11
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.js +0 -20
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.d.ts +0 -5
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.js +0 -52
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.d.ts +0 -2
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.js +0 -14
- package/dimple-canvas/use-dimple-canvas/index.d.ts +0 -9
- package/dimple-canvas/use-dimple-canvas/index.js +0 -10
- package/hooks/use-get-auth/apis.js +0 -8
- package/style/math.js +0 -17
- package/style/style.js +0 -61
- /package/api-services/modules/{app-manage.d.ts → app-manage/index.d.ts} +0 -0
- /package/api-services/modules/{app-manage.js → app-manage/index.js} +0 -0
- /package/api-services/modules/{authentication.d.ts → authentication/index.d.ts} +0 -0
- /package/api-services/modules/{authentication.js → authentication/index.js} +0 -0
- /package/api-services/modules/{bems.d.ts → bems/index.d.ts} +0 -0
- /package/api-services/modules/{bems.js → bems/index.js} +0 -0
- /package/api-services/modules/{contract.d.ts → contract/index.d.ts} +0 -0
- /package/api-services/modules/{contract.js → contract/index.js} +0 -0
- /package/api-services/modules/{duty-manage.d.ts → duty-manage/index.d.ts} +0 -0
- /package/api-services/modules/{duty-manage.js → duty-manage/index.js} +0 -0
- /package/api-services/modules/{enterpriseright.d.ts → enterpriseright/index.d.ts} +0 -0
- /package/api-services/modules/{enterpriseright.js → enterpriseright/index.js} +0 -0
- /package/api-services/modules/{gateway-edge.d.ts → gateway-edge/index.d.ts} +0 -0
- /package/api-services/modules/{gateway-edge.js → gateway-edge/index.js} +0 -0
- /package/api-services/modules/{iot.d.ts → iot/index.d.ts} +0 -0
- /package/api-services/modules/{iot.js → iot/index.js} +0 -0
- /package/api-services/modules/{justauth.d.ts → justauth/index.d.ts} +0 -0
- /package/api-services/modules/{justauth.js → justauth/index.js} +0 -0
- /package/api-services/modules/{knowledge.d.ts → knowledge/index.d.ts} +0 -0
- /package/api-services/modules/{knowledge.js → knowledge/index.js} +0 -0
- /package/api-services/modules/{link.d.ts → link/index.d.ts} +0 -0
- /package/api-services/modules/{link.js → link/index.js} +0 -0
- /package/api-services/modules/{permission.d.ts → permission/index.d.ts} +0 -0
- /package/api-services/modules/{permission.js → permission/index.js} +0 -0
- /package/api-services/modules/{platformManage.d.ts → platformManage/index.d.ts} +0 -0
- /package/api-services/modules/{platformManage.js → platformManage/index.js} +0 -0
- /package/api-services/modules/{portal.d.ts → portal/index.d.ts} +0 -0
- /package/api-services/modules/{portal.js → portal/index.js} +0 -0
- /package/api-services/modules/{space-manage.d.ts → space-manage/index.d.ts} +0 -0
- /package/api-services/modules/{space-manage.js → space-manage/index.js} +0 -0
- /package/api-services/modules/{super-admin.d.ts → super-admin/index.d.ts} +0 -0
- /package/api-services/modules/{super-admin.js → super-admin/index.js} +0 -0
- /package/api-services/modules/{supplier.d.ts → supplier/index.d.ts} +0 -0
- /package/api-services/modules/{supplier.js → supplier/index.js} +0 -0
- /package/api-services/modules/{supplychain-manage.d.ts → supplychain-manage/index.d.ts} +0 -0
- /package/api-services/modules/{supplychain-manage.js → supplychain-manage/index.js} +0 -0
- /package/api-services/modules/{systemConfiguration.d.ts → systemConfiguration/index.d.ts} +0 -0
- /package/api-services/modules/{systemConfiguration.js → systemConfiguration/index.js} +0 -0
- /package/api-services/modules/{tool.d.ts → tool/index.d.ts} +0 -0
- /package/api-services/modules/{tool.js → tool/index.js} +0 -0
- /package/api-services/src/{create-service.d.ts → create-service/index.d.ts} +0 -0
- /package/api-services/src/{create-service.js → create-service/index.js} +0 -0
- /package/common-info/{getIframeUrl.d.ts → getIframeUrl/index.d.ts} +0 -0
- /package/common-info/{getInfoFromUrl.d.ts → getInfoFromUrl/index.d.ts} +0 -0
- /package/common-tools/{arr-tools.js → arr-tools/index.js} +0 -0
- /package/common-tools/{date-format.d.ts → date-format/index.d.ts} +0 -0
- /package/common-tools/{handle-data.d.ts → handle-data/index.d.ts} +0 -0
- /package/common-tools/{handle-data.js → handle-data/index.js} +0 -0
- /package/common-tools/{obj-tools.d.ts → obj-tools/index.d.ts} +0 -0
- /package/common-tools/{platform-tools.d.ts → platform-tools/index.d.ts} +0 -0
- /package/common-tools/{queue-promise.js → queue-promise/index.js} +0 -0
- /package/common-tools/{setHtmlMinWH.js → setHtmlMinWH/index.js} +0 -0
- /package/create-api-service/{proxy-sso.d.ts → proxy-sso/index.d.ts} +0 -0
- /package/create-api-service/{proxy-sso.js → proxy-sso/index.js} +0 -0
- /package/directive/{auth.d.ts → auth/index.d.ts} +0 -0
- /package/directive/{clickOutside.d.ts → clickOutside/index.d.ts} +0 -0
- /package/directive/{clickOutside.js → clickOutside/index.js} +0 -0
- /package/directive/{hoverInside.d.ts → hoverInside/index.d.ts} +0 -0
- /package/directive/{hoverInside.js → hoverInside/index.js} +0 -0
- /package/directive/{utils.d.ts → utils/index.d.ts} +0 -0
- /package/directive/{utils.js → utils/index.js} +0 -0
- /package/hooks/popup-manager/{use-zindex.d.ts → use-zindex/index.d.ts} +0 -0
- /package/hooks/popup-manager/{use-zindex.js → use-zindex/index.js} +0 -0
- /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.
|
|
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
|
-
|
|
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) =>
|
|
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?: {}) =>
|
|
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) =>
|
|
24
|
+
declare const createStyle: (id: string, data: any) => any;
|
|
25
25
|
/**
|
|
26
26
|
* 修改指定样式表
|
|
27
27
|
* @param id 样式表id
|
package/token-tools/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const getAccessToken: () => string;
|
|
|
6
6
|
/**
|
|
7
7
|
* 获取tokenInfo相关信息
|
|
8
8
|
*/
|
|
9
|
-
export declare const getAccessTokenInfo: (key:
|
|
9
|
+
export declare const getAccessTokenInfo: (key: "accessTokenExpiredAt" | "refreshToken" | "redirectUri") => any;
|
|
10
10
|
/**
|
|
11
11
|
* 存入token、tokenInfo
|
|
12
12
|
* @param token
|
|
Binary file
|
package/use-low-code/index.js
CHANGED
|
@@ -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,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
|
|
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
|
-
},
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
},
|
|
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:
|
|
14
|
-
params:
|
|
15
|
-
opened:
|
|
16
|
-
close:
|
|
17
|
-
error:
|
|
18
|
-
message:
|
|
19
|
-
ifReconnect:
|
|
20
|
-
reconnectNum:
|
|
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 =
|
|
24
|
-
this.url =
|
|
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
|
-
|
|
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
|
-
|
|
32
|
-
|
|
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 = (
|
|
36
|
-
this.close(
|
|
37
|
-
}, this.$ws.onmessage = (
|
|
38
|
-
this.message(
|
|
39
|
-
}, this.$ws.onerror = (
|
|
40
|
-
this.error(
|
|
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()
|
|
43
|
+
this.currentReconnectNum = 0, this.startTime = (/* @__PURE__ */ new Date()).getTime(), this.opened(this.$ws), this.startHeartbeat();
|
|
45
44
|
}
|
|
46
|
-
opened(
|
|
47
|
-
console.log(this.url + " =>websocket连接已打开:", e);
|
|
45
|
+
opened(t) {
|
|
48
46
|
}
|
|
49
|
-
close(
|
|
50
|
-
|
|
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(
|
|
56
|
-
const
|
|
57
|
-
this.afterMsg(
|
|
50
|
+
message(t) {
|
|
51
|
+
const e = typeof t.data == "object" ? t.data : JSON.parse(t.data);
|
|
52
|
+
this.afterMsg(e);
|
|
58
53
|
}
|
|
59
|
-
afterMsg(
|
|
60
|
-
console.log(this.url + " =>接收到websocket的消息:", e);
|
|
54
|
+
afterMsg(t) {
|
|
61
55
|
}
|
|
62
|
-
error(
|
|
63
|
-
return this.ifReconnect && this.reconnect(),
|
|
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(
|
|
73
|
-
var
|
|
74
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
}, g(3e4, 3e5));
|
|
73
|
+
this.send("");
|
|
74
|
+
}, p(3e4, 3e5));
|
|
86
75
|
}
|
|
87
76
|
/** 断开连接 */
|
|
88
77
|
disconnect() {
|
|
89
|
-
this.$ws.close()
|
|
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
|
+
}
|
package/with-install/index.d.ts
CHANGED
|
@@ -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,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 };
|