@das-fed/upf-utils 6.4.0-dev.184 → 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.
Files changed (83) hide show
  1. package/api-services/es5.js +1187 -1175
  2. package/api-services/i18n/index.js.gz +0 -0
  3. package/api-services/index.js +946 -928
  4. package/api-services/index.js.gz +0 -0
  5. package/api-services/modules/app-manage/index.js.gz +0 -0
  6. package/api-services/modules/authentication/es5.js +980 -968
  7. package/api-services/modules/authentication/index.js +804 -786
  8. package/api-services/modules/authentication/index.js.gz +0 -0
  9. package/api-services/modules/bems/es5.js +984 -996
  10. package/api-services/modules/bems/index.js +800 -818
  11. package/api-services/modules/bems/index.js.gz +0 -0
  12. package/api-services/modules/contract/es5.js +978 -969
  13. package/api-services/modules/contract/index.js +802 -788
  14. package/api-services/modules/contract/index.js.gz +0 -0
  15. package/api-services/modules/duty-manage/es5.js +799 -796
  16. package/api-services/modules/duty-manage/index.js +620 -616
  17. package/api-services/modules/duty-manage/index.js.gz +0 -0
  18. package/api-services/modules/enterpriseright/es5.js +801 -798
  19. package/api-services/modules/enterpriseright/index.js +621 -617
  20. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  21. package/api-services/modules/es5.js +1187 -1175
  22. package/api-services/modules/file/index.js.gz +0 -0
  23. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  24. package/api-services/modules/index.js +946 -928
  25. package/api-services/modules/index.js.gz +0 -0
  26. package/api-services/modules/iot/es5.js +974 -962
  27. package/api-services/modules/iot/index.js +798 -780
  28. package/api-services/modules/iot/index.js.gz +0 -0
  29. package/api-services/modules/justauth/index.js.gz +0 -0
  30. package/api-services/modules/knowledge/es5.js +980 -968
  31. package/api-services/modules/knowledge/index.js +804 -786
  32. package/api-services/modules/knowledge/index.js.gz +0 -0
  33. package/api-services/modules/link/es5.js +980 -968
  34. package/api-services/modules/link/index.js +804 -786
  35. package/api-services/modules/link/index.js.gz +0 -0
  36. package/api-services/modules/permission/index.js.gz +0 -0
  37. package/api-services/modules/platformManage/es5.js +972 -960
  38. package/api-services/modules/platformManage/index.js +795 -777
  39. package/api-services/modules/platformManage/index.js.gz +0 -0
  40. package/api-services/modules/portal/index.js.gz +0 -0
  41. package/api-services/modules/space-manage/es5.js +968 -980
  42. package/api-services/modules/space-manage/index.js +786 -804
  43. package/api-services/modules/space-manage/index.js.gz +0 -0
  44. package/api-services/modules/super-admin/index.js.gz +0 -0
  45. package/api-services/modules/supplier/es5.js +1002 -990
  46. package/api-services/modules/supplier/index.js +822 -804
  47. package/api-services/modules/supplier/index.js.gz +0 -0
  48. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  49. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  50. package/api-services/modules/tool/es5.js +980 -968
  51. package/api-services/modules/tool/index.js +804 -786
  52. package/api-services/modules/tool/index.js.gz +0 -0
  53. package/api-services/src/create-service/es5.js +796 -799
  54. package/api-services/src/create-service/index.js +616 -620
  55. package/api-services/src/create-service/index.js.gz +0 -0
  56. package/common-info/es5.js +147 -112
  57. package/common-info/getInfoFromUrl/index.js.gz +0 -0
  58. package/common-info/index.d.ts +5 -1
  59. package/common-info/index.js +82 -56
  60. package/common-info/index.js.gz +0 -0
  61. package/common-info/set-personal-info/index.js.gz +0 -0
  62. package/common-info/type.d.ts +15 -0
  63. package/common-tools/extract-file-name/index.js.gz +0 -0
  64. package/common-tools/get-url-params/index.js.gz +0 -0
  65. package/common-tools/handle-data/es5.js +80 -111
  66. package/common-tools/handle-data/index.d.ts +0 -4
  67. package/common-tools/handle-data/index.js +71 -78
  68. package/common-tools/handle-data/index.js.gz +0 -0
  69. package/create-api-service/check-token/index.js.gz +0 -0
  70. package/create-api-service/index.js.gz +0 -0
  71. package/create-api-service/sso/index.js.gz +0 -0
  72. package/curring-http/index.js.gz +0 -0
  73. package/directive/auth/es5.js +47 -61
  74. package/directive/auth/index.js +41 -48
  75. package/directive/auth/index.js.gz +0 -0
  76. package/esm-map.json +3 -2
  77. package/hooks/use-get-auth/index.js.gz +0 -0
  78. package/nextTiken/index.js.gz +0 -0
  79. package/package.json +4 -4
  80. package/pinyin-first-character/index.js.gz +0 -0
  81. package/style/index.js.gz +0 -0
  82. package/use-low-code/index.js.gz +0 -0
  83. package/webSocket-service/index.js.gz +0 -0
@@ -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 N = tokenTools.getAccessToken,
8
- A = function A() {
9
- var _e$id, _e$userName, _e$flag, _ref;
10
- var r;
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: (_ref = (r = e == null ? undefined : e.tenant) == null ? undefined : r.id) !== null && _ref !== void 0 ? _ref : ""
61
+ tenantId: (_ref2 = (s = e == null ? undefined : e.tenant) == null ? undefined : s.id) !== null && _ref2 !== void 0 ? _ref2 : ""
17
62
  };
18
63
  },
19
- J = function J() {
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
- M = function M() {
101
+ T = function T() {
57
102
  return sessionStorage.getItem("languages");
58
103
  },
59
- C = function C() {
60
- var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10;
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: (_ref2 = e == null ? undefined : e.id) !== null && _ref2 !== void 0 ? _ref2 : 0,
65
- code: (_ref3 = e == null ? undefined : e.code) !== null && _ref3 !== void 0 ? _ref3 : 0,
66
- name: (_ref4 = e == null ? undefined : e.name) !== null && _ref4 !== void 0 ? _ref4 : "",
67
- type: (_ref5 = e == null ? undefined : e.type) !== null && _ref5 !== void 0 ? _ref5 : null,
68
- parentId: (_ref6 = e == null ? undefined : e.parentId) !== null && _ref6 !== void 0 ? _ref6 : "",
69
- parentName: (_ref7 = e == null ? undefined : e.parentName) !== null && _ref7 !== void 0 ? _ref7 : "",
70
- parentType: (_ref8 = e == null ? undefined : e.parentType) !== null && _ref8 !== void 0 ? _ref8 : null,
71
- tenantId: (_ref9 = e == null ? undefined : e.tenant) !== null && _ref9 !== void 0 ? _ref9 : "",
72
- isParent: (_ref0 = e == null ? undefined : e.isParent) !== null && _ref0 !== void 0 ? _ref0 : false,
73
- leaf: (_ref1 = e == null ? undefined : e.leaf) !== null && _ref1 !== void 0 ? _ref1 : false,
74
- optional: (_ref10 = e == null ? undefined : e.leaf) !== null && _ref10 !== void 0 ? _ref10 : true
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
- f = function f() {
78
- var _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31;
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: (_ref11 = e == null ? undefined : e.id) !== null && _ref11 !== void 0 ? _ref11 : 0,
82
- projectName: (_ref12 = e == null ? undefined : e.projectName) !== null && _ref12 !== void 0 ? _ref12 : "",
83
- provinceCode: (_ref13 = e == null ? undefined : e.provinceCode) !== null && _ref13 !== void 0 ? _ref13 : "",
84
- cityCode: (_ref14 = e == null ? undefined : e.cityCode) !== null && _ref14 !== void 0 ? _ref14 : "",
85
- areaCode: (_ref15 = e == null ? undefined : e.areaCode) !== null && _ref15 !== void 0 ? _ref15 : "",
86
- address: (_ref16 = e == null ? undefined : e.address) !== null && _ref16 !== void 0 ? _ref16 : "",
87
- projectDesc: (_ref17 = e == null ? undefined : e.projectDesc) !== null && _ref17 !== void 0 ? _ref17 : "",
88
- logoPath: (_ref18 = e == null ? undefined : e.logoPath) !== null && _ref18 !== void 0 ? _ref18 : "",
89
- projectType: (_ref19 = e == null ? undefined : e.projectType) !== null && _ref19 !== void 0 ? _ref19 : "",
90
- projectTypeCode: (_ref20 = e == null ? undefined : e.projectTypeCode) !== null && _ref20 !== void 0 ? _ref20 : "",
91
- longitude: (_ref21 = e == null ? undefined : e.longitude) !== null && _ref21 !== void 0 ? _ref21 : "",
92
- latitude: (_ref22 = e == null ? undefined : e.latitude) !== null && _ref22 !== void 0 ? _ref22 : "",
93
- projectStartDate: (_ref23 = e == null ? undefined : e.projectStartDate) !== null && _ref23 !== void 0 ? _ref23 : "",
94
- projectExpiryDate: (_ref24 = e == null ? undefined : e.projectExpiryDate) !== null && _ref24 !== void 0 ? _ref24 : "",
95
- projectCode: (_ref25 = e == null ? undefined : e.projectCode) !== null && _ref25 !== void 0 ? _ref25 : "",
96
- mapConfiguration: (_ref26 = e == null ? undefined : e.mapConfiguration) !== null && _ref26 !== void 0 ? _ref26 : false,
97
- cityName: (_ref27 = e == null ? undefined : e.cityName) !== null && _ref27 !== void 0 ? _ref27 : "",
98
- cityNamePinyin: (_ref28 = e == null ? undefined : e.cityNamePinyin) !== null && _ref28 !== void 0 ? _ref28 : "",
99
- timezone: (_ref29 = e == null ? undefined : e.timezone) !== null && _ref29 !== void 0 ? _ref29 : "",
100
- autoTimezone: (_ref30 = e == null ? undefined : e.autoTimezone) !== null && _ref30 !== void 0 ? _ref30 : false,
101
- currency: (_ref31 = e == null ? undefined : e.currency) !== null && _ref31 !== void 0 ? _ref31 : {}
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
- k = function k() {
105
- var _ref32, _ref33, _ref34, _ref35, _ref36, _ref37, _ref38;
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: (_ref32 = e == null ? undefined : e.applicationCode) !== null && _ref32 !== void 0 ? _ref32 : "",
109
- applicationPath: (_ref33 = e == null ? undefined : e.applicationPath) !== null && _ref33 !== void 0 ? _ref33 : "",
110
- enable: (_ref34 = e == null ? undefined : e.enable) !== null && _ref34 !== void 0 ? _ref34 : false,
111
- originalCode: (_ref35 = e == null ? undefined : e.originalCode) !== null && _ref35 !== void 0 ? _ref35 : "",
112
- routeUrl: (_ref36 = e == null ? undefined : e.routeUrl) !== null && _ref36 !== void 0 ? _ref36 : "",
113
- displayPosition: (_ref37 = e == null ? undefined : e.displayPosition) !== null && _ref37 !== void 0 ? _ref37 : 1,
114
- type: (_ref38 = e == null ? undefined : e.type) !== null && _ref38 !== void 0 ? _ref38 : null
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
- v = function v() {
118
- var _ref39, _ref40;
162
+ A = function A() {
163
+ var _ref40, _ref41;
119
164
  var e = JSON.parse(sessionStorage.getItem("personal-config") || "{}");
120
165
  return {
121
- style: (_ref39 = e == null ? undefined : e.style) !== null && _ref39 !== void 0 ? _ref39 : "",
122
- skinStyle: (_ref40 = e == null ? undefined : e.skinStyle) !== null && _ref40 !== void 0 ? _ref40 : ""
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
- j = function j(e, t) {
126
- var _c$n$originAuth$l;
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
- m = function m() {
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
- U = function U(e) {
156
- var _ref41, _ref42;
188
+ E = function E(e) {
189
+ var _ref42, _ref43;
157
190
  var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
158
- var a, o;
159
- var r = m().subAppList;
160
- if (e) return t ? (_ref41 = (a = r == null ? undefined : r.find(function (n) {
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 : a.originalMenus) !== null && _ref41 !== void 0 ? _ref41 : [] : (_ref42 = (o = r == null ? undefined : r.find(function (n) {
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 && _ref42 !== void 0 ? _ref42 : [];
197
+ })) == null ? undefined : o.menus) !== null && _ref43 !== void 0 ? _ref43 : [];
165
198
  {
166
199
  var n = {};
167
- return t ? r == null || r.forEach(function (s) {
168
- var _s$originalMenus;
169
- n[s.code] = (_s$originalMenus = s.originalMenus) !== null && _s$originalMenus !== void 0 ? _s$originalMenus : [];
170
- }) : r == null || r.forEach(function (s) {
171
- var _s$menus;
172
- n[s.code] = (_s$menus = s.menus) !== null && _s$menus !== void 0 ? _s$menus : [];
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
- E = function E() {
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
- z = function z() {
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
- x = function x() {
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
- F = function F() {
230
+ v = function v() {
198
231
  return localStorage.getItem("fav-icon") || "./logo.svg";
199
232
  };
200
- N() || getInfoFromUrl.getTokenFromQuery();
201
- var i;
202
- (i = C()) != null && i.id || getInfoFromUrl.getProjectInfoFromQuery();
203
- exports.getFavIcon = F;
204
- exports.getHomeInfo = k;
205
- exports.getInstanceInfo = x;
206
- exports.getLanguages = M;
207
- exports.getMenus = U;
208
- exports.getMinioAddress = z;
209
- exports.getPageAuth = j;
210
- exports.getPageAuthBtn = D;
211
- exports.getPersonalConfig = v;
212
- exports.getPersonalInfo = J;
213
- exports.getProjectInfo = C;
214
- exports.getProjectMessage = f;
215
- exports.getSubApps = m;
216
- exports.getTabInfo = E;
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 = N;
219
- exports.getUserInfo = A;
253
+ exports.getToken = I;
254
+ exports.getUserInfo = b;
@@ -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
  /** 获取账户详情 */
@@ -1,19 +1,52 @@
1
- import { getConfig as u } from "@das-fed/upf-utils/config";
2
- import { getUrlParams as d } from "@das-fed/upf-utils/common-tools";
3
- import { getAccessToken as I } from "@das-fed/upf-utils/token-tools";
4
- import { getTokenFromQuery as S, getProjectInfoFromQuery as y } from "@das-fed/upf-utils/common-info/getInfoFromUrl";
5
- const N = I, A = () => {
6
- var r;
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: ((r = e == null ? void 0 : e.tenant) == null ? void 0 : r.id) ?? ""
45
+ tenantId: ((s = e == null ? void 0 : e.tenant) == null ? void 0 : s.id) ?? ""
13
46
  };
14
- }, J = () => {
47
+ }, f = () => {
15
48
  let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
16
- const t = u();
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
- }, M = () => sessionStorage.getItem("languages"), C = () => {
80
+ }, T = () => sessionStorage.getItem("languages"), y = () => {
48
81
  let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
49
- const t = u();
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
- }, f = () => {
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
- }, k = () => {
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
- }, v = () => {
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
- }, j = (e, t) => {
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
- }, U = (e, t = !1) => {
124
- var a, o;
125
- const r = m().subAppList;
147
+ }, E = (e, t = !1) => {
148
+ var r, o;
149
+ const s = h().subAppList;
126
150
  if (e)
127
- return t ? ((a = r == null ? void 0 : r.find((n) => n.code === e)) == null ? void 0 : a.originalMenus) ?? [] : ((o = r == null ? void 0 : r.find((n) => n.code === e)) == null ? void 0 : o.menus) ?? [];
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 ? r == null || r.forEach((s) => {
131
- n[s.code] = s.originalMenus ?? [];
132
- }) : r == null || r.forEach((s) => {
133
- n[s.code] = s.menus ?? [];
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
- }, E = () => {
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
- }, z = () => {
145
- const e = u(), t = sessionStorage.getItem("minioAddress");
168
+ }, k = () => {
169
+ const e = p(), t = sessionStorage.getItem("minioAddress");
146
170
  return t || (e.baseURL ? e.baseURL : location.origin);
147
- }, x = () => ({
171
+ }, U = () => ({
148
172
  instanceInfo: JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo ?? {}
149
- }), F = () => localStorage.getItem("fav-icon") || "./logo.svg";
150
- N() || S();
151
- var i;
152
- (i = C()) != null && i.id || y();
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
- F as getFavIcon,
155
- k as getHomeInfo,
156
- x as getInstanceInfo,
157
- M as getLanguages,
158
- U as getMenus,
159
- z as getMinioAddress,
160
- j as getPageAuth,
161
- D as getPageAuthBtn,
162
- v as getPersonalConfig,
163
- J as getPersonalInfo,
164
- C as getProjectInfo,
165
- f as getProjectMessage,
166
- m as getSubApps,
167
- E as getTabInfo,
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
- N as getToken,
170
- A as getUserInfo
195
+ I as getToken,
196
+ b as getUserInfo
171
197
  };
Binary file
@@ -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