@fewangsit/wangsvue-fats 1.0.1-alpha.58 → 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/package.json +1 -1
- package/stats.html +1 -1
- package/wangsvue-fats.esm.browser.js +12 -12
- 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
|
};
|