tsv2-library 1.1.1-dev-alpha.9 → 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 = (
@@ -72017,8 +72051,25 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
72017
72051
  addBorder: { type: Boolean }
72018
72052
  },
72019
72053
  setup(__props) {
72054
+ const props = __props;
72020
72055
  const textSize = computed(() => {
72021
- return "small";
72056
+ var _a, _b, _c, _d, _e, _f;
72057
+ const largeLinesLength = [
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
72061
+ ].filter(Boolean).length;
72062
+ const mediumLinesLength = [
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
72066
+ ].filter(Boolean).length;
72067
+ if (largeLinesLength > 0) {
72068
+ if (mediumLinesLength > 1)
72069
+ return "small";
72070
+ return "medium";
72071
+ }
72072
+ return "large";
72022
72073
  });
72023
72074
  return (_ctx, _cache) => {
72024
72075
  return openBlock(), createElementBlock("div", {
@@ -72100,19 +72151,19 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72100
72151
  const props = __props;
72101
72152
  const emit = __emit;
72102
72153
  const paperStylesheet2 = computed(() => {
72103
- const pageSize = labelSize.value === "small" ? "105mm 17mm" : "70mm 30mm";
72154
+ const pageSize = labelSize.value === "small" ? "103mm 25mm" : "70mm 30mm";
72104
72155
  return `@page {
72105
72156
  size: ${pageSize};
72106
72157
  }`;
72107
72158
  });
72108
72159
  const printLabelLayoutStylesheet = computed(() => {
72109
72160
  const isSmall = labelSize.value === "small";
72110
- const boxWidth = isSmall ? "51mm" : "70mm";
72111
- const boxHeight = isSmall ? "17mm" : "30mm";
72112
- const gridColumns = isSmall ? "repeat(2, 51mm)" : "repeat(1, 70mm)";
72161
+ const boxWidth = isSmall ? "50mm" : "70mm";
72162
+ const boxHeight = isSmall ? "25mm" : "30mm";
72163
+ const gridColumns = isSmall ? "repeat(2, 50mm)" : "repeat(1, 70mm)";
72113
72164
  const columnGap = isSmall ? "3mm" : "0";
72114
- const gridWidth = isSmall ? "105mm" : "70mm";
72115
- const labelScale = isSmall ? "1.147" : "1.575";
72165
+ const gridWidth = isSmall ? "103mm" : "70mm";
72166
+ const labelScale = isSmall ? "1.005" : "1.575";
72116
72167
  return `
72117
72168
  .label {
72118
72169
  position: relative;
@@ -72123,10 +72174,10 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72123
72174
  }
72124
72175
 
72125
72176
  .label--small {
72126
- width: 168px;
72127
- height: 56px;
72177
+ width: 190px;
72178
+ height: 95px;
72128
72179
  padding: 8px;
72129
- padding-left: calc(6px + 12.5px);
72180
+ padding-left: calc(8px + 12.5px);
72130
72181
  }
72131
72182
 
72132
72183
  .label--large {
@@ -72148,10 +72199,10 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72148
72199
  }
72149
72200
 
72150
72201
  .label__logo--small {
72151
- height: 9px;
72152
- width: 40px;
72202
+ height: 13px;
72203
+ width: 60px;
72153
72204
  left: 10.5px;
72154
- transform: translateY(15.5px) rotate(-90deg);
72205
+ transform: translateY(23.5px) rotate(-90deg);
72155
72206
  }
72156
72207
 
72157
72208
  .label__logo--large {
@@ -72172,33 +72223,33 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72172
72223
  }
72173
72224
 
72174
72225
  .label__asset--small {
72175
- font-size: 9px;
72176
- line-height: 12px;
72226
+ font-size: 12px;
72227
+ line-height: 16px;
72177
72228
  }
72178
72229
 
72179
72230
  .label__asset--medium {
72180
- font-size: 9px;
72181
- line-height: 12px;
72231
+ font-size: 14px;
72232
+ line-height: 19px;
72182
72233
  }
72183
72234
 
72184
72235
  .label__asset--large {
72185
- font-size: 0.75rem;
72186
- line-height: 1rem;
72236
+ font-size: 16px;
72237
+ line-height: 22px;
72187
72238
  }
72188
72239
 
72189
72240
  .label__code--small {
72190
- font-size: 6px;
72191
- line-height: 8px;
72241
+ font-size: 9px;
72242
+ line-height: 12px;
72192
72243
  }
72193
72244
 
72194
72245
  .label__code--medium {
72195
- font-size: 8px;
72196
- line-height: 10px;
72246
+ font-size: 12px;
72247
+ line-height: 16px;
72197
72248
  }
72198
72249
 
72199
72250
  .label__code--large {
72200
- font-size: 9px;
72201
- line-height: 0.75rem;
72251
+ font-size: 14px;
72252
+ line-height: 19px;
72202
72253
  }
72203
72254
 
72204
72255
  .label__meta {
@@ -72209,18 +72260,18 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72209
72260
  }
72210
72261
 
72211
72262
  .label__meta--small {
72212
- font-size: 6px;
72213
- line-height: 8px;
72263
+ font-size: 9px;
72264
+ line-height: 12px;
72214
72265
  }
72215
72266
 
72216
72267
  .label__meta--medium {
72217
- font-size: 8px;
72218
- line-height: 10px;
72268
+ font-size: 12px;
72269
+ line-height: 16px;
72219
72270
  }
72220
72271
 
72221
72272
  .label__meta--large {
72222
- font-size: 9px;
72223
- line-height: 0.75rem;
72273
+ font-size: 12px;
72274
+ line-height: 16px;
72224
72275
  }
72225
72276
 
72226
72277
  .label__date {
@@ -72285,7 +72336,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72285
72336
  }
72286
72337
  return labels.value.slice(0, 2);
72287
72338
  });
72288
- const printLabel = async () => {
72339
+ const printLabel2 = async () => {
72289
72340
  var _a;
72290
72341
  const printContainer = document.getElementById(
72291
72342
  "print-container"
@@ -72306,6 +72357,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72306
72357
  };
72307
72358
  await htmlToPaper("print-container", localOptions);
72308
72359
  emit("printed");
72360
+ putPrintLabel();
72309
72361
  closeDialog();
72310
72362
  (_a = printContainer.querySelector("style")) == null ? void 0 : _a.remove();
72311
72363
  };
@@ -72326,6 +72378,13 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72326
72378
  }
72327
72379
  };
72328
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
+ };
72329
72388
  watch(
72330
72389
  () => props.visible,
72331
72390
  (is) => {
@@ -72346,7 +72405,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72346
72405
  draggable: false,
72347
72406
  pt: {
72348
72407
  root: {
72349
- class: [...unref(DialogPreset).root({ state: {} }).class, "!w-[400px]"]
72408
+ class: [...unref(DialogPreset).root({ state: {} }).class, "!w-[450px]"]
72350
72409
  },
72351
72410
  header: {
72352
72411
  class: unref(DialogPreset).header.class
@@ -72410,7 +72469,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
72410
72469
  _hoisted_7$4,
72411
72470
  createElementVNode("div", _hoisted_8$3, [
72412
72471
  createVNode(_sfc_main$1Q, {
72413
- onClick: printLabel,
72472
+ onClick: printLabel2,
72414
72473
  label: "Start Print"
72415
72474
  })
72416
72475
  ]),