@fewangsit/wangsvue-fats 1.0.1-alpha.43 → 1.0.1-alpha.45

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.
package/utils/index.es.js CHANGED
@@ -1,2 +1,3 @@
1
+ import "./role.util.es.js";
1
2
  import "../event-bus/index.es.js";
2
3
  import "vue";
@@ -1,70 +1,68 @@
1
- const g = () => {
2
- const { plan: e } = JSON.parse(localStorage.getItem("user") ?? "{}");
1
+ const t = localStorage.getItem("user") ?? "{}", o = localStorage.getItem("userFixedAsset"), u = () => {
2
+ const { plan: e } = JSON.parse(o ?? t);
3
3
  return e;
4
- }, s = (e) => {
5
- const { transactionRoles: t } = JSON.parse(
6
- localStorage.getItem("user") ?? "{}"
4
+ }, n = (e) => {
5
+ const { transactionRoles: s } = JSON.parse(
6
+ o ?? t
7
7
  );
8
- return (t == null ? void 0 : t[e]) ?? {
8
+ return (s == null ? void 0 : s[e]) ?? {
9
9
  monitoringReport: !1,
10
10
  manager: !1,
11
11
  staff: !1,
12
12
  approver: !1
13
13
  };
14
- }, i = (e) => {
15
- const { systemRoles: t } = JSON.parse(
16
- localStorage.getItem("user") ?? "{}"
17
- );
18
- return (t == null ? void 0 : t[e]) ?? {
14
+ }, p = (e) => {
15
+ const { systemRoles: s } = JSON.parse(o ?? t);
16
+ return (s == null ? void 0 : s[e]) ?? {
19
17
  create: !1,
20
18
  view: !1,
21
19
  update: !1,
22
20
  delete: !1
23
21
  };
24
- }, p = (e) => i(e).view, f = (e) => {
25
- const { manager: t, staff: o, monitoringReport: a } = s(e);
26
- return t || o || a;
27
- }, m = (e) => {
28
- const { manager: t } = s(e);
29
- return t;
30
- }, u = () => {
22
+ }, g = (e) => p(e).view, m = (e) => {
23
+ const { manager: s, staff: a, monitoringReport: r } = n(e);
24
+ return s || a || r;
25
+ }, R = (e) => {
26
+ const { manager: s } = n(e);
27
+ return s;
28
+ }, h = () => {
31
29
  const { transactionRoles: e } = JSON.parse(
32
- localStorage.getItem("user") ?? "{}"
30
+ o ?? t
33
31
  );
34
- return Object.entries(e).some(([, t]) => t.manager);
35
- }, R = () => {
32
+ return Object.entries(e).some(([, s]) => s.manager);
33
+ }, d = () => {
36
34
  const { transactionRoles: e } = JSON.parse(
37
- localStorage.getItem("user") ?? "{}"
35
+ o ?? t
38
36
  );
39
37
  return Object.entries(e).some(
40
- ([, t]) => t.monitoringReport
38
+ ([, s]) => s.monitoringReport
41
39
  );
42
40
  }, S = (e) => {
43
- const { staff: t } = s(e);
44
- return t;
45
- }, h = (e) => {
46
- const { monitoringReport: t } = s(e);
47
- return t;
48
- }, d = (e) => {
49
- const { approver: t } = s(e);
50
- return t;
51
- }, O = (e, t, o) => {
52
- const { userType: a } = JSON.parse(
41
+ const { staff: s } = n(e);
42
+ return s;
43
+ }, A = (e) => {
44
+ const { monitoringReport: s } = n(e);
45
+ return s;
46
+ }, O = (e) => {
47
+ const { approver: s } = n(e);
48
+ return s;
49
+ }, v = (e, s, a) => {
50
+ const { userType: r } = JSON.parse(
53
51
  localStorage.getItem("user") ?? "{}"
54
- ), { hasAccess: r = !0 } = e.meta, n = a === "Admin", c = e.path.includes("handover-confirmation"), l = e.path.includes("my-profile");
55
- (n || c || l) && r ? o() : o("/not-found");
52
+ ), { hasAccess: c = !0 } = e.meta, l = r === "Admin", i = e.path.includes("handover-confirmation"), f = e.path.includes("my-profile");
53
+ (l || i || f) && c ? a() : a("/not-found");
56
54
  };
57
55
  export {
58
- g as a,
59
- i as b,
60
- f as c,
61
- m as d,
62
- u as e,
63
- R as f,
64
- s as g,
65
- p as h,
56
+ u as a,
57
+ p as b,
58
+ m as c,
59
+ R as d,
60
+ h as e,
61
+ d as f,
62
+ n as g,
63
+ g as h,
66
64
  S as i,
67
- h as j,
68
- d as k,
69
- O as l
65
+ A as j,
66
+ O as k,
67
+ v as l
70
68
  };