@das-fed/ui 7.0.0 → 7.0.1

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,32 +1,33 @@
1
1
  import '@das-fed/ui/packages/business-components/layout-breadcrumb/style.css';
2
- import { ref as S, computed as R, watch as L, nextTick as I, defineComponent as T, createElementBlock as N, createCommentVNode as U, unref as g, openBlock as x, createVNode as D } from "vue";
2
+ import { ref as S, computed as T, watch as L, nextTick as R, defineComponent as q, createElementBlock as N, createCommentVNode as U, unref as y, openBlock as x, createVNode as D } from "vue";
3
3
  import { withInstall as P } from "@das-fed/utils/with-install/index";
4
4
  import { DasBreadCrumb as O } from "@das-fed/ui/packages/components/breadcrumb/index";
5
5
  import { useRouter as $, useRoute as j } from "vue-router";
6
- import { flatTree as q } from "@das-fed/utils/common-tools";
7
- import { getSubApps as k } from "@das-fed/utils/common-info";
6
+ import { flatTree as I } from "@das-fed/utils/common-tools";
7
+ import { getSubApps as _ } from "@das-fed/utils/common-info";
8
8
  import { setThemeRule as E } from "@das-fed/web/packages/theme/index";
9
- const J = (a, l) => {
10
- const i = S([]), f = R(() => [...i.value, ...a.data || []]), p = () => new Promise((e) => {
11
- const s = () => {
12
- var n, t;
13
- const { app: o = "" } = (u == null ? void 0 : u.query) || {}, d = ((t = (n = k()) == null ? void 0 : n.currentSubApp) == null ? void 0 : t.menus) ?? [];
14
- if (o === k().currentSubAppCode && d.length) return e();
15
- setTimeout(() => s(), 50);
9
+ const J = (s, f) => {
10
+ const a = S([]), l = T(() => [...a.value, ...s.data || []]), m = (e) => new Promise((n) => {
11
+ const { app: o = "", menu: d = "" } = e || {};
12
+ if (!o) return n(!1);
13
+ const c = () => {
14
+ const t = _() ?? {}, r = t.currentSubAppCode, i = t.currentSubApp.currentMenuCode;
15
+ if (o === r && d === i) return n(!0);
16
+ setTimeout(() => c(), 100);
16
17
  };
17
- s();
18
- }), h = async (e, s) => {
19
- var b, c;
20
- await I(), await p();
21
- const o = [], d = s.menu || "", n = ((c = (b = k()) == null ? void 0 : b.currentSubApp) == null ? void 0 : c.menus) ?? [];
22
- if (!n || !n.length) return;
18
+ c();
19
+ }), h = async (e, n) => {
20
+ var i, u;
21
+ await m(n);
22
+ const o = [], d = n.menu || "", c = ((u = (i = _()) == null ? void 0 : i.currentSubApp) == null ? void 0 : u.menus) ?? [];
23
+ if (!c || !c.length) return;
23
24
  let t = null;
24
- const r = q(n);
25
- if (d ? t = r.find((m) => m.code === d) : t = r.find((m) => m.routeUrl && m.routeUrl === e), t) {
26
- const m = t.code.split(".");
27
- if (m.length === 3) {
28
- const v = m.slice(0, 2).join("."), _ = r.find((A) => A.code === v || A.originalCode === v);
29
- o.push({ name: (_ == null ? void 0 : _.name) ?? "", isMenu: !0, disabled: !0 });
25
+ const r = I(c);
26
+ if (d ? t = r.find((p) => p.code === d) : t = r.find((p) => p.routeUrl && p.routeUrl === e), t) {
27
+ const p = t.code.split(".");
28
+ if (p.length === 3) {
29
+ const B = p.slice(0, 2).join("."), k = r.find((v) => v.code === B || v.originalCode === B);
30
+ o.push({ name: (k == null ? void 0 : k.name) ?? "", isMenu: !0, disabled: !0 });
30
31
  }
31
32
  const M = {
32
33
  name: (t == null ? void 0 : t.name) ?? "",
@@ -35,69 +36,71 @@ const J = (a, l) => {
35
36
  };
36
37
  o.push(M);
37
38
  }
38
- i.value = o;
39
- }, C = (e) => {
40
- e.disabled || l("click-item", e);
41
- }, y = $(), u = j();
39
+ a.value = o;
40
+ }, g = (e) => {
41
+ e.disabled || f("click-item", e);
42
+ }, C = $(), b = j();
42
43
  L(
43
- () => y.currentRoute.value,
44
+ () => C.currentRoute.value,
44
45
  (e) => {
45
- const s = (e == null ? void 0 : e.path) ?? "", o = (e == null ? void 0 : e.query) ?? {};
46
- h(s, o);
46
+ const n = (e == null ? void 0 : e.path) ?? "", o = (e == null ? void 0 : e.query) ?? {};
47
+ setTimeout(() => {
48
+ h(n, o);
49
+ }, 200);
47
50
  }
48
- ), h(u.path, u.query);
49
- const B = S(!1);
51
+ ), h(b.path, b.query);
52
+ const A = S(!1);
50
53
  return L(
51
- () => a.data,
54
+ () => s.data,
52
55
  () => {
53
- I(() => {
54
- p().then(() => {
56
+ R(() => {
57
+ m().then(() => {
55
58
  var t;
56
- const e = k(), s = u.query.app || e.currentSubApp.code || "";
57
- let o = u.query.menu || "";
59
+ const e = _(), n = b.query.app || e.currentSubApp.code || "";
60
+ let o = b.query.menu || "";
58
61
  if (!o) {
59
- const r = ((t = e.currentSubApp) == null ? void 0 : t.menus) ?? [], b = q(r).find(
60
- (c) => `/${(c == null ? void 0 : c.applicationPath) ?? ""}${(c == null ? void 0 : c.routeUrl) ?? ""}`.replace(/\/\//g, "/") === location.pathname
62
+ const r = ((t = e.currentSubApp) == null ? void 0 : t.menus) ?? [], i = I(r).find(
63
+ (u) => `/${(u == null ? void 0 : u.applicationPath) ?? ""}${(u == null ? void 0 : u.routeUrl) ?? ""}`.replace(/\/\//g, "/") === location.pathname
61
64
  );
62
- b && (o = b.code);
65
+ i && (o = i.code);
63
66
  }
64
- const d = JSON.parse(sessionStorage.getItem("breadcrumb") || "{}")[s], n = [];
65
- for (let r in d) d[r] && n.push(r);
66
- B.value = !!n.find((r) => o === r);
67
+ const d = JSON.parse(sessionStorage.getItem("breadcrumb") || "{}")[n], c = [];
68
+ for (let r in d) d[r] && c.push(r);
69
+ A.value = !!c.find((r) => o === r);
67
70
  });
68
71
  });
69
72
  },
70
73
  { deep: !0, immediate: !0 }
71
74
  ), {
72
- isShow: B,
73
- breadcrumbList: f,
74
- clickItem: C
75
+ isShow: A,
76
+ breadcrumbList: l,
77
+ clickItem: g
75
78
  };
76
79
  }, z = {
77
80
  key: 0,
78
81
  class: "layout-breadcrumb"
79
82
  }, F = {
80
83
  name: "LayoutBreadCrumb"
81
- }, G = /* @__PURE__ */ T({
84
+ }, G = /* @__PURE__ */ q({
82
85
  ...F,
83
86
  props: {
84
87
  data: { default: () => [] }
85
88
  },
86
89
  emits: ["click-item"],
87
- setup(a, { emit: l }) {
88
- const i = a, f = l, { isShow: p, breadcrumbList: h, clickItem: C } = J(i, f);
89
- return (y, u) => g(p) && y.data && y.data.length ? (x(), N("div", z, [
90
- D(g(O), {
91
- data: g(h),
92
- onClickItem: g(C)
90
+ setup(s, { emit: f }) {
91
+ const a = s, l = f, { isShow: m, breadcrumbList: h, clickItem: g } = J(a, l);
92
+ return (C, b) => y(m) && C.data && C.data.length ? (x(), N("div", z, [
93
+ D(y(O), {
94
+ data: y(h),
95
+ onClickItem: y(g)
93
96
  }, null, 8, ["data", "onClickItem"])
94
97
  ])) : U("v-if", !0);
95
98
  }
96
- }), H = (a, l) => {
97
- const i = a.__vccOpts || a;
98
- for (const [f, p] of l)
99
- i[f] = p;
100
- return i;
99
+ }), H = (s, f) => {
100
+ const a = s.__vccOpts || s;
101
+ for (const [l, m] of f)
102
+ a[l] = m;
103
+ return a;
101
104
  }, K = /* @__PURE__ */ H(G, [["__scopeId", "data-v-878cd70a"]]), Q = {
102
105
  "--das-layout-micro-container-bg-color": "#e2e7ef",
103
106
  "--das-layout-breadcrumb-bg-color": "#ffffff"