@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.
- package/assetinfo/index.es.js +71 -71
- package/disposalreporttable/index.es.js +11 -11
- package/package.json +1 -1
- package/stats.html +1 -1
- package/wangsvue-fats.esm.browser.js +13 -13
- package/wangsvue-fats.system.js +23 -23
package/assetinfo/index.es.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { shallowRef as
|
|
2
|
-
import { AssetServices as
|
|
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
|
|
5
|
-
import { u as
|
|
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
|
|
8
|
-
import { _ as
|
|
9
|
-
const
|
|
10
|
-
loading:
|
|
11
|
-
message:
|
|
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
|
-
|
|
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" },
|
|
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
|
-
},
|
|
18
|
+
}, _e = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "flex gap-3"
|
|
21
|
-
},
|
|
21
|
+
}, xe = {
|
|
22
22
|
key: 2,
|
|
23
23
|
class: "flex gap-3"
|
|
24
|
-
},
|
|
24
|
+
}, be = {
|
|
25
25
|
key: 3,
|
|
26
26
|
class: "flex gap-3"
|
|
27
|
-
},
|
|
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
|
-
|
|
39
|
-
t.transactionDetail ?
|
|
38
|
+
Z(async () => {
|
|
39
|
+
t.transactionDetail ? s.value = t.transactionDetail : await U();
|
|
40
40
|
});
|
|
41
|
-
const
|
|
42
|
-
var
|
|
43
|
-
return (
|
|
44
|
-
}),
|
|
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:
|
|
46
|
+
setDefault: e,
|
|
47
47
|
firstImageBig: a,
|
|
48
48
|
secondImageBig: n,
|
|
49
49
|
assetImage: o,
|
|
50
50
|
firstImage: i,
|
|
51
|
-
secondImage:
|
|
52
|
-
} =
|
|
53
|
-
return t.transactionDetail ? o : g ? i ?? a :
|
|
54
|
-
}),
|
|
55
|
-
var a, n, o, i,
|
|
56
|
-
const
|
|
57
|
-
return (o = (n = (a =
|
|
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
|
|
60
|
-
return ((
|
|
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
|
-
]),
|
|
69
|
+
]), U = async () => {
|
|
70
70
|
try {
|
|
71
71
|
h(!0);
|
|
72
|
-
const { data:
|
|
73
|
-
|
|
74
|
-
} catch (
|
|
75
|
-
|
|
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
|
|
80
|
+
return ee(
|
|
81
81
|
() => t.transactionDetail,
|
|
82
|
-
(
|
|
83
|
-
|
|
82
|
+
(e) => {
|
|
83
|
+
s.value = e;
|
|
84
84
|
},
|
|
85
85
|
{ deep: !0 }
|
|
86
|
-
), m({ asset:
|
|
87
|
-
var n, o, i,
|
|
88
|
-
return d(),
|
|
89
|
-
p(
|
|
90
|
-
l("div",
|
|
91
|
-
l("div",
|
|
92
|
-
l("div",
|
|
93
|
-
l("div",
|
|
94
|
-
l("div",
|
|
95
|
-
l("span",
|
|
96
|
-
|
|
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(
|
|
99
|
-
type:
|
|
100
|
-
"use-nfc":
|
|
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
|
-
|
|
105
|
+
q(R).userType !== "Basic" ? (d(), u("a", {
|
|
106
106
|
key: 0,
|
|
107
|
-
href: `/assets/detail/${((
|
|
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,
|
|
110
|
+
}, " Asset Detail > ", 8, ve)) : f("", !0)
|
|
111
111
|
]),
|
|
112
|
-
l("div",
|
|
113
|
-
!t.fields || (
|
|
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 =
|
|
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 || (
|
|
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: ((
|
|
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 || (
|
|
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: ((
|
|
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
|
-
(
|
|
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: ((
|
|
149
|
-
severity:
|
|
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
|
-
|
|
161
|
-
|
|
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
|
|
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" },
|
|
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
|
|
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 ||
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
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
|
|
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
|
|
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:
|
|
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",
|
|
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),
|