@fewangsit/wangsvue-fats 1.0.1-alpha.52 → 1.0.1-alpha.53
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,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as _, ref as
|
|
2
|
-
import { e as
|
|
1
|
+
import { defineComponent as _, ref as x, shallowRef as u, createElementBlock as h, openBlock as d, Fragment as w, createVNode as v, mergeProps as R, withCtx as k, createBlock as B, createCommentVNode as V, unref as l } from "vue";
|
|
2
|
+
import { e as p } from "../event-bus/index.es.js";
|
|
3
3
|
import { u as y } from "../plugins/basei18n.es.js";
|
|
4
4
|
import { _ as A } from "../buttonbulkaction/index.es.js";
|
|
5
5
|
import { _ as C } from "../dialogconfirm/index.es.js";
|
|
@@ -10,14 +10,14 @@ const S = /* @__PURE__ */ _({
|
|
|
10
10
|
tableName: {}
|
|
11
11
|
},
|
|
12
12
|
emits: ["noted", "removed"],
|
|
13
|
-
setup(
|
|
14
|
-
const { t: e } = y(), r =
|
|
13
|
+
setup(c, { emit: b }) {
|
|
14
|
+
const { t: e } = y(), r = c, s = b, o = x([]), n = u(!1), m = u(), f = [
|
|
15
15
|
{
|
|
16
16
|
label: e("Note"),
|
|
17
17
|
icon: "note",
|
|
18
18
|
useAdditionSlot: !0,
|
|
19
19
|
command: () => {
|
|
20
|
-
s("noted", o.value, m.value),
|
|
20
|
+
s("noted", o.value, m.value), p.emit("data-table:clear-selected-data", {
|
|
21
21
|
tableName: r.tableName
|
|
22
22
|
}), m.value = void 0;
|
|
23
23
|
}
|
|
@@ -30,13 +30,13 @@ const S = /* @__PURE__ */ _({
|
|
|
30
30
|
n.value = !0;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
],
|
|
34
|
-
s("removed", o.value),
|
|
33
|
+
], g = () => {
|
|
34
|
+
s("removed", o.value), p.emit("data-table:clear-selected-data", {
|
|
35
35
|
tableName: r.tableName
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
return (i, t) => (d(),
|
|
39
|
-
v(A,
|
|
38
|
+
return (i, t) => (d(), h(w, null, [
|
|
39
|
+
v(A, R({
|
|
40
40
|
"selected-data": o.value,
|
|
41
41
|
"onUpdate:selectedData": t[1] || (t[1] = (a) => o.value = a)
|
|
42
42
|
}, i.$attrs, {
|
|
@@ -44,11 +44,13 @@ const S = /* @__PURE__ */ _({
|
|
|
44
44
|
"table-name": i.tableName,
|
|
45
45
|
naming: "Asset(s)"
|
|
46
46
|
}), {
|
|
47
|
-
addition:
|
|
48
|
-
(a == null ? void 0 : a.label) === l(e)("Note") ? (d(),
|
|
47
|
+
addition: k(({ selectedOption: a }) => [
|
|
48
|
+
(a == null ? void 0 : a.label) === l(e)("Note") ? (d(), B(D, {
|
|
49
49
|
key: 0,
|
|
50
50
|
modelValue: m.value,
|
|
51
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
51
|
+
"onUpdate:modelValue": t[0] || (t[0] = (N) => m.value = N),
|
|
52
|
+
"max-input": 30,
|
|
53
|
+
maxlength: 30,
|
|
52
54
|
placeholder: l(e)("Enter note"),
|
|
53
55
|
rows: 1,
|
|
54
56
|
"textarea-pt": {
|
|
@@ -56,8 +58,9 @@ const S = /* @__PURE__ */ _({
|
|
|
56
58
|
maxlength: 30
|
|
57
59
|
}
|
|
58
60
|
},
|
|
59
|
-
class: "!max-w-[250px]"
|
|
60
|
-
|
|
61
|
+
class: "!max-w-[250px]",
|
|
62
|
+
"prevent-input-on-max-length": ""
|
|
63
|
+
}, null, 8, ["modelValue", "placeholder"])) : V("", !0)
|
|
61
64
|
]),
|
|
62
65
|
_: 1
|
|
63
66
|
}, 16, ["selected-data", "table-name"]),
|
|
@@ -68,7 +71,7 @@ const S = /* @__PURE__ */ _({
|
|
|
68
71
|
header: l(e)("Remove from List"),
|
|
69
72
|
list: o.value,
|
|
70
73
|
message: l(e)("Are you sure you want to remove it?"),
|
|
71
|
-
onConfirm:
|
|
74
|
+
onConfirm: g,
|
|
72
75
|
"list-label": "name.nameWithSequence",
|
|
73
76
|
severity: "danger"
|
|
74
77
|
}, null, 8, ["visible", "confirm-label", "header", "list", "message"])
|
|
@@ -65,7 +65,7 @@ const ue = {
|
|
|
65
65
|
z(() => {
|
|
66
66
|
$();
|
|
67
67
|
});
|
|
68
|
-
const m = se(), { t: a } = te(), { setLoading: c } = ee(), y = f(!1),
|
|
68
|
+
const m = se(), { t: a } = te(), { setLoading: c } = ee(), y = f(!1), v = f(!1), b = f(!1), x = f([]), h = f(), n = f(
|
|
69
69
|
[]
|
|
70
70
|
), p = W(
|
|
71
71
|
/* @__PURE__ */ new Map()
|
|
@@ -164,7 +164,8 @@ const ue = {
|
|
|
164
164
|
modelValue: (e = p.value.get(s._id ?? "assetId")) == null ? void 0 : e.notes,
|
|
165
165
|
placeholder: a("Enter note"),
|
|
166
166
|
rows: 1,
|
|
167
|
-
maxlength: 30
|
|
167
|
+
maxlength: 30,
|
|
168
|
+
preventInputOnMaxLength: !0
|
|
168
169
|
},
|
|
169
170
|
events: {
|
|
170
171
|
"update:modelValue": (t) => {
|
|
@@ -210,10 +211,10 @@ const ue = {
|
|
|
210
211
|
icon: "delete-bin",
|
|
211
212
|
danger: !0,
|
|
212
213
|
command: () => {
|
|
213
|
-
|
|
214
|
+
v.value = !0;
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
|
-
],
|
|
217
|
+
], I = (s) => {
|
|
217
218
|
n.value = n.value.filter(
|
|
218
219
|
(e) => !s.some((t) => e._id === t._id)
|
|
219
220
|
), E(s);
|
|
@@ -234,7 +235,7 @@ const ue = {
|
|
|
234
235
|
}, _ = () => {
|
|
235
236
|
const s = window.location.pathname, e = s.slice(0, s.lastIndexOf("/"));
|
|
236
237
|
u.router.replace(e), sessionStorage.removeItem("assetsDisposalReport");
|
|
237
|
-
},
|
|
238
|
+
}, L = async () => {
|
|
238
239
|
const s = [];
|
|
239
240
|
p.value.forEach((e, t) => {
|
|
240
241
|
const o = {
|
|
@@ -256,11 +257,11 @@ const ue = {
|
|
|
256
257
|
} finally {
|
|
257
258
|
c(!1);
|
|
258
259
|
}
|
|
259
|
-
},
|
|
260
|
+
}, F = async (s) => {
|
|
260
261
|
try {
|
|
261
262
|
c(!0);
|
|
262
263
|
const e = s.map((t) => {
|
|
263
|
-
var o, r, i,
|
|
264
|
+
var o, r, i, R, S, A;
|
|
264
265
|
return p.value.set(t.asset ?? "", {
|
|
265
266
|
notes: null,
|
|
266
267
|
reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
|
|
@@ -283,7 +284,7 @@ const ue = {
|
|
|
283
284
|
key: (i = t.category) == null ? void 0 : i.key
|
|
284
285
|
},
|
|
285
286
|
group: {
|
|
286
|
-
_id: (
|
|
287
|
+
_id: (R = t.assetGroup) == null ? void 0 : R._id,
|
|
287
288
|
name: (S = t.assetGroup) == null ? void 0 : S.name,
|
|
288
289
|
key: (A = t.assetGroup) == null ? void 0 : A.key
|
|
289
290
|
}
|
|
@@ -355,7 +356,7 @@ const ue = {
|
|
|
355
356
|
"selected-data": x.value,
|
|
356
357
|
"onUpdate:selectedData": e[1] || (e[1] = (t) => x.value = t),
|
|
357
358
|
onNoted: P,
|
|
358
|
-
onRemoved: e[2] || (e[2] = (t) =>
|
|
359
|
+
onRemoved: e[2] || (e[2] = (t) => I(t)),
|
|
359
360
|
"table-name": "disposal-report-page-table"
|
|
360
361
|
}, null, 8, ["assets-to-report", "selected-data"]),
|
|
361
362
|
l(oe, {
|
|
@@ -390,22 +391,22 @@ const ue = {
|
|
|
390
391
|
"onUpdate:visible": e[5] || (e[5] = (t) => y.value = t),
|
|
391
392
|
"fetch-function": u.from === "damage" ? q : U,
|
|
392
393
|
"fetch-option-function": u.from === "damage" ? J : G,
|
|
393
|
-
onSelect:
|
|
394
|
+
onSelect: F
|
|
394
395
|
}, null, 8, ["visible", "fetch-function", "fetch-option-function"]),
|
|
395
396
|
l(M, {
|
|
396
|
-
visible:
|
|
397
|
-
"onUpdate:visible": e[6] || (e[6] = (t) =>
|
|
397
|
+
visible: v.value,
|
|
398
|
+
"onUpdate:visible": e[6] || (e[6] = (t) => v.value = t),
|
|
398
399
|
body: d(a)("Are you sure you want to remove it?"),
|
|
399
400
|
"confirm-label": d(a)("Remove"),
|
|
400
401
|
header: d(a)("Remove from List"),
|
|
401
402
|
lists: [h.value],
|
|
402
|
-
onConfirm: e[7] || (e[7] = (t) =>
|
|
403
|
+
onConfirm: e[7] || (e[7] = (t) => I([h.value])),
|
|
403
404
|
"list-label": "name.nameWithSequence",
|
|
404
405
|
severity: "danger"
|
|
405
406
|
}, null, 8, ["visible", "body", "confirm-label", "header", "lists"]),
|
|
406
407
|
l(M, {
|
|
407
|
-
visible:
|
|
408
|
-
"onUpdate:visible": e[8] || (e[8] = (t) =>
|
|
408
|
+
visible: b.value,
|
|
409
|
+
"onUpdate:visible": e[8] || (e[8] = (t) => b.value = t),
|
|
409
410
|
"confirm-label": d(a)("Continue"),
|
|
410
411
|
header: d(a)("Cancel Report"),
|
|
411
412
|
onConfirm: _,
|
|
@@ -420,13 +421,13 @@ const ue = {
|
|
|
420
421
|
g("div", ce, [
|
|
421
422
|
l(w, {
|
|
422
423
|
label: d(a)("Cancel"),
|
|
423
|
-
onClick: e[9] || (e[9] = (t) =>
|
|
424
|
+
onClick: e[9] || (e[9] = (t) => b.value = !0),
|
|
424
425
|
severity: "dark",
|
|
425
426
|
text: ""
|
|
426
427
|
}, null, 8, ["label"]),
|
|
427
428
|
l(w, {
|
|
428
429
|
label: d(a)("Submit"),
|
|
429
|
-
onClick:
|
|
430
|
+
onClick: L,
|
|
430
431
|
severity: "success"
|
|
431
432
|
}, null, 8, ["label"])
|
|
432
433
|
])
|