tsv2-library 1.0.61-alpha.30 → 1.0.61-alpha.32

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.
@@ -2,8 +2,8 @@ import type { PropType as __PropType } from 'vue';
2
2
  type Field = 'brand' | 'model' | 'group' | 'status';
3
3
  declare const _sfc_main: import("vue").DefineComponent<{
4
4
  id: {
5
- type: __PropType<string>;
6
- required: true;
5
+ type: __PropType<string | undefined>;
6
+ required: false;
7
7
  };
8
8
  fields: {
9
9
  type: __PropType<Field[] | undefined>;
@@ -15,8 +15,8 @@ declare const _sfc_main: import("vue").DefineComponent<{
15
15
  };
16
16
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
17
  id: {
18
- type: __PropType<string>;
19
- required: true;
18
+ type: __PropType<string | undefined>;
19
+ required: false;
20
20
  };
21
21
  fields: {
22
22
  type: __PropType<Field[] | undefined>;
@@ -60,8 +60,10 @@ export type Asset = {
60
60
  };
61
61
  lastModifier?: string;
62
62
  updatedAt?: string;
63
- rfid?: string;
64
- qr?: string;
63
+ tagReported: {
64
+ rfid?: string;
65
+ qr?: string;
66
+ };
65
67
  firstImage?: string;
66
68
  secondImageSmall?: string;
67
69
  secondImageMedium?: string;
@@ -27977,8 +27977,8 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
27977
27977
  return ((_h = (_g = (_f = asset.value) == null ? void 0 : _f.name) == null ? void 0 : _g.aliasCode) == null ? void 0 : _h.length) ? `(${(_j = (_i = asset.value) == null ? void 0 : _i.name) == null ? void 0 : _j.aliasCode})` : "";
27978
27978
  });
27979
27979
  const assetTagType = computed(() => {
27980
- var _a, _b;
27981
- return ((_a = asset.value) == null ? void 0 : _a.assetTagType) ?? ((_b = asset.value) == null ? void 0 : _b.tagType);
27980
+ var _a, _b, _c;
27981
+ return ((_a = asset.value) == null ? void 0 : _a.assetTagType) ?? ((_b = asset.value) == null ? void 0 : _b.tagType) ?? ((_c = props.transactionDetail) == null ? void 0 : _c.tagType);
27982
27982
  });
27983
27983
  const assetName = computed(() => {
27984
27984
  var _a, _b;
@@ -27991,6 +27991,8 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
27991
27991
  }
27992
27992
  ]);
27993
27993
  const fetchAssetDetail = async () => {
27994
+ if (!props.id)
27995
+ return;
27994
27996
  try {
27995
27997
  setLoading(true);
27996
27998
  const { data: response } = await AssetsServices.getAssetDetail(props.id);
@@ -28011,8 +28013,44 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
28011
28013
  { deep: true }
28012
28014
  );
28013
28015
  __expose({ asset });
28016
+ const nameWithSequence = computed(
28017
+ () => {
28018
+ var _a, _b;
28019
+ return ((_a = assetName.value) == null ? void 0 : _a.nameWithSequence) ?? ((_b = props.transactionDetail) == null ? void 0 : _b.nameWithSequence) ?? "-";
28020
+ }
28021
+ );
28022
+ const assetId = computed(
28023
+ () => {
28024
+ var _a, _b;
28025
+ return ((_a = asset.value) == null ? void 0 : _a.assetId) ?? ((_b = props.transactionDetail) == null ? void 0 : _b.assetId) ?? "-";
28026
+ }
28027
+ );
28028
+ const brand = computed(
28029
+ () => {
28030
+ var _a, _b, _c, _d, _e;
28031
+ return ((_b = (_a = asset.value) == null ? void 0 : _a.assetBrand) == null ? void 0 : _b.name) ?? ((_d = (_c = asset.value) == null ? void 0 : _c.brand) == null ? void 0 : _d.name) ?? ((_e = props.transactionDetail) == null ? void 0 : _e.assetBrand) ?? "-";
28032
+ }
28033
+ );
28034
+ const model = computed(
28035
+ () => {
28036
+ var _a, _b, _c, _d, _e;
28037
+ return ((_b = (_a = asset.value) == null ? void 0 : _a.assetModel) == null ? void 0 : _b.name) ?? ((_d = (_c = asset.value) == null ? void 0 : _c.model) == null ? void 0 : _d.name) ?? ((_e = props.transactionDetail) == null ? void 0 : _e.assetModel) ?? "-";
28038
+ }
28039
+ );
28040
+ const group = computed(
28041
+ () => {
28042
+ var _a, _b, _c, _d, _e;
28043
+ return ((_b = (_a = asset.value) == null ? void 0 : _a.assetGroup) == null ? void 0 : _b.name) ?? ((_d = (_c = asset.value) == null ? void 0 : _c.group) == null ? void 0 : _d.name) ?? ((_e = props.transactionDetail) == null ? void 0 : _e.assetGroup) ?? "-";
28044
+ }
28045
+ );
28046
+ const status = computed(
28047
+ () => {
28048
+ var _a, _b;
28049
+ return ((_a = asset.value) == null ? void 0 : _a.status) ?? ((_b = props.transactionDetail) == null ? void 0 : _b.status) ?? "-";
28050
+ }
28051
+ );
28014
28052
  return (_ctx, _cache) => {
28015
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t2, _u, _v, _w, _x;
28053
+ var _a, _b, _c, _d, _e, _f, _g, _h;
28016
28054
  return openBlock(), createElementBlock("div", _hoisted_1$1Y, [
28017
28055
  createVNode(unref(_sfc_main$Q), {
28018
28056
  preview: defaultImage.value.preview,
@@ -28021,61 +28059,59 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
28021
28059
  createElementVNode("div", _hoisted_2$1y, [
28022
28060
  createElementVNode("div", _hoisted_3$D, [
28023
28061
  createElementVNode("div", _hoisted_4$q, [
28024
- createElementVNode("div", _hoisted_5$i, toDisplayString$1(((_a = assetName.value) == null ? void 0 : _a.nameWithSequence) ?? "-"), 1),
28062
+ createElementVNode("div", _hoisted_5$i, toDisplayString$1(nameWithSequence.value), 1),
28025
28063
  unref(user).userType !== "Basic" ? (openBlock(), createElementBlock("a", {
28026
28064
  key: 0,
28027
- href: `/assets/detail/${((_b = asset.value) == null ? void 0 : _b.asset) ?? ((_c = asset.value) == null ? void 0 : _c._id)}`,
28065
+ href: `/assets/detail/${((_a = asset.value) == null ? void 0 : _a.asset) ?? ((_b = asset.value) == null ? void 0 : _b._id)}`,
28028
28066
  class: "text-primary-500",
28029
28067
  target: "_blank"
28030
28068
  }, " Asset Detail > ", 8, _hoisted_6$d)) : createCommentVNode("", true)
28031
28069
  ]),
28032
28070
  createElementVNode("div", _hoisted_7$a, [
28033
- createElementVNode("span", _hoisted_8$6, toDisplayString$1(((_d = asset.value) == null ? void 0 : _d.assetId) ?? "-") + " " + toDisplayString$1(aliasCode.value), 1),
28071
+ createElementVNode("span", _hoisted_8$6, toDisplayString$1(assetId.value) + " " + toDisplayString$1(aliasCode.value), 1),
28034
28072
  _hoisted_9$3,
28035
28073
  createVNode(unref(TSTagType), {
28036
- qr: (_e = assetTagType.value) == null ? void 0 : _e.includes("QR"),
28037
- rfid: (_f = assetTagType.value) == null ? void 0 : _f.includes("RFID")
28074
+ qr: (_c = assetTagType.value) == null ? void 0 : _c.includes("QR"),
28075
+ rfid: (_d = assetTagType.value) == null ? void 0 : _d.includes("RFID")
28038
28076
  }, null, 8, ["qr", "rfid"])
28039
28077
  ])
28040
28078
  ]),
28041
28079
  createElementVNode("div", _hoisted_10$3, [
28042
- !props.fields || ((_g = props.fields) == null ? void 0 : _g.includes("brand")) ? (openBlock(), createElementBlock("div", _hoisted_11$3, [
28080
+ !props.fields || ((_e = props.fields) == null ? void 0 : _e.includes("brand")) ? (openBlock(), createElementBlock("div", _hoisted_11$3, [
28043
28081
  createElementVNode("span", {
28044
28082
  class: normalizeClass(itemWidthClass.value)
28045
28083
  }, " Brand ", 2),
28046
28084
  _hoisted_12$2,
28047
28085
  createVNode(unref(_sfc_main$1l), {
28048
- label: ((_i = (_h = asset.value) == null ? void 0 : _h.assetBrand) == null ? void 0 : _i.name) ?? ((_k = (_j = asset.value) == null ? void 0 : _j.brand) == null ? void 0 : _k.name) ?? "-",
28086
+ label: brand.value,
28049
28087
  severity: "dark"
28050
28088
  }, null, 8, ["label"])
28051
28089
  ])) : createCommentVNode("", true),
28052
- !props.fields || ((_l = props.fields) == null ? void 0 : _l.includes("model")) ? (openBlock(), createElementBlock("div", _hoisted_13$2, [
28090
+ !props.fields || ((_f = props.fields) == null ? void 0 : _f.includes("model")) ? (openBlock(), createElementBlock("div", _hoisted_13$2, [
28053
28091
  createElementVNode("span", {
28054
28092
  class: normalizeClass(itemWidthClass.value)
28055
28093
  }, " Model/Type ", 2),
28056
28094
  _hoisted_14$2,
28057
28095
  createVNode(unref(_sfc_main$1l), {
28058
- label: ((_n = (_m = asset.value) == null ? void 0 : _m.assetModel) == null ? void 0 : _n.name) ?? ((_p = (_o = asset.value) == null ? void 0 : _o.model) == null ? void 0 : _p.name) ?? "-",
28096
+ label: model.value,
28059
28097
  severity: "dark"
28060
28098
  }, null, 8, ["label"])
28061
28099
  ])) : createCommentVNode("", true),
28062
- !props.fields || ((_q = props.fields) == null ? void 0 : _q.includes("group")) ? (openBlock(), createElementBlock("div", _hoisted_15$2, [
28100
+ !props.fields || ((_g = props.fields) == null ? void 0 : _g.includes("group")) ? (openBlock(), createElementBlock("div", _hoisted_15$2, [
28063
28101
  createElementVNode("span", {
28064
28102
  class: normalizeClass(itemWidthClass.value)
28065
28103
  }, " Group ", 2),
28066
28104
  _hoisted_16$2,
28067
- createVNode(unref(_sfc_main$1l), {
28068
- label: ((_s = (_r = asset.value) == null ? void 0 : _r.assetGroup) == null ? void 0 : _s.name) ?? ((_u = (_t2 = asset.value) == null ? void 0 : _t2.group) == null ? void 0 : _u.name) ?? "-"
28069
- }, null, 8, ["label"])
28105
+ createVNode(unref(_sfc_main$1l), { label: group.value }, null, 8, ["label"])
28070
28106
  ])) : createCommentVNode("", true),
28071
- ((_v = props.fields) == null ? void 0 : _v.includes("status")) ? (openBlock(), createElementBlock("div", _hoisted_17$2, [
28107
+ ((_h = props.fields) == null ? void 0 : _h.includes("status")) ? (openBlock(), createElementBlock("div", _hoisted_17$2, [
28072
28108
  createElementVNode("span", {
28073
28109
  class: normalizeClass(itemWidthClass.value)
28074
28110
  }, " Asset Status ", 2),
28075
28111
  _hoisted_18$2,
28076
28112
  createVNode(unref(_sfc_main$1l), {
28077
- label: ((_w = asset.value) == null ? void 0 : _w.status) ?? "-",
28078
- severity: unref(getSeverityByAssetStatus)((_x = asset.value) == null ? void 0 : _x.status),
28113
+ label: status.value,
28114
+ severity: unref(getSeverityByAssetStatus)(status.value),
28079
28115
  format: "nowrap"
28080
28116
  }, null, 8, ["label", "severity"])
28081
28117
  ])) : createCommentVNode("", true)
@@ -65911,24 +65947,24 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
65911
65947
  const emit = __emit;
65912
65948
  const visibility = computed(() => props.visible);
65913
65949
  const tagOptions = computed(() => {
65914
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t2, _u, _v;
65950
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t2, _u, _v, _w, _x, _y, _z;
65915
65951
  const isRFIDReported = (_a = props.tagReported) == null ? void 0 : _a.rfid;
65916
65952
  const isQRReported = (_b = props.tagReported) == null ? void 0 : _b.qr;
65917
65953
  return [
65918
65954
  {
65919
65955
  label: "RFID TAG",
65920
65956
  value: "RFID",
65921
- visible: ((_d = (_c = assetInfo.value) == null ? void 0 : _c.asset) == null ? void 0 : _d.rfid) && !isRFIDReported && !((_g = (_f = (_e = assetInfo.value) == null ? void 0 : _e.asset) == null ? void 0 : _f.tagReported) == null ? void 0 : _g.rfid)
65957
+ visible: !!((_e = (_d = (_c = assetInfo.value) == null ? void 0 : _c.asset) == null ? void 0 : _d.tagType) == null ? void 0 : _e.includes("RFID")) && !isRFIDReported && !((_h = (_g = (_f = assetInfo.value) == null ? void 0 : _f.asset) == null ? void 0 : _g.tagReported) == null ? void 0 : _h.rfid)
65922
65958
  },
65923
65959
  {
65924
65960
  label: "QR TAG",
65925
65961
  value: "QR",
65926
- visible: ((_i = (_h = assetInfo.value) == null ? void 0 : _h.asset) == null ? void 0 : _i.qr) && !isQRReported && !((_l = (_k = (_j = assetInfo.value) == null ? void 0 : _j.asset) == null ? void 0 : _k.tagReported) == null ? void 0 : _l.qr)
65962
+ visible: !!((_k = (_j = (_i = assetInfo.value) == null ? void 0 : _i.asset) == null ? void 0 : _j.tagType) == null ? void 0 : _k.includes("QR")) && !isQRReported && !((_n = (_m = (_l = assetInfo.value) == null ? void 0 : _l.asset) == null ? void 0 : _m.tagReported) == null ? void 0 : _n.qr)
65927
65963
  },
65928
65964
  {
65929
65965
  label: "RFID & QR TAG",
65930
65966
  value: "RFID & QR",
65931
- visible: ((_n = (_m = assetInfo.value) == null ? void 0 : _m.asset) == null ? void 0 : _n.rfid) && ((_p = (_o = assetInfo.value) == null ? void 0 : _o.asset) == null ? void 0 : _p.qr) && !isRFIDReported && !((_s = (_r = (_q = assetInfo.value) == null ? void 0 : _q.asset) == null ? void 0 : _r.tagReported) == null ? void 0 : _s.rfid) && !isQRReported && !((_v = (_u = (_t2 = assetInfo.value) == null ? void 0 : _t2.asset) == null ? void 0 : _u.tagReported) == null ? void 0 : _v.qr)
65967
+ visible: !!((_q = (_p = (_o = assetInfo.value) == null ? void 0 : _o.asset) == null ? void 0 : _p.tagType) == null ? void 0 : _q.includes("RFID")) && !!((_t2 = (_s = (_r = assetInfo.value) == null ? void 0 : _r.asset) == null ? void 0 : _s.tagType) == null ? void 0 : _t2.includes("QR")) && !isRFIDReported && !((_w = (_v = (_u = assetInfo.value) == null ? void 0 : _u.asset) == null ? void 0 : _v.tagReported) == null ? void 0 : _w.rfid) && !isQRReported && !((_z = (_y = (_x = assetInfo.value) == null ? void 0 : _x.asset) == null ? void 0 : _y.tagReported) == null ? void 0 : _z.qr)
65932
65968
  }
65933
65969
  ].filter((option) => option.visible);
65934
65970
  });
@@ -65991,10 +66027,11 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
65991
66027
  width: "large"
65992
66028
  }, {
65993
66029
  confirm: withCtx((confirmProps) => {
65994
- var _a, _b, _c;
66030
+ var _a, _b, _c, _d, _e, _f;
65995
66031
  return [
65996
- createVNode(unref(_sfc_main$13), {
65997
- lists: [(_c = (_b = (_a = assetInfo.value) == null ? void 0 : _a.asset) == null ? void 0 : _b.name) == null ? void 0 : _c.nameWithSequence],
66032
+ ((_c = (_b = (_a = assetInfo.value) == null ? void 0 : _a.asset) == null ? void 0 : _b.name) == null ? void 0 : _c.nameWithSequence) ? (openBlock(), createBlock(unref(_sfc_main$13), {
66033
+ key: 0,
66034
+ lists: [(_f = (_e = (_d = assetInfo.value) == null ? void 0 : _d.asset) == null ? void 0 : _e.name) == null ? void 0 : _f.nameWithSequence],
65998
66035
  visible: confirmProps.visible,
65999
66036
  onConfirm: ($event) => confirmProps.submit(submitForm),
66000
66037
  "onUpdate:visible": ($event) => !$event && confirmProps.hide(),
@@ -66003,7 +66040,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
66003
66040
  "data-ts-section": "confirm-dialog",
66004
66041
  header: "Report TAG",
66005
66042
  severity: "danger"
66006
- }, null, 8, ["lists", "visible", "onConfirm", "onUpdate:visible"])
66043
+ }, null, 8, ["lists", "visible", "onConfirm", "onUpdate:visible"])) : createCommentVNode("", true)
66007
66044
  ];
66008
66045
  }),
66009
66046
  fields: withCtx(() => {