@das-fed/upf-utils 6.4.0-dev.185 → 6.4.0-dev.187

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 (70) hide show
  1. package/api-services/es5.js +943 -946
  2. package/api-services/index.js +700 -704
  3. package/api-services/index.js.gz +0 -0
  4. package/api-services/modules/app-manage/es5.js +980 -968
  5. package/api-services/modules/app-manage/index.js +804 -786
  6. package/api-services/modules/app-manage/index.js.gz +0 -0
  7. package/api-services/modules/authentication/es5.js +978 -969
  8. package/api-services/modules/authentication/index.js +802 -788
  9. package/api-services/modules/authentication/index.js.gz +0 -0
  10. package/api-services/modules/bems/es5.js +798 -796
  11. package/api-services/modules/bems/index.js +621 -617
  12. package/api-services/modules/bems/index.js.gz +0 -0
  13. package/api-services/modules/contract/es5.js +980 -968
  14. package/api-services/modules/contract/index.js +804 -786
  15. package/api-services/modules/contract/index.js.gz +0 -0
  16. package/api-services/modules/enterpriseright/es5.js +968 -980
  17. package/api-services/modules/enterpriseright/index.js +786 -804
  18. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  19. package/api-services/modules/es5.js +1187 -1175
  20. package/api-services/modules/file/es5.js +1091 -1103
  21. package/api-services/modules/file/index.js +882 -900
  22. package/api-services/modules/file/index.js.gz +0 -0
  23. package/api-services/modules/index.js +946 -928
  24. package/api-services/modules/index.js.gz +0 -0
  25. package/api-services/modules/justauth/es5.js +982 -970
  26. package/api-services/modules/justauth/index.js +805 -787
  27. package/api-services/modules/justauth/index.js.gz +0 -0
  28. package/api-services/modules/knowledge/es5.js +980 -968
  29. package/api-services/modules/knowledge/index.js +804 -786
  30. package/api-services/modules/knowledge/index.js.gz +0 -0
  31. package/api-services/modules/link/es5.js +980 -968
  32. package/api-services/modules/link/index.js +804 -786
  33. package/api-services/modules/link/index.js.gz +0 -0
  34. package/api-services/modules/permission/es5.js +978 -969
  35. package/api-services/modules/permission/index.js +802 -788
  36. package/api-services/modules/permission/index.js.gz +0 -0
  37. package/api-services/modules/portal/es5.js +980 -968
  38. package/api-services/modules/portal/index.js +804 -786
  39. package/api-services/modules/portal/index.js.gz +0 -0
  40. package/api-services/modules/space-manage/es5.js +980 -968
  41. package/api-services/modules/space-manage/index.js +804 -786
  42. package/api-services/modules/space-manage/index.js.gz +0 -0
  43. package/api-services/modules/super-admin/es5.js +996 -984
  44. package/api-services/modules/super-admin/index.js +817 -799
  45. package/api-services/modules/super-admin/index.js.gz +0 -0
  46. package/api-services/modules/supplier/es5.js +990 -1002
  47. package/api-services/modules/supplier/index.js +804 -822
  48. package/api-services/modules/supplier/index.js.gz +0 -0
  49. package/api-services/modules/systemConfiguration/es5.js +968 -980
  50. package/api-services/modules/systemConfiguration/index.js +786 -804
  51. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  52. package/api-services/modules/tool/es5.js +801 -798
  53. package/api-services/modules/tool/index.js +621 -617
  54. package/api-services/modules/tool/index.js.gz +0 -0
  55. package/api-services/src/create-service/es5.js +978 -966
  56. package/api-services/src/create-service/index.js +803 -785
  57. package/api-services/src/create-service/index.js.gz +0 -0
  58. package/common-info/es5.js +147 -112
  59. package/common-info/index.d.ts +5 -1
  60. package/common-info/index.js +82 -56
  61. package/common-info/index.js.gz +0 -0
  62. package/common-info/type.d.ts +15 -0
  63. package/common-tools/handle-data/es5.js +156 -185
  64. package/common-tools/handle-data/index.js +106 -87
  65. package/common-tools/handle-data/index.js.gz +0 -0
  66. package/directive/auth/es5.js +47 -61
  67. package/directive/auth/index.js +41 -48
  68. package/directive/auth/index.js.gz +0 -0
  69. package/esm-map.json +3 -1
  70. package/package.json +4 -4
@@ -1,130 +1,149 @@
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 || {};
1
+ import { getConfig as _ } from "@das-fed/upf-utils/config";
2
+ const M = (f) => f === null || typeof f > "u" || f === "", z = (f) => {
3
+ var n;
4
+ return (((n = _()) == null ? void 0 : n.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(f);
5
+ }, A = async (f) => {
6
+ const x = f || {};
7
7
  let {
8
- currentLang: t = "zh-CN",
9
- baseUrl: o = "/",
10
- appName: g = "jc",
11
- isPullFrontEnd: _ = !0,
8
+ currentLang: n = "zh-CN",
9
+ baseUrl: c = "/",
10
+ appName: h = "jc",
11
+ isPullFrontEnd: L = !0,
12
12
  isPullBack: N = !1,
13
- isDasUI: x = !1,
14
- fallbackBaseUrl: r = ""
15
- } = U;
16
- (typeof t != "string" || !t) && (t = "zh-CN");
17
- let f = [];
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
- const d = {
13
+ isDasUI: O = !1,
14
+ fallbackBaseUrl: a = ""
15
+ } = x;
16
+ (typeof n != "string" || !n) && (n = "zh-CN");
17
+ let l = [];
18
+ Array.isArray(h) ? (l = h.filter((r) => typeof r == "string" && r), l.length === 0 && (l = ["jc"])) : typeof h == "string" && h ? l = [h] : l = ["jc"], typeof c != "string" && (c = "/"), c || (c = "/"), c.endsWith("/") || (c = c + "/"), typeof a != "string" && (a = ""), a && !a.endsWith("/") && (a = a + "/");
19
+ const y = {
20
20
  frontEnd: null,
21
21
  // 统一格式:{ appName1: data1, appName2: data2, ... }
22
22
  dasUiEnd: null,
23
23
  backMsg: null
24
24
  // 统一格式:{ appName1: data1, appName2: data2, ... }
25
25
  };
26
- let w = !1;
27
- const k = async (a, s, h = "zh-CN", $ = "资源") => {
28
- const u = async (l) => {
26
+ let m = !1;
27
+ const j = async (r, s, $ = "zh-CN", w = "资源") => {
28
+ const u = async (i) => {
29
29
  try {
30
30
  if (typeof window < "u" && typeof window.fetch == "function") {
31
- const n = await window.fetch(l, { cache: "no-cache" });
32
- return !n || !n.ok ? null : await n.text();
31
+ const o = await window.fetch(i, { cache: "no-cache" });
32
+ return !o || !o.ok ? null : await o.text();
33
33
  } else
34
- return await new Promise((n) => {
34
+ return await new Promise((o) => {
35
35
  try {
36
- const e = new XMLHttpRequest();
37
- e.open("GET", l, !0), e.onreadystatechange = function() {
38
- e.readyState === 4 && n(e.status >= 200 && e.status < 300 ? e.responseText : null);
39
- }, e.onerror = function() {
40
- n(null);
41
- }, e.send();
36
+ const t = new XMLHttpRequest();
37
+ t.open("GET", i, !0), t.onreadystatechange = function() {
38
+ t.readyState === 4 && o(t.status >= 200 && t.status < 300 ? t.responseText : null);
39
+ }, t.onerror = function() {
40
+ o(null);
41
+ }, t.send();
42
42
  } catch {
43
- n(null);
43
+ o(null);
44
44
  }
45
45
  });
46
46
  } catch {
47
47
  return null;
48
48
  }
49
- }, C = (l) => {
50
- const n = (l || "").replace(/^\uFEFF/, "");
49
+ }, F = (i) => {
50
+ if (!i || typeof i != "string")
51
+ return null;
52
+ const t = i.replace(/^\uFEFF/, "").trim();
53
+ if (t.startsWith("{"))
54
+ try {
55
+ const e = JSON.parse(t);
56
+ if (e && typeof e == "object")
57
+ return e;
58
+ } catch {
59
+ }
60
+ const b = t.match(/export\s+default\s*/);
61
+ if (!b || b.index === void 0)
62
+ return null;
51
63
  try {
52
- const e = n.trim();
53
- if (/^export\s+default\s*\{[\s\S]*\}\s*;?$/m.test(e)) {
54
- let i = e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1");
55
- const p = i.indexOf("{"), y = i.lastIndexOf("}");
56
- if (p !== -1 && y !== -1 && y > p)
57
- return i = i.slice(p, y + 1), i = i.replace(/,\s*([}\]])/g, "$1"), JSON.parse(i);
64
+ let e = t.substring(b.index);
65
+ if (e = e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1").trim(), e = e.replace(/^\s*export\s+default\s*/, "").replace(/;?\s*$/, "").trim(), !e)
66
+ return null;
67
+ try {
68
+ const d = new Function(`return ${e}`)();
69
+ if (d && typeof d == "object")
70
+ return d;
71
+ } catch {
72
+ }
73
+ try {
74
+ const g = e.indexOf("{"), d = e.lastIndexOf("}");
75
+ if (g === -1 || d === -1 || d <= g)
76
+ return null;
77
+ let p = e.slice(g, d + 1);
78
+ p = p.replace(
79
+ /([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g,
80
+ '$1"$2":'
81
+ ), p = p.replace(/'([^'\\]*(\\.[^'\\]*)*)'/g, '"$1"'), p = p.replace(/,\s*([}\]])/g, "$1");
82
+ const E = JSON.parse(p);
83
+ if (E && typeof E == "object")
84
+ return E;
85
+ } catch {
58
86
  }
87
+ return null;
59
88
  } catch {
60
89
  return null;
61
90
  }
62
- }, b = async (l) => {
63
- if (!l) return null;
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
- const p = (async () => {
69
- const y = await u(n);
70
- if (!y)
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
- })();
75
- m.set(n, p);
76
- try {
77
- return await p;
78
- } finally {
79
- m.delete(n);
80
- }
81
- }, j = await b(a);
82
- if (j) return j;
83
- if (s && O(h)) {
84
- const l = await b(s);
85
- if (l) return l;
91
+ }, U = async (i) => {
92
+ if (!i) return null;
93
+ const o = await u(i);
94
+ if (!o)
95
+ return null;
96
+ const t = F(o);
97
+ return t !== null && typeof t == "object" ? t : null;
98
+ }, k = await U(r);
99
+ if (k)
100
+ return k;
101
+ if (s && z($)) {
102
+ const i = await U(s);
103
+ if (i)
104
+ return i;
86
105
  }
87
106
  return null;
88
107
  };
89
- if (_) {
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,
108
+ if (L) {
109
+ const r = {};
110
+ for (const s of l) {
111
+ const $ = `${c}front-end/i18n/front-end-page/${s}_${n}.js`, w = a ? `${a}front-end/i18n/front-end-page/${s}_${n}.js` : void 0, u = await j(
94
112
  $,
95
- t,
113
+ w,
114
+ n,
96
115
  `前端业务语言资源(${s})`
97
116
  );
98
- u && (a[s] = u, w = !0);
117
+ u && (r[s] = u, m = !0);
99
118
  }
100
- Object.keys(a).length > 0 && (d.frontEnd = a);
119
+ Object.keys(r).length > 0 && (y.frontEnd = r);
101
120
  }
102
121
  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,
122
+ const r = {};
123
+ for (const s of l) {
124
+ const $ = `${c}front-end/i18n/return-msg/${s}_${n}.js`, w = a ? `${a}front-end/i18n/return-msg/${s}_${n}.js` : void 0, u = await j(
107
125
  $,
108
- t,
126
+ w,
127
+ n,
109
128
  `后端语言资源(${s})`
110
129
  );
111
- u && (a[s] = u, w = !0);
130
+ u && (r[s] = u, m = !0);
112
131
  }
113
- Object.keys(a).length > 0 && (d.backMsg = a);
132
+ Object.keys(r).length > 0 && (y.backMsg = r);
114
133
  }
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,
134
+ if (O) {
135
+ const r = `${c}front-end/i18n/front-end-page/dasui_${n}.js`, s = a ? `${a}front-end/i18n/front-end-page/dasui_${n}.js` : void 0;
136
+ y.dasUiEnd = await j(
137
+ r,
119
138
  s,
120
- t,
139
+ n,
121
140
  "UI组件库语言资源"
122
- ), d.dasUiEnd && (w = !0);
141
+ ), y.dasUiEnd && (m = !0);
123
142
  }
124
- return d;
143
+ return y;
125
144
  };
126
145
  export {
127
- S as handleI18nData,
128
- O as isCurrentLangInSysLang,
129
- F as isEmpty
146
+ A as handleI18nData,
147
+ z as isCurrentLangInSysLang,
148
+ M as isEmpty
130
149
  };
@@ -3,25 +3,24 @@
3
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; } } }; }
4
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; } }
5
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; }
6
- var commonTools = require('@das-fed/upf-utils/common-tools/es5');
7
6
  var commonInfo = require('@das-fed/upf-utils/common-info/es5');
8
7
  var utils = require('@das-fed/upf-utils/directive/utils/es5');
9
- var A = function A(e, t) {
10
- if (!e || !t) return false;
11
- if (typeof t == "string") return !!e.find(function (s) {
12
- return s.code === t;
8
+ var m = function m(e, s) {
9
+ if (!e || !s) return false;
10
+ if (typeof s == "string") return !!e.find(function (r) {
11
+ return r.endsWith(s);
13
12
  });
14
13
  {
15
- var r = false;
16
- var _iterator = _createForOfIteratorHelper(t),
14
+ var t = false;
15
+ var _iterator = _createForOfIteratorHelper(s),
17
16
  _step;
18
17
  try {
19
18
  var _loop = function _loop() {
20
- var s = _step.value;
21
- if (e.find(function (a) {
22
- return a.code === s;
19
+ var r = _step.value;
20
+ if (e.find(function (i) {
21
+ return i.endsWith(r);
23
22
  })) {
24
- r = true;
23
+ t = true;
25
24
  return 1; // break
26
25
  }
27
26
  };
@@ -33,64 +32,51 @@ var A = function A(e, t) {
33
32
  } finally {
34
33
  _iterator.f();
35
34
  }
36
- return r;
35
+ return t;
37
36
  }
38
37
  },
39
- m = function m(e) {
40
- var _ref, _ref2, _ref3, _ref4;
41
- var n;
42
- var t = (_ref = e == null ? undefined : e.code) !== null && _ref !== void 0 ? _ref : "",
43
- r = (_ref2 = (_ref3 = e == null ? undefined : e.path) !== null && _ref3 !== void 0 ? _ref3 : location == null ? undefined : location.pathname) !== null && _ref2 !== void 0 ? _ref2 : "",
44
- s = (_ref4 = e == null ? undefined : e.applicationCode) !== null && _ref4 !== void 0 ? _ref4 : commonTools.getUrlParams(location.href, "app");
45
- var l = "";
46
- if (l = e != null && e.menuCode ? e.menuCode : commonTools.getUrlParams(location.href, "menu"), !l) {
47
- var _ref5;
48
- var c = (_ref5 = (n = commonInfo.getSubApps().currentSubApp) == null ? undefined : n.menus) !== null && _ref5 !== void 0 ? _ref5 : [];
49
- if (c && c.length) {
50
- var d = commonTools.flatTree(c).filter(function (f) {
51
- return f == null ? undefined : f.routeUrl;
52
- });
53
- if (d && d.length) {
54
- var _ref6;
55
- var f = d.find(function (u) {
56
- return u != null && u.applicationPath ? r == null ? undefined : r.includes("/" + u.applicationPath + u.routeUrl) : r == null ? undefined : r.includes(u.routeUrl);
57
- });
58
- f && (l = (_ref6 = f == null ? undefined : f.code) !== null && _ref6 !== void 0 ? _ref6 : "");
59
- }
38
+ n = function n(e) {
39
+ var _ref, _ref2;
40
+ var s = (_ref = e == null ? undefined : e.code) !== null && _ref !== void 0 ? _ref : "";
41
+ var t = (_ref2 = e == null ? undefined : e.menuCode) !== null && _ref2 !== void 0 ? _ref2 : "",
42
+ r = false;
43
+ if (s) {
44
+ var _commonInfo$getMenuIt;
45
+ var f = [];
46
+ if (!t) f = (_commonInfo$getMenuIt = commonInfo.getMenuItemInfo().authCodes) !== null && _commonInfo$getMenuIt !== void 0 ? _commonInfo$getMenuIt : [];else {
47
+ var i = commonInfo.getAuthobj()[t];
48
+ i && (r = i.some(function (l) {
49
+ return l.code === s;
50
+ }));
60
51
  }
61
- }
62
- var a = false;
63
- if (t) {
64
- var _commonInfo$getPageAu;
65
- var _c = (_commonInfo$getPageAu = commonInfo.getPageAuth(l, s)) !== null && _commonInfo$getPageAu !== void 0 ? _commonInfo$getPageAu : [];
66
- a = A(_c, t);
67
- } else a = !!commonInfo.getPageAuth(l, s);
68
- return a;
52
+ r = m(f, s);
53
+ } else t && (r = !!commonInfo.getAuthobj()[t]);
54
+ return r;
69
55
  },
70
- g = function g(e, t) {
71
- t === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
56
+ c = function c(e, s) {
57
+ s === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
72
58
  },
73
- b = function b(e, t) {
74
- t === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
59
+ h = function h(e, s) {
60
+ s === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
75
61
  },
76
- U = function U(e, t) {
77
- var _ref7;
78
- var r = (e ? t.value : t) || {};
79
- typeof r == "string" && (r = {
80
- code: r
62
+ A = function A(e, s) {
63
+ var _ref3;
64
+ var t = (e ? s.value : s) || {};
65
+ typeof t == "string" && (t = {
66
+ code: t
81
67
  });
82
- var s = (_ref7 = r == null ? undefined : r.type) !== null && _ref7 !== void 0 ? _ref7 : "hide",
83
- l = m(r);
84
- if (e) if (!t.oldValue) l || utils.getEl(e, r).then(function (a) {
85
- g(a, s);
68
+ var r = (_ref3 = t == null ? undefined : t.type) !== null && _ref3 !== void 0 ? _ref3 : "hide",
69
+ f = n(t);
70
+ if (e) if (!s.oldValue) f || utils.getEl(e, t).then(function (i) {
71
+ c(i, r);
86
72
  });else {
87
- var a = m(t.oldValue),
88
- n = l;
89
- if (a === n) return;
90
- utils.getEl(e, r).then(function (c) {
91
- n ? b(c, s) : g(c, s);
73
+ var i = n(s.oldValue),
74
+ l = f;
75
+ if (i === l) return;
76
+ utils.getEl(e, t).then(function (a) {
77
+ l ? h(a, r) : c(a, r);
92
78
  });
93
79
  }
94
- return l;
80
+ return f;
95
81
  };
96
- exports.vAuth = U;
82
+ exports.vAuth = A;
@@ -1,62 +1,55 @@
1
- import { getUrlParams as i, flatTree as P } from "@das-fed/upf-utils/common-tools";
2
- import { getSubApps as v, getPageAuth as o } from "@das-fed/upf-utils/common-info";
3
- import { getEl as h } from "@das-fed/upf-utils/directive/utils";
4
- const A = (e, t) => {
5
- if (!e || !t) return !1;
6
- if (typeof t == "string")
7
- return !!e.find((s) => s.code === t);
1
+ import { getMenuItemInfo as o, getAuthobj as d } from "@das-fed/upf-utils/common-info";
2
+ import { getEl as u } from "@das-fed/upf-utils/directive/utils";
3
+ const m = (e, s) => {
4
+ if (!e || !s) return !1;
5
+ if (typeof s == "string")
6
+ return !!e.find((r) => r.endsWith(s));
8
7
  {
9
- let r = !1;
10
- for (let s of t)
11
- if (e.find((a) => a.code === s)) {
12
- r = !0;
8
+ let t = !1;
9
+ for (let r of s)
10
+ if (e.find((i) => i.endsWith(r))) {
11
+ t = !0;
13
12
  break;
14
13
  }
15
- return r;
14
+ return t;
16
15
  }
17
- }, m = (e) => {
18
- var n;
19
- const t = (e == null ? void 0 : e.code) ?? "", r = (e == null ? void 0 : e.path) ?? (location == null ? void 0 : location.pathname) ?? "", s = (e == null ? void 0 : e.applicationCode) ?? i(location.href, "app");
20
- let l = "";
21
- if (l = e != null && e.menuCode ? e.menuCode : i(location.href, "menu"), !l) {
22
- const c = ((n = v().currentSubApp) == null ? void 0 : n.menus) ?? [];
23
- if (c && c.length) {
24
- const d = P(c).filter((f) => f == null ? void 0 : f.routeUrl);
25
- if (d && d.length) {
26
- const f = d.find((u) => u != null && u.applicationPath ? r == null ? void 0 : r.includes("/" + u.applicationPath + u.routeUrl) : r == null ? void 0 : r.includes(u.routeUrl));
27
- f && (l = (f == null ? void 0 : f.code) ?? "");
28
- }
16
+ }, n = (e) => {
17
+ const s = (e == null ? void 0 : e.code) ?? "";
18
+ let t = (e == null ? void 0 : e.menuCode) ?? "", r = !1;
19
+ if (s) {
20
+ let f = [];
21
+ if (!t)
22
+ f = o().authCodes ?? [];
23
+ else {
24
+ const i = d()[t];
25
+ i && (r = i.some((l) => l.code === s));
29
26
  }
30
- }
31
- let a = !1;
32
- if (t) {
33
- const c = o(l, s) ?? [];
34
- a = A(c, t);
27
+ r = m(f, s);
35
28
  } else
36
- a = !!o(l, s);
37
- return a;
38
- }, g = (e, t) => {
39
- t === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
40
- }, b = (e, t) => {
41
- t === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
42
- }, U = (e, t) => {
43
- let r = (e ? t.value : t) || {};
44
- typeof r == "string" && (r = { code: r });
45
- const s = (r == null ? void 0 : r.type) ?? "hide", l = m(r);
29
+ t && (r = !!d()[t]);
30
+ return r;
31
+ }, c = (e, s) => {
32
+ s === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
33
+ }, h = (e, s) => {
34
+ s === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
35
+ }, A = (e, s) => {
36
+ let t = (e ? s.value : s) || {};
37
+ typeof t == "string" && (t = { code: t });
38
+ const r = (t == null ? void 0 : t.type) ?? "hide", f = n(t);
46
39
  if (e)
47
- if (!t.oldValue)
48
- l || h(e, r).then((a) => {
49
- g(a, s);
40
+ if (!s.oldValue)
41
+ f || u(e, t).then((i) => {
42
+ c(i, r);
50
43
  });
51
44
  else {
52
- const a = m(t.oldValue), n = l;
53
- if (a === n) return;
54
- h(e, r).then((c) => {
55
- n ? b(c, s) : g(c, s);
45
+ const i = n(s.oldValue), l = f;
46
+ if (i === l) return;
47
+ u(e, t).then((a) => {
48
+ l ? h(a, r) : c(a, r);
56
49
  });
57
50
  }
58
- return l;
51
+ return f;
59
52
  };
60
53
  export {
61
- U as vAuth
54
+ A as vAuth
62
55
  };
Binary file
package/esm-map.json CHANGED
@@ -145,5 +145,7 @@
145
145
  "handleI18nData": "/common-tools/handle-data/index",
146
146
  "getToken": "/create-api-service/sso/index",
147
147
  "getValidAccessToken": "/create-api-service/check-token/index",
148
- "isCurrentLangInSysLang": "/common-tools/handle-data/index"
148
+ "isCurrentLangInSysLang": "/common-tools/handle-data/index",
149
+ "getMenuItemInfo": "/common-info/index",
150
+ "getAuthobj": "/common-info/index"
149
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/upf-utils",
3
- "version": "6.4.0-dev.185",
3
+ "version": "6.4.0-dev.187",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -9,7 +9,7 @@
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
11
  "@antv/x6": "^2.18.1",
12
- "@das-fed/upf-utils": "6.4.0-dev.185",
12
+ "@das-fed/upf-utils": "6.4.0-dev.187",
13
13
  "@vue/shared": "^3.4.21",
14
14
  "@vueuse/core": "^9.6.0",
15
15
  "axios": "^1.6.7",
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@babel/preset-env": "7.26.0",
25
- "@das-fed/upf-cli": "6.4.0-dev.185",
26
- "@das-fed/upf-web": "6.4.0-dev.185",
25
+ "@das-fed/upf-cli": "6.4.0-dev.187",
26
+ "@das-fed/upf-web": "6.4.0-dev.187",
27
27
  "@rollup/plugin-babel": "6.0.4",
28
28
  "@types/js-cookie": "^3.0.6",
29
29
  "@types/lodash-es": "^4.17.12",