tsv2-library 1.1.1-dev-alpha.7 → 1.1.1-dev-alpha.10

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.
@@ -13473,6 +13473,9 @@ const getAssetMaps = (params) => {
13473
13473
  params
13474
13474
  }).get("/asset-maps", { signal: abortController.signal });
13475
13475
  };
13476
+ const printLabel = (assets) => {
13477
+ return API$h().put("/print-label", { assets });
13478
+ };
13476
13479
  const AssetsServices = {
13477
13480
  getAllAssets,
13478
13481
  postAssetList,
@@ -13487,7 +13490,8 @@ const AssetsServices = {
13487
13490
  getUnlinkedAssets,
13488
13491
  getOptions: getOptions$1,
13489
13492
  scanAsset,
13490
- getAssetMaps
13493
+ getAssetMaps,
13494
+ printLabel
13491
13495
  };
13492
13496
  const API$g = ({
13493
13497
  headers = {},
@@ -29129,6 +29133,20 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
29129
29133
  severity: getRoleSeverity(roleData, "disposal"),
29130
29134
  visible: true
29131
29135
  },
29136
+ {
29137
+ label: "Missing",
29138
+ icon: "search-eye",
29139
+ info: getRoleInfo(roleData, "missing"),
29140
+ severity: getRoleSeverity(roleData, "tracking"),
29141
+ visible: !companyAddons.tracking && type.value === "user"
29142
+ },
29143
+ {
29144
+ label: "Damage",
29145
+ icon: "settings",
29146
+ info: getRoleInfo(roleData, "damage"),
29147
+ severity: getRoleSeverity(roleData, "repairTicketing"),
29148
+ visible: !companyAddons.repairTicketing && type.value === "user"
29149
+ },
29132
29150
  {
29133
29151
  label: "Registration",
29134
29152
  icon: "asset",
@@ -29219,6 +29237,10 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
29219
29237
  return "This user has tracking role";
29220
29238
  case "registration":
29221
29239
  return "This user has registration role";
29240
+ case "damage":
29241
+ return "This user has damage role";
29242
+ case "missing":
29243
+ return "This user has missing role";
29222
29244
  default:
29223
29245
  return "This user doesn't have role";
29224
29246
  }
@@ -29294,6 +29316,10 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
29294
29316
  return "This user doesn't have tracking role";
29295
29317
  case "registration":
29296
29318
  return "This user doesn't have registration role";
29319
+ case "damage":
29320
+ return "This user doesn't have damage role";
29321
+ case "missing":
29322
+ return "This user doesn't have missing role";
29297
29323
  default:
29298
29324
  return "This user doesn't have role";
29299
29325
  }
@@ -29323,6 +29349,14 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
29323
29349
  };
29324
29350
  const hasRole = (data30, role) => {
29325
29351
  var _a;
29352
+ switch (role) {
29353
+ case "damage":
29354
+ role = "repairTicketing";
29355
+ break;
29356
+ case "missing":
29357
+ role = "tracking";
29358
+ break;
29359
+ }
29326
29360
  if (props.type === "transaction-policy")
29327
29361
  return !!((_a = data30.transactions) == null ? void 0 : _a[role]);
29328
29362
  const roleData = (
@@ -72021,17 +72055,17 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
72021
72055
  const textSize = computed(() => {
72022
72056
  var _a, _b, _c, _d, _e, _f;
72023
72057
  const largeLinesLength = [
72024
- (((_a = props.label.assetName) == null ? void 0 : _a.length) ?? 0) > 10,
72025
- (((_b = props.label.code) == null ? void 0 : _b.length) ?? 0) > 14,
72026
- (((_c = props.label.category) == null ? void 0 : _c.length) ?? 0) > 10
72058
+ (((_a = props.label.assetName) == null ? void 0 : _a.length) ?? 0) > 16,
72059
+ (((_b = props.label.code) == null ? void 0 : _b.length) ?? 0) > 16,
72060
+ (((_c = props.label.category) == null ? void 0 : _c.length) ?? 0) > 14
72027
72061
  ].filter(Boolean).length;
72028
72062
  const mediumLinesLength = [
72029
- (((_d = props.label.assetName) == null ? void 0 : _d.length) ?? 0) > 14,
72030
- (((_e = props.label.code) == null ? void 0 : _e.length) ?? 0) > 16,
72031
- (((_f = props.label.category) == null ? void 0 : _f.length) ?? 0) > 11
72063
+ (((_d = props.label.assetName) == null ? void 0 : _d.length) ?? 0) > 18,
72064
+ (((_e = props.label.code) == null ? void 0 : _e.length) ?? 0) > 19,
72065
+ (((_f = props.label.category) == null ? void 0 : _f.length) ?? 0) > 15
72032
72066
  ].filter(Boolean).length;
72033
72067
  if (largeLinesLength > 0) {
72034
- if (mediumLinesLength > 2)
72068
+ if (mediumLinesLength > 1)
72035
72069
  return "small";
72036
72070
  return "medium";
72037
72071
  }
@@ -72129,7 +72163,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72129
72163
  const gridColumns = isSmall ? "repeat(2, 50mm)" : "repeat(1, 70mm)";
72130
72164
  const columnGap = isSmall ? "3mm" : "0";
72131
72165
  const gridWidth = isSmall ? "103mm" : "70mm";
72132
- const labelScale = isSmall ? "1.629" : "1.575";
72166
+ const labelScale = isSmall ? "1.005" : "1.575";
72133
72167
  return `
72134
72168
  .label {
72135
72169
  position: relative;
@@ -72140,10 +72174,10 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72140
72174
  }
72141
72175
 
72142
72176
  .label--small {
72143
- width: 116px;
72144
- height: 58px;
72177
+ width: 190px;
72178
+ height: 95px;
72145
72179
  padding: 8px;
72146
- padding-left: calc(6px + 12.5px);
72180
+ padding-left: calc(8px + 12.5px);
72147
72181
  }
72148
72182
 
72149
72183
  .label--large {
@@ -72165,10 +72199,10 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72165
72199
  }
72166
72200
 
72167
72201
  .label__logo--small {
72168
- height: 9px;
72169
- width: 40px;
72202
+ height: 13px;
72203
+ width: 60px;
72170
72204
  left: 10.5px;
72171
- transform: translateY(15.5px) rotate(-90deg);
72205
+ transform: translateY(23.5px) rotate(-90deg);
72172
72206
  }
72173
72207
 
72174
72208
  .label__logo--large {
@@ -72189,33 +72223,33 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72189
72223
  }
72190
72224
 
72191
72225
  .label__asset--small {
72192
- font-size: 7px;
72193
- line-height: 9px;
72226
+ font-size: 12px;
72227
+ line-height: 16px;
72194
72228
  }
72195
72229
 
72196
72230
  .label__asset--medium {
72197
- font-size: 9px;
72198
- line-height: 12px;
72231
+ font-size: 14px;
72232
+ line-height: 19px;
72199
72233
  }
72200
72234
 
72201
72235
  .label__asset--large {
72202
- font-size: 0.75rem;
72203
- line-height: 1rem;
72236
+ font-size: 16px;
72237
+ line-height: 22px;
72204
72238
  }
72205
72239
 
72206
72240
  .label__code--small {
72207
- font-size: 6px;
72208
- line-height: 8px;
72241
+ font-size: 9px;
72242
+ line-height: 12px;
72209
72243
  }
72210
72244
 
72211
72245
  .label__code--medium {
72212
- font-size: 8px;
72213
- line-height: 10px;
72246
+ font-size: 12px;
72247
+ line-height: 16px;
72214
72248
  }
72215
72249
 
72216
72250
  .label__code--large {
72217
- font-size: 9px;
72218
- line-height: 0.75rem;
72251
+ font-size: 14px;
72252
+ line-height: 19px;
72219
72253
  }
72220
72254
 
72221
72255
  .label__meta {
@@ -72226,18 +72260,18 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72226
72260
  }
72227
72261
 
72228
72262
  .label__meta--small {
72229
- font-size: 6px;
72230
- line-height: 8px;
72263
+ font-size: 9px;
72264
+ line-height: 12px;
72231
72265
  }
72232
72266
 
72233
72267
  .label__meta--medium {
72234
- font-size: 8px;
72235
- line-height: 10px;
72268
+ font-size: 12px;
72269
+ line-height: 16px;
72236
72270
  }
72237
72271
 
72238
72272
  .label__meta--large {
72239
- font-size: 9px;
72240
- line-height: 0.75rem;
72273
+ font-size: 12px;
72274
+ line-height: 16px;
72241
72275
  }
72242
72276
 
72243
72277
  .label__date {
@@ -72280,11 +72314,11 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72280
72314
  const labelSize = shallowRef("small");
72281
72315
  const labels = computed(
72282
72316
  () => props.selectedData.map((d) => {
72283
- var _a, _b;
72317
+ var _a, _b, _c;
72284
72318
  return {
72285
72319
  assetName: (_a = d.name) == null ? void 0 : _a.nameWithSequence,
72286
- code: d.assetId,
72287
- category: (_b = d.category) == null ? void 0 : _b.name,
72320
+ code: (_b = d.name) == null ? void 0 : _b.aliasCode,
72321
+ category: (_c = d.category) == null ? void 0 : _c.name,
72288
72322
  purchaseDate: d.purchaseDate ? new Date(d.purchaseDate).getFullYear() : void 0
72289
72323
  };
72290
72324
  })
@@ -72302,7 +72336,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72302
72336
  }
72303
72337
  return labels.value.slice(0, 2);
72304
72338
  });
72305
- const printLabel = async () => {
72339
+ const printLabel2 = async () => {
72306
72340
  var _a;
72307
72341
  const printContainer = document.getElementById(
72308
72342
  "print-container"
@@ -72323,6 +72357,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72323
72357
  };
72324
72358
  await htmlToPaper("print-container", localOptions);
72325
72359
  emit("printed");
72360
+ putPrintLabel();
72326
72361
  closeDialog();
72327
72362
  (_a = printContainer.querySelector("style")) == null ? void 0 : _a.remove();
72328
72363
  };
@@ -72343,6 +72378,13 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72343
72378
  }
72344
72379
  };
72345
72380
  const closeDialog = () => emit("update:visible", false);
72381
+ const putPrintLabel = async () => {
72382
+ try {
72383
+ await AssetsServices.printLabel(props.selectedData.map((d) => d._id));
72384
+ } catch (error) {
72385
+ console.error(error);
72386
+ }
72387
+ };
72346
72388
  watch(
72347
72389
  () => props.visible,
72348
72390
  (is) => {
@@ -72363,7 +72405,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72363
72405
  draggable: false,
72364
72406
  pt: {
72365
72407
  root: {
72366
- class: [...unref(DialogPreset).root({ state: {} }).class, "!w-[400px]"]
72408
+ class: [...unref(DialogPreset).root({ state: {} }).class, "!w-[450px]"]
72367
72409
  },
72368
72410
  header: {
72369
72411
  class: unref(DialogPreset).header.class
@@ -72427,7 +72469,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72427
72469
  _hoisted_7$4,
72428
72470
  createElementVNode("div", _hoisted_8$3, [
72429
72471
  createVNode(_sfc_main$1Q, {
72430
- onClick: printLabel,
72472
+ onClick: printLabel2,
72431
72473
  label: "Start Print"
72432
72474
  })
72433
72475
  ]),