@das-fed/upf-web 6.4.0-dev.202 → 6.4.0-dev.203

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.
@@ -1,59 +1,137 @@
1
- import { ref as v, createApp as x } from "vue";
2
- import { initTheme as w } from "@das-fed/upf-web/packages/theme/index";
3
- import { DasWebLayout as O } from "@das-fed/upf-web/packages/layout/index";
4
- import { registerMicroI18nData as P } from "@das-fed/upf-web/packages/i18n/index";
5
- import { createPinia as W } from "pinia";
6
- import $ from "pinia-plugin-persistedstate";
7
- import { createRouter as j, createWebHistory as D } from "vue-router";
8
- const k = {
9
- install: (e, a) => {
10
- var l;
11
- const c = (l = a == null ? void 0 : a.plugins) == null ? void 0 : l.glob;
12
- c && Object.values(c).sort((t, u) => (t.index ?? 0) - (u.index ?? 0)).filter((t) => t ? !!(t.default && t.default.install || t.install) : !1).forEach((t) => {
13
- t.default && t.default.install && e.use(t.default, a), t.install && e.use(t, a);
1
+ import { reactive as L, ref as j, createApp as B } from "vue";
2
+ import { initTheme as I } from "@das-fed/upf-web/packages/theme/index";
3
+ import { DasWebLayout as N } from "@das-fed/upf-web/packages/layout/index";
4
+ import { createPinia as D } from "pinia";
5
+ import W from "pinia-plugin-persistedstate";
6
+ import { createRouter as C, createWebHistory as M } from "vue-router";
7
+ import { getUrlParams as O, handleI18nData as S } from "@das-fed/upf-utils/common-tools";
8
+ import { getConfig as z } from "@das-fed/upf-utils/config";
9
+ const H = {
10
+ install: (e, n) => {
11
+ var a;
12
+ const r = (a = n == null ? void 0 : n.plugins) == null ? void 0 : a.glob;
13
+ r && Object.values(r).sort((t, s) => (t.index ?? 0) - (s.index ?? 0)).filter((t) => t ? !!(t.default && t.default.install || t.install) : !1).forEach((t) => {
14
+ t.default && t.default.install && e.use(t.default, n), t.install && e.use(t, n);
14
15
  });
15
16
  }
16
- }, d = W();
17
- d.use($);
18
- const y = (e) => {
19
- var h, b, p, g, A;
20
- const a = ((h = e == null ? void 0 : e.router) == null ? void 0 : h.routerBase) ?? "/", c = ((b = e == null ? void 0 : e.router) == null ? void 0 : b.options) || {};
21
- let l = Object.assign(((p = e == null ? void 0 : e.router) == null ? void 0 : p.glob) || {});
22
- const t = Object.values(l).filter((f) => !!f).flat().sort((f, m) => (f.index ?? 0) - (m.index ?? 0)), u = [];
23
- (g = e == null ? void 0 : e.microApps) == null || g.map((f) => {
24
- var R;
25
- const m = Object.values(((R = f.router) == null ? void 0 : R.glob) || {}).filter((r) => !!r).flat().sort((r, o) => (r.index ?? 0) - (o.index ?? 0));
26
- u.push(
27
- ...m.map((r) => ({ ...r, path: `/${f.microAppName}${r.path}` }))
28
- ), u.push(
29
- ...m.filter((r) => !!r.path).filter((r) => r.path !== "").filter((r) => r.path !== "/").filter((r) => !r.path.startsWith(`/${r.microAppName}`)).map((r) => ({
30
- path: r.path,
31
- redirect: `/${f.microAppName}${r.path}`,
32
- meta: { ...r.meta || {}, isMicroAppRouteRedirect: !0 }
17
+ }, E = D();
18
+ E.use(W);
19
+ const P = "language", A = L({});
20
+ L({});
21
+ L({});
22
+ const K = O(location.href, "uiCulture") || "", F = K || window.localStorage.getItem(P) || window.navigator.language || "zh-CN", $ = j(F), G = () => {
23
+ const e = document.documentElement;
24
+ e && e.setAttribute("lang", $.value);
25
+ }, R = (e = {}, n) => {
26
+ const r = {};
27
+ for (const a in e)
28
+ for (const t in e[a])
29
+ r[t] || (r[t] = {}), r[t][a] = e[a][t] ?? "", A[t] || (A[t] = {}), A[t][a] = r[t][a];
30
+ }, T = (e) => {
31
+ $.value = e, G();
32
+ }, q = {
33
+ loaded: {},
34
+ isLoaded(e) {
35
+ return !!this.loaded[e];
36
+ },
37
+ markLoaded(e) {
38
+ this.loaded[e] = !0;
39
+ },
40
+ markUnloaded(e) {
41
+ delete this.loaded[e];
42
+ }
43
+ }, J = async (e, n) => {
44
+ var d, g, l;
45
+ const r = z() || {}, a = ((d = r.i18n) == null ? void 0 : d.fromOss) ?? !0, t = ((g = r.i18n) == null ? void 0 : g.isPullBack) ?? !1, s = ((l = r.i18n) == null ? void 0 : l.isDasUI) ?? !0;
46
+ let i = "/oss/resource/";
47
+ try {
48
+ const f = await S({
49
+ baseUrl: a ? i : "/",
50
+ currentLang: n,
51
+ appName: e,
52
+ isPullBack: t,
53
+ fallbackBaseUrl: "/",
54
+ isDasUI: s
55
+ });
56
+ if (!f || !(f != null && f.frontEnd))
57
+ throw new Error("Failed to fetch i18n data");
58
+ return f;
59
+ } catch (h) {
60
+ throw new Error(`registerResources error: ${h}`);
61
+ }
62
+ }, Q = async (e = []) => {
63
+ const n = O(location.href, "uiCulture") || window.localStorage.getItem(P) || window.navigator.language || "zh-CN";
64
+ try {
65
+ const r = await J(e, n);
66
+ r != null && r.frontEnd && typeof r.frontEnd == "object" && Object.keys(r.frontEnd).length && e.forEach((a) => {
67
+ r.frontEnd[a] && typeof r.frontEnd[a] == "object" && Object.keys(r.frontEnd[a]).length && R({ [n]: r.frontEnd[a] });
68
+ }), r != null && r.dasUiEnd && typeof r.dasUiEnd == "object" && Object.keys(r.dasUiEnd).length && R({ [n]: r.dasUiEnd }), T(n);
69
+ } catch {
70
+ }
71
+ }, V = (e) => {
72
+ var h, p, f, U, v;
73
+ const n = ((h = e == null ? void 0 : e.router) == null ? void 0 : h.routerBase) ?? "/", r = ((p = e == null ? void 0 : e.router) == null ? void 0 : p.options) || {};
74
+ let a = Object.assign(((f = e == null ? void 0 : e.router) == null ? void 0 : f.glob) || {});
75
+ const t = Object.values(a).filter((u) => !!u).flat().sort((u, o) => (u.index ?? 0) - (o.index ?? 0)), s = [];
76
+ (U = e == null ? void 0 : e.microApps) == null || U.map((u) => {
77
+ var w;
78
+ const o = Object.values(((w = u.router) == null ? void 0 : w.glob) || {}).filter((c) => !!c).flat().sort((c, y) => (c.index ?? 0) - (y.index ?? 0));
79
+ s.push(
80
+ ...o.map((c) => ({ ...c, path: `/${u.microAppName}${c.path}` }))
81
+ ), s.push(
82
+ ...o.filter((c) => !!c.path).filter((c) => c.path !== "").filter((c) => c.path !== "/").filter((c) => !c.path.startsWith(`/${c.microAppName}`)).map((c) => ({
83
+ path: c.path,
84
+ redirect: `/${u.microAppName}${c.path}`,
85
+ meta: { ...c.meta || {}, isMicroAppRouteRedirect: !0 }
33
86
  }))
34
87
  );
35
88
  });
36
- const s = ((A = e == null ? void 0 : e.router) == null ? void 0 : A.routers) || [], n = [
37
- ...i(t, e),
38
- ...i(s, e),
39
- ...i(u, e)
40
- ];
41
- return { router: j({ history: D(a), routes: n, ...c }) };
42
- }, i = (e, a) => e.map((c) => {
43
- const l = c.meta || {};
44
- return l.keepAlive = l.keepAlive ?? (a == null ? void 0 : a.keepAlive) ?? !0, { ...c, meta: l };
45
- }), q = (e) => {
46
- var n;
89
+ const i = ((v = e == null ? void 0 : e.router) == null ? void 0 : v.routers) || [], d = [
90
+ ...k(t, e),
91
+ ...k(i, e),
92
+ ...k(s, e)
93
+ ], g = C({ history: M(n), routes: d, ...r }), l = q;
94
+ if (Array.isArray(e == null ? void 0 : e.microApps) && e.microApps.length && l) {
95
+ const u = /* @__PURE__ */ new Map();
96
+ for (const o of e.microApps)
97
+ o != null && o.microAppName && (o != null && o.i18n) && u.set(o.microAppName, o.i18n);
98
+ g.beforeEach(async (o, w, c) => {
99
+ try {
100
+ const y = o.path || "";
101
+ for (const [b, m] of u.entries()) {
102
+ if (!b || !y.toLowerCase().startsWith(`/${b.toLowerCase()}`)) continue;
103
+ if (typeof l.isLoaded == "function" && l.isLoaded(b) || !m || !(m != null && m.length)) break;
104
+ const x = typeof m == "string" ? [m] : m;
105
+ typeof l.markLoaded == "function" && l.markLoaded(b);
106
+ try {
107
+ await Q(x);
108
+ } catch {
109
+ typeof l.markUnloaded == "function" && l.markUnloaded(b);
110
+ }
111
+ break;
112
+ }
113
+ } catch {
114
+ } finally {
115
+ c();
116
+ }
117
+ });
118
+ }
119
+ return { router: g };
120
+ }, k = (e, n) => e.map((r) => {
121
+ const a = r.meta || {};
122
+ return a.keepAlive = a.keepAlive ?? (n == null ? void 0 : n.keepAlive) ?? !0, { ...r, meta: a };
123
+ }), ce = (e) => {
124
+ var d;
47
125
  e || (e = {});
48
- const a = v(!0);
49
- Promise.all([w(e), P(e)]).then(() => {
50
- a.value = !1;
126
+ const n = j(!0);
127
+ Promise.all([I(e)]).then(() => {
128
+ n.value = !1;
51
129
  });
52
- const { container: c, component: l, props: t } = (e == null ? void 0 : e.root) || {}, u = x(l || O, t);
53
- u.use(k, e), u.use(d);
54
- const { router: s } = y(e);
55
- return u.use(s), u.mount(c || "#app"), (n = window.top) != null && n.vueRouter || window.top && (window.top.vueRouter = s), { app: u, router: s, loading: a, store: d };
130
+ const { container: r, component: a, props: t } = (e == null ? void 0 : e.root) || {}, s = B(a || N, t);
131
+ s.use(H, e), s.use(E);
132
+ const { router: i } = V(e);
133
+ return s.use(i), s.mount(r || "#app"), (d = window.top) != null && d.vueRouter || window.top && (window.top.vueRouter = i), { app: s, router: i, loading: n, store: E };
56
134
  };
57
135
  export {
58
- q as createDasWebApp
136
+ ce as createDasWebApp
59
137
  };
@@ -1,150 +1,105 @@
1
1
  'use strict';
2
2
 
3
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
5
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
3
  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); }
7
- 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 _t4 in e) "default" !== _t4 && {}.hasOwnProperty.call(e, _t4) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t4)) && (i.get || i.set) ? o(f, _t4, i) : f[_t4] = e[_t4]); return f; })(e, t); }
4
+ 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 _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
8
5
  function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
9
6
  function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
10
7
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
11
8
  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); }); }; }
12
9
  var vue = require('vue');
13
10
  var commonTools = require('@das-fed/upf-utils/common-tools');
14
- var config = require('@das-fed/upf-utils/config');
15
- var k = /*#__PURE__*/function () {
16
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t, n) {
17
- var _ref2, _ref3, _ref4;
18
- var m, u, b, a, o, s, e, r, l, _t;
19
- return _regenerator().w(function (_context) {
20
- while (1) switch (_context.p = _context.n) {
21
- case 0:
22
- a = config.getConfig() || {}, o = (_ref2 = (m = a.i18n) == null ? undefined : m.fromOss) !== null && _ref2 !== void 0 ? _ref2 : true, s = (_ref3 = (u = a.i18n) == null ? undefined : u.isPullBack) !== null && _ref3 !== void 0 ? _ref3 : true, e = (_ref4 = (b = a.i18n) == null ? undefined : b.isDasUI) !== null && _ref4 !== void 0 ? _ref4 : true;
23
- r = "/oss/resource/";
24
- _context.p = 1;
25
- _context.n = 2;
26
- return commonTools.handleI18nData({
27
- baseUrl: o ? r : "/",
28
- currentLang: n,
29
- appName: t,
30
- isPullBack: s,
31
- fallbackBaseUrl: "/",
32
- isDasUI: e
33
- });
34
- case 2:
35
- l = _context.v;
36
- if (!(!l || !(l != null && l.frontEnd))) {
37
- _context.n = 3;
38
- break;
39
- }
40
- throw new Error("Failed to fetch i18n data");
41
- case 3:
42
- return _context.a(2, l);
43
- case 4:
44
- _context.p = 4;
45
- _t = _context.v;
46
- throw new Error("registerResources error: ".concat(_t));
47
- case 5:
48
- return _context.a(2);
49
- }
50
- }, _callee, null, [[1, 4]]);
51
- }));
52
- return function k(_x, _x2) {
53
- return _ref.apply(this, arguments);
54
- };
55
- }(),
56
- j = "language",
11
+ var h = "language",
12
+ s = vue.reactive({}),
57
13
  c = vue.reactive({}),
58
- i = vue.reactive({}),
59
- f = vue.reactive({}),
60
- U = commonTools.getUrlParams(location.href, "uiCulture") || "",
61
- D = U || window.localStorage.getItem(j) || window.navigator.language || "zh-CN",
62
- g = vue.ref(D),
63
- O = "dasI18n",
64
- E = function E() {
14
+ l = vue.reactive({}),
15
+ j = commonTools.getUrlParams(location.href, "uiCulture") || "",
16
+ y = j || window.localStorage.getItem(h) || window.navigator.language || "zh-CN",
17
+ m = vue.ref(y),
18
+ D = "dasI18n",
19
+ g = function g() {
65
20
  var t = document.documentElement;
66
- t && t.setAttribute("lang", g.value);
21
+ t && t.setAttribute("lang", m.value);
67
22
  },
68
- d = function d() {
23
+ v = function v() {
69
24
  var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
70
- var n = arguments.length > 1 ? arguments[1] : undefined;
71
- var a = n === "global",
72
- o = !a,
73
- s = {};
74
- for (var e in t) for (var r in t[e]) {
75
- var _t$e$r;
76
- s[r] || (s[r] = {}), s[r][e] = (_t$e$r = t[e][r]) !== null && _t$e$r !== void 0 ? _t$e$r : "", a && (i[r] || (i[r] = {}), i[r][e] = s[r][e]), o && (c[r] || (c[r] = {}), c[r][e] = s[r][e]);
25
+ var a = arguments.length > 1 ? arguments[1] : undefined;
26
+ var r = a === "global",
27
+ e = !r,
28
+ i = {};
29
+ for (var o in t) for (var n in t[o]) {
30
+ var _t$o$n;
31
+ i[n] || (i[n] = {}), i[n][o] = (_t$o$n = t[o][n]) !== null && _t$o$n !== void 0 ? _t$o$n : "", r && (c[n] || (c[n] = {}), c[n][o] = i[n][o]), e && (s[n] || (s[n] = {}), s[n][o] = i[n][o]);
77
32
  }
78
33
  },
79
- z = function z() {
34
+ b = function b() {
80
35
  var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
81
- var n = arguments.length > 1 ? arguments[1] : undefined;
82
- var s;
83
- var a = n === "global",
84
- o = !a;
85
- for (var e in t) if (a && !i[e] && (i[e] = t[e]), o) {
86
- var r = (s = t[e]) != null && s._appCode ? t[e]._appCode.toLowerCase() : "";
87
- r && (f[r] || (f[r] = {}), f[r][e] = t[e]), c[e] || (c[e] = t[e]);
36
+ var a = arguments.length > 1 ? arguments[1] : undefined;
37
+ var i;
38
+ var r = a === "global",
39
+ e = !r;
40
+ for (var o in t) if (r && !c[o] && (c[o] = t[o]), e) {
41
+ var n = (i = t[o]) != null && i._appCode ? t[o]._appCode.toLowerCase() : "";
42
+ n && (l[n] || (l[n] = {}), l[n][o] = t[o]), s[o] || (s[o] = t[o]);
88
43
  }
89
44
  },
90
- x = /*#__PURE__*/function () {
91
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t) {
92
- var n;
93
- return _regenerator().w(function (_context2) {
94
- while (1) switch (_context2.n) {
45
+ R = /*#__PURE__*/function () {
46
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t) {
47
+ var a;
48
+ return _regenerator().w(function (_context) {
49
+ while (1) switch (_context.n) {
95
50
  case 0:
96
- E();
97
- n = window[O];
98
- n && z(n, "global");
51
+ g();
52
+ a = window[D];
53
+ a && b(a, "global");
99
54
  case 1:
100
- return _context2.a(2);
55
+ return _context.a(2);
101
56
  }
102
- }, _callee2);
57
+ }, _callee);
103
58
  }));
104
- return function x(_x3) {
105
- return _ref5.apply(this, arguments);
59
+ return function R(_x) {
60
+ return _ref.apply(this, arguments);
106
61
  };
107
62
  }(),
108
63
  A = function A(t) {
109
- var n = "";
110
- var a = /\/([^\/]+)\/([^\/]+)\//,
111
- o = t.match(a);
112
- return o && o.length >= 3 && (n = o[1] + "/" + o[2]), n ? n.toLowerCase() : "";
64
+ var a = "";
65
+ var r = /\/([^\/]+)\/([^\/]+)\//,
66
+ e = t.match(r);
67
+ return e && e.length >= 3 && (a = e[1] + "/" + e[2]), a ? a.toLowerCase() : "";
113
68
  },
114
- v = function v(t) {
115
- for (var _len = arguments.length, n = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
116
- n[_key - 1] = arguments[_key];
69
+ I = function I(t) {
70
+ for (var _len = arguments.length, a = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
71
+ a[_key - 1] = arguments[_key];
117
72
  }
118
73
  return vue.computed(function () {
119
- var _f$framework, _f$a;
120
- var a = A(location.pathname);
121
- var o = (_f$framework = f.framework) !== null && _f$framework !== void 0 ? _f$framework : {},
122
- s = (_f$a = f[a]) !== null && _f$a !== void 0 ? _f$a : {},
123
- e = c[t] || i[t] || o[t] || s[t] || t;
124
- if (e === t) return t;
125
- typeof e == "string" && (e = {
126
- "zh-CN": e
74
+ var _l$framework, _l$r;
75
+ var r = A(location.pathname);
76
+ var e = (_l$framework = l.framework) !== null && _l$framework !== void 0 ? _l$framework : {},
77
+ i = (_l$r = l[r]) !== null && _l$r !== void 0 ? _l$r : {},
78
+ o = s[t] || c[t] || e[t] || i[t] || t;
79
+ if (o === t) return t;
80
+ typeof o == "string" && (o = {
81
+ "zh-CN": o
127
82
  });
128
- var r = e[g.value];
129
- return g.value === "zh-CN" && e["zh-cn"] && !e["zh-CN"] && (r = e["zh-cn"]), n.map(function (m, u) {
130
- r && (r = r.replace("$".concat(u), m));
131
- }), r;
83
+ var n = o[m.value];
84
+ return m.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (n = o["zh-cn"]), a.map(function (f, d) {
85
+ n && (n = n.replace("$".concat(d), f));
86
+ }), n;
132
87
  });
133
88
  },
134
- N = v,
135
- B = function B(t) {
136
- for (var _len2 = arguments.length, n = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
137
- n[_key2 - 1] = arguments[_key2];
89
+ z = I,
90
+ N = function N(t) {
91
+ for (var _len2 = arguments.length, a = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
92
+ a[_key2 - 1] = arguments[_key2];
138
93
  }
139
- return N.apply(void 0, [t].concat(n)).value;
94
+ return z.apply(void 0, [t].concat(a)).value;
140
95
  },
141
- R = function R(t) {
142
- g.value = t, E();
96
+ T = function T(t) {
97
+ m.value = t, g();
143
98
  },
144
- F = function F() {
145
- return g;
99
+ _ = function _() {
100
+ return m;
146
101
  },
147
- y = {
102
+ u = {
148
103
  "en-US": {
149
104
  ant: function ant() {
150
105
  return Promise.resolve().then(function () {
@@ -302,79 +257,49 @@ var k = /*#__PURE__*/function () {
302
257
  }
303
258
  }
304
259
  };
305
- function G(t, n) {
306
- var o;
307
- var a = window.DATE_FORMAT_MAP;
308
- return a && a[t] && a[t][n] ? a[t][n] : ((o = window.DATE_FORMAT_MAP[t]) == null ? undefined : o[n]) || "YYYY-MM-DD";
260
+ function x(t, a) {
261
+ var e;
262
+ var r = window.DATE_FORMAT_MAP;
263
+ return r && r[t] && r[t][a] ? r[t][a] : ((e = window.DATE_FORMAT_MAP[t]) == null ? undefined : e[a]) || "YYYY-MM-DD";
309
264
  }
310
- var Y = /*#__PURE__*/function () {
311
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(t) {
312
- var n, a, _t2;
313
- return _regenerator().w(function (_context3) {
314
- while (1) switch (_context3.p = _context3.n) {
315
- case 0:
316
- n = y[t] || y["zh-CN"];
317
- _context3.p = 1;
318
- _context3.n = 2;
319
- return n.ant();
320
- case 2:
321
- a = _context3.v;
322
- _context3.n = 3;
323
- return n.dayjs();
324
- case 3:
325
- return _context3.a(2, a["default"]);
326
- case 4:
327
- _context3.p = 4;
328
- _t2 = _context3.v;
329
- case 5:
330
- return _context3.a(2);
331
- }
332
- }, _callee3, null, [[1, 4]]);
333
- }));
334
- return function Y(_x4) {
335
- return _ref6.apply(this, arguments);
336
- };
337
- }(),
338
- K = /*#__PURE__*/function () {
339
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(t) {
340
- var n, a, o, _t3;
341
- return _regenerator().w(function (_context4) {
342
- while (1) switch (_context4.p = _context4.n) {
343
- case 0:
344
- n = commonTools.getUrlParams(location.href, "uiCulture") || window.localStorage.getItem(j) || window.navigator.language || "zh-CN", a = (t == null ? undefined : t.i18n) || [];
345
- _context4.p = 1;
346
- _context4.n = 2;
347
- return k(a, n);
348
- case 2:
349
- o = _context4.v;
350
- o != null && o.frontEnd && _typeof(o.frontEnd) == "object" && Object.keys(o.frontEnd).length && a.forEach(function (s) {
351
- o.frontEnd[s] && _typeof(o.frontEnd[s]) == "object" && Object.keys(o.frontEnd[s]).length && d(_defineProperty({}, n, o.frontEnd[s]));
352
- }), o != null && o.backMsg && _typeof(o.backMsg) == "object" && Object.keys(o.backMsg).length && o.backMsg.aiot && _typeof(o.backMsg.aiot) == "object" && Object.keys(o.backMsg.aiot).length && d(_defineProperty({}, n, o.backMsg.aiot)), o != null && o.dasUiEnd && _typeof(o.dasUiEnd) == "object" && Object.keys(o.dasUiEnd).length && d(_defineProperty({}, n, o.dasUiEnd)), R(n);
353
- _context4.n = 4;
354
- break;
355
- case 3:
356
- _context4.p = 3;
357
- _t3 = _context4.v;
358
- case 4:
359
- return _context4.a(2);
360
- }
361
- }, _callee4, null, [[1, 3]]);
362
- }));
363
- return function K(_x5) {
364
- return _ref7.apply(this, arguments);
365
- };
366
- }();
367
- exports.currentLang = g;
368
- exports.customLangeData = c;
369
- exports.getDateFormat = G;
370
- exports.getI18nRule = v;
371
- exports.getLang = F;
372
- exports.i18n = N;
373
- exports.initI18n = x;
374
- exports.languageKey = j;
375
- exports.loadLocale = Y;
376
- exports.registerMicroI18nData = K;
377
- exports.setI18nRule = z;
378
- exports.setLang = R;
379
- exports.setLangRule = d;
380
- exports.t = B;
265
+ var O = /*#__PURE__*/function () {
266
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t) {
267
+ var a, r, _t;
268
+ return _regenerator().w(function (_context2) {
269
+ while (1) switch (_context2.p = _context2.n) {
270
+ case 0:
271
+ a = u[t] || u["zh-CN"];
272
+ _context2.p = 1;
273
+ _context2.n = 2;
274
+ return a.ant();
275
+ case 2:
276
+ r = _context2.v;
277
+ _context2.n = 3;
278
+ return a.dayjs();
279
+ case 3:
280
+ return _context2.a(2, r["default"]);
281
+ case 4:
282
+ _context2.p = 4;
283
+ _t = _context2.v;
284
+ case 5:
285
+ return _context2.a(2);
286
+ }
287
+ }, _callee2, null, [[1, 4]]);
288
+ }));
289
+ return function O(_x2) {
290
+ return _ref2.apply(this, arguments);
291
+ };
292
+ }();
293
+ exports.currentLang = m;
294
+ exports.customLangeData = s;
295
+ exports.getDateFormat = x;
296
+ exports.getI18nRule = I;
297
+ exports.getLang = _;
298
+ exports.i18n = z;
299
+ exports.initI18n = R;
300
+ exports.languageKey = h;
301
+ exports.loadLocale = O;
302
+ exports.setI18nRule = b;
303
+ exports.setLang = T;
304
+ exports.setLangRule = v;
305
+ exports.t = N;