@fewangsit/wangsvue-fats 1.0.1-alpha.57 → 1.0.1-alpha.59

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,30 +1,30 @@
1
- import { shallowRef as O, ref as Y, defineComponent as Z, onMounted as ee, computed as c, watch as se, createElementBlock as r, openBlock as d, createVNode as p, createElementVNode as l, createCommentVNode as f, toDisplayString as x, Fragment as ae, unref as z, normalizeClass as y } from "vue";
2
- import { AssetServices as te } from "@tagsamurai/fats-api-services";
1
+ import { shallowRef as K, ref as X, defineComponent as Y, onMounted as Z, computed as c, watch as ee, createElementBlock as u, openBlock as d, createVNode as p, createElementVNode as l, createCommentVNode as f, toDisplayString as x, Fragment as se, unref as q, normalizeClass as y } from "vue";
2
+ import { AssetServices as ae } from "@tagsamurai/fats-api-services";
3
3
  import "../utils/role.util.es.js";
4
- import { g as le } from "../utils/getStatusSeverity.util.es.js";
5
- import { u as ne } from "../utils/toast.util.es.js";
4
+ import { g as te } from "../utils/getStatusSeverity.util.es.js";
5
+ import { u as le } from "../utils/toast.util.es.js";
6
6
  import { _ } from "../badge/index.es.js";
7
- import { _ as oe } from "../image/index.es.js";
8
- import { _ as ie } from "../tagtype/index.es.js";
9
- const J = O(!1), K = Y(), ue = () => ({
10
- loading: J,
11
- message: K,
7
+ import { _ as ne } from "../image/index.es.js";
8
+ import { _ as oe } from "../tagtype/index.es.js";
9
+ const z = K(!1), J = X(), ie = () => ({
10
+ loading: z,
11
+ message: J,
12
12
  setLoading: (m, t) => {
13
- J.value = m, K.value = t, document.body.classList[m ? "add" : "remove"]("loading");
13
+ z.value = m, J.value = t, document.body.classList[m ? "add" : "remove"]("loading");
14
14
  }
15
- }), re = { class: "flex justify-between gap-[18px] dark:text-general-100" }, de = { class: "w-full flex flex-col gap-[6px]" }, ce = { class: "flex justify-between" }, pe = { class: "" }, fe = { class: "text-[16px] font-bold leading-[19.12px]" }, me = { class: "flex items-center gap-[6px]" }, ve = { class: "text-general-400 leading-[16.39px]" }, ge = ["href"], ye = { class: "flex flex-col gap-1" }, _e = {
15
+ }), re = { class: "flex justify-between gap-[18px] dark:text-general-100" }, ue = { class: "w-full flex flex-col gap-[6px]" }, de = { class: "flex justify-between" }, ce = { class: "" }, pe = { class: "text-[16px] font-bold leading-[19.12px]" }, fe = { class: "flex items-center gap-[6px]" }, me = { class: "text-general-400 leading-[16.39px]" }, ve = ["href"], ge = { class: "flex flex-col gap-1" }, ye = {
16
16
  key: 0,
17
17
  class: "flex gap-3"
18
- }, xe = {
18
+ }, _e = {
19
19
  key: 1,
20
20
  class: "flex gap-3"
21
- }, be = {
21
+ }, xe = {
22
22
  key: 2,
23
23
  class: "flex gap-3"
24
- }, he = {
24
+ }, be = {
25
25
  key: 3,
26
26
  class: "flex gap-3"
27
- }, Ce = /* @__PURE__ */ Z({
27
+ }, Ne = /* @__PURE__ */ Y({
28
28
  __name: "AssetInfo",
29
29
  props: {
30
30
  id: {},
@@ -35,118 +35,118 @@ const J = O(!1), K = Y(), ue = () => ({
35
35
  },
36
36
  setup(b, { expose: m }) {
37
37
  const t = b;
38
- ee(async () => {
39
- t.transactionDetail ? e.value = t.transactionDetail : await X();
38
+ Z(async () => {
39
+ t.transactionDetail ? s.value = t.transactionDetail : await U();
40
40
  });
41
- const R = ne(), { setLoading: h } = ue(), H = JSON.parse(localStorage.getItem("user") ?? "{}"), e = O(), k = c(() => {
42
- var s;
43
- return (s = t.fields) == null ? void 0 : s.includes("status");
44
- }), P = c(() => {
41
+ const O = le(), { setLoading: h } = ie(), R = JSON.parse(localStorage.getItem("user") ?? "{}"), s = K(), k = c(() => {
42
+ var e;
43
+ return (e = t.fields) == null ? void 0 : e.includes("status");
44
+ }), H = c(() => {
45
45
  const {
46
- setDefault: s,
46
+ setDefault: e,
47
47
  firstImageBig: a,
48
48
  secondImageBig: n,
49
49
  assetImage: o,
50
50
  firstImage: i,
51
- secondImage: u
52
- } = e.value ?? {}, g = s === "firstImage";
53
- return t.transactionDetail ? o : g ? i ?? a : u ?? n;
54
- }), I = c(() => {
55
- var a, n, o, i, u;
56
- const s = t.transactionDetail ? "assetName" : "name";
57
- return (o = (n = (a = e.value) == null ? void 0 : a[s]) == null ? void 0 : n.aliasCode) != null && o.length ? `${(u = (i = e.value) == null ? void 0 : i[s]) == null ? void 0 : u.aliasCode}` : void 0;
51
+ secondImage: r
52
+ } = s.value ?? {}, g = e === "firstImage";
53
+ return t.transactionDetail ? o : g ? i ?? a : r ?? n;
54
+ }), T = c(() => {
55
+ var a, n, o, i, r;
56
+ const e = t.transactionDetail ? "assetName" : "name";
57
+ return (o = (n = (a = s.value) == null ? void 0 : a[e]) == null ? void 0 : n.aliasCode) != null && o.length ? `${(r = (i = s.value) == null ? void 0 : i[e]) == null ? void 0 : r.aliasCode}` : void 0;
58
+ }), P = c(() => {
59
+ var e, a;
60
+ return ((e = s.value) == null ? void 0 : e.assetTagType) ?? ((a = s.value) == null ? void 0 : a.tagType);
58
61
  }), Q = c(() => {
59
- var s, a;
60
- return ((s = e.value) == null ? void 0 : s.assetTagType) ?? ((a = e.value) == null ? void 0 : a.tagType);
61
- }), U = c(() => {
62
- var s, a;
63
- return ((s = e.value) == null ? void 0 : s.assetName) ?? ((a = e.value) == null ? void 0 : a.name);
62
+ var e, a;
63
+ return ((e = s.value) == null ? void 0 : e.assetName) ?? ((a = s.value) == null ? void 0 : a.name);
64
64
  }), v = c(() => [
65
65
  {
66
66
  "w-[69px]": !k.value,
67
67
  "w-[76px]": k.value
68
68
  }
69
- ]), X = async () => {
69
+ ]), U = async () => {
70
70
  try {
71
71
  h(!0);
72
- const { data: s } = await te.getAssetDetail(t.id);
73
- s && (e.value = s.data);
74
- } catch (s) {
75
- R.add({ error: s, message: "Error, failed to load asset details." });
72
+ const { data: e } = await ae.getAssetDetail(t.id);
73
+ e && (s.value = e.data);
74
+ } catch (e) {
75
+ O.add({ error: e, message: "Error, failed to load asset details." });
76
76
  } finally {
77
77
  h(!1);
78
78
  }
79
79
  };
80
- return se(
80
+ return ee(
81
81
  () => t.transactionDetail,
82
- (s) => {
83
- e.value = s;
82
+ (e) => {
83
+ s.value = e;
84
84
  },
85
85
  { deep: !0 }
86
- ), m({ asset: e }), (s, a) => {
87
- var n, o, i, u, g, T, w, D, S, B, N, C, A, $, L, E, F, M, V, j, G, W, q;
88
- return d(), r("div", re, [
89
- p(oe, { src: P.value }, null, 8, ["src"]),
90
- l("div", de, [
91
- l("div", ce, [
92
- l("div", pe, [
93
- l("div", fe, x(((n = U.value) == null ? void 0 : n.nameWithSequence) ?? "-"), 1),
94
- l("div", me, [
95
- l("span", ve, x(I.value ?? ((o = e.value) == null ? void 0 : o.assetId)) + " " + x(I.value ? `(${(i = e.value) == null ? void 0 : i.assetId})` : ""), 1),
96
- s.useTagType ? (d(), r(ae, { key: 0 }, [
86
+ ), m({ asset: s }), (e, a) => {
87
+ var n, o, i, r, g, w, D, I, S, B, N, C, A, $, L, E, F, M, V, j, G, W;
88
+ return d(), u("div", re, [
89
+ p(ne, { src: H.value }, null, 8, ["src"]),
90
+ l("div", ue, [
91
+ l("div", de, [
92
+ l("div", ce, [
93
+ l("div", pe, x(((n = Q.value) == null ? void 0 : n.nameWithSequence) ?? "-"), 1),
94
+ l("div", fe, [
95
+ l("span", me, x((o = s.value) == null ? void 0 : o.assetId) + " " + x(T.value ? `(${T.value})` : ""), 1),
96
+ e.useTagType ? (d(), u(se, { key: 0 }, [
97
97
  a[0] || (a[0] = l("div", { class: "w-[6px] h-[6px] rounded-full bg-general-100" }, null, -1)),
98
- p(ie, {
99
- type: Q.value,
100
- "use-nfc": s.useNfc
98
+ p(oe, {
99
+ type: P.value,
100
+ "use-nfc": e.useNfc
101
101
  }, null, 8, ["type", "use-nfc"])
102
102
  ], 64)) : f("", !0)
103
103
  ])
104
104
  ]),
105
- z(H).userType !== "Basic" ? (d(), r("a", {
105
+ q(R).userType !== "Basic" ? (d(), u("a", {
106
106
  key: 0,
107
- href: `/assets/detail/${((u = e.value) == null ? void 0 : u.asset) ?? ((g = e.value) == null ? void 0 : g._id)}`,
107
+ href: `/assets/detail/${((i = s.value) == null ? void 0 : i.asset) ?? ((r = s.value) == null ? void 0 : r._id)}`,
108
108
  class: "text-primary-500",
109
109
  target: "_blank"
110
- }, " Asset Detail > ", 8, ge)) : f("", !0)
110
+ }, " Asset Detail > ", 8, ve)) : f("", !0)
111
111
  ]),
112
- l("div", ye, [
113
- !t.fields || (T = t.fields) != null && T.includes("brand") ? (d(), r("div", _e, [
112
+ l("div", ge, [
113
+ !t.fields || (g = t.fields) != null && g.includes("brand") ? (d(), u("div", ye, [
114
114
  l("span", {
115
115
  class: y(v.value)
116
116
  }, " Brand ", 2),
117
117
  a[1] || (a[1] = l("span", null, ":", -1)),
118
118
  p(_, {
119
- label: ((D = (w = e.value) == null ? void 0 : w.assetBrand) == null ? void 0 : D.name) ?? ((B = (S = e.value) == null ? void 0 : S.brand) == null ? void 0 : B.name) ?? "-",
119
+ label: ((D = (w = s.value) == null ? void 0 : w.assetBrand) == null ? void 0 : D.name) ?? ((S = (I = s.value) == null ? void 0 : I.brand) == null ? void 0 : S.name) ?? "-",
120
120
  severity: "dark"
121
121
  }, null, 8, ["label"])
122
122
  ])) : f("", !0),
123
- !t.fields || (N = t.fields) != null && N.includes("model") ? (d(), r("div", xe, [
123
+ !t.fields || (B = t.fields) != null && B.includes("model") ? (d(), u("div", _e, [
124
124
  l("span", {
125
125
  class: y(v.value)
126
126
  }, " Model/Type ", 2),
127
127
  a[2] || (a[2] = l("span", null, ":", -1)),
128
128
  p(_, {
129
- label: ((A = (C = e.value) == null ? void 0 : C.assetModel) == null ? void 0 : A.name) ?? ((L = ($ = e.value) == null ? void 0 : $.model) == null ? void 0 : L.name) ?? "-",
129
+ label: ((C = (N = s.value) == null ? void 0 : N.assetModel) == null ? void 0 : C.name) ?? (($ = (A = s.value) == null ? void 0 : A.model) == null ? void 0 : $.name) ?? "-",
130
130
  severity: "dark"
131
131
  }, null, 8, ["label"])
132
132
  ])) : f("", !0),
133
- !t.fields || (E = t.fields) != null && E.includes("group") ? (d(), r("div", be, [
133
+ !t.fields || (L = t.fields) != null && L.includes("group") ? (d(), u("div", xe, [
134
134
  l("span", {
135
135
  class: y(v.value)
136
136
  }, " Group ", 2),
137
137
  a[3] || (a[3] = l("span", null, ":", -1)),
138
138
  p(_, {
139
- label: ((M = (F = e.value) == null ? void 0 : F.assetGroup) == null ? void 0 : M.name) ?? ((j = (V = e.value) == null ? void 0 : V.group) == null ? void 0 : j.name) ?? "-"
139
+ label: ((F = (E = s.value) == null ? void 0 : E.assetGroup) == null ? void 0 : F.name) ?? ((V = (M = s.value) == null ? void 0 : M.group) == null ? void 0 : V.name) ?? "-"
140
140
  }, null, 8, ["label"])
141
141
  ])) : f("", !0),
142
- (G = t.fields) != null && G.includes("status") ? (d(), r("div", he, [
142
+ (j = t.fields) != null && j.includes("status") ? (d(), u("div", be, [
143
143
  l("span", {
144
144
  class: y(v.value)
145
145
  }, " Asset Status ", 2),
146
146
  a[4] || (a[4] = l("span", null, ":", -1)),
147
147
  p(_, {
148
- label: ((W = e.value) == null ? void 0 : W.status) ?? "-",
149
- severity: z(le)((q = e.value) == null ? void 0 : q.status),
148
+ label: ((G = s.value) == null ? void 0 : G.status) ?? "-",
149
+ severity: q(te)((W = s.value) == null ? void 0 : W.status),
150
150
  format: "nowrap"
151
151
  }, null, 8, ["label", "severity"])
152
152
  ])) : f("", !0)
@@ -157,6 +157,6 @@ const J = O(!1), K = Y(), ue = () => ({
157
157
  }
158
158
  });
159
159
  export {
160
- Ce as _,
161
- ue as u
160
+ Ne as _,
161
+ ie as u
162
162
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as Y, onMounted as Z, shallowRef as f, ref as ee, createElementBlock as te, openBlock as se, Fragment as ae, createElementVNode as g, createVNode as i, mergeProps as oe, unref as d, withCtx as re, toDisplayString as M } from "vue";
2
- import { AssetServices as _, DisposalServices as ne, DamageServices as T, MissingServices as N } from "@tagsamurai/fats-api-services";
2
+ import { AssetServices as D, DisposalServices as ne, DamageServices as T, MissingServices as N } from "@tagsamurai/fats-api-services";
3
3
  import { u as le } from "../assetinfo/index.es.js";
4
4
  import { u as ie } from "../plugins/basei18n.es.js";
5
5
  import "../utils/role.util.es.js";
@@ -18,7 +18,7 @@ import { _ as ve } from "../disposalreporttablefilter/index.es.js";
18
18
  const be = {
19
19
  class: "flex flex-col gap-2",
20
20
  "data-ts-section": "disposalreporttablewrapper"
21
- }, he = { class: "flex gap-1 justify-end" }, De = { class: "flex gap-1 justify-end" }, Le = /* @__PURE__ */ Y({
21
+ }, he = { class: "flex gap-1 justify-end" }, _e = { class: "flex gap-1 justify-end" }, Le = /* @__PURE__ */ Y({
22
22
  __name: "DisposalReportTable",
23
23
  props: {
24
24
  treeTable: { type: Boolean },
@@ -187,7 +187,7 @@ const be = {
187
187
  }
188
188
  try {
189
189
  c(!0);
190
- const { data: e } = await _.getAllAssets({ _id: s });
190
+ const { data: e } = await D.getAllAssets({ _id: s });
191
191
  e.data.data.forEach((t) => {
192
192
  u.value.set(t._id ?? "", {
193
193
  notes: null,
@@ -218,7 +218,7 @@ const be = {
218
218
  }, F = (s) => {
219
219
  s.forEach((e) => {
220
220
  u.value.delete(e._id ?? "");
221
- }), n.value.length || D(), m.add({
221
+ }), n.value.length || _(), m.add({
222
222
  message: r("Success, asset has been removed from the list."),
223
223
  severity: "success"
224
224
  });
@@ -229,7 +229,7 @@ const be = {
229
229
  reason: ["Damaged", "Missing"].includes(t.status) ? t.status : p.reason
230
230
  });
231
231
  });
232
- }, D = () => {
232
+ }, _ = () => {
233
233
  const s = window.location.pathname, e = s.slice(0, s.lastIndexOf("/"));
234
234
  p.router.replace(e), sessionStorage.removeItem("assetsDisposalReport");
235
235
  }, U = async () => {
@@ -245,7 +245,7 @@ const be = {
245
245
  try {
246
246
  c(!0), await ne.postReportDisposal({ data: s }), m.add({
247
247
  message: r("Success, disposal report has been submitted.")
248
- }), D();
248
+ }), _();
249
249
  } catch (e) {
250
250
  console.error(e), m.add({
251
251
  error: e,
@@ -322,12 +322,12 @@ const be = {
322
322
  }, W = async (s) => {
323
323
  var a;
324
324
  const e = JSON.stringify(
325
- ((a = n.value) == null ? void 0 : a.map((l) => l.reportId)) ?? []
325
+ ((a = n.value) == null ? void 0 : a.map((l) => l.reportId ?? l._id)) ?? []
326
326
  ), t = {
327
327
  excludeId: e,
328
328
  excludeIds: e,
329
329
  ...s
330
- }, { data: o } = await _.getAllAssets(t);
330
+ }, { data: o } = await D.getAllAssets(t);
331
331
  return o;
332
332
  }, j = async (s) => p.from === "damage" ? V(s) : p.from === "missing" ? z(s) : W(s), H = async (s) => {
333
333
  var a;
@@ -361,7 +361,7 @@ const be = {
361
361
  excludeId: e,
362
362
  excludeIds: e,
363
363
  [s]: !0
364
- }, { data: o } = await _.getAllAssetsOptions(t);
364
+ }, { data: o } = await D.getAllAssetsOptions(t);
365
365
  return o.data[s] ?? [];
366
366
  }, X = async (s) => p.from === "damage" ? H(s) : p.from === "missing" ? K(s) : Q(s);
367
367
  return (s, e) => (se(), te(ae, null, [
@@ -427,7 +427,7 @@ const be = {
427
427
  "onUpdate:visible": e[8] || (e[8] = (t) => b.value = t),
428
428
  "confirm-label": d(r)("Continue"),
429
429
  header: d(r)("Cancel Report"),
430
- onConfirm: D,
430
+ onConfirm: _,
431
431
  severity: "danger"
432
432
  }, {
433
433
  body: re(() => [
@@ -436,7 +436,7 @@ const be = {
436
436
  ]),
437
437
  _: 1
438
438
  }, 8, ["visible", "confirm-label", "header"]),
439
- g("div", De, [
439
+ g("div", _e, [
440
440
  i(x, {
441
441
  label: d(r)("Cancel"),
442
442
  onClick: e[9] || (e[9] = (t) => b.value = !0),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.57",
3
+ "version": "1.0.1-alpha.59",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",