@das-fed/upf-utils 6.4.0-dev.185 → 6.4.0-dev.186
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/es5.js +1164 -1155
- package/api-services/i18n/index.js.gz +0 -0
- package/api-services/index.js +921 -907
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/es5.js +980 -968
- package/api-services/modules/app-manage/index.js +804 -786
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.js +978 -969
- package/api-services/modules/authentication/index.js +802 -788
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/es5.js +984 -994
- package/api-services/modules/bems/index.js +799 -813
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/es5.js +980 -968
- package/api-services/modules/contract/index.js +804 -786
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.js +982 -991
- package/api-services/modules/duty-manage/index.js +801 -815
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/es5.js +969 -978
- package/api-services/modules/enterpriseright/index.js +788 -802
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/es5.js +1187 -1175
- package/api-services/modules/file/es5.js +1091 -1103
- package/api-services/modules/file/index.js +882 -900
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +946 -928
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +980 -968
- package/api-services/modules/knowledge/index.js +804 -786
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.js +980 -968
- package/api-services/modules/link/index.js +804 -786
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/es5.js +978 -969
- package/api-services/modules/permission/index.js +802 -788
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +972 -960
- package/api-services/modules/platformManage/index.js +795 -777
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/es5.js +996 -984
- package/api-services/modules/super-admin/index.js +817 -799
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/es5.js +980 -968
- package/api-services/modules/supplychain-manage/index.js +804 -786
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/es5.js +980 -968
- package/api-services/modules/tool/index.js +804 -786
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/es5.js +147 -112
- package/common-info/getInfoFromUrl/index.js.gz +0 -0
- package/common-info/index.d.ts +5 -1
- package/common-info/index.js +82 -56
- package/common-info/index.js.gz +0 -0
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-info/type.d.ts +15 -0
- package/common-tools/extract-file-name/index.js.gz +0 -0
- package/common-tools/get-url-params/index.js.gz +0 -0
- package/common-tools/handle-data/index.js.gz +0 -0
- package/create-api-service/check-token/index.js.gz +0 -0
- package/create-api-service/es5.js +978 -966
- package/create-api-service/index.js +803 -785
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/index.js.gz +0 -0
- package/directive/auth/es5.js +47 -61
- package/directive/auth/index.js +41 -48
- package/directive/auth/index.js.gz +0 -0
- package/esm-map.json +3 -1
- package/hooks/use-get-auth/index.js.gz +0 -0
- package/nextTiken/index.js.gz +0 -0
- package/package.json +4 -4
- package/pinyin-first-character/index.js.gz +0 -0
- package/style/index.js.gz +0 -0
- package/use-low-code/index.js.gz +0 -0
- package/webSocket-service/index.js.gz +0 -0
|
Binary file
|
|
Binary file
|
package/common-info/es5.js
CHANGED
|
@@ -1,22 +1,67 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var config = require('@das-fed/upf-utils/config/es5');
|
|
4
|
-
var commonTools = require('@das-fed/upf-utils/common-tools/es5');
|
|
5
4
|
var tokenTools = require('@das-fed/upf-utils/token-tools/es5');
|
|
6
5
|
var getInfoFromUrl = require('@das-fed/upf-utils/common-info/getInfoFromUrl/es5');
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
6
|
+
var P = function P(e) {
|
|
7
|
+
var _t$rightFuncCodes, _t$routeUrl, _t$parentId, _t$id, _t$appId, _t$menuAppearance, _t$name, _ref;
|
|
8
|
+
var t = e || JSON.parse(sessionStorage.getItem("menuItem") || "{}");
|
|
9
|
+
return {
|
|
10
|
+
authCodes: (_t$rightFuncCodes = t.rightFuncCodes) !== null && _t$rightFuncCodes !== void 0 ? _t$rightFuncCodes : [],
|
|
11
|
+
routeUrl: (_t$routeUrl = t.routeUrl) !== null && _t$routeUrl !== void 0 ? _t$routeUrl : "",
|
|
12
|
+
parentId: (_t$parentId = t.parentId) !== null && _t$parentId !== void 0 ? _t$parentId : "",
|
|
13
|
+
id: (_t$id = t.id) !== null && _t$id !== void 0 ? _t$id : "",
|
|
14
|
+
appId: (_t$appId = t.appId) !== null && _t$appId !== void 0 ? _t$appId : "",
|
|
15
|
+
menuAppearance: (_t$menuAppearance = t.menuAppearance) !== null && _t$menuAppearance !== void 0 ? _t$menuAppearance : "",
|
|
16
|
+
name: (_t$name = t.name) !== null && _t$name !== void 0 ? _t$name : "",
|
|
17
|
+
type: (_ref = t == null ? undefined : t.type) !== null && _ref !== void 0 ? _ref : ""
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
m = function m() {
|
|
21
|
+
var e = JSON.parse(sessionStorage.getItem("menuList") || "[]"),
|
|
22
|
+
t = {};
|
|
23
|
+
return e.forEach(function (s) {
|
|
24
|
+
s.routeUrl && (s.rightFuncCodes && s.rightFuncCodes.forEach(function (r) {
|
|
25
|
+
return t[r] = [];
|
|
26
|
+
}), s.children && s.children.forEach(function (r) {
|
|
27
|
+
if (r.rightFuncCodes && r.rightFuncCodes[0] && !r.children) {
|
|
28
|
+
var o = r.rightFuncCodes[0].lastIndexOf("."),
|
|
29
|
+
n = r.rightFuncCodes[0].slice(0, o);
|
|
30
|
+
t[n] = [], r.rightFuncCodes.forEach(function (a) {
|
|
31
|
+
var c = a.lastIndexOf(".");
|
|
32
|
+
t[n].push({
|
|
33
|
+
code: a.slice(c + 1)
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
r.children && r.children.forEach(function (o) {
|
|
38
|
+
if (o.rightFuncCodes) {
|
|
39
|
+
var _n = o.rightFuncCodes[0].lastIndexOf("."),
|
|
40
|
+
a = o.rightFuncCodes[0].slice(0, _n);
|
|
41
|
+
t[a] = [], o.rightFuncCodes.forEach(function (c) {
|
|
42
|
+
var l = c.lastIndexOf(".");
|
|
43
|
+
t[a].push({
|
|
44
|
+
code: c.slice(l + 1)
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}));
|
|
50
|
+
}), t;
|
|
51
|
+
},
|
|
52
|
+
I = tokenTools.getAccessToken,
|
|
53
|
+
b = function b() {
|
|
54
|
+
var _e$id, _e$userName, _e$flag, _ref2;
|
|
55
|
+
var s;
|
|
11
56
|
var e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
|
|
12
57
|
return {
|
|
13
58
|
id: (_e$id = e.id) !== null && _e$id !== void 0 ? _e$id : "",
|
|
14
59
|
name: (_e$userName = e.userName) !== null && _e$userName !== void 0 ? _e$userName : "",
|
|
15
60
|
flag: (_e$flag = e.flag) !== null && _e$flag !== void 0 ? _e$flag : null,
|
|
16
|
-
tenantId: (
|
|
61
|
+
tenantId: (_ref2 = (s = e == null ? undefined : e.tenant) == null ? undefined : s.id) !== null && _ref2 !== void 0 ? _ref2 : ""
|
|
17
62
|
};
|
|
18
63
|
},
|
|
19
|
-
|
|
64
|
+
f = function f() {
|
|
20
65
|
var _e$id2, _e$name, _e$userName2, _e$phone, _e$email, _e$headPicture;
|
|
21
66
|
var e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
|
|
22
67
|
var t = config.getConfig();
|
|
@@ -53,95 +98,83 @@ var N = tokenTools.getAccessToken,
|
|
|
53
98
|
description: (_e$description = e.description) !== null && _e$description !== void 0 ? _e$description : ""
|
|
54
99
|
};
|
|
55
100
|
},
|
|
56
|
-
|
|
101
|
+
T = function T() {
|
|
57
102
|
return sessionStorage.getItem("languages");
|
|
58
103
|
},
|
|
59
|
-
|
|
60
|
-
var
|
|
104
|
+
y = function y() {
|
|
105
|
+
var _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11;
|
|
61
106
|
var e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
|
|
62
107
|
var t = config.getConfig();
|
|
63
108
|
return JSON.stringify(e) === "{}" && t.projectInfo && (e = t.projectInfo), {
|
|
64
|
-
id: (
|
|
65
|
-
code: (
|
|
66
|
-
name: (
|
|
67
|
-
type: (
|
|
68
|
-
parentId: (
|
|
69
|
-
parentName: (
|
|
70
|
-
parentType: (
|
|
71
|
-
tenantId: (
|
|
72
|
-
isParent: (
|
|
73
|
-
leaf: (
|
|
74
|
-
optional: (
|
|
109
|
+
id: (_ref3 = e == null ? undefined : e.id) !== null && _ref3 !== void 0 ? _ref3 : 0,
|
|
110
|
+
code: (_ref4 = e == null ? undefined : e.code) !== null && _ref4 !== void 0 ? _ref4 : 0,
|
|
111
|
+
name: (_ref5 = e == null ? undefined : e.name) !== null && _ref5 !== void 0 ? _ref5 : "",
|
|
112
|
+
type: (_ref6 = e == null ? undefined : e.type) !== null && _ref6 !== void 0 ? _ref6 : null,
|
|
113
|
+
parentId: (_ref7 = e == null ? undefined : e.parentId) !== null && _ref7 !== void 0 ? _ref7 : "",
|
|
114
|
+
parentName: (_ref8 = e == null ? undefined : e.parentName) !== null && _ref8 !== void 0 ? _ref8 : "",
|
|
115
|
+
parentType: (_ref9 = e == null ? undefined : e.parentType) !== null && _ref9 !== void 0 ? _ref9 : null,
|
|
116
|
+
tenantId: (_ref0 = e == null ? undefined : e.tenant) !== null && _ref0 !== void 0 ? _ref0 : "",
|
|
117
|
+
isParent: (_ref1 = e == null ? undefined : e.isParent) !== null && _ref1 !== void 0 ? _ref1 : false,
|
|
118
|
+
leaf: (_ref10 = e == null ? undefined : e.leaf) !== null && _ref10 !== void 0 ? _ref10 : false,
|
|
119
|
+
optional: (_ref11 = e == null ? undefined : e.leaf) !== null && _ref11 !== void 0 ? _ref11 : true
|
|
75
120
|
};
|
|
76
121
|
},
|
|
77
|
-
|
|
78
|
-
var
|
|
122
|
+
F = function F() {
|
|
123
|
+
var _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32;
|
|
79
124
|
var e = JSON.parse(sessionStorage.getItem("project-message") || "{}");
|
|
80
125
|
return {
|
|
81
|
-
id: (
|
|
82
|
-
projectName: (
|
|
83
|
-
provinceCode: (
|
|
84
|
-
cityCode: (
|
|
85
|
-
areaCode: (
|
|
86
|
-
address: (
|
|
87
|
-
projectDesc: (
|
|
88
|
-
logoPath: (
|
|
89
|
-
projectType: (
|
|
90
|
-
projectTypeCode: (
|
|
91
|
-
longitude: (
|
|
92
|
-
latitude: (
|
|
93
|
-
projectStartDate: (
|
|
94
|
-
projectExpiryDate: (
|
|
95
|
-
projectCode: (
|
|
96
|
-
mapConfiguration: (
|
|
97
|
-
cityName: (
|
|
98
|
-
cityNamePinyin: (
|
|
99
|
-
timezone: (
|
|
100
|
-
autoTimezone: (
|
|
101
|
-
currency: (
|
|
126
|
+
id: (_ref12 = e == null ? undefined : e.id) !== null && _ref12 !== void 0 ? _ref12 : 0,
|
|
127
|
+
projectName: (_ref13 = e == null ? undefined : e.projectName) !== null && _ref13 !== void 0 ? _ref13 : "",
|
|
128
|
+
provinceCode: (_ref14 = e == null ? undefined : e.provinceCode) !== null && _ref14 !== void 0 ? _ref14 : "",
|
|
129
|
+
cityCode: (_ref15 = e == null ? undefined : e.cityCode) !== null && _ref15 !== void 0 ? _ref15 : "",
|
|
130
|
+
areaCode: (_ref16 = e == null ? undefined : e.areaCode) !== null && _ref16 !== void 0 ? _ref16 : "",
|
|
131
|
+
address: (_ref17 = e == null ? undefined : e.address) !== null && _ref17 !== void 0 ? _ref17 : "",
|
|
132
|
+
projectDesc: (_ref18 = e == null ? undefined : e.projectDesc) !== null && _ref18 !== void 0 ? _ref18 : "",
|
|
133
|
+
logoPath: (_ref19 = e == null ? undefined : e.logoPath) !== null && _ref19 !== void 0 ? _ref19 : "",
|
|
134
|
+
projectType: (_ref20 = e == null ? undefined : e.projectType) !== null && _ref20 !== void 0 ? _ref20 : "",
|
|
135
|
+
projectTypeCode: (_ref21 = e == null ? undefined : e.projectTypeCode) !== null && _ref21 !== void 0 ? _ref21 : "",
|
|
136
|
+
longitude: (_ref22 = e == null ? undefined : e.longitude) !== null && _ref22 !== void 0 ? _ref22 : "",
|
|
137
|
+
latitude: (_ref23 = e == null ? undefined : e.latitude) !== null && _ref23 !== void 0 ? _ref23 : "",
|
|
138
|
+
projectStartDate: (_ref24 = e == null ? undefined : e.projectStartDate) !== null && _ref24 !== void 0 ? _ref24 : "",
|
|
139
|
+
projectExpiryDate: (_ref25 = e == null ? undefined : e.projectExpiryDate) !== null && _ref25 !== void 0 ? _ref25 : "",
|
|
140
|
+
projectCode: (_ref26 = e == null ? undefined : e.projectCode) !== null && _ref26 !== void 0 ? _ref26 : "",
|
|
141
|
+
mapConfiguration: (_ref27 = e == null ? undefined : e.mapConfiguration) !== null && _ref27 !== void 0 ? _ref27 : false,
|
|
142
|
+
cityName: (_ref28 = e == null ? undefined : e.cityName) !== null && _ref28 !== void 0 ? _ref28 : "",
|
|
143
|
+
cityNamePinyin: (_ref29 = e == null ? undefined : e.cityNamePinyin) !== null && _ref29 !== void 0 ? _ref29 : "",
|
|
144
|
+
timezone: (_ref30 = e == null ? undefined : e.timezone) !== null && _ref30 !== void 0 ? _ref30 : "",
|
|
145
|
+
autoTimezone: (_ref31 = e == null ? undefined : e.autoTimezone) !== null && _ref31 !== void 0 ? _ref31 : false,
|
|
146
|
+
currency: (_ref32 = e == null ? undefined : e.currency) !== null && _ref32 !== void 0 ? _ref32 : {}
|
|
102
147
|
};
|
|
103
148
|
},
|
|
104
|
-
|
|
105
|
-
var
|
|
149
|
+
J = function J() {
|
|
150
|
+
var _ref33, _ref34, _ref35, _ref36, _ref37, _ref38, _ref39;
|
|
106
151
|
var e = JSON.parse(sessionStorage.getItem("home-config") || "{}");
|
|
107
152
|
return {
|
|
108
|
-
applicationCode: (
|
|
109
|
-
applicationPath: (
|
|
110
|
-
enable: (
|
|
111
|
-
originalCode: (
|
|
112
|
-
routeUrl: (
|
|
113
|
-
displayPosition: (
|
|
114
|
-
type: (
|
|
153
|
+
applicationCode: (_ref33 = e == null ? undefined : e.applicationCode) !== null && _ref33 !== void 0 ? _ref33 : "",
|
|
154
|
+
applicationPath: (_ref34 = e == null ? undefined : e.applicationPath) !== null && _ref34 !== void 0 ? _ref34 : "",
|
|
155
|
+
enable: (_ref35 = e == null ? undefined : e.enable) !== null && _ref35 !== void 0 ? _ref35 : false,
|
|
156
|
+
originalCode: (_ref36 = e == null ? undefined : e.originalCode) !== null && _ref36 !== void 0 ? _ref36 : "",
|
|
157
|
+
routeUrl: (_ref37 = e == null ? undefined : e.routeUrl) !== null && _ref37 !== void 0 ? _ref37 : "",
|
|
158
|
+
displayPosition: (_ref38 = e == null ? undefined : e.displayPosition) !== null && _ref38 !== void 0 ? _ref38 : 1,
|
|
159
|
+
type: (_ref39 = e == null ? undefined : e.type) !== null && _ref39 !== void 0 ? _ref39 : null
|
|
115
160
|
};
|
|
116
161
|
},
|
|
117
|
-
|
|
118
|
-
var
|
|
162
|
+
A = function A() {
|
|
163
|
+
var _ref40, _ref41;
|
|
119
164
|
var e = JSON.parse(sessionStorage.getItem("personal-config") || "{}");
|
|
120
165
|
return {
|
|
121
|
-
style: (
|
|
122
|
-
skinStyle: (
|
|
166
|
+
style: (_ref40 = e == null ? undefined : e.style) !== null && _ref40 !== void 0 ? _ref40 : "",
|
|
167
|
+
skinStyle: (_ref41 = e == null ? undefined : e.skinStyle) !== null && _ref41 !== void 0 ? _ref41 : ""
|
|
123
168
|
};
|
|
124
169
|
},
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
var g;
|
|
128
|
-
var r = "permission-btn",
|
|
129
|
-
a = m(),
|
|
130
|
-
o = commonTools.getUrlParams(location.href, "app") || "",
|
|
131
|
-
n = t || o || a.currentSubAppCode;
|
|
132
|
-
if (!n) return;
|
|
133
|
-
var s = commonTools.getUrlParams(location.href, "menu") || "",
|
|
134
|
-
l = e || s || a.currentSubApp.currentMenuCode,
|
|
135
|
-
c = JSON.parse(sessionStorage.getItem(r) || "{}");
|
|
136
|
-
if (!c || JSON.stringify(c) === "{}") return;
|
|
137
|
-
var p = (g = c[n]) == null ? undefined : g[l];
|
|
138
|
-
if (p) return p.length ? p : c[n]["origin-auth"] ? (_c$n$originAuth$l = c[n]["origin-auth"][l]) !== null && _c$n$originAuth$l !== void 0 ? _c$n$originAuth$l : [] : [];
|
|
139
|
-
},
|
|
140
|
-
D = function D(e, t) {
|
|
141
|
-
var _j;
|
|
142
|
-
return (_j = j(e, t)) !== null && _j !== void 0 ? _j : [];
|
|
170
|
+
C = function C(e, t) {
|
|
171
|
+
return e ? m()[e] : undefined;
|
|
143
172
|
},
|
|
144
|
-
|
|
173
|
+
x = function x(e, t) {
|
|
174
|
+
var _C;
|
|
175
|
+
return (_C = C(e)) !== null && _C !== void 0 ? _C : [];
|
|
176
|
+
},
|
|
177
|
+
h = function h() {
|
|
145
178
|
var _e$appcategorys, _e$currentSubApp, _e$currentSubAppCode, _e$subAppList, _e$menuCollapses;
|
|
146
179
|
var e = JSON.parse(sessionStorage.getItem("subApps") || "{}");
|
|
147
180
|
return {
|
|
@@ -152,28 +185,28 @@ var N = tokenTools.getAccessToken,
|
|
|
152
185
|
menuCollapses: (_e$menuCollapses = e.menuCollapses) !== null && _e$menuCollapses !== void 0 ? _e$menuCollapses : []
|
|
153
186
|
};
|
|
154
187
|
},
|
|
155
|
-
|
|
156
|
-
var
|
|
188
|
+
E = function E(e) {
|
|
189
|
+
var _ref42, _ref43;
|
|
157
190
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
158
|
-
var
|
|
159
|
-
var
|
|
160
|
-
if (e) return t ? (
|
|
191
|
+
var r, o;
|
|
192
|
+
var s = h().subAppList;
|
|
193
|
+
if (e) return t ? (_ref42 = (r = s == null ? undefined : s.find(function (n) {
|
|
161
194
|
return n.code === e;
|
|
162
|
-
})) == null ? undefined :
|
|
195
|
+
})) == null ? undefined : r.originalMenus) !== null && _ref42 !== void 0 ? _ref42 : [] : (_ref43 = (o = s == null ? undefined : s.find(function (n) {
|
|
163
196
|
return n.code === e;
|
|
164
|
-
})) == null ? undefined : o.menus) !== null &&
|
|
197
|
+
})) == null ? undefined : o.menus) !== null && _ref43 !== void 0 ? _ref43 : [];
|
|
165
198
|
{
|
|
166
199
|
var n = {};
|
|
167
|
-
return t ?
|
|
168
|
-
var
|
|
169
|
-
n[
|
|
170
|
-
}) :
|
|
171
|
-
var
|
|
172
|
-
n[
|
|
200
|
+
return t ? s == null || s.forEach(function (a) {
|
|
201
|
+
var _a$originalMenus;
|
|
202
|
+
n[a.code] = (_a$originalMenus = a.originalMenus) !== null && _a$originalMenus !== void 0 ? _a$originalMenus : [];
|
|
203
|
+
}) : s == null || s.forEach(function (a) {
|
|
204
|
+
var _a$menus;
|
|
205
|
+
n[a.code] = (_a$menus = a.menus) !== null && _a$menus !== void 0 ? _a$menus : [];
|
|
173
206
|
}), n;
|
|
174
207
|
}
|
|
175
208
|
},
|
|
176
|
-
|
|
209
|
+
M = function M() {
|
|
177
210
|
var _e$currentCode, _e$currentTab, _e$tabMap, _e$preTab;
|
|
178
211
|
var e = JSON.parse(sessionStorage.getItem("tabs") || "{}");
|
|
179
212
|
return {
|
|
@@ -183,37 +216,39 @@ var N = tokenTools.getAccessToken,
|
|
|
183
216
|
preTab: (_e$preTab = e.preTab) !== null && _e$preTab !== void 0 ? _e$preTab : {}
|
|
184
217
|
};
|
|
185
218
|
},
|
|
186
|
-
|
|
219
|
+
k = function k() {
|
|
187
220
|
var e = config.getConfig(),
|
|
188
221
|
t = sessionStorage.getItem("minioAddress");
|
|
189
222
|
return t || (e.baseURL ? e.baseURL : location.origin);
|
|
190
223
|
},
|
|
191
|
-
|
|
224
|
+
U = function U() {
|
|
192
225
|
var _JSON$parse$instanceI;
|
|
193
226
|
return {
|
|
194
227
|
instanceInfo: (_JSON$parse$instanceI = JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo) !== null && _JSON$parse$instanceI !== void 0 ? _JSON$parse$instanceI : {}
|
|
195
228
|
};
|
|
196
229
|
},
|
|
197
|
-
|
|
230
|
+
v = function v() {
|
|
198
231
|
return localStorage.getItem("fav-icon") || "./logo.svg";
|
|
199
232
|
};
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
(
|
|
203
|
-
exports.
|
|
204
|
-
exports.
|
|
205
|
-
exports.
|
|
206
|
-
exports.
|
|
207
|
-
exports.
|
|
208
|
-
exports.
|
|
209
|
-
exports.
|
|
210
|
-
exports.
|
|
211
|
-
exports.
|
|
212
|
-
exports.
|
|
213
|
-
exports.
|
|
214
|
-
exports.
|
|
215
|
-
exports.
|
|
216
|
-
exports.
|
|
233
|
+
I() || getInfoFromUrl.getTokenFromQuery();
|
|
234
|
+
var u;
|
|
235
|
+
(u = y()) != null && u.id || getInfoFromUrl.getProjectInfoFromQuery();
|
|
236
|
+
exports.getAuthobj = m;
|
|
237
|
+
exports.getFavIcon = v;
|
|
238
|
+
exports.getHomeInfo = J;
|
|
239
|
+
exports.getInstanceInfo = U;
|
|
240
|
+
exports.getLanguages = T;
|
|
241
|
+
exports.getMenuItemInfo = P;
|
|
242
|
+
exports.getMenus = E;
|
|
243
|
+
exports.getMinioAddress = k;
|
|
244
|
+
exports.getPageAuth = C;
|
|
245
|
+
exports.getPageAuthBtn = x;
|
|
246
|
+
exports.getPersonalConfig = A;
|
|
247
|
+
exports.getPersonalInfo = f;
|
|
248
|
+
exports.getProjectInfo = y;
|
|
249
|
+
exports.getProjectMessage = F;
|
|
250
|
+
exports.getSubApps = h;
|
|
251
|
+
exports.getTabInfo = M;
|
|
217
252
|
exports.getTenantInfo = O;
|
|
218
|
-
exports.getToken =
|
|
219
|
-
exports.getUserInfo =
|
|
253
|
+
exports.getToken = I;
|
|
254
|
+
exports.getUserInfo = b;
|
|
Binary file
|
package/common-info/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { UserInfo, PersonalInfo, TenantInfo, HomeInfo, PersonalConfigInfo, ProjectInfo, ProjectMessage, SubAppsInfo, TabInfo, permissionBtnInfo } from './type';
|
|
1
|
+
import { UserInfo, PersonalInfo, TenantInfo, HomeInfo, PersonalConfigInfo, ProjectInfo, ProjectMessage, SubAppsInfo, TabInfo, permissionBtnInfo, menuItemTs } from './type';
|
|
2
2
|
|
|
3
|
+
/** 获取当前应用详情 */
|
|
4
|
+
export declare const getMenuItemInfo: (val?: any) => menuItemTs;
|
|
5
|
+
/** 获取所有权限code详情 */
|
|
6
|
+
export declare const getAuthobj: () => any;
|
|
3
7
|
/** 获取token */
|
|
4
8
|
export declare const getToken: any;
|
|
5
9
|
/** 获取账户详情 */
|
package/common-info/index.js
CHANGED
|
@@ -1,19 +1,52 @@
|
|
|
1
|
-
import { getConfig as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { getConfig as p } from "@das-fed/upf-utils/config";
|
|
2
|
+
import { getAccessToken as g } from "@das-fed/upf-utils/token-tools";
|
|
3
|
+
import { getTokenFromQuery as d, getProjectInfoFromQuery as i } from "@das-fed/upf-utils/common-info/getInfoFromUrl";
|
|
4
|
+
const P = (e) => {
|
|
5
|
+
let t = e || JSON.parse(sessionStorage.getItem("menuItem") || "{}");
|
|
6
|
+
return {
|
|
7
|
+
authCodes: t.rightFuncCodes ?? [],
|
|
8
|
+
routeUrl: t.routeUrl ?? "",
|
|
9
|
+
parentId: t.parentId ?? "",
|
|
10
|
+
id: t.id ?? "",
|
|
11
|
+
appId: t.appId ?? "",
|
|
12
|
+
menuAppearance: t.menuAppearance ?? "",
|
|
13
|
+
name: t.name ?? "",
|
|
14
|
+
type: (t == null ? void 0 : t.type) ?? ""
|
|
15
|
+
};
|
|
16
|
+
}, m = () => {
|
|
17
|
+
const e = JSON.parse(sessionStorage.getItem("menuList") || "[]"), t = {};
|
|
18
|
+
return e.forEach((s) => {
|
|
19
|
+
s.routeUrl && (s.rightFuncCodes && s.rightFuncCodes.forEach((r) => t[r] = []), s.children && s.children.forEach((r) => {
|
|
20
|
+
if (r.rightFuncCodes && r.rightFuncCodes[0] && !r.children) {
|
|
21
|
+
const o = r.rightFuncCodes[0].lastIndexOf("."), n = r.rightFuncCodes[0].slice(0, o);
|
|
22
|
+
t[n] = [], r.rightFuncCodes.forEach((a) => {
|
|
23
|
+
const c = a.lastIndexOf(".");
|
|
24
|
+
t[n].push({ code: a.slice(c + 1) });
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
r.children && r.children.forEach((o) => {
|
|
28
|
+
if (o.rightFuncCodes) {
|
|
29
|
+
const n = o.rightFuncCodes[0].lastIndexOf("."), a = o.rightFuncCodes[0].slice(0, n);
|
|
30
|
+
t[a] = [], o.rightFuncCodes.forEach((c) => {
|
|
31
|
+
const l = c.lastIndexOf(".");
|
|
32
|
+
t[a].push({ code: c.slice(l + 1) });
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}));
|
|
37
|
+
}), t;
|
|
38
|
+
}, I = g, b = () => {
|
|
39
|
+
var s;
|
|
7
40
|
let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
|
|
8
41
|
return {
|
|
9
42
|
id: e.id ?? "",
|
|
10
43
|
name: e.userName ?? "",
|
|
11
44
|
flag: e.flag ?? null,
|
|
12
|
-
tenantId: ((
|
|
45
|
+
tenantId: ((s = e == null ? void 0 : e.tenant) == null ? void 0 : s.id) ?? ""
|
|
13
46
|
};
|
|
14
|
-
},
|
|
47
|
+
}, f = () => {
|
|
15
48
|
let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
|
|
16
|
-
const t =
|
|
49
|
+
const t = p();
|
|
17
50
|
return JSON.stringify(e) === "{}" && t.personalInfo && (e = t.personalInfo), {
|
|
18
51
|
id: e.id ?? "",
|
|
19
52
|
name: e.name ?? "",
|
|
@@ -44,9 +77,9 @@ const N = I, A = () => {
|
|
|
44
77
|
address: e.address ?? "",
|
|
45
78
|
description: e.description ?? ""
|
|
46
79
|
};
|
|
47
|
-
},
|
|
80
|
+
}, T = () => sessionStorage.getItem("languages"), y = () => {
|
|
48
81
|
let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
|
|
49
|
-
const t =
|
|
82
|
+
const t = p();
|
|
50
83
|
return JSON.stringify(e) === "{}" && t.projectInfo && (e = t.projectInfo), {
|
|
51
84
|
id: (e == null ? void 0 : e.id) ?? 0,
|
|
52
85
|
code: (e == null ? void 0 : e.code) ?? 0,
|
|
@@ -60,7 +93,7 @@ const N = I, A = () => {
|
|
|
60
93
|
leaf: (e == null ? void 0 : e.leaf) ?? !1,
|
|
61
94
|
optional: (e == null ? void 0 : e.leaf) ?? !0
|
|
62
95
|
};
|
|
63
|
-
},
|
|
96
|
+
}, F = () => {
|
|
64
97
|
let e = JSON.parse(sessionStorage.getItem("project-message") || "{}");
|
|
65
98
|
return {
|
|
66
99
|
id: (e == null ? void 0 : e.id) ?? 0,
|
|
@@ -85,7 +118,7 @@ const N = I, A = () => {
|
|
|
85
118
|
autoTimezone: (e == null ? void 0 : e.autoTimezone) ?? !1,
|
|
86
119
|
currency: (e == null ? void 0 : e.currency) ?? {}
|
|
87
120
|
};
|
|
88
|
-
},
|
|
121
|
+
}, J = () => {
|
|
89
122
|
const e = JSON.parse(sessionStorage.getItem("home-config") || "{}");
|
|
90
123
|
return {
|
|
91
124
|
applicationCode: (e == null ? void 0 : e.applicationCode) ?? "",
|
|
@@ -96,22 +129,13 @@ const N = I, A = () => {
|
|
|
96
129
|
displayPosition: (e == null ? void 0 : e.displayPosition) ?? 1,
|
|
97
130
|
type: (e == null ? void 0 : e.type) ?? null
|
|
98
131
|
};
|
|
99
|
-
},
|
|
132
|
+
}, A = () => {
|
|
100
133
|
const e = JSON.parse(sessionStorage.getItem("personal-config") || "{}");
|
|
101
134
|
return {
|
|
102
135
|
style: (e == null ? void 0 : e.style) ?? "",
|
|
103
136
|
skinStyle: (e == null ? void 0 : e.skinStyle) ?? ""
|
|
104
137
|
};
|
|
105
|
-
},
|
|
106
|
-
var g;
|
|
107
|
-
const r = "permission-btn", a = m(), o = d(location.href, "app") || "", n = t || o || a.currentSubAppCode;
|
|
108
|
-
if (!n) return;
|
|
109
|
-
const s = d(location.href, "menu") || "", l = e || s || a.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(r) || "{}");
|
|
110
|
-
if (!c || JSON.stringify(c) === "{}") return;
|
|
111
|
-
const p = (g = c[n]) == null ? void 0 : g[l];
|
|
112
|
-
if (p)
|
|
113
|
-
return p.length ? p : c[n]["origin-auth"] ? c[n]["origin-auth"][l] ?? [] : [];
|
|
114
|
-
}, D = (e, t) => j(e, t) ?? [], m = () => {
|
|
138
|
+
}, C = (e, t) => e ? m()[e] : void 0, x = (e, t) => C(e) ?? [], h = () => {
|
|
115
139
|
const e = JSON.parse(sessionStorage.getItem("subApps") || "{}");
|
|
116
140
|
return {
|
|
117
141
|
appcategorys: e.appcategorys ?? [],
|
|
@@ -120,20 +144,20 @@ const N = I, A = () => {
|
|
|
120
144
|
subAppList: e.subAppList ?? [],
|
|
121
145
|
menuCollapses: e.menuCollapses ?? []
|
|
122
146
|
};
|
|
123
|
-
},
|
|
124
|
-
var
|
|
125
|
-
const
|
|
147
|
+
}, E = (e, t = !1) => {
|
|
148
|
+
var r, o;
|
|
149
|
+
const s = h().subAppList;
|
|
126
150
|
if (e)
|
|
127
|
-
return t ? ((
|
|
151
|
+
return t ? ((r = s == null ? void 0 : s.find((n) => n.code === e)) == null ? void 0 : r.originalMenus) ?? [] : ((o = s == null ? void 0 : s.find((n) => n.code === e)) == null ? void 0 : o.menus) ?? [];
|
|
128
152
|
{
|
|
129
153
|
let n = {};
|
|
130
|
-
return t ?
|
|
131
|
-
n[
|
|
132
|
-
}) :
|
|
133
|
-
n[
|
|
154
|
+
return t ? s == null || s.forEach((a) => {
|
|
155
|
+
n[a.code] = a.originalMenus ?? [];
|
|
156
|
+
}) : s == null || s.forEach((a) => {
|
|
157
|
+
n[a.code] = a.menus ?? [];
|
|
134
158
|
}), n;
|
|
135
159
|
}
|
|
136
|
-
},
|
|
160
|
+
}, M = () => {
|
|
137
161
|
const e = JSON.parse(sessionStorage.getItem("tabs") || "{}");
|
|
138
162
|
return {
|
|
139
163
|
currentCode: e.currentCode ?? "",
|
|
@@ -141,31 +165,33 @@ const N = I, A = () => {
|
|
|
141
165
|
tabMap: e.tabMap ?? {},
|
|
142
166
|
preTab: e.preTab ?? {}
|
|
143
167
|
};
|
|
144
|
-
},
|
|
145
|
-
const e =
|
|
168
|
+
}, k = () => {
|
|
169
|
+
const e = p(), t = sessionStorage.getItem("minioAddress");
|
|
146
170
|
return t || (e.baseURL ? e.baseURL : location.origin);
|
|
147
|
-
},
|
|
171
|
+
}, U = () => ({
|
|
148
172
|
instanceInfo: JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo ?? {}
|
|
149
|
-
}),
|
|
150
|
-
|
|
151
|
-
var
|
|
152
|
-
(
|
|
173
|
+
}), v = () => localStorage.getItem("fav-icon") || "./logo.svg";
|
|
174
|
+
I() || d();
|
|
175
|
+
var u;
|
|
176
|
+
(u = y()) != null && u.id || i();
|
|
153
177
|
export {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
f as
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
m as getAuthobj,
|
|
179
|
+
v as getFavIcon,
|
|
180
|
+
J as getHomeInfo,
|
|
181
|
+
U as getInstanceInfo,
|
|
182
|
+
T as getLanguages,
|
|
183
|
+
P as getMenuItemInfo,
|
|
184
|
+
E as getMenus,
|
|
185
|
+
k as getMinioAddress,
|
|
186
|
+
C as getPageAuth,
|
|
187
|
+
x as getPageAuthBtn,
|
|
188
|
+
A as getPersonalConfig,
|
|
189
|
+
f as getPersonalInfo,
|
|
190
|
+
y as getProjectInfo,
|
|
191
|
+
F as getProjectMessage,
|
|
192
|
+
h as getSubApps,
|
|
193
|
+
M as getTabInfo,
|
|
168
194
|
O as getTenantInfo,
|
|
169
|
-
|
|
170
|
-
|
|
195
|
+
I as getToken,
|
|
196
|
+
b as getUserInfo
|
|
171
197
|
};
|
package/common-info/index.js.gz
CHANGED
|
Binary file
|
|
Binary file
|
package/common-info/type.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
export interface menuItemTs {
|
|
2
|
+
/** 菜单/按钮资源编码集合 */
|
|
3
|
+
authCodes: any[]
|
|
4
|
+
/** 路由URL */
|
|
5
|
+
routeUrl: string
|
|
6
|
+
parentId: string
|
|
7
|
+
id: string
|
|
8
|
+
appId: string
|
|
9
|
+
menuAppearance: string
|
|
10
|
+
/** 名字 */
|
|
11
|
+
name: string
|
|
12
|
+
/** 类型 */
|
|
13
|
+
type: string
|
|
14
|
+
}
|
|
15
|
+
|
|
1
16
|
export interface UserInfo {
|
|
2
17
|
/** 用户id */
|
|
3
18
|
id: string
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|