@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,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t5 in e) "default" !== _t5 && {}.hasOwnProperty.call(e, _t5) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t5)) && (i.get || i.set) ? o(f, _t5, i) : f[_t5] = e[_t5]); return f; })(e, t); }
4
3
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
5
4
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
6
5
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -10,29 +9,29 @@ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.
10
9
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
11
10
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
11
  var config = require('@das-fed/upf-utils/config/es5');
13
- var k = /* @__PURE__ */new Map(),
14
- j = /* @__PURE__ */new Map(),
12
+ var m = /* @__PURE__ */new Map(),
13
+ E = /* @__PURE__ */new Map(),
15
14
  M = 3e5,
16
- S = function S(c) {
15
+ F = function F(c) {
17
16
  return c === null || _typeof(c) > "u" || c === "";
18
17
  },
19
18
  O = function O(c) {
20
- var n;
21
- return (((n = config.getConfig()) == null ? undefined : n.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(c);
19
+ var t;
20
+ return (((t = config.getConfig()) == null ? undefined : t.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(c);
22
21
  },
23
- F = /*#__PURE__*/function () {
22
+ S = /*#__PURE__*/function () {
24
23
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(c) {
25
- var g, _g$currentLang, n, _g$baseUrl, a, _g$appName, h, _g$isPullFrontEnd, _, _g$isPullBack, I, _g$isDasUI, N, _g$fallbackBaseUrl, i, f, d, b, s, _iterator, _step, r, w, m, u, _s, _iterator2, _step2, _r, _w, _m, _u, _s2, _r2, _t3, _t4;
24
+ var U, _U$currentLang, t, _U$baseUrl, o, _U$appName, g, _U$isPullFrontEnd, _, _U$isPullBack, N, _U$isDasUI, x, _U$fallbackBaseUrl, r, f, d, k, a, _iterator, _step, s, h, $, u, _a, _iterator2, _step2, _s, _h, _$, _u, _a2, _s2, _t3, _t4;
26
25
  return _regenerator().w(function (_context5) {
27
26
  while (1) switch (_context5.p = _context5.n) {
28
27
  case 0:
29
- g = c || {};
30
- _g$currentLang = g.currentLang, n = _g$currentLang === void 0 ? "zh-CN" : _g$currentLang, _g$baseUrl = g.baseUrl, a = _g$baseUrl === void 0 ? "/" : _g$baseUrl, _g$appName = g.appName, h = _g$appName === void 0 ? "jc" : _g$appName, _g$isPullFrontEnd = g.isPullFrontEnd, _ = _g$isPullFrontEnd === void 0 ? true : _g$isPullFrontEnd, _g$isPullBack = g.isPullBack, I = _g$isPullBack === void 0 ? false : _g$isPullBack, _g$isDasUI = g.isDasUI, N = _g$isDasUI === void 0 ? false : _g$isDasUI, _g$fallbackBaseUrl = g.fallbackBaseUrl, i = _g$fallbackBaseUrl === void 0 ? "" : _g$fallbackBaseUrl;
31
- (typeof n != "string" || !n) && (n = "zh-CN");
28
+ U = c || {};
29
+ _U$currentLang = U.currentLang, t = _U$currentLang === void 0 ? "zh-CN" : _U$currentLang, _U$baseUrl = U.baseUrl, o = _U$baseUrl === void 0 ? "/" : _U$baseUrl, _U$appName = U.appName, g = _U$appName === void 0 ? "jc" : _U$appName, _U$isPullFrontEnd = U.isPullFrontEnd, _ = _U$isPullFrontEnd === void 0 ? true : _U$isPullFrontEnd, _U$isPullBack = U.isPullBack, N = _U$isPullBack === void 0 ? false : _U$isPullBack, _U$isDasUI = U.isDasUI, x = _U$isDasUI === void 0 ? false : _U$isDasUI, _U$fallbackBaseUrl = U.fallbackBaseUrl, r = _U$fallbackBaseUrl === void 0 ? "" : _U$fallbackBaseUrl;
30
+ (typeof t != "string" || !t) && (t = "zh-CN");
32
31
  f = [];
33
- Array.isArray(h) ? (f = h.filter(function (s) {
34
- return typeof s == "string" && s;
35
- }), f.length === 0 && (f = ["jc"])) : typeof h == "string" && h ? f = [h] : f = ["jc"], typeof a != "string" && (a = "/"), a || (a = "/"), a.endsWith("/") || (a = a + "/"), typeof i != "string" && (i = ""), i && !i.endsWith("/") && (i = i + "/");
32
+ Array.isArray(g) ? (f = g.filter(function (a) {
33
+ return typeof a == "string" && a;
34
+ }), f.length === 0 && (f = ["jc"])) : typeof g == "string" && g ? f = [g] : f = ["jc"], typeof o != "string" && (o = "/"), o || (o = "/"), o.endsWith("/") || (o = o + "/"), typeof r != "string" && (r = ""), r && !r.endsWith("/") && (r = r + "/");
36
35
  d = {
37
36
  frontEnd: null,
38
37
  // 统一格式:{ appName1: data1, appName2: data2, ... }
@@ -40,24 +39,24 @@ var k = /* @__PURE__ */new Map(),
40
39
  backMsg: null
41
40
  // 统一格式:{ appName1: data1, appName2: data2, ... }
42
41
  };
43
- b = /*#__PURE__*/function () {
44
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(s, r) {
45
- var w,
46
- m,
42
+ k = /*#__PURE__*/function () {
43
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(a, s) {
44
+ var h,
45
+ $,
47
46
  u,
48
- x,
49
- E,
50
- U,
47
+ C,
48
+ b,
49
+ j,
51
50
  l,
52
51
  _args4 = arguments;
53
52
  return _regenerator().w(function (_context4) {
54
53
  while (1) switch (_context4.n) {
55
54
  case 0:
56
- w = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : "zh-CN";
57
- m = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : "资源";
55
+ h = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : "zh-CN";
56
+ $ = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : "资源";
58
57
  u = /*#__PURE__*/function () {
59
58
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(l) {
60
- var t, _t, _t2;
59
+ var n, _t, _t2;
61
60
  return _regenerator().w(function (_context) {
62
61
  while (1) switch (_context.p = _context.n) {
63
62
  case 0:
@@ -71,8 +70,8 @@ var k = /* @__PURE__ */new Map(),
71
70
  cache: "no-cache"
72
71
  });
73
72
  case 1:
74
- t = _context.v;
75
- if (!(!t || !t.ok)) {
73
+ n = _context.v;
74
+ if (!(!n || !n.ok)) {
76
75
  _context.n = 2;
77
76
  break;
78
77
  }
@@ -81,23 +80,23 @@ var k = /* @__PURE__ */new Map(),
81
80
  break;
82
81
  case 2:
83
82
  _context.n = 3;
84
- return t.text();
83
+ return n.text();
85
84
  case 3:
86
85
  _t = _context.v;
87
86
  case 4:
88
87
  return _context.a(2, _t);
89
88
  case 5:
90
89
  _context.n = 6;
91
- return new Promise(function (t) {
90
+ return new Promise(function (n) {
92
91
  try {
93
92
  var e = new XMLHttpRequest();
94
93
  e.open("GET", l, !0), e.onreadystatechange = function () {
95
- e.readyState === 4 && t(e.status >= 200 && e.status < 300 ? e.responseText : null);
94
+ e.readyState === 4 && n(e.status >= 200 && e.status < 300 ? e.responseText : null);
96
95
  }, e.onerror = function () {
97
- t(null);
96
+ n(null);
98
97
  }, e.send();
99
98
  } catch (_unused) {
100
- t(null);
99
+ n(null);
101
100
  }
102
101
  });
103
102
  case 6:
@@ -118,24 +117,24 @@ var k = /* @__PURE__ */new Map(),
118
117
  return _ref3.apply(this, arguments);
119
118
  };
120
119
  }();
121
- x = function x(l) {
122
- var t = (l || "").replace(/^\uFEFF/, "");
120
+ C = function C(l) {
121
+ var n = (l || "").replace(/^\uFEFF/, "");
123
122
  try {
124
- var e = t.trim();
123
+ var e = n.trim();
125
124
  if (/^export\s+default\s*\{[\s\S]*\}\s*;?$/m.test(e)) {
126
- var o = e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1");
127
- var p = o.indexOf("{"),
128
- y = o.lastIndexOf("}");
129
- if (p !== -1 && y !== -1 && y > p) return o = o.slice(p, y + 1), o = o.replace(/,\s*([}\]])/g, "$1"), JSON.parse(o);
125
+ var i = e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1");
126
+ var p = i.indexOf("{"),
127
+ y = i.lastIndexOf("}");
128
+ if (p !== -1 && y !== -1 && y > p) return i = i.slice(p, y + 1), i = i.replace(/,\s*([}\]])/g, "$1"), JSON.parse(i);
130
129
  }
131
130
  } catch (_unused3) {
132
131
  return null;
133
132
  }
134
133
  };
135
- E = /*#__PURE__*/function () {
134
+ b = /*#__PURE__*/function () {
136
135
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(l) {
137
- var _o$value;
138
- var t, e, o, p;
136
+ var _i$value;
137
+ var n, e, i, p;
139
138
  return _regenerator().w(function (_context3) {
140
139
  while (1) switch (_context3.p = _context3.n) {
141
140
  case 0:
@@ -145,18 +144,18 @@ var k = /* @__PURE__ */new Map(),
145
144
  }
146
145
  return _context3.a(2, null);
147
146
  case 1:
148
- t = l, e = Date.now(), o = j.get(t);
149
- if (!(o && e - o.t <= M)) {
147
+ n = l, e = Date.now(), i = E.get(n);
148
+ if (!(i && e - i.t <= M)) {
150
149
  _context3.n = 2;
151
150
  break;
152
151
  }
153
- return _context3.a(2, o.ok ? (_o$value = o.value) !== null && _o$value !== void 0 ? _o$value : null : null);
152
+ return _context3.a(2, i.ok ? (_i$value = i.value) !== null && _i$value !== void 0 ? _i$value : null : null);
154
153
  case 2:
155
- if (!k.has(t)) {
154
+ if (!m.has(n)) {
156
155
  _context3.n = 3;
157
156
  break;
158
157
  }
159
- return _context3.a(2, k.get(t));
158
+ return _context3.a(2, m.get(n));
160
159
  case 3:
161
160
  p = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
162
161
  var y, L;
@@ -164,21 +163,21 @@ var k = /* @__PURE__ */new Map(),
164
163
  while (1) switch (_context2.n) {
165
164
  case 0:
166
165
  _context2.n = 1;
167
- return u(t);
166
+ return u(n);
168
167
  case 1:
169
168
  y = _context2.v;
170
169
  if (y) {
171
170
  _context2.n = 2;
172
171
  break;
173
172
  }
174
- return _context2.a(2, (j.set(t, {
173
+ return _context2.a(2, (E.set(n, {
175
174
  ok: false,
176
175
  value: null,
177
176
  t: e
178
177
  }), null));
179
178
  case 2:
180
- L = x(y);
181
- return _context2.a(2, (j.set(t, {
179
+ L = C(y);
180
+ return _context2.a(2, (E.set(n, {
182
181
  ok: true,
183
182
  value: L,
184
183
  t: Date.now()
@@ -186,7 +185,7 @@ var k = /* @__PURE__ */new Map(),
186
185
  }
187
186
  }, _callee2);
188
187
  }))();
189
- k.set(t, p);
188
+ m.set(n, p);
190
189
  _context3.p = 4;
191
190
  _context3.n = 5;
192
191
  return p;
@@ -194,33 +193,33 @@ var k = /* @__PURE__ */new Map(),
194
193
  return _context3.a(2, _context3.v);
195
194
  case 6:
196
195
  _context3.p = 6;
197
- k["delete"](t);
196
+ m["delete"](n);
198
197
  return _context3.f(6);
199
198
  case 7:
200
199
  return _context3.a(2);
201
200
  }
202
201
  }, _callee3, null, [[4,, 6, 7]]);
203
202
  }));
204
- return function E(_x5) {
203
+ return function b(_x5) {
205
204
  return _ref4.apply(this, arguments);
206
205
  };
207
206
  }();
208
207
  _context4.n = 1;
209
- return E(s);
208
+ return b(a);
210
209
  case 1:
211
- U = _context4.v;
212
- if (!U) {
210
+ j = _context4.v;
211
+ if (!j) {
213
212
  _context4.n = 2;
214
213
  break;
215
214
  }
216
- return _context4.a(2, U);
215
+ return _context4.a(2, j);
217
216
  case 2:
218
- if (!(r && O(w))) {
217
+ if (!(s && O(h))) {
219
218
  _context4.n = 4;
220
219
  break;
221
220
  }
222
221
  _context4.n = 3;
223
- return E(r);
222
+ return b(s);
224
223
  case 3:
225
224
  l = _context4.v;
226
225
  if (!l) {
@@ -233,7 +232,7 @@ var k = /* @__PURE__ */new Map(),
233
232
  }
234
233
  }, _callee4);
235
234
  }));
236
- return function b(_x2, _x3) {
235
+ return function k(_x2, _x3) {
237
236
  return _ref2.apply(this, arguments);
238
237
  };
239
238
  }();
@@ -241,7 +240,7 @@ var k = /* @__PURE__ */new Map(),
241
240
  _context5.n = 9;
242
241
  break;
243
242
  }
244
- s = {};
243
+ a = {};
245
244
  _iterator = _createForOfIteratorHelper(f);
246
245
  _context5.p = 1;
247
246
  _iterator.s();
@@ -250,14 +249,14 @@ var k = /* @__PURE__ */new Map(),
250
249
  _context5.n = 5;
251
250
  break;
252
251
  }
253
- r = _step.value;
254
- w = "".concat(a, "front-end/i18n/front-end-page/").concat(r, "_").concat(n, ".js");
255
- m = i ? "".concat(i, "front-end/i18n/front-end-page/").concat(r, "_").concat(n, ".js") : undefined;
252
+ s = _step.value;
253
+ h = "".concat(o, "front-end/i18n/front-end-page/").concat(s, "_").concat(t, ".js");
254
+ $ = r ? "".concat(r, "front-end/i18n/front-end-page/").concat(s, "_").concat(t, ".js") : undefined;
256
255
  _context5.n = 3;
257
- return b(w, m, n, "\u524D\u7AEF\u4E1A\u52A1\u8BED\u8A00\u8D44\u6E90(".concat(r, ")"));
256
+ return k(h, $, t, "\u524D\u7AEF\u4E1A\u52A1\u8BED\u8A00\u8D44\u6E90(".concat(s, ")"));
258
257
  case 3:
259
258
  u = _context5.v;
260
- u && (s[r] = u, true);
259
+ u && (a[s] = u, true);
261
260
  case 4:
262
261
  _context5.n = 2;
263
262
  break;
@@ -273,13 +272,13 @@ var k = /* @__PURE__ */new Map(),
273
272
  _iterator.f();
274
273
  return _context5.f(7);
275
274
  case 8:
276
- Object.keys(s).length > 0 && (d.frontEnd = s);
275
+ Object.keys(a).length > 0 && (d.frontEnd = a);
277
276
  case 9:
278
- if (!I) {
277
+ if (!N) {
279
278
  _context5.n = 18;
280
279
  break;
281
280
  }
282
- _s = {};
281
+ _a = {};
283
282
  _iterator2 = _createForOfIteratorHelper(f);
284
283
  _context5.p = 10;
285
284
  _iterator2.s();
@@ -288,14 +287,14 @@ var k = /* @__PURE__ */new Map(),
288
287
  _context5.n = 14;
289
288
  break;
290
289
  }
291
- _r = _step2.value;
292
- _w = "".concat(a, "front-end/i18n/return-msg/").concat(_r, "_").concat(n, ".js");
293
- _m = i ? "".concat(i, "front-end/i18n/return-msg/").concat(_r, "_").concat(n, ".js") : undefined;
290
+ _s = _step2.value;
291
+ _h = "".concat(o, "front-end/i18n/return-msg/").concat(_s, "_").concat(t, ".js");
292
+ _$ = r ? "".concat(r, "front-end/i18n/return-msg/").concat(_s, "_").concat(t, ".js") : undefined;
294
293
  _context5.n = 12;
295
- return b(_w, _m, n, "\u540E\u7AEF\u8BED\u8A00\u8D44\u6E90(".concat(_r, ")"));
294
+ return k(_h, _$, t, "\u540E\u7AEF\u8BED\u8A00\u8D44\u6E90(".concat(_s, ")"));
296
295
  case 12:
297
296
  _u = _context5.v;
298
- _u && (_s[_r] = _u, true);
297
+ _u && (_a[_s] = _u, true);
299
298
  case 13:
300
299
  _context5.n = 11;
301
300
  break;
@@ -311,15 +310,15 @@ var k = /* @__PURE__ */new Map(),
311
310
  _iterator2.f();
312
311
  return _context5.f(16);
313
312
  case 17:
314
- Object.keys(_s).length > 0 && (d.backMsg = _s);
313
+ Object.keys(_a).length > 0 && (d.backMsg = _a);
315
314
  case 18:
316
- if (!N) {
315
+ if (!x) {
317
316
  _context5.n = 20;
318
317
  break;
319
318
  }
320
- _s2 = "".concat(a, "front-end/i18n/front-end-page/dasui_").concat(n, ".js"), _r2 = i ? "".concat(i, "front-end/i18n/front-end-page/dasui_").concat(n, ".js") : undefined;
319
+ _a2 = "".concat(o, "front-end/i18n/front-end-page/dasui_").concat(t, ".js"), _s2 = r ? "".concat(r, "front-end/i18n/front-end-page/dasui_").concat(t, ".js") : undefined;
321
320
  _context5.n = 19;
322
- return b(_s2, _r2, n, "UI组件库语言资源");
321
+ return k(_a2, _s2, t, "UI组件库语言资源");
323
322
  case 19:
324
323
  d.dasUiEnd = _context5.v;
325
324
  d.dasUiEnd && true;
@@ -328,40 +327,10 @@ var k = /* @__PURE__ */new Map(),
328
327
  }
329
328
  }, _callee5, null, [[10, 15, 16, 17], [1, 6, 7, 8]]);
330
329
  }));
331
- return function F(_x) {
330
+ return function S(_x) {
332
331
  return _ref.apply(this, arguments);
333
332
  };
334
- }(),
335
- z = /*#__PURE__*/function () {
336
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
337
- var c,
338
- g,
339
- a,
340
- _args6 = arguments;
341
- return _regenerator().w(function (_context6) {
342
- while (1) switch (_context6.n) {
343
- case 0:
344
- c = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : "front-end";
345
- g = {};
346
- _context6.n = 1;
347
- return function (specifier) {
348
- return new Promise(function (r) {
349
- return r(specifier);
350
- }).then(function (s) {
351
- return _interopRequireWildcard(require(s));
352
- });
353
- }(/* @vite-ignore */"/i18n/".concat(c, "/global.js"));
354
- case 1:
355
- a = _context6.v;
356
- return _context6.a(2, (g = (a == null ? undefined : a["default"]) || {}, g));
357
- }
358
- }, _callee6);
359
- }));
360
- return function z() {
361
- return _ref6.apply(this, arguments);
362
- };
363
333
  }();
364
- exports.handleGlobalI18n = z;
365
- exports.handleI18nData = F;
334
+ exports.handleI18nData = S;
366
335
  exports.isCurrentLangInSysLang = O;
367
- exports.isEmpty = S;
336
+ exports.isEmpty = F;
@@ -17,7 +17,3 @@ export declare const isCurrentLangInSysLang: (lang: string) => any;
17
17
  * @param opt.fallbackBaseUrl - 回退资源路径,默认 ''
18
18
  */
19
19
  export declare const handleI18nData: (opt: any) => unknown;
20
- /**
21
- * 处理不同语言包中公共的全局变量
22
- */
23
- export declare const handleGlobalI18n: (pathname?: string) => unknown;
@@ -1,21 +1,21 @@
1
- import { getConfig as C } from "@das-fed/upf-utils/config";
2
- const k = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), M = 3e5, S = (c) => c === null || typeof c > "u" || c === "", O = (c) => {
3
- var n;
4
- return (((n = C()) == null ? void 0 : n.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(c);
5
- }, F = async (c) => {
6
- const g = c || {};
1
+ import { getConfig as I } from "@das-fed/upf-utils/config";
2
+ const m = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), M = 3e5, F = (c) => c === null || typeof c > "u" || c === "", O = (c) => {
3
+ var t;
4
+ return (((t = I()) == null ? void 0 : t.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(c);
5
+ }, S = async (c) => {
6
+ const U = c || {};
7
7
  let {
8
- currentLang: n = "zh-CN",
9
- baseUrl: a = "/",
10
- appName: h = "jc",
8
+ currentLang: t = "zh-CN",
9
+ baseUrl: o = "/",
10
+ appName: g = "jc",
11
11
  isPullFrontEnd: _ = !0,
12
- isPullBack: I = !1,
13
- isDasUI: N = !1,
14
- fallbackBaseUrl: i = ""
15
- } = g;
16
- (typeof n != "string" || !n) && (n = "zh-CN");
12
+ isPullBack: N = !1,
13
+ isDasUI: x = !1,
14
+ fallbackBaseUrl: r = ""
15
+ } = U;
16
+ (typeof t != "string" || !t) && (t = "zh-CN");
17
17
  let f = [];
18
- Array.isArray(h) ? (f = h.filter((s) => typeof s == "string" && s), f.length === 0 && (f = ["jc"])) : typeof h == "string" && h ? f = [h] : f = ["jc"], typeof a != "string" && (a = "/"), a || (a = "/"), a.endsWith("/") || (a = a + "/"), typeof i != "string" && (i = ""), i && !i.endsWith("/") && (i = i + "/");
18
+ Array.isArray(g) ? (f = g.filter((a) => typeof a == "string" && a), f.length === 0 && (f = ["jc"])) : typeof g == "string" && g ? f = [g] : f = ["jc"], typeof o != "string" && (o = "/"), o || (o = "/"), o.endsWith("/") || (o = o + "/"), typeof r != "string" && (r = ""), r && !r.endsWith("/") && (r = r + "/");
19
19
  const d = {
20
20
  frontEnd: null,
21
21
  // 统一格式:{ appName1: data1, appName2: data2, ... }
@@ -23,115 +23,108 @@ const k = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), M = 3e5, S =
23
23
  backMsg: null
24
24
  // 统一格式:{ appName1: data1, appName2: data2, ... }
25
25
  };
26
- let $ = !1;
27
- const b = async (s, r, w = "zh-CN", m = "资源") => {
26
+ let w = !1;
27
+ const k = async (a, s, h = "zh-CN", $ = "资源") => {
28
28
  const u = async (l) => {
29
29
  try {
30
30
  if (typeof window < "u" && typeof window.fetch == "function") {
31
- const t = await window.fetch(l, { cache: "no-cache" });
32
- return !t || !t.ok ? null : await t.text();
31
+ const n = await window.fetch(l, { cache: "no-cache" });
32
+ return !n || !n.ok ? null : await n.text();
33
33
  } else
34
- return await new Promise((t) => {
34
+ return await new Promise((n) => {
35
35
  try {
36
36
  const e = new XMLHttpRequest();
37
37
  e.open("GET", l, !0), e.onreadystatechange = function() {
38
- e.readyState === 4 && t(e.status >= 200 && e.status < 300 ? e.responseText : null);
38
+ e.readyState === 4 && n(e.status >= 200 && e.status < 300 ? e.responseText : null);
39
39
  }, e.onerror = function() {
40
- t(null);
40
+ n(null);
41
41
  }, e.send();
42
42
  } catch {
43
- t(null);
43
+ n(null);
44
44
  }
45
45
  });
46
46
  } catch {
47
47
  return null;
48
48
  }
49
- }, x = (l) => {
50
- const t = (l || "").replace(/^\uFEFF/, "");
49
+ }, C = (l) => {
50
+ const n = (l || "").replace(/^\uFEFF/, "");
51
51
  try {
52
- const e = t.trim();
52
+ const e = n.trim();
53
53
  if (/^export\s+default\s*\{[\s\S]*\}\s*;?$/m.test(e)) {
54
- let o = e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1");
55
- const p = o.indexOf("{"), y = o.lastIndexOf("}");
54
+ let i = e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1");
55
+ const p = i.indexOf("{"), y = i.lastIndexOf("}");
56
56
  if (p !== -1 && y !== -1 && y > p)
57
- return o = o.slice(p, y + 1), o = o.replace(/,\s*([}\]])/g, "$1"), JSON.parse(o);
57
+ return i = i.slice(p, y + 1), i = i.replace(/,\s*([}\]])/g, "$1"), JSON.parse(i);
58
58
  }
59
59
  } catch {
60
60
  return null;
61
61
  }
62
- }, E = async (l) => {
62
+ }, b = async (l) => {
63
63
  if (!l) return null;
64
- const t = l, e = Date.now(), o = j.get(t);
65
- if (o && e - o.t <= M)
66
- return o.ok ? o.value ?? null : null;
67
- if (k.has(t)) return k.get(t);
64
+ const n = l, e = Date.now(), i = E.get(n);
65
+ if (i && e - i.t <= M)
66
+ return i.ok ? i.value ?? null : null;
67
+ if (m.has(n)) return m.get(n);
68
68
  const p = (async () => {
69
- const y = await u(t);
69
+ const y = await u(n);
70
70
  if (!y)
71
- return j.set(t, { ok: !1, value: null, t: e }), null;
72
- const L = x(y);
73
- return j.set(t, { ok: !0, value: L, t: Date.now() }), L ?? null;
71
+ return E.set(n, { ok: !1, value: null, t: e }), null;
72
+ const L = C(y);
73
+ return E.set(n, { ok: !0, value: L, t: Date.now() }), L ?? null;
74
74
  })();
75
- k.set(t, p);
75
+ m.set(n, p);
76
76
  try {
77
77
  return await p;
78
78
  } finally {
79
- k.delete(t);
79
+ m.delete(n);
80
80
  }
81
- }, U = await E(s);
82
- if (U) return U;
83
- if (r && O(w)) {
84
- const l = await E(r);
81
+ }, j = await b(a);
82
+ if (j) return j;
83
+ if (s && O(h)) {
84
+ const l = await b(s);
85
85
  if (l) return l;
86
86
  }
87
87
  return null;
88
88
  };
89
89
  if (_) {
90
- const s = {};
91
- for (const r of f) {
92
- const w = `${a}front-end/i18n/front-end-page/${r}_${n}.js`, m = i ? `${i}front-end/i18n/front-end-page/${r}_${n}.js` : void 0, u = await b(
93
- w,
94
- m,
95
- n,
96
- `前端业务语言资源(${r})`
90
+ const a = {};
91
+ for (const s of f) {
92
+ const h = `${o}front-end/i18n/front-end-page/${s}_${t}.js`, $ = r ? `${r}front-end/i18n/front-end-page/${s}_${t}.js` : void 0, u = await k(
93
+ h,
94
+ $,
95
+ t,
96
+ `前端业务语言资源(${s})`
97
97
  );
98
- u && (s[r] = u, $ = !0);
98
+ u && (a[s] = u, w = !0);
99
99
  }
100
- Object.keys(s).length > 0 && (d.frontEnd = s);
100
+ Object.keys(a).length > 0 && (d.frontEnd = a);
101
101
  }
102
- if (I) {
103
- const s = {};
104
- for (const r of f) {
105
- const w = `${a}front-end/i18n/return-msg/${r}_${n}.js`, m = i ? `${i}front-end/i18n/return-msg/${r}_${n}.js` : void 0, u = await b(
106
- w,
107
- m,
108
- n,
109
- `后端语言资源(${r})`
102
+ if (N) {
103
+ const a = {};
104
+ for (const s of f) {
105
+ const h = `${o}front-end/i18n/return-msg/${s}_${t}.js`, $ = r ? `${r}front-end/i18n/return-msg/${s}_${t}.js` : void 0, u = await k(
106
+ h,
107
+ $,
108
+ t,
109
+ `后端语言资源(${s})`
110
110
  );
111
- u && (s[r] = u, $ = !0);
111
+ u && (a[s] = u, w = !0);
112
112
  }
113
- Object.keys(s).length > 0 && (d.backMsg = s);
113
+ Object.keys(a).length > 0 && (d.backMsg = a);
114
114
  }
115
- if (N) {
116
- const s = `${a}front-end/i18n/front-end-page/dasui_${n}.js`, r = i ? `${i}front-end/i18n/front-end-page/dasui_${n}.js` : void 0;
117
- d.dasUiEnd = await b(
115
+ if (x) {
116
+ const a = `${o}front-end/i18n/front-end-page/dasui_${t}.js`, s = r ? `${r}front-end/i18n/front-end-page/dasui_${t}.js` : void 0;
117
+ d.dasUiEnd = await k(
118
+ a,
118
119
  s,
119
- r,
120
- n,
120
+ t,
121
121
  "UI组件库语言资源"
122
- ), d.dasUiEnd && ($ = !0);
122
+ ), d.dasUiEnd && (w = !0);
123
123
  }
124
124
  return d;
125
- }, z = async (c = "front-end") => {
126
- let g = {}, a = await import(
127
- /* @vite-ignore */
128
- `/i18n/${c}/global.js`
129
- );
130
- return g = (a == null ? void 0 : a.default) || {}, g;
131
125
  };
132
126
  export {
133
- z as handleGlobalI18n,
134
- F as handleI18nData,
127
+ S as handleI18nData,
135
128
  O as isCurrentLangInSysLang,
136
- S as isEmpty
129
+ F as isEmpty
137
130
  };
Binary file
Binary file
Binary file