@das-fed/upf-web 6.4.0-dev.152 → 6.4.0-dev.154

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.
Binary file
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as r } from "vue";
2
- import { _ as c } from "./index-C05MU1yC.js";
2
+ import { _ as c } from "./index-DKVGTpe2.js";
3
3
  const o = {};
4
4
  function t(n, _) {
5
5
  return r(), e("div");
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { J as e, A as t, C as n, B as i, D as r, e as u, m as o, w as m, o as p, f as g, k as D, v as l, y as L, z as b, h as c, i as h, G as A, H as T, q as y, E as R, F as W, K as I, I as M, s as F, j as V, n as f, r as k, x as v, t as w } from "./index-C05MU1yC.js";
1
+ import { J as e, A as t, C as n, B as i, D as r, e as u, m as o, w as m, o as p, f as g, k as D, v as l, y as L, z as b, h as c, i as h, G as A, H as T, q as y, E as R, F as W, K as I, I as M, s as F, j as V, n as f, r as k, x as v, t as w } from "./index-DKVGTpe2.js";
2
2
  export {
3
3
  e as DasMainAppLayout,
4
4
  t as DasWebLayout,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@das-fed/upf-web",
3
- "version": "6.4.0-dev.152",
3
+ "version": "6.4.0-dev.154",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "dependencies": {
7
- "@das-fed/upf-ui": "6.4.0-dev.152",
8
- "@das-fed/upf-utils": "6.4.0-dev.152",
9
- "@das-fed/upf-web": "6.4.0-dev.152",
10
- "@das-fed/upf-web-components": "6.4.0-dev.152",
7
+ "@das-fed/upf-ui": "6.4.0-dev.154",
8
+ "@das-fed/upf-utils": "6.4.0-dev.154",
9
+ "@das-fed/upf-web": "6.4.0-dev.154",
10
+ "@das-fed/upf-web-components": "6.4.0-dev.154",
11
11
  "@microsoft/signalr": "^8.0.7",
12
12
  "@vueuse/core": "^9.13.0",
13
13
  "animate.css": "^4.1.1",
@@ -19,7 +19,7 @@
19
19
  "vue-router": "^4.4.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@das-fed/upf-cli": "6.4.0-dev.152",
22
+ "@das-fed/upf-cli": "6.4.0-dev.154",
23
23
  "@types/crypto-js": "^4.2.2",
24
24
  "@types/lodash": "^4.14.194",
25
25
  "@types/lodash-es": "^4.17.12",
@@ -1,31 +1,31 @@
1
- import { ref as x, createApp as O } from "vue";
2
- import { initTheme as P } from "@das-fed/upf-web/packages/theme/index";
3
- import { initI18n as W } from "@das-fed/upf-web/packages/i18n/index";
4
- import { DasWebLayout as $ } from "@das-fed/upf-web/packages/layout/index";
5
- import { createPinia as j } from "pinia";
6
- import k from "pinia-plugin-persistedstate";
7
- import { createRouter as y, createWebHistory as D } from "vue-router";
8
- const N = {
9
- install: (e, a) => {
1
+ import { ref as o, createApp as x } from "vue";
2
+ import { initTheme as w } from "@das-fed/upf-web/packages/theme/index";
3
+ import { initI18n as O } from "@das-fed/upf-web/packages/i18n/index";
4
+ import { DasWebLayout as P } from "@das-fed/upf-web/packages/layout/index";
5
+ import { createPinia as W } from "pinia";
6
+ import $ from "pinia-plugin-persistedstate";
7
+ import { createRouter as j, createWebHistory as k } from "vue-router";
8
+ const y = {
9
+ install: (e, u) => {
10
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);
11
+ const c = (l = u == null ? void 0 : u.plugins) == null ? void 0 : l.glob;
12
+ c && Object.values(c).sort((t, a) => (t.index ?? 0) - (a.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, u), t.install && e.use(t, u);
14
14
  });
15
15
  }
16
- }, d = j();
17
- d.use(k);
18
- const B = (e) => {
19
- var i, h, b, A, g;
20
- const a = ((i = e == null ? void 0 : e.router) == null ? void 0 : i.routerBase) ?? "/", c = ((h = e == null ? void 0 : e.router) == null ? void 0 : h.options) || {};
21
- let l = Object.assign(((b = e == null ? void 0 : e.router) == null ? void 0 : b.glob) || {});
22
- const t = Object.values(l).filter((f) => !!f).flat().sort((f, m) => (f.index ?? 0) - (m.index ?? 0)), u = [];
16
+ }, d = W();
17
+ d.use($);
18
+ const D = (e) => {
19
+ var h, b, p, A, g;
20
+ const u = ((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)), a = [];
23
23
  (A = e == null ? void 0 : e.microApps) == null || A.map((f) => {
24
- var p;
25
- const m = Object.values(((p = f.router) == null ? void 0 : p.glob) || {}).filter((r) => !!r).flat().sort((r, v) => (r.index ?? 0) - (v.index ?? 0));
26
- u.push(
24
+ var R;
25
+ const m = Object.values(((R = f.router) == null ? void 0 : R.glob) || {}).filter((r) => !!r).flat().sort((r, v) => (r.index ?? 0) - (v.index ?? 0));
26
+ a.push(
27
27
  ...m.map((r) => ({ ...r, path: `/${f.microAppName}${r.path}` }))
28
- ), u.push(
28
+ ), a.push(
29
29
  ...m.filter((r) => !!r.path).filter((r) => r.path !== "").filter((r) => r.path !== "/").filter((r) => !r.path.startsWith(`/${r.microAppName}`)).map((r) => ({
30
30
  path: r.path,
31
31
  redirect: `/${f.microAppName}${r.path}`,
@@ -33,26 +33,27 @@ const B = (e) => {
33
33
  }))
34
34
  );
35
35
  });
36
- const s = ((g = e == null ? void 0 : e.router) == null ? void 0 : g.routers) || [], R = [
37
- ...n(t, e),
38
- ...n(s, e),
39
- ...n(u, e)
36
+ const s = ((g = e == null ? void 0 : e.router) == null ? void 0 : g.routers) || [], n = [
37
+ ...i(t, e),
38
+ ...i(s, e),
39
+ ...i(a, e)
40
40
  ];
41
- return { router: y({ history: D(a), routes: R, ...c }) };
42
- }, n = (e, a) => e.map((c) => {
41
+ return { router: j({ history: k(u), routes: n, ...c }) };
42
+ }, i = (e, u) => e.map((c) => {
43
43
  const l = c.meta || {};
44
- return l.keepAlive = l.keepAlive ?? (a == null ? void 0 : a.keepAlive) ?? !0, { ...c, meta: l };
45
- }), w = (e) => {
44
+ return l.keepAlive = l.keepAlive ?? (u == null ? void 0 : u.keepAlive) ?? !0, { ...c, meta: l };
45
+ }), q = (e) => {
46
+ var n;
46
47
  e || (e = {});
47
- const a = x(!0);
48
- Promise.all([P(e), W(e)]).then(() => {
49
- a.value = !1;
48
+ const u = o(!0);
49
+ Promise.all([w(e), O(e)]).then(() => {
50
+ u.value = !1;
50
51
  });
51
- const { container: c, component: l, props: t } = (e == null ? void 0 : e.root) || {}, u = O(l || $, t);
52
- u.use(N, e), u.use(d);
53
- const { router: s } = B(e);
54
- return u.use(s), u.mount(c || "#app"), { app: u, router: s, loading: a, store: d };
52
+ const { container: c, component: l, props: t } = (e == null ? void 0 : e.root) || {}, a = x(l || P, t);
53
+ a.use(y, e), a.use(d);
54
+ const { router: s } = D(e);
55
+ return a.use(s), a.mount(c || "#app"), (n = window.top) != null && n.vueRouter || window.top && (window.top.vueRouter = s), { app: a, router: s, loading: u, store: d };
55
56
  };
56
57
  export {
57
- w as createDasWebApp
58
+ q as createDasWebApp
58
59
  };
@@ -1,5 +1,6 @@
1
- import { reactive as i, ref as s, computed as k } from "vue";
2
- const _ = {
1
+ import { reactive as w, ref as _, computed as s } from "vue";
2
+ import { handleI18nData as l } from "@das-fed/upf-utils/common-tools/handle-data";
3
+ const c = {
3
4
  // 按钮
4
5
  详情: { "zh-CN": "详情", en: "Details", _appCode: "framework" },
5
6
  下载: { "zh-CN": "下载", en: "Download", _appCode: "framework" },
@@ -119,57 +120,58 @@ const _ = {
119
120
  删除失败: { "zh-CN": "删除失败", en: "Deleted Failed", _appCode: "framework" },
120
121
  操作成功: { "zh-CN": "操作成功", en: "Operated Successfully", _appCode: "framework" },
121
122
  操作失败: { "zh-CN": "操作失败", en: "Operated Failed", _appCode: "framework" }
122
- }, d = i({}), f = i({}), m = i({});
123
+ }, d = w({}), f = w({}), t = w({});
123
124
  var N;
124
- const l = (N = navigator.language) != null && N.toLowerCase().startsWith("zh") ? "zh-CN" : "en", t = s(l), c = "dasI18n", b = (e = {}, r) => {
125
- const C = r === "global", n = !C, p = {};
125
+ const u = (N = navigator.language) != null && N.toLowerCase().startsWith("zh") ? "zh-CN" : "en", m = _(u), g = "dasI18n", z = () => {
126
+ const e = document.documentElement;
127
+ e && e.setAttribute("lang", m.value);
128
+ }, P = (e = {}, r) => {
129
+ const n = r === "global", p = !n, C = {};
126
130
  for (const o in e)
127
131
  for (const a in e[o])
128
- p[a] || (p[a] = {}), p[a][o] = e[o][a] ?? "", C && (f[a] || (f[a] = {}), f[a][o] = p[a][o]), n && (d[a] || (d[a] = {}), d[a][o] = p[a][o]);
132
+ C[a] || (C[a] = {}), C[a][o] = e[o][a] ?? "", n && (f[a] || (f[a] = {}), f[a][o] = C[a][o]), p && (d[a] || (d[a] = {}), d[a][o] = C[a][o]);
129
133
  }, h = (e = {}, r) => {
130
- var p;
131
- const C = r === "global", n = !C;
134
+ var C;
135
+ const n = r === "global", p = !n;
132
136
  for (const o in e)
133
- if (C && !f[o] && (f[o] = e[o]), n) {
134
- const a = (p = e[o]) != null && p._appCode ? e[o]._appCode.toLowerCase() : "";
135
- a && (m[a] || (m[a] = {}), m[a][o] = e[o]), d[o] || (d[o] = e[o]);
137
+ if (n && !f[o] && (f[o] = e[o]), p) {
138
+ const a = (C = e[o]) != null && C._appCode ? e[o]._appCode.toLowerCase() : "";
139
+ a && (t[a] || (t[a] = {}), t[a][o] = e[o]), d[o] || (d[o] = e[o]);
136
140
  }
137
- }, R = async (e) => {
138
- var p, o;
139
- const r = document.documentElement;
140
- r && r.setAttribute("lang", t.value);
141
- const C = window[c];
142
- C && h(C, "global"), h(_);
143
- let n = Object.assign(((p = e == null ? void 0 : e.i18n) == null ? void 0 : p.glob) || {});
144
- (o = e == null ? void 0 : e.microApps) == null || o.map((a) => {
145
- var w;
146
- n = Object.assign(n, ((w = a.i18n) == null ? void 0 : w.glob) || {});
147
- }), Object.values(n).filter((a) => !!a).flat().map((a) => h(a));
148
- }, u = (e) => {
141
+ }, L = async (e) => {
142
+ z();
143
+ const r = window[g];
144
+ r && h(r, "global"), h(c);
145
+ {
146
+ let n = await l({ pathname: "front-end" });
147
+ P(n);
148
+ return;
149
+ }
150
+ }, v = (e) => {
149
151
  let r = "";
150
- const C = /\/([^\/]+)\/([^\/]+)\//, n = e.match(C);
151
- return n && n.length >= 3 && (r = n[1] + "/" + n[2]), r ? r.toLowerCase() : "";
152
- }, g = (e, ...r) => k(() => {
153
- const C = u(location.pathname);
154
- let n = m.framework ?? {}, p = m[C] ?? {}, o = f[e] || n[e] || p[e] || d[e] || e;
152
+ const n = /\/([^\/]+)\/([^\/]+)\//, p = e.match(n);
153
+ return p && p.length >= 3 && (r = p[1] + "/" + p[2]), r ? r.toLowerCase() : "";
154
+ }, R = (e, ...r) => s(() => {
155
+ const n = v(location.pathname);
156
+ let p = t.framework ?? {}, C = t[n] ?? {}, o = f[e] || p[e] || C[e] || d[e] || e;
155
157
  if (o === e) return e;
156
158
  typeof o == "string" && (o = { "zh-CN": o });
157
- let a = o[t.value];
158
- return t.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (a = o["zh-cn"]), r.map((w, z) => {
159
- a && (a = a.replace(`$${z}`, w));
159
+ let a = o[m.value];
160
+ return m.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (a = o["zh-cn"]), r.map((i, k) => {
161
+ a && (a = a.replace(`$${k}`, i));
160
162
  }), a;
161
- }), P = g, S = (e, ...r) => P(e, ...r).value, D = (e) => {
162
- t.value = e;
163
- }, L = () => t;
163
+ }), D = R, A = (e, ...r) => D(e, ...r).value, E = (e) => {
164
+ m.value = e, z();
165
+ }, I = () => m;
164
166
  export {
165
- t as currentLang,
167
+ m as currentLang,
166
168
  d as customLangeData,
167
- g as getI18nRule,
168
- L as getLang,
169
- P as i18n,
170
- R as initI18n,
169
+ R as getI18nRule,
170
+ I as getLang,
171
+ D as i18n,
172
+ L as initI18n,
171
173
  h as setI18nRule,
172
- D as setLang,
173
- b as setLangRule,
174
- S as t
174
+ E as setLang,
175
+ P as setLangRule,
176
+ A as t
175
177
  };
Binary file
@@ -1,3 +1,4 @@
1
+ type langType = 'zh-CN' | 'en';
1
2
  declare const customLangeData: any;
2
3
  declare const currentLang: import('vue').Ref<any, any>;
3
4
  declare const setLangRule: (data?: any, type?: "global" | "custom") => void;
@@ -18,6 +19,6 @@ declare const i18n: (key: string, ...args: any[]) => import('vue').ComputedRef<s
18
19
  * @returns string
19
20
  */
20
21
  declare const t: (key: string, ...args: any) => string;
21
- declare const setLang: (lang: string) => void;
22
+ declare const setLang: (lang: langType) => void;
22
23
  declare const getLang: () => import('vue').Ref<any, any>;
23
24
  export { initI18n, setI18nRule, getI18nRule, i18n, t, setLang, getLang, currentLang, setLangRule, customLangeData };
Binary file
Binary file