@das-fed/utils 1.0.4 → 1.0.6
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/api-services/src/create-service.js +669 -667
- package/common-info/index.js +63 -62
- package/common-tools/get-url-params.js +0 -1
- package/dimple-canvas/index.d.ts +2 -0
- package/dimple-canvas/index.js +5 -0
- package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.d.ts +28 -0
- package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js +19946 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/index.d.ts +53 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/index.js +119 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.d.ts +101 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.js +17 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.d.ts +7 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.js +55 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.d.ts +5 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.js +14 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.d.ts +4 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.js +5 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.d.ts +4 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.js +181 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.d.ts +3 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js +7374 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.d.ts +6 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.js +13 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.d.ts +3 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.js +7 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.d.ts +8 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.js +193 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.d.ts +10 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.js +20 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.d.ts +4 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.js +52 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.d.ts +2 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.js +14 -0
- package/dimple-canvas/use-dimple-canvas/index.d.ts +8 -0
- package/dimple-canvas/use-dimple-canvas/index.js +10 -0
- package/micro-app/globalData.d.ts +3 -0
- package/micro-app/globalData.js +11 -0
- package/micro-app/index.d.ts +5 -0
- package/micro-app/index.js +3699 -0
- package/nextTiken/index.d.ts +13 -0
- package/nextTiken/index.js +62 -0
- package/package.json +5 -6
- package/panel/index.d.ts +31 -0
- package/panel/index.js +37 -0
package/common-info/index.js
CHANGED
|
@@ -5,9 +5,9 @@ import { getUrlToken as m, getProjectInfoFromQuery as S } from "@das-fed/utils/c
|
|
|
5
5
|
/*! js-cookie v3.0.5 | MIT */
|
|
6
6
|
function g(e) {
|
|
7
7
|
for (var n = 1; n < arguments.length; n++) {
|
|
8
|
-
var
|
|
9
|
-
for (var s in
|
|
10
|
-
e[s] =
|
|
8
|
+
var r = arguments[n];
|
|
9
|
+
for (var s in r)
|
|
10
|
+
e[s] = r[s];
|
|
11
11
|
}
|
|
12
12
|
return e;
|
|
13
13
|
}
|
|
@@ -23,35 +23,35 @@ var b = {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
function I(e, n) {
|
|
26
|
-
function
|
|
26
|
+
function r(o, a, t) {
|
|
27
27
|
if (!(typeof document > "u")) {
|
|
28
|
-
|
|
28
|
+
t = g({}, n, t), typeof t.expires == "number" && (t.expires = new Date(Date.now() + t.expires * 864e5)), t.expires && (t.expires = t.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
29
29
|
var i = "";
|
|
30
|
-
for (var c in
|
|
31
|
-
|
|
30
|
+
for (var c in t)
|
|
31
|
+
t[c] && (i += "; " + c, t[c] !== !0 && (i += "=" + t[c].split(";")[0]));
|
|
32
32
|
return document.cookie = o + "=" + e.write(a, o) + i;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
function s(o) {
|
|
36
36
|
if (!(typeof document > "u" || arguments.length && !o)) {
|
|
37
|
-
for (var a = document.cookie ? document.cookie.split("; ") : [],
|
|
37
|
+
for (var a = document.cookie ? document.cookie.split("; ") : [], t = {}, i = 0; i < a.length; i++) {
|
|
38
38
|
var c = a[i].split("="), p = c.slice(1).join("=");
|
|
39
39
|
try {
|
|
40
40
|
var u = decodeURIComponent(c[0]);
|
|
41
|
-
if (
|
|
41
|
+
if (t[u] = e.read(p, u), o === u)
|
|
42
42
|
break;
|
|
43
43
|
} catch {
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
return o ?
|
|
46
|
+
return o ? t[o] : t;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
return Object.create(
|
|
50
50
|
{
|
|
51
|
-
set:
|
|
51
|
+
set: r,
|
|
52
52
|
get: s,
|
|
53
53
|
remove: function(o, a) {
|
|
54
|
-
|
|
54
|
+
r(
|
|
55
55
|
o,
|
|
56
56
|
"",
|
|
57
57
|
g({}, a, {
|
|
@@ -73,27 +73,28 @@ function I(e, n) {
|
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
var A = I(b, { path: "/" });
|
|
76
|
-
const h = () => A.get("accessToken") ?? "",
|
|
77
|
-
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
const h = () => A.get("accessToken") ?? "", w = () => {
|
|
77
|
+
var s;
|
|
78
|
+
let e = (s = l().getData()) == null ? void 0 : s.info;
|
|
79
|
+
const n = f();
|
|
80
|
+
return JSON.stringify(e) === "{}" && n.userInfo && (e = n.userInfo), {
|
|
81
|
+
id: e.sub ?? "",
|
|
82
|
+
name: e.name ?? "",
|
|
83
|
+
flag: e.flag,
|
|
84
|
+
tenantId: (e == null ? void 0 : e.tenant) ?? (e == null ? void 0 : e.tenantId) ?? ""
|
|
84
85
|
};
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return
|
|
89
|
-
id:
|
|
90
|
-
name:
|
|
91
|
-
phone:
|
|
92
|
-
userName:
|
|
93
|
-
email:
|
|
94
|
-
headPicture:
|
|
86
|
+
}, J = () => {
|
|
87
|
+
let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
|
|
88
|
+
const n = f();
|
|
89
|
+
return JSON.stringify(e) === "{}" && n.personalInfo && (e = n.personalInfo), {
|
|
90
|
+
id: e.id ?? "",
|
|
91
|
+
name: e.name ?? "",
|
|
92
|
+
phone: e.phone ?? "",
|
|
93
|
+
userName: e.userName ?? "",
|
|
94
|
+
email: e.email ?? "",
|
|
95
|
+
headPicture: e.headPicture ?? ""
|
|
95
96
|
};
|
|
96
|
-
},
|
|
97
|
+
}, j = () => {
|
|
97
98
|
let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
|
|
98
99
|
return {
|
|
99
100
|
userId: e.id ?? "",
|
|
@@ -104,25 +105,25 @@ const h = () => A.get("accessToken") ?? "", j = () => {
|
|
|
104
105
|
flag: e.flag ?? null,
|
|
105
106
|
tenant: e.tenant ?? {}
|
|
106
107
|
};
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return
|
|
111
|
-
id: (
|
|
112
|
-
parentId: (
|
|
113
|
-
name: (
|
|
114
|
-
tenantId: (
|
|
108
|
+
}, R = () => {
|
|
109
|
+
let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
|
|
110
|
+
const n = f();
|
|
111
|
+
return JSON.stringify(e) === "{}" && n.projectInfo && (e = n.projectInfo), {
|
|
112
|
+
id: (e == null ? void 0 : e.id) ?? "",
|
|
113
|
+
parentId: (e == null ? void 0 : e.parentId) ?? "",
|
|
114
|
+
name: (e == null ? void 0 : e.name) ?? "",
|
|
115
|
+
tenantId: (e == null ? void 0 : e.tenant) ?? ""
|
|
115
116
|
};
|
|
116
117
|
}, _ = (e, n) => {
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
118
|
+
const r = "permission-btn", s = f(), o = v(), a = d(location.href, "app") || "", t = n || a || (window.__IN_MICRO_APP__ ? o.currentSubAppCode : s.title);
|
|
119
|
+
if (!t)
|
|
119
120
|
return;
|
|
120
|
-
const i = d(location.href, "menu") || "", c = e || i || (window.__IN_MICRO_APP__ ? o.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${s.title}-tabs`) || "{}").currentTab.code), p = JSON.parse(sessionStorage.getItem(
|
|
121
|
+
const i = d(location.href, "menu") || "", c = e || i || (window.__IN_MICRO_APP__ ? o.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${s.title}-tabs`) || "{}").currentTab.code), p = JSON.parse(sessionStorage.getItem(r) || "{}");
|
|
121
122
|
if (!p || JSON.stringify(p) === "{}")
|
|
122
123
|
return;
|
|
123
|
-
const u = p[
|
|
124
|
-
return u && u.length ? u : p[
|
|
125
|
-
},
|
|
124
|
+
const u = p[t][c];
|
|
125
|
+
return u && u.length ? u : p[t]["origin-auth"] ? p[t]["origin-auth"][c] ?? [] : [];
|
|
126
|
+
}, U = (e, n) => _(e, n) ?? [], v = () => {
|
|
126
127
|
var s;
|
|
127
128
|
if (!window.__IN_MICRO_APP__)
|
|
128
129
|
return {};
|
|
@@ -134,25 +135,25 @@ const h = () => A.get("accessToken") ?? "", j = () => {
|
|
|
134
135
|
flatSubAppList: n,
|
|
135
136
|
subAppList: e.subAppList ?? []
|
|
136
137
|
};
|
|
137
|
-
},
|
|
138
|
+
}, M = (e) => {
|
|
138
139
|
const n = JSON.parse(sessionStorage.getItem("menus") || "{}");
|
|
139
140
|
return e ? n[e] ?? [] : n;
|
|
140
|
-
},
|
|
141
|
+
}, T = () => {
|
|
141
142
|
const e = f();
|
|
142
143
|
let n = {};
|
|
143
144
|
if (window.__IN_MICRO_APP__) {
|
|
144
|
-
const
|
|
145
|
+
const r = JSON.parse(sessionStorage.getItem("tabs") || "{}");
|
|
145
146
|
n = {
|
|
146
|
-
activeKey:
|
|
147
|
-
currentTab:
|
|
148
|
-
tabMap:
|
|
147
|
+
activeKey: r.activeKey ?? "",
|
|
148
|
+
currentTab: r.currentTab ?? {},
|
|
149
|
+
tabMap: r.tabMap ?? {}
|
|
149
150
|
};
|
|
150
151
|
} else {
|
|
151
|
-
const
|
|
152
|
+
const r = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
|
|
152
153
|
n = {
|
|
153
|
-
activeKey:
|
|
154
|
-
currentTab:
|
|
155
|
-
tabList:
|
|
154
|
+
activeKey: r.activeKey ?? "",
|
|
155
|
+
currentTab: r.currentTab ?? {},
|
|
156
|
+
tabList: r.tabList ?? []
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
159
|
return n;
|
|
@@ -163,15 +164,15 @@ const h = () => A.get("accessToken") ?? "", j = () => {
|
|
|
163
164
|
h() || m();
|
|
164
165
|
S();
|
|
165
166
|
export {
|
|
166
|
-
|
|
167
|
+
M as getMenus,
|
|
167
168
|
k as getMinioAddress,
|
|
168
169
|
_ as getPageAuth,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
U as getPageAuthBtn,
|
|
171
|
+
J as getPersonalInfo,
|
|
172
|
+
R as getProjectInfo,
|
|
172
173
|
v as getSubApps,
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
T as getTabInfo,
|
|
175
|
+
j as getTenantInfo,
|
|
175
176
|
h as getToken,
|
|
176
|
-
|
|
177
|
+
w as getUserInfo
|
|
177
178
|
};
|
|
@@ -20,7 +20,6 @@ const a = (r, n) => {
|
|
|
20
20
|
i === s.length - 1 ? t += `${l}=${n[l]}` : t += `${l}=${n[l]}&`;
|
|
21
21
|
}), t ? e = location.origin + r + `?${t}` : e = location.origin + r, e;
|
|
22
22
|
}, u = (r, n) => {
|
|
23
|
-
debugger;
|
|
24
23
|
const e = n || location.href, t = a(e), s = Object.keys(t) || [];
|
|
25
24
|
if (!s || !s.length)
|
|
26
25
|
return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Graph, Shape, Node } from '@antv/x6';
|
|
2
|
+
type ObjectTypeMap = {
|
|
3
|
+
Rect: typeof Shape.Rect;
|
|
4
|
+
Circle: typeof Shape.Circle;
|
|
5
|
+
Ellipse: typeof Shape.Ellipse;
|
|
6
|
+
Polygon: typeof Shape.Polygon;
|
|
7
|
+
Polyline: typeof Shape.Polyline;
|
|
8
|
+
Path: typeof Shape.Path;
|
|
9
|
+
Image: typeof Shape.Image;
|
|
10
|
+
HTML: typeof Shape.HTML;
|
|
11
|
+
BackgroundImage: null;
|
|
12
|
+
};
|
|
13
|
+
declare const useAntvX6: (initOptions?: Graph.Options) => {
|
|
14
|
+
canvasContainerEl: any;
|
|
15
|
+
init: (container: HTMLDivElement) => void;
|
|
16
|
+
waitInit: () => Promise<void>;
|
|
17
|
+
canvas: any;
|
|
18
|
+
onCanvasMounted: (cb: Function) => number;
|
|
19
|
+
addObject: <T extends keyof ObjectTypeMap>(type: T, metadata?: Node.Metadata & {
|
|
20
|
+
src?: string;
|
|
21
|
+
}, options?: Model.AddOptions) => Promise<typeof Node>;
|
|
22
|
+
removeObject: (key: string) => Promise<void>;
|
|
23
|
+
zoom: (type?: 'in' | 'out', radio?: number) => Promise<void>;
|
|
24
|
+
toJSON: () => Promise<any>;
|
|
25
|
+
loadJSON: (data: any) => Promise<any>;
|
|
26
|
+
remove: () => Promise<any>;
|
|
27
|
+
};
|
|
28
|
+
export { useAntvX6, Graph };
|