@fewangsit/wangsvue-fats 1.0.1-alpha.50 → 1.0.1-alpha.52

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.
Files changed (36) hide show
  1. package/basecalendar/index.es.js +270 -261
  2. package/disposalreport/index.d.ts +62 -0
  3. package/disposalreport/index.es.js +17 -14
  4. package/disposalreportdialogselectasset/index.es.js +238 -0
  5. package/disposalreporttable/index.es.js +256 -137
  6. package/disposalreporttablefilter/index.es.js +17 -45
  7. package/icon/index.d.ts +1 -0
  8. package/package.json +1 -1
  9. package/stats.html +1 -1
  10. package/style.css +1 -1
  11. package/vendor/luxon/src/datetime.es.js +1845 -0
  12. package/vendor/luxon/src/duration.es.js +734 -0
  13. package/vendor/luxon/src/errors.es.js +40 -0
  14. package/vendor/luxon/src/impl/conversions.es.js +92 -0
  15. package/vendor/luxon/src/impl/diff.es.js +36 -0
  16. package/vendor/luxon/src/impl/digits.es.js +77 -0
  17. package/vendor/luxon/src/impl/english.es.js +132 -0
  18. package/vendor/luxon/src/impl/formats.es.js +150 -0
  19. package/vendor/luxon/src/impl/formatter.es.js +274 -0
  20. package/vendor/luxon/src/impl/invalid.es.js +11 -0
  21. package/vendor/luxon/src/impl/locale.es.js +293 -0
  22. package/vendor/luxon/src/impl/regexParser.es.js +202 -0
  23. package/vendor/luxon/src/impl/tokenParser.es.js +344 -0
  24. package/vendor/luxon/src/impl/util.es.js +217 -0
  25. package/vendor/luxon/src/impl/zoneUtil.es.js +19 -0
  26. package/vendor/luxon/src/info.es.js +180 -0
  27. package/vendor/luxon/src/interval.es.js +477 -0
  28. package/vendor/luxon/src/luxon.es.js +2 -0
  29. package/vendor/luxon/src/settings.es.js +150 -0
  30. package/vendor/luxon/src/zone.es.js +88 -0
  31. package/vendor/luxon/src/zones/IANAZone.es.js +181 -0
  32. package/vendor/luxon/src/zones/fixedOffsetZone.es.js +125 -0
  33. package/vendor/luxon/src/zones/invalidZone.es.js +41 -0
  34. package/vendor/luxon/src/zones/systemZone.es.js +47 -0
  35. package/wangsvue-fats.esm.browser.js +22804 -16970
  36. package/wangsvue-fats.system.js +73 -73
@@ -1,23 +1,24 @@
1
- import { defineComponent as E, onMounted as I, shallowRef as i, ref as M, createElementBlock as N, openBlock as F, Fragment as L, createElementVNode as d, createVNode as a, mergeProps as P, unref as l, withCtx as U, toDisplayString as _ } from "vue";
2
- import { AssetServices as V, DisposalServices as q } from "@tagsamurai/fats-api-services";
3
- import { u as z } from "../assetinfo/index.es.js";
4
- import { u as O } from "../plugins/basei18n.es.js";
1
+ import { defineComponent as V, onMounted as z, shallowRef as f, ref as W, createElementBlock as j, openBlock as H, Fragment as K, createElementVNode as g, createVNode as l, mergeProps as Q, unref as d, withCtx as X, toDisplayString as C } from "vue";
2
+ import { AssetServices as Y, DisposalServices as Z, DamageServices as B, MissingServices as O } from "@tagsamurai/fats-api-services";
3
+ import { u as ee } from "../assetinfo/index.es.js";
4
+ import { u as te } from "../plugins/basei18n.es.js";
5
5
  import "../utils/role.util.es.js";
6
- import { u as W } from "../utils/toast.util.es.js";
7
- import { _ as g } from "../badge/index.es.js";
6
+ import { u as se } from "../utils/toast.util.es.js";
7
+ import { _ as D } from "../badge/index.es.js";
8
8
  import { _ as w } from "../button/index.es.js";
9
- import { _ as j } from "../buttonfilter/index.es.js";
10
- import { _ as H } from "../buttonsearch/index.es.js";
11
- import { D as K } from "../datatable/index.es.js";
12
- import { _ as R } from "../dialogconfirm/index.es.js";
13
- import { _ as G } from "../image/index.es.js";
14
- import { _ as Q } from "../textarea/index.es.js";
15
- import { _ as J } from "../disposalreportbulkaction/index.es.js";
16
- import { _ as X } from "../disposalreporttablefilter/index.es.js";
17
- const Y = {
9
+ import { _ as ae } from "../buttonfilter/index.es.js";
10
+ import { _ as oe } from "../buttonsearch/index.es.js";
11
+ import { D as re } from "../datatable/index.es.js";
12
+ import { _ as M } from "../dialogconfirm/index.es.js";
13
+ import { _ as ne } from "../image/index.es.js";
14
+ import { _ as le } from "../textarea/index.es.js";
15
+ import { _ as ie } from "../disposalreportbulkaction/index.es.js";
16
+ import { _ as de } from "../disposalreportdialogselectasset/index.es.js";
17
+ import { _ as pe } from "../disposalreporttablefilter/index.es.js";
18
+ const ue = {
18
19
  class: "flex flex-col gap-2",
19
20
  "data-ts-section": "disposalreporttablewrapper"
20
- }, Z = { class: "flex gap-1 justify-end" }, ee = { class: "flex gap-1 justify-end" }, ge = /* @__PURE__ */ E({
21
+ }, me = { class: "flex gap-1 justify-end" }, ce = { class: "flex gap-1 justify-end" }, Me = /* @__PURE__ */ V({
21
22
  __name: "DisposalReportTable",
22
23
  props: {
23
24
  treeTable: { type: Boolean },
@@ -56,16 +57,19 @@ const Y = {
56
57
  emptyTableMessage: {},
57
58
  singleSelection: {},
58
59
  router: {},
59
- reason: {}
60
+ reason: {},
61
+ from: {}
60
62
  },
61
- setup(x) {
62
- const u = x;
63
- I(() => {
64
- S();
63
+ setup(T) {
64
+ const u = T;
65
+ z(() => {
66
+ $();
65
67
  });
66
- const p = W(), { t: s } = O(), { setLoading: m } = z(), c = i(!1), f = i(!1), D = i(0), y = i([]), b = i(), r = i([]), n = M(
68
+ const m = se(), { t: a } = te(), { setLoading: c } = ee(), y = f(!1), b = f(!1), v = f(!1), x = f([]), h = f(), n = f(
69
+ []
70
+ ), p = W(
67
71
  /* @__PURE__ */ new Map()
68
- ), C = [
72
+ ), k = [
69
73
  {
70
74
  field: "assetImageSmall",
71
75
  header: "Photo",
@@ -73,10 +77,10 @@ const Y = {
73
77
  fixed: !0,
74
78
  sortable: !1,
75
79
  excluded: !0,
76
- bodyComponent: (o) => ({
77
- component: G,
80
+ bodyComponent: (s) => ({
81
+ component: ne,
78
82
  props: {
79
- src: o.assetImage,
83
+ src: s.assetImage,
80
84
  description: "asset-report-photo",
81
85
  size: "small"
82
86
  }
@@ -87,22 +91,28 @@ const Y = {
87
91
  field: "name.nameWithSequence",
88
92
  sortable: !0,
89
93
  fixed: !0,
90
- bodyTemplate: (o) => {
94
+ bodyTemplate: (s) => {
91
95
  var e;
92
- return ((e = o.name) == null ? void 0 : e.nameWithSequence) ?? "-";
96
+ return ((e = s.name) == null ? void 0 : e.nameWithSequence) ?? "-";
93
97
  }
94
98
  },
99
+ {
100
+ header: "Asset ID",
101
+ field: "assetId",
102
+ sortable: !0,
103
+ fixed: !0
104
+ },
95
105
  {
96
106
  header: "Brand",
97
107
  field: "brand.name",
98
108
  sortable: !0,
99
109
  fixed: !1,
100
- bodyComponent: (o) => {
110
+ bodyComponent: (s) => {
101
111
  var e;
102
112
  return {
103
- component: g,
113
+ component: D,
104
114
  props: {
105
- label: (e = o.brand) == null ? void 0 : e.name,
115
+ label: (e = s.brand) == null ? void 0 : e.name,
106
116
  severity: "dark",
107
117
  format: "nowrap"
108
118
  }
@@ -114,12 +124,12 @@ const Y = {
114
124
  field: "model.name",
115
125
  sortable: !0,
116
126
  fixed: !1,
117
- bodyComponent: (o) => {
127
+ bodyComponent: (s) => {
118
128
  var e;
119
129
  return {
120
- component: g,
130
+ component: D,
121
131
  props: {
122
- label: (e = o.model) == null ? void 0 : e.name,
132
+ label: (e = s.model) == null ? void 0 : e.name,
123
133
  severity: "dark",
124
134
  format: "nowrap"
125
135
  }
@@ -131,12 +141,12 @@ const Y = {
131
141
  field: "group.name",
132
142
  sortable: !0,
133
143
  fixed: !1,
134
- bodyComponent: (o) => {
144
+ bodyComponent: (s) => {
135
145
  var e;
136
146
  return {
137
- component: g,
147
+ component: D,
138
148
  props: {
139
- label: (e = o.group) == null ? void 0 : e.name,
149
+ label: (e = s.group) == null ? void 0 : e.name,
140
150
  format: "nowrap"
141
151
  }
142
152
  };
@@ -146,125 +156,227 @@ const Y = {
146
156
  header: "Note",
147
157
  field: "note",
148
158
  fixed: !0,
149
- bodyComponent: (o) => ({
150
- component: Q,
151
- props: {
152
- modelValue: n.value.get(o._id ?? "assetId").notes,
153
- placeholder: s("Enter note"),
154
- rows: 1,
155
- maxlength: 30
156
- },
157
- events: {
158
- "update:modelValue": (e) => {
159
- const t = n.value.get(o._id ?? "assetId");
160
- n.value.set(o._id ?? "assetId", {
161
- ...t,
162
- notes: e
163
- }), o.note = e;
159
+ bodyComponent: (s) => {
160
+ var e;
161
+ return {
162
+ component: le,
163
+ props: {
164
+ modelValue: (e = p.value.get(s._id ?? "assetId")) == null ? void 0 : e.notes,
165
+ placeholder: a("Enter note"),
166
+ rows: 1,
167
+ maxlength: 30
168
+ },
169
+ events: {
170
+ "update:modelValue": (t) => {
171
+ const o = p.value.get(s._id ?? "assetId");
172
+ p.value.set(s._id ?? "assetId", {
173
+ ...o,
174
+ notes: t
175
+ }), s.note = t;
176
+ }
164
177
  }
165
- }
166
- })
178
+ };
179
+ }
180
+ }
181
+ ], $ = async () => {
182
+ const s = sessionStorage.getItem("assetsDisposalReport");
183
+ if (!s) {
184
+ m.add({
185
+ message: a("Error, no assets found for disposal report."),
186
+ severity: "error"
187
+ });
188
+ return;
167
189
  }
168
- ], S = async () => {
169
190
  try {
170
- m(!0);
171
- const o = sessionStorage.getItem("assetsDisposalReport") ?? "[]", { data: e } = await V.getAllAssets({ _id: o });
191
+ c(!0);
192
+ const { data: e } = await Y.getAllAssets({ _id: s });
172
193
  e.data.data.forEach((t) => {
173
- n.value.set(t._id ?? "", {
194
+ p.value.set(t._id ?? "", {
174
195
  notes: null,
175
196
  reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
176
197
  });
177
- }), r.value = e.data.data, D.value = e.data.totalRecords;
178
- } catch (o) {
179
- console.error(o), p.add({
180
- error: o,
198
+ }), n.value = e.data.data;
199
+ } catch (e) {
200
+ console.error(e), m.add({
201
+ error: e,
181
202
  message: "Error, failed to get assets. "
182
203
  });
183
204
  } finally {
184
- m(!1);
205
+ c(!1);
185
206
  }
186
- }, T = [
207
+ }, N = [
187
208
  {
188
- label: s("Remove from List"),
209
+ label: a("Remove from List"),
189
210
  icon: "delete-bin",
190
211
  danger: !0,
191
212
  command: () => {
192
- c.value = !0;
213
+ b.value = !0;
193
214
  }
194
215
  }
195
- ], h = (o) => {
196
- r.value = r.value.filter(
197
- (e) => !o.some((t) => e._id === t._id)
198
- ), B(o);
199
- }, B = (o) => {
200
- o.forEach((e) => {
201
- n.value.delete(e._id ?? "");
202
- }), r.value.length || v(), p.add({
203
- message: s("Success, asset has been removed from the list."),
216
+ ], R = (s) => {
217
+ n.value = n.value.filter(
218
+ (e) => !s.some((t) => e._id === t._id)
219
+ ), E(s);
220
+ }, E = (s) => {
221
+ s.forEach((e) => {
222
+ p.value.delete(e._id ?? "");
223
+ }), n.value.length || _(), m.add({
224
+ message: a("Success, asset has been removed from the list."),
204
225
  severity: "success"
205
226
  });
206
- }, $ = (o, e) => {
207
- o.forEach((t) => {
208
- n.value.set(t._id ?? "", {
227
+ }, P = (s, e) => {
228
+ s.forEach((t) => {
229
+ p.value.set(t._id ?? "", {
209
230
  notes: e ?? null,
210
231
  reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
211
232
  });
212
233
  });
213
- }, v = () => {
214
- const o = window.location.pathname, e = o.slice(0, o.lastIndexOf("/"));
234
+ }, _ = () => {
235
+ const s = window.location.pathname, e = s.slice(0, s.lastIndexOf("/"));
215
236
  u.router.replace(e), sessionStorage.removeItem("assetsDisposalReport");
216
- }, A = async () => {
217
- const o = [];
218
- n.value.forEach((e, t) => {
219
- const k = {
237
+ }, F = async () => {
238
+ const s = [];
239
+ p.value.forEach((e, t) => {
240
+ const o = {
220
241
  asset: t,
221
242
  notes: e.notes,
222
243
  reason: e.reason
223
244
  };
224
- o.push(k);
245
+ s.push(o);
225
246
  });
226
247
  try {
227
- m(!0), await q.postReportDisposal({ data: o }), p.add({
228
- message: s("Success, disposal report has been submitted.")
229
- }), v();
248
+ c(!0), await Z.postReportDisposal({ data: s }), m.add({
249
+ message: a("Success, disposal report has been submitted.")
250
+ }), _();
251
+ } catch (e) {
252
+ console.error(e), m.add({
253
+ error: e,
254
+ message: a("Error, failed to submit disposal report.")
255
+ });
256
+ } finally {
257
+ c(!1);
258
+ }
259
+ }, L = async (s) => {
260
+ try {
261
+ c(!0);
262
+ const e = s.map((t) => {
263
+ var o, r, i, I, S, A;
264
+ return p.value.set(t.asset ?? "", {
265
+ notes: null,
266
+ reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
267
+ }), {
268
+ ...t,
269
+ reportId: t._id,
270
+ _id: t.asset,
271
+ name: t.assetName,
272
+ assetImage: t.assetImage ?? t.damageImage,
273
+ brand: t.assetBrand,
274
+ model: t.assetModel,
275
+ rfid: !1,
276
+ qr: !1,
277
+ transactions: null,
278
+ manager: null,
279
+ licenseStatuses: null,
280
+ category: {
281
+ _id: (o = t.category) == null ? void 0 : o._id,
282
+ name: (r = t.category) == null ? void 0 : r.name,
283
+ key: (i = t.category) == null ? void 0 : i.key
284
+ },
285
+ group: {
286
+ _id: (I = t.assetGroup) == null ? void 0 : I._id,
287
+ name: (S = t.assetGroup) == null ? void 0 : S.name,
288
+ key: (A = t.assetGroup) == null ? void 0 : A.key
289
+ }
290
+ };
291
+ });
292
+ n.value = n.value.concat(e);
230
293
  } catch (e) {
231
- console.error(e), p.add({
294
+ console.error(e), m.add({
232
295
  error: e,
233
- message: s("Error, failed to submit disposal report.")
296
+ message: "Error, failed to add asset.",
297
+ severity: "error"
234
298
  });
235
299
  } finally {
236
- m(!1);
300
+ c(!1);
237
301
  }
302
+ }, q = async (s) => {
303
+ var r;
304
+ const e = JSON.stringify(
305
+ ((r = n.value) == null ? void 0 : r.map((i) => i.reportId)) ?? []
306
+ ), t = {
307
+ excludeId: e,
308
+ excludeIds: e,
309
+ status: '["Damaged", "Reported Disposal", "On Disposal Process"]',
310
+ ...s
311
+ }, { data: o } = await B.getDamageReportList(t);
312
+ return o;
313
+ }, U = async (s) => {
314
+ var r;
315
+ const e = JSON.stringify(
316
+ ((r = n.value) == null ? void 0 : r.map((i) => i.reportId)) ?? []
317
+ ), t = {
318
+ excludeId: e,
319
+ excludeIds: e,
320
+ status: '["Missing", "Reported Disposal", "On Disposal Process"]',
321
+ ...s
322
+ }, { data: o } = await O.getData(t);
323
+ return o;
324
+ }, G = async (s) => {
325
+ var r;
326
+ const e = JSON.stringify(
327
+ ((r = n.value) == null ? void 0 : r.map((i) => i.reportId)) ?? []
328
+ ), t = {
329
+ excludeId: e,
330
+ excludeIds: e,
331
+ status: '["Missing", "Reported Disposal", "On Disposal Process"]',
332
+ reportedByOptions: "true",
333
+ [s]: !0
334
+ }, { data: o } = await O.getDataOptions(t);
335
+ return o.data[s] ?? [];
336
+ }, J = async (s) => {
337
+ var r;
338
+ const e = JSON.stringify(
339
+ ((r = n.value) == null ? void 0 : r.map((i) => i.reportId)) ?? []
340
+ ), t = {
341
+ excludeId: e,
342
+ excludeIds: e,
343
+ status: '["Missing", "Reported Disposal", "On Disposal Process"]',
344
+ reportedByOptions: "true",
345
+ [s]: !0
346
+ }, { data: o } = await B.getDamageReportListFilterOptions(t);
347
+ return o.data[s] ?? [];
238
348
  };
239
- return (o, e) => (F(), N(L, null, [
240
- d("div", Y, [
241
- d("div", Z, [
242
- a(J, {
243
- "assets-to-report": r.value,
244
- "onUpdate:assetsToReport": e[0] || (e[0] = (t) => r.value = t),
245
- "selected-data": y.value,
246
- "onUpdate:selectedData": e[1] || (e[1] = (t) => y.value = t),
247
- onNoted: $,
248
- onRemoved: e[2] || (e[2] = (t) => h(t)),
349
+ return (s, e) => (H(), j(K, null, [
350
+ g("div", ue, [
351
+ g("div", me, [
352
+ l(ie, {
353
+ "assets-to-report": n.value,
354
+ "onUpdate:assetsToReport": e[0] || (e[0] = (t) => n.value = t),
355
+ "selected-data": x.value,
356
+ "onUpdate:selectedData": e[1] || (e[1] = (t) => x.value = t),
357
+ onNoted: P,
358
+ onRemoved: e[2] || (e[2] = (t) => R(t)),
249
359
  "table-name": "disposal-report-page-table"
250
360
  }, null, 8, ["assets-to-report", "selected-data"]),
251
- a(H, {
361
+ l(oe, {
252
362
  class: "ml-auto",
253
363
  "table-name": "disposal-report-page-table"
254
364
  }),
255
- a(j, { "table-name": "disposal-report-page-table" })
365
+ l(ae, { "table-name": "disposal-report-page-table" }),
366
+ l(w, {
367
+ onClick: e[3] || (e[3] = (t) => y.value = !0),
368
+ icon: "add",
369
+ label: "Asset"
370
+ })
256
371
  ]),
257
- a(X, {
258
- assets: r.value,
259
- "table-name": "disposal-report-page-table"
260
- }, null, 8, ["assets"]),
261
- a(K, P(o.$props, {
262
- columns: C,
263
- data: r.value,
372
+ l(pe, { "table-name": "disposal-report-page-table" }),
373
+ l(re, Q(s.$props, {
374
+ columns: k,
375
+ data: n.value,
264
376
  lazy: !1,
265
- options: T,
377
+ options: N,
266
378
  rows: 10,
267
- onToggleOption: e[3] || (e[3] = (t) => b.value = t),
379
+ onToggleOption: e[4] || (e[4] = (t) => h.value = t),
268
380
  "data-key": "_id",
269
381
  "rounded-header": "",
270
382
  "selection-type": "checkbox",
@@ -273,41 +385,48 @@ const Y = {
273
385
  "use-paginator": ""
274
386
  }), null, 16, ["data"])
275
387
  ]),
276
- a(R, {
277
- visible: c.value,
278
- "onUpdate:visible": e[4] || (e[4] = (t) => c.value = t),
279
- body: l(s)("Are you sure you want to remove it?"),
280
- "confirm-label": l(s)("Remove"),
281
- header: l(s)("Remove from List"),
282
- lists: [b.value],
283
- onConfirm: e[5] || (e[5] = (t) => h([b.value])),
388
+ l(de, {
389
+ visible: y.value,
390
+ "onUpdate:visible": e[5] || (e[5] = (t) => y.value = t),
391
+ "fetch-function": u.from === "damage" ? q : U,
392
+ "fetch-option-function": u.from === "damage" ? J : G,
393
+ onSelect: L
394
+ }, null, 8, ["visible", "fetch-function", "fetch-option-function"]),
395
+ l(M, {
396
+ visible: b.value,
397
+ "onUpdate:visible": e[6] || (e[6] = (t) => b.value = t),
398
+ body: d(a)("Are you sure you want to remove it?"),
399
+ "confirm-label": d(a)("Remove"),
400
+ header: d(a)("Remove from List"),
401
+ lists: [h.value],
402
+ onConfirm: e[7] || (e[7] = (t) => R([h.value])),
284
403
  "list-label": "name.nameWithSequence",
285
404
  severity: "danger"
286
405
  }, null, 8, ["visible", "body", "confirm-label", "header", "lists"]),
287
- a(R, {
288
- visible: f.value,
289
- "onUpdate:visible": e[6] || (e[6] = (t) => f.value = t),
290
- "confirm-label": l(s)("Continue"),
291
- header: l(s)("Cancel Report"),
292
- onConfirm: v,
406
+ l(M, {
407
+ visible: v.value,
408
+ "onUpdate:visible": e[8] || (e[8] = (t) => v.value = t),
409
+ "confirm-label": d(a)("Continue"),
410
+ header: d(a)("Cancel Report"),
411
+ onConfirm: _,
293
412
  severity: "danger"
294
413
  }, {
295
- body: U(() => [
296
- d("p", null, _(l(s)("This action will cancel the disposal report.")), 1),
297
- d("p", null, _(l(s)("Are you sure you want to continue?")), 1)
414
+ body: X(() => [
415
+ g("p", null, C(d(a)("This action will cancel the disposal report.")), 1),
416
+ g("p", null, C(d(a)("Are you sure you want to continue?")), 1)
298
417
  ]),
299
418
  _: 1
300
419
  }, 8, ["visible", "confirm-label", "header"]),
301
- d("div", ee, [
302
- a(w, {
303
- label: l(s)("Cancel"),
304
- onClick: e[7] || (e[7] = (t) => f.value = !0),
420
+ g("div", ce, [
421
+ l(w, {
422
+ label: d(a)("Cancel"),
423
+ onClick: e[9] || (e[9] = (t) => v.value = !0),
305
424
  severity: "dark",
306
425
  text: ""
307
426
  }, null, 8, ["label"]),
308
- a(w, {
309
- label: l(s)("Submit"),
310
- onClick: A,
427
+ l(w, {
428
+ label: d(a)("Submit"),
429
+ onClick: F,
311
430
  severity: "success"
312
431
  }, null, 8, ["label"])
313
432
  ])
@@ -315,5 +434,5 @@ const Y = {
315
434
  }
316
435
  });
317
436
  export {
318
- ge as _
437
+ Me as _
319
438
  };
@@ -1,68 +1,40 @@
1
- import { defineComponent as y, shallowRef as r, ref as g, createBlock as b, openBlock as h } from "vue";
2
- import { AssetServices as _ } from "@tagsamurai/fats-api-services";
3
- import { u as O } from "../plugins/basei18n.es.js";
4
- import "../utils/role.util.es.js";
5
- import { u as k } from "../utils/toast.util.es.js";
6
- import { _ as v } from "../filtercontainer/index.es.js";
7
- const x = /* @__PURE__ */ y({
1
+ import { defineComponent as t, shallowRef as o, createBlock as p, openBlock as r } from "vue";
2
+ import { u as s } from "../plugins/basei18n.es.js";
3
+ import { _ as m } from "../filtercontainer/index.es.js";
4
+ const u = /* @__PURE__ */ t({
8
5
  __name: "DisposalReportTableFilter",
9
6
  props: {
10
- assets: {},
11
7
  tableName: {}
12
8
  },
13
- setup(p) {
14
- const o = p, c = k(), { t: e } = O(), i = r([
9
+ setup(n) {
10
+ const { t: e } = s(), l = o([
15
11
  {
16
12
  label: e("Name"),
17
13
  placeholder: e("Select asset name"),
18
- field: "name.key",
19
- type: "multiselect",
20
- fetchOptionFn: async () => s("nameOptions")
14
+ field: "name.name",
15
+ type: "multiselect"
21
16
  },
22
17
  {
23
18
  label: e("Brand"),
24
19
  placeholder: e("Select brand"),
25
- field: "brand.key",
26
- type: "multiselect",
27
- fetchOptionFn: async () => s("brandOptions")
20
+ field: "brand.name",
21
+ type: "multiselect"
28
22
  },
29
23
  {
30
24
  label: e("Model/Type"),
31
25
  placeholder: e("Select model/type"),
32
- field: "model.key",
33
- type: "multiselect",
34
- fetchOptionFn: async () => s("modelOptions")
26
+ field: "model.name",
27
+ type: "multiselect"
35
28
  },
36
29
  {
37
30
  label: e("Group"),
38
31
  field: "group.key",
39
32
  type: "group"
40
33
  }
41
- ]), m = r(o.assets.length), n = g(
42
- {}
43
- ), s = async (t) => {
44
- var l;
45
- try {
46
- n.value[t] = !0;
47
- const a = o.assets.map((u) => u._id ?? "");
48
- m.value = a.length;
49
- const d = {
50
- _id: JSON.stringify(a),
51
- [t]: !0
52
- }, { data: f } = await _.getAllAssetsOptions(d);
53
- return (l = f.data) == null ? void 0 : l[t];
54
- } catch (a) {
55
- return console.error(a), c.add({
56
- error: a,
57
- message: "Error, failed to get filter option."
58
- }), [];
59
- } finally {
60
- n.value[t] = !1;
61
- }
62
- };
63
- return (t, l) => (h(), b(v, {
64
- fields: i.value,
65
- "table-name": t.tableName,
34
+ ]);
35
+ return (a, c) => (r(), p(m, {
36
+ fields: l.value,
37
+ "table-name": a.tableName,
66
38
  class: "!gap-x-3 !gap-y-4 !p-3",
67
39
  "data-ts-name": "diposalreportfilter",
68
40
  static: ""
@@ -70,5 +42,5 @@ const x = /* @__PURE__ */ y({
70
42
  }
71
43
  });
72
44
  export {
73
- x as _
45
+ u as _
74
46
  };
package/icon/index.d.ts CHANGED
@@ -144,6 +144,7 @@ export type WangsIcons =
144
144
  | 'node-tree'
145
145
  | 'note'
146
146
  | 'notification'
147
+ | 'organization-chart'
147
148
  | 'pdf'
148
149
  | 'pair-tag'
149
150
  | 'pencil'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.50",
3
+ "version": "1.0.1-alpha.52",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",