@das-fed/utils 1.0.1 → 1.0.3
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/index.d.ts +1 -0
- package/api-services/index.js +3 -19845
- package/api-services/modules/app-manage.d.ts +2 -0
- package/api-services/modules/app-manage.js +5 -6
- package/api-services/modules/authentication.d.ts +2 -0
- package/api-services/modules/authentication.js +5 -6
- package/api-services/modules/bems.d.ts +6 -0
- package/api-services/modules/bems.js +8 -10
- package/api-services/modules/contract.d.ts +2 -0
- package/api-services/modules/contract.js +5 -6
- package/api-services/modules/duty-manage.d.ts +7 -0
- package/api-services/modules/duty-manage.js +9 -10
- package/api-services/modules/enterpriseright.d.ts +2 -0
- package/api-services/modules/enterpriseright.js +5 -6
- package/api-services/modules/file.d.ts +36 -0
- package/api-services/modules/file.js +449 -354
- package/api-services/modules/gateway-edge.d.ts +2 -0
- package/api-services/modules/gateway-edge.js +5 -6
- package/api-services/modules/index.d.ts +21 -0
- package/api-services/modules/index.js +501 -435
- package/api-services/modules/iot.d.ts +15 -0
- package/api-services/modules/iot.js +17 -18
- package/api-services/modules/justauth.d.ts +3 -0
- package/api-services/modules/justauth.js +6 -7
- package/api-services/modules/knowledge.d.ts +2 -0
- package/api-services/modules/knowledge.js +5 -6
- package/api-services/modules/link.d.ts +2 -0
- package/api-services/modules/link.js +5 -6
- package/api-services/modules/permission.d.ts +2 -0
- package/api-services/modules/permission.js +5 -6
- package/api-services/modules/platformManage.d.ts +14 -0
- package/api-services/modules/platformManage.js +12 -13
- package/api-services/modules/portal.d.ts +2 -0
- package/api-services/modules/portal.js +5 -6
- package/api-services/modules/space-manage.d.ts +2 -0
- package/api-services/modules/space-manage.js +5 -6
- package/api-services/modules/super-admin.d.ts +8 -0
- package/api-services/modules/super-admin.js +8 -9
- package/api-services/modules/supplier.d.ts +6 -0
- package/api-services/modules/supplier.js +7 -8
- package/api-services/modules/supplychain-manage.d.ts +2 -0
- package/api-services/modules/supplychain-manage.js +5 -6
- package/api-services/modules/systemConfiguration.d.ts +2 -0
- package/api-services/modules/systemConfiguration.js +5 -6
- package/api-services/modules/tool.d.ts +2 -0
- package/api-services/modules/tool.js +5 -6
- package/api-services/src/create-service.d.ts +2 -0
- package/api-services/src/create-service.js +3119 -19726
- package/api-services/src/sso.d.ts +29 -0
- package/api-services/src/sso.js +1547 -156
- package/api-services/src/util.d.ts +1 -0
- package/api-services/src/util.js +1462 -19
- package/atob/index.d.ts +2 -0
- package/atob/index.js +9 -10
- package/common-info/getIframeUrl.d.ts +9 -0
- package/common-info/getIframeUrl.js +9 -11
- package/common-info/index.d.ts +42 -0
- package/common-info/index.js +138 -272
- package/common-info/setInfoFromUrl.d.ts +8 -0
- package/common-info/setInfoFromUrl.js +60 -128
- package/common-tools/arr-tools.d.ts +15 -0
- package/common-tools/arr-tools.js +6 -13
- package/common-tools/date-format.d.ts +7 -0
- package/common-tools/date-format.js +18 -21
- package/common-tools/get-url-params.d.ts +33 -0
- package/common-tools/get-url-params.js +48 -88
- package/common-tools/handle-data.d.ts +6 -0
- package/common-tools/handle-data.js +3 -4
- package/common-tools/index.d.ts +7 -0
- package/common-tools/index.js +7 -213
- package/common-tools/nest-tree-format.d.ts +30 -0
- package/common-tools/nest-tree-format.js +22 -49
- package/common-tools/obj-tools.d.ts +7 -0
- package/common-tools/obj-tools.js +17 -18
- package/common-tools/setHtmlMinWH.d.ts +5 -0
- package/common-tools/setHtmlMinWH.js +6 -10
- package/common-tools/throttled.d.ts +7 -0
- package/common-tools/throttled.js +7 -16
- package/config/index.d.ts +2 -0
- package/config/index.js +8 -25
- package/curring-http/index.d.ts +11 -0
- package/curring-http/index.js +5150 -17289
- package/directive/auth.d.ts +8 -0
- package/directive/auth.js +54 -104
- package/directive/clickOutside.d.ts +5 -0
- package/directive/clickOutside.js +23 -49
- package/directive/hoverInside.d.ts +5 -0
- package/directive/hoverInside.js +16 -35
- package/directive/index.d.ts +3 -0
- package/directive/index.js +7 -182
- package/directive/utils.d.ts +7 -0
- package/directive/utils.js +6 -11
- package/dom-check-in/index.d.ts +6 -0
- package/dom-check-in/index.js +7 -15
- package/dom-watcher/index.d.ts +25 -0
- package/dom-watcher/index.js +7 -8
- package/hooks/popup-manager/use-zindex.d.ts +5 -0
- package/hooks/popup-manager/use-zindex.js +17 -36
- package/index.d.ts +2 -0
- package/index.js +2 -215
- package/load-js/index.d.ts +3 -0
- package/load-js/index.js +10 -20
- package/oss/index.d.ts +2 -0
- package/oss/index.js +11 -15
- package/package.json +8 -13
- package/pinyin-first-character/index.d.ts +2 -0
- package/pinyin-first-character/index.js +25011 -12217
- package/process-engine-info/index.d.ts +10 -0
- package/process-engine-info/index.js +8 -10
- package/pure-image-src/index.d.ts +2 -0
- package/pure-image-src/index.js +3 -29
- package/set-personal-info/index.d.ts +5 -0
- package/set-personal-info/index.js +1460 -16
- package/size-watcher/index.d.ts +6 -0
- package/size-watcher/index.js +17 -24
- package/style/index.d.ts +2 -0
- package/style/index.js +62 -103
- package/style/math.d.ts +9 -0
- package/style/math.js +16 -31
- package/style/style.d.ts +30 -0
- package/style/style.js +49 -72
- package/token-tools/index.d.ts +18 -0
- package/token-tools/index.js +72 -149
- package/vue/hooks/use-model-value.d.ts +3 -0
- package/vue/hooks/use-model-value.js +9 -10
- package/vue/index.d.ts +1 -0
- package/vue/index.js +3 -10
- package/webSocket-service/index.d.ts +40 -0
- package/webSocket-service/index.js +62 -138
- package/with-install/index.d.ts +10 -0
- package/with-install/index.js +5 -7
package/atob/index.d.ts
ADDED
package/atob/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const n = (t) => {
|
|
2
|
+
var e = encodeURIComponent(t);
|
|
3
|
+
return e = btoa(e), e;
|
|
4
|
+
}, o = (t) => {
|
|
5
|
+
var e = atob(t);
|
|
6
|
+
return e = decodeURIComponent(e), e;
|
|
5
7
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return decStr;
|
|
8
|
+
export {
|
|
9
|
+
o as decrypt,
|
|
10
|
+
n as encryption
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
-
export { decrypt, encryption };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type pageType = 'editor' | 'editor3d' | 'editor2d3d' | 'preview' | 'preview3d';
|
|
2
|
+
/**
|
|
3
|
+
* 编辑器的路径和预览图纸的路径
|
|
4
|
+
* @param page 'editor' | 'editor3d' | 'editor2d3d' | 'preview' | 'preview3d'
|
|
5
|
+
* @param query 路由参数location.search
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const getIframeUrl: (page: pageType, query?: Record<any, any>) => any;
|
|
9
|
+
export {};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { getFullPath } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (!page)
|
|
1
|
+
import { getFullPath as n } from "@das-fed/utils/common-tools";
|
|
2
|
+
const l = (r, t) => {
|
|
3
|
+
if (!r)
|
|
5
4
|
return;
|
|
6
|
-
let
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
let e = {};
|
|
6
|
+
const i = "enterpriseadmin/iocvisual";
|
|
7
|
+
return (r === "preview" || r === "preview3d") && (e = { showLayout: !1 }), n("/" + i + "/" + r, { ...e, ...t });
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
l as getIframeUrl
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
export { getIframeUrl };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { UserInfo, PersonalInfo, TenantInfo, ProjectInfo, SubAppsInfo, TabInfo, permissionBtnInfo } from './type';
|
|
2
|
+
/** 获取token */
|
|
3
|
+
export declare const getToken: () => string;
|
|
4
|
+
/** 获取token详情 */
|
|
5
|
+
export declare const getUserInfo: () => UserInfo;
|
|
6
|
+
/** 获取用户详情 */
|
|
7
|
+
export declare const getPersonalInfo: () => PersonalInfo;
|
|
8
|
+
/** 获取当前租户详情 */
|
|
9
|
+
export declare const getTenantInfo: () => TenantInfo;
|
|
10
|
+
/**
|
|
11
|
+
* 获取项目信息
|
|
12
|
+
* @returns 项目信息
|
|
13
|
+
*/
|
|
14
|
+
export declare const getProjectInfo: () => ProjectInfo;
|
|
15
|
+
/**
|
|
16
|
+
* 可用于判断菜单或者按钮权限
|
|
17
|
+
* @param menuCode 菜单编码
|
|
18
|
+
* @param applicationCode 应用编码
|
|
19
|
+
* @returns undefined(无菜单权限);空数组(无按钮权限)
|
|
20
|
+
*/
|
|
21
|
+
export declare const getPageAuth: (menuCode?: string, applicationCode?: string) => any;
|
|
22
|
+
/**
|
|
23
|
+
* 获取指定菜单的按钮权限数据
|
|
24
|
+
* @param menuCode 菜单编码
|
|
25
|
+
* @param applicationCode 应用编码
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export declare const getPageAuthBtn: (menuCode?: string, applicationCode?: string) => permissionBtnInfo;
|
|
29
|
+
/**
|
|
30
|
+
* 获取应用信息(独立打开子应用不可用)
|
|
31
|
+
* @returns 应用信息
|
|
32
|
+
*/
|
|
33
|
+
export declare const getSubApps: () => SubAppsInfo;
|
|
34
|
+
/**
|
|
35
|
+
* 获取菜单
|
|
36
|
+
* @param appCode 应用编码
|
|
37
|
+
*/
|
|
38
|
+
export declare const getMenus: (appCode?: string) => any;
|
|
39
|
+
/** 获取tabs标签页信息 */
|
|
40
|
+
export declare const getTabInfo: () => TabInfo;
|
|
41
|
+
/** 获取minio地址 */
|
|
42
|
+
export declare const getMinioAddress: () => any;
|
package/common-info/index.js
CHANGED
|
@@ -1,311 +1,177 @@
|
|
|
1
|
-
import { tokenStorage } from
|
|
2
|
-
import { getConfig } from
|
|
3
|
-
import { getUrlParams } from
|
|
4
|
-
|
|
1
|
+
import { tokenStorage as l } from "@das-fed/utils/api-services/src/sso";
|
|
2
|
+
import { getConfig as f } from "@das-fed/utils/config";
|
|
3
|
+
import { getUrlParams as d } from "@das-fed/utils/common-tools";
|
|
4
|
+
import { getUrlToken as m, getProjectInfoFromQuery as S } from "@das-fed/utils/common-info/setInfoFromUrl";
|
|
5
5
|
/*! js-cookie v3.0.5 | MIT */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
target[key] = source[key];
|
|
12
|
-
}
|
|
6
|
+
function g(e) {
|
|
7
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
8
|
+
var t = arguments[n];
|
|
9
|
+
for (var s in t)
|
|
10
|
+
e[s] = t[s];
|
|
13
11
|
}
|
|
14
|
-
return
|
|
12
|
+
return e;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var defaultConverter = {
|
|
20
|
-
read: function (value) {
|
|
21
|
-
if (value[0] === '"') {
|
|
22
|
-
value = value.slice(1, -1);
|
|
23
|
-
}
|
|
24
|
-
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
|
|
14
|
+
var b = {
|
|
15
|
+
read: function(e) {
|
|
16
|
+
return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
25
17
|
},
|
|
26
|
-
write: function
|
|
27
|
-
return encodeURIComponent(
|
|
18
|
+
write: function(e) {
|
|
19
|
+
return encodeURIComponent(e).replace(
|
|
28
20
|
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
29
21
|
decodeURIComponent
|
|
30
|
-
)
|
|
22
|
+
);
|
|
31
23
|
}
|
|
32
24
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
attributes = assign({}, defaultAttributes, attributes);
|
|
44
|
-
|
|
45
|
-
if (typeof attributes.expires === 'number') {
|
|
46
|
-
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
47
|
-
}
|
|
48
|
-
if (attributes.expires) {
|
|
49
|
-
attributes.expires = attributes.expires.toUTCString();
|
|
25
|
+
function I(e, n) {
|
|
26
|
+
function t(o, a, r) {
|
|
27
|
+
if (!(typeof document > "u")) {
|
|
28
|
+
r = g({}, 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);
|
|
29
|
+
var i = "";
|
|
30
|
+
for (var c in r)
|
|
31
|
+
r[c] && (i += "; " + c, r[c] !== !0 && (i += "=" + r[c].split(";")[0]));
|
|
32
|
+
return document.cookie = o + "=" + e.write(a, o) + i;
|
|
50
33
|
}
|
|
51
|
-
|
|
52
|
-
name = encodeURIComponent(name)
|
|
53
|
-
.replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
|
|
54
|
-
.replace(/[()]/g, escape);
|
|
55
|
-
|
|
56
|
-
var stringifiedAttributes = '';
|
|
57
|
-
for (var attributeName in attributes) {
|
|
58
|
-
if (!attributes[attributeName]) {
|
|
59
|
-
continue
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
stringifiedAttributes += '; ' + attributeName;
|
|
63
|
-
|
|
64
|
-
if (attributes[attributeName] === true) {
|
|
65
|
-
continue
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Considers RFC 6265 section 5.2:
|
|
69
|
-
// ...
|
|
70
|
-
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
|
71
|
-
// character:
|
|
72
|
-
// Consume the characters of the unparsed-attributes up to,
|
|
73
|
-
// not including, the first %x3B (";") character.
|
|
74
|
-
// ...
|
|
75
|
-
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return (document.cookie =
|
|
79
|
-
name + '=' + converter.write(value, name) + stringifiedAttributes)
|
|
80
34
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var jar = {};
|
|
91
|
-
for (var i = 0; i < cookies.length; i++) {
|
|
92
|
-
var parts = cookies[i].split('=');
|
|
93
|
-
var value = parts.slice(1).join('=');
|
|
94
|
-
|
|
95
|
-
try {
|
|
96
|
-
var found = decodeURIComponent(parts[0]);
|
|
97
|
-
jar[found] = converter.read(value, found);
|
|
98
|
-
|
|
99
|
-
if (name === found) {
|
|
100
|
-
break
|
|
35
|
+
function s(o) {
|
|
36
|
+
if (!(typeof document > "u" || arguments.length && !o)) {
|
|
37
|
+
for (var a = document.cookie ? document.cookie.split("; ") : [], r = {}, i = 0; i < a.length; i++) {
|
|
38
|
+
var c = a[i].split("="), p = c.slice(1).join("=");
|
|
39
|
+
try {
|
|
40
|
+
var u = decodeURIComponent(c[0]);
|
|
41
|
+
if (r[u] = e.read(p, u), o === u)
|
|
42
|
+
break;
|
|
43
|
+
} catch {
|
|
101
44
|
}
|
|
102
|
-
}
|
|
45
|
+
}
|
|
46
|
+
return o ? r[o] : r;
|
|
103
47
|
}
|
|
104
|
-
|
|
105
|
-
return name ? jar[name] : jar
|
|
106
48
|
}
|
|
107
|
-
|
|
108
49
|
return Object.create(
|
|
109
50
|
{
|
|
110
|
-
set,
|
|
111
|
-
get,
|
|
112
|
-
remove: function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
51
|
+
set: t,
|
|
52
|
+
get: s,
|
|
53
|
+
remove: function(o, a) {
|
|
54
|
+
t(
|
|
55
|
+
o,
|
|
56
|
+
"",
|
|
57
|
+
g({}, a, {
|
|
117
58
|
expires: -1
|
|
118
59
|
})
|
|
119
60
|
);
|
|
120
61
|
},
|
|
121
|
-
withAttributes: function
|
|
122
|
-
return
|
|
62
|
+
withAttributes: function(o) {
|
|
63
|
+
return I(this.converter, g({}, this.attributes, o));
|
|
123
64
|
},
|
|
124
|
-
withConverter: function
|
|
125
|
-
return
|
|
65
|
+
withConverter: function(o) {
|
|
66
|
+
return I(g({}, this.converter, o), this.attributes);
|
|
126
67
|
}
|
|
127
68
|
},
|
|
128
69
|
{
|
|
129
|
-
attributes: { value: Object.freeze(
|
|
130
|
-
converter: { value: Object.freeze(
|
|
70
|
+
attributes: { value: Object.freeze(n) },
|
|
71
|
+
converter: { value: Object.freeze(e) }
|
|
131
72
|
}
|
|
132
|
-
)
|
|
73
|
+
);
|
|
133
74
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
sessionStorage.setItem("tokenInfo", tokenInfo);
|
|
144
|
-
api.set("accessToken", token);
|
|
145
|
-
api.set("accessTokenInfo", tokenInfo);
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
const getProjectInfoFromQuery = () => {
|
|
149
|
-
const preProject = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
|
|
150
|
-
const search = new URL(location.href).searchParams;
|
|
151
|
-
const id = search.get("project") || search.get("projectId") || "";
|
|
152
|
-
if (!id)
|
|
153
|
-
return;
|
|
154
|
-
const parentId = search.get("projectParent") || search.get("projectParentId") || preProject?.parentId || "";
|
|
155
|
-
const name = search.get("projectName") || preProject?.name || "";
|
|
156
|
-
sessionStorage.setItem("project", id);
|
|
157
|
-
sessionStorage.setItem("projectInfo", JSON.stringify({ ...preProject, id, name, parentId }));
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
const isDev = import.meta.env.DEV;
|
|
161
|
-
const getToken = () => {
|
|
162
|
-
return api.get("accessToken") ?? "";
|
|
163
|
-
};
|
|
164
|
-
const getUserInfo = () => {
|
|
165
|
-
const config = getConfig();
|
|
166
|
-
const infoStrict = config?.infoStrict ?? true;
|
|
167
|
-
let info = tokenStorage().getData().info;
|
|
168
|
-
if (infoStrict) {
|
|
169
|
-
if (isDev && config.userInfo)
|
|
170
|
-
info = config.userInfo;
|
|
171
|
-
} else {
|
|
172
|
-
if (config.userInfo)
|
|
173
|
-
info = config.userInfo;
|
|
174
|
-
}
|
|
175
|
-
const userInfo = {
|
|
176
|
-
id: info.sub ?? "",
|
|
177
|
-
name: info.name ?? "",
|
|
178
|
-
flag: info.flag,
|
|
179
|
-
tenantId: info?.tenant ?? info?.tenantId ?? ""
|
|
75
|
+
var A = I(b, { path: "/" });
|
|
76
|
+
const h = () => A.get("accessToken") ?? "", j = () => {
|
|
77
|
+
const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
|
|
78
|
+
let t = l().getData().info;
|
|
79
|
+
return n || e.userInfo && (t = e.userInfo), {
|
|
80
|
+
id: t.sub ?? "",
|
|
81
|
+
name: t.name ?? "",
|
|
82
|
+
flag: t.flag,
|
|
83
|
+
tenantId: (t == null ? void 0 : t.tenant) ?? (t == null ? void 0 : t.tenantId) ?? ""
|
|
180
84
|
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
if (config.personalInfo)
|
|
192
|
-
info = config.personalInfo;
|
|
193
|
-
}
|
|
194
|
-
const personalInfo = {
|
|
195
|
-
id: info.id ?? "",
|
|
196
|
-
name: info.name ?? "",
|
|
197
|
-
phone: info.phone ?? "",
|
|
198
|
-
userName: info.userName ?? "",
|
|
199
|
-
email: info.email ?? "",
|
|
200
|
-
headPicture: info.headPicture ?? ""
|
|
85
|
+
}, y = () => {
|
|
86
|
+
const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
|
|
87
|
+
let t = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
|
|
88
|
+
return n || e.personalInfo && (t = e.personalInfo), {
|
|
89
|
+
id: t.id ?? "",
|
|
90
|
+
name: t.name ?? "",
|
|
91
|
+
phone: t.phone ?? "",
|
|
92
|
+
userName: t.userName ?? "",
|
|
93
|
+
email: t.email ?? "",
|
|
94
|
+
headPicture: t.headPicture ?? ""
|
|
201
95
|
};
|
|
202
|
-
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
flag: info.flag ?? null,
|
|
213
|
-
tenant: info.tenant ?? {}
|
|
96
|
+
}, R = () => {
|
|
97
|
+
let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
|
|
98
|
+
return {
|
|
99
|
+
userId: e.id ?? "",
|
|
100
|
+
userName: e.userName ?? "",
|
|
101
|
+
name: e.name ?? "",
|
|
102
|
+
areaCode: e.areaCode ?? "",
|
|
103
|
+
phone: e.phone ?? "",
|
|
104
|
+
flag: e.flag ?? null,
|
|
105
|
+
tenant: e.tenant ?? {}
|
|
214
106
|
};
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
info = config.projectInfo;
|
|
224
|
-
} else {
|
|
225
|
-
if (config.projectInfo)
|
|
226
|
-
info = config.projectInfo;
|
|
227
|
-
}
|
|
228
|
-
const projectInfo = {
|
|
229
|
-
id: info?.id ?? "",
|
|
230
|
-
parentId: info?.parentId ?? "",
|
|
231
|
-
name: info?.name ?? "",
|
|
232
|
-
tenantId: info?.tenant ?? ""
|
|
107
|
+
}, U = () => {
|
|
108
|
+
const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
|
|
109
|
+
let t = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
|
|
110
|
+
return n || e.projectInfo && (t = e.projectInfo), {
|
|
111
|
+
id: (t == null ? void 0 : t.id) ?? "",
|
|
112
|
+
parentId: (t == null ? void 0 : t.parentId) ?? "",
|
|
113
|
+
name: (t == null ? void 0 : t.name) ?? "",
|
|
114
|
+
tenantId: (t == null ? void 0 : t.tenant) ?? ""
|
|
233
115
|
};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const realMenuCode = menuCode ? menuCode : urlMenu ? urlMenu : window.__IN_MICRO_APP__ ? subApps.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${config.title}-tabs`) || "{}").currentTab.code;
|
|
246
|
-
const btnInfo = JSON.parse(sessionStorage.getItem(KEY) || "{}");
|
|
247
|
-
if (!btnInfo || JSON.stringify(btnInfo) === "{}")
|
|
248
|
-
return void 0;
|
|
249
|
-
const btnList = btnInfo[realApplicationCode][realMenuCode];
|
|
250
|
-
if (btnList && btnList.length)
|
|
251
|
-
return btnList;
|
|
252
|
-
if (!btnInfo[realApplicationCode]["origin-auth"])
|
|
253
|
-
return [];
|
|
254
|
-
return btnInfo[realApplicationCode]["origin-auth"][realMenuCode] ?? [];
|
|
255
|
-
};
|
|
256
|
-
const getPageAuthBtn = (menuCode, applicationCode) => {
|
|
257
|
-
const result = getPageAuth(menuCode, applicationCode);
|
|
258
|
-
return result ?? [];
|
|
259
|
-
};
|
|
260
|
-
const getSubApps = () => {
|
|
116
|
+
}, _ = (e, n) => {
|
|
117
|
+
const t = "permission-btn", s = f(), o = v(), a = d(location.href, "app") || "", r = n || a || (window.__IN_MICRO_APP__ ? o.currentSubAppCode : s.title);
|
|
118
|
+
if (!r)
|
|
119
|
+
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(t) || "{}");
|
|
121
|
+
if (!p || JSON.stringify(p) === "{}")
|
|
122
|
+
return;
|
|
123
|
+
const u = p[r][c];
|
|
124
|
+
return u && u.length ? u : p[r]["origin-auth"] ? p[r]["origin-auth"][c] ?? [] : [];
|
|
125
|
+
}, M = (e, n) => _(e, n) ?? [], v = () => {
|
|
126
|
+
var s;
|
|
261
127
|
if (!window.__IN_MICRO_APP__)
|
|
262
128
|
return {};
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
subAppList: info.subAppList ?? []
|
|
129
|
+
const e = JSON.parse(sessionStorage.getItem("subApps") || "{}"), n = ((s = e.appcategorys) == null ? void 0 : s.map((o) => o.apps).flat()) ?? [];
|
|
130
|
+
return {
|
|
131
|
+
appcategorys: e.appcategorys ?? [],
|
|
132
|
+
currentSubApp: e.currentSubApp ?? {},
|
|
133
|
+
currentSubAppCode: e.currentSubAppCode ?? "",
|
|
134
|
+
flatSubAppList: n,
|
|
135
|
+
subAppList: e.subAppList ?? []
|
|
271
136
|
};
|
|
272
|
-
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
} else {
|
|
279
|
-
return info;
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
const getTabInfo = () => {
|
|
283
|
-
const config = getConfig();
|
|
284
|
-
let result = {};
|
|
137
|
+
}, T = (e) => {
|
|
138
|
+
const n = JSON.parse(sessionStorage.getItem("menus") || "{}");
|
|
139
|
+
return e ? n[e] ?? [] : n;
|
|
140
|
+
}, J = () => {
|
|
141
|
+
const e = f();
|
|
142
|
+
let n = {};
|
|
285
143
|
if (window.__IN_MICRO_APP__) {
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
activeKey:
|
|
289
|
-
currentTab:
|
|
290
|
-
tabMap:
|
|
144
|
+
const t = JSON.parse(sessionStorage.getItem("tabs") || "{}");
|
|
145
|
+
n = {
|
|
146
|
+
activeKey: t.activeKey ?? "",
|
|
147
|
+
currentTab: t.currentTab ?? {},
|
|
148
|
+
tabMap: t.tabMap ?? {}
|
|
291
149
|
};
|
|
292
150
|
} else {
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
activeKey:
|
|
296
|
-
currentTab:
|
|
297
|
-
tabList:
|
|
151
|
+
const t = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
|
|
152
|
+
n = {
|
|
153
|
+
activeKey: t.activeKey ?? "",
|
|
154
|
+
currentTab: t.currentTab ?? {},
|
|
155
|
+
tabList: t.tabList ?? []
|
|
298
156
|
};
|
|
299
157
|
}
|
|
300
|
-
return
|
|
158
|
+
return n;
|
|
159
|
+
}, k = () => {
|
|
160
|
+
const e = f(), n = sessionStorage.getItem("minioAddress");
|
|
161
|
+
return n || (e.baseURL ? e.baseURL : location.origin);
|
|
301
162
|
};
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
163
|
+
h() || m();
|
|
164
|
+
S();
|
|
165
|
+
export {
|
|
166
|
+
T as getMenus,
|
|
167
|
+
k as getMinioAddress,
|
|
168
|
+
_ as getPageAuth,
|
|
169
|
+
M as getPageAuthBtn,
|
|
170
|
+
y as getPersonalInfo,
|
|
171
|
+
U as getProjectInfo,
|
|
172
|
+
v as getSubApps,
|
|
173
|
+
J as getTabInfo,
|
|
174
|
+
R as getTenantInfo,
|
|
175
|
+
h as getToken,
|
|
176
|
+
j as getUserInfo
|
|
306
177
|
};
|
|
307
|
-
if (!getToken())
|
|
308
|
-
getUrlToken();
|
|
309
|
-
getProjectInfoFromQuery();
|
|
310
|
-
|
|
311
|
-
export { getMenus, getMinioAddress, getPageAuth, getPageAuthBtn, getPersonalInfo, getProjectInfo, getSubApps, getTabInfo, getTenantInfo, getToken, getUserInfo };
|