myio-js-library 0.1.568 → 0.1.569
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.
- package/dist/index.cjs +20 -12
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -12
- package/dist/myio-js-library.umd.js +20 -12
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -953,7 +953,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
953
953
|
// package.json
|
|
954
954
|
var package_default = {
|
|
955
955
|
name: "myio-js-library",
|
|
956
|
-
version: "0.1.
|
|
956
|
+
version: "0.1.569",
|
|
957
957
|
description: "A clean, standalone JS SDK for MYIO projects",
|
|
958
958
|
license: "MIT",
|
|
959
959
|
repository: "github:gh-myio/myio-js-library",
|
|
@@ -2338,6 +2338,7 @@ var DeviceIconType = {
|
|
|
2338
2338
|
BOMBA_INCENDIO: "BOMBA_INCENDIO",
|
|
2339
2339
|
BOMBA: "BOMBA",
|
|
2340
2340
|
BOMBA_POCO: "BOMBA_POCO",
|
|
2341
|
+
BOMBA_CISTERNA: "BOMBA_CISTERNA",
|
|
2341
2342
|
MEDIDOR_3F: "3F_MEDIDOR",
|
|
2342
2343
|
RELOGIO: "RELOGIO",
|
|
2343
2344
|
ENTRADA: "ENTRADA",
|
|
@@ -2375,6 +2376,8 @@ var deviceIcons = {
|
|
|
2375
2376
|
BOMBA: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
2376
2377
|
// BOMBA_POCO (ED-1354): bomba de poço artesiano — sem arte própria ainda, usa a do MOTOR/BOMBA.
|
|
2377
2378
|
BOMBA_POCO: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
2379
|
+
// BOMBA_CISTERNA: mesmo comportamento/arte de BOMBA_POCO.
|
|
2380
|
+
BOMBA_CISTERNA: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
2378
2381
|
"3F_MEDIDOR": "https://dashboard.myio-bas.com/api/images/public/f9Ce4meybsdaAhAkUlAfy5ei3I4kcN4k",
|
|
2379
2382
|
RELOGIO: "https://dashboard.myio-bas.com/api/images/public/ljHZostWg0G5AfKiyM8oZixWRIIGRASB",
|
|
2380
2383
|
ENTRADA: "https://dashboard.myio-bas.com/api/images/public/TQHPFqiejMW6lOSVsb8Pi85WtC0QKOLU",
|
|
@@ -2414,6 +2417,7 @@ var deviceIconLabels = {
|
|
|
2414
2417
|
BOMBA_INCENDIO: "Bomba Inc\xEAndio",
|
|
2415
2418
|
BOMBA: "Bomba",
|
|
2416
2419
|
BOMBA_POCO: "Bomba de Po\xE7o",
|
|
2420
|
+
BOMBA_CISTERNA: "Bomba de Cisterna",
|
|
2417
2421
|
"3F_MEDIDOR": "Medidor 3F",
|
|
2418
2422
|
RELOGIO: "Rel\xF3gio",
|
|
2419
2423
|
ENTRADA: "Entrada",
|
|
@@ -2477,6 +2481,8 @@ var DEVICE_TYPE_CONFIG = {
|
|
|
2477
2481
|
CISTERNA_ENTRADA: { category: "water", image: deviceIcons.CISTERNA_ENTRADA },
|
|
2478
2482
|
BOMBA_POCO: { category: "energy", image: deviceIcons.BOMBA_POCO },
|
|
2479
2483
|
// ED-1354: bomba do poço (consumption W)
|
|
2484
|
+
BOMBA_CISTERNA: { category: "energy", image: deviceIcons.BOMBA_CISTERNA },
|
|
2485
|
+
// mesmo comportamento de BOMBA_POCO
|
|
2480
2486
|
// Tank devices (dynamic images based on level)
|
|
2481
2487
|
TANK: { category: "tank", image: null },
|
|
2482
2488
|
// Temperature devices (dynamic images based on status)
|
|
@@ -4032,7 +4038,7 @@ function isEntradaDevice(device) {
|
|
|
4032
4038
|
}
|
|
4033
4039
|
|
|
4034
4040
|
// src/utils/devices/deviceClassificationProfile.ts
|
|
4035
|
-
var WELL_AUTOMATION_PROFILES = /* @__PURE__ */ new Set(["BOMBA_POCO", "SOLENOIDE"]);
|
|
4041
|
+
var WELL_AUTOMATION_PROFILES = /* @__PURE__ */ new Set(["BOMBA_POCO", "BOMBA_CISTERNA", "SOLENOIDE"]);
|
|
4036
4042
|
function filterWellAutomationItems(items) {
|
|
4037
4043
|
return (items || []).filter(
|
|
4038
4044
|
(item) => !WELL_AUTOMATION_PROFILES.has(String(item?.deviceProfile || "").trim().toUpperCase())
|
|
@@ -63041,6 +63047,8 @@ var DeviceProfileTab = class {
|
|
|
63041
63047
|
};
|
|
63042
63048
|
|
|
63043
63049
|
// src/components/premium-modals/settings/well-equipment/WellEquipmentTab.ts
|
|
63050
|
+
var PUMP_EQUIPMENT_PROFILES = /* @__PURE__ */ new Set(["BOMBA_POCO", "BOMBA_CISTERNA"]);
|
|
63051
|
+
var kindOf = (profile) => PUMP_EQUIPMENT_PROFILES.has(profile) ? "pump" : "valve";
|
|
63044
63052
|
var ATTRIBUTE_KEYS = "deviceProfile,gcdrDeviceId,pumpBindings";
|
|
63045
63053
|
var MAX_CUSTOMER_DEVICE_PAGES = 100;
|
|
63046
63054
|
function escapeHtml6(value) {
|
|
@@ -63143,7 +63151,7 @@ var WellEquipmentTab = class {
|
|
|
63143
63151
|
try {
|
|
63144
63152
|
const attributes = await this.fetchAttributes(item.tbId, ATTRIBUTE_KEYS);
|
|
63145
63153
|
const profile = String(attributes.get("deviceProfile") || "").toUpperCase();
|
|
63146
|
-
if (profile
|
|
63154
|
+
if (!PUMP_EQUIPMENT_PROFILES.has(profile) && profile !== "SOLENOIDE") continue;
|
|
63147
63155
|
matching.push({
|
|
63148
63156
|
tbId: item.tbId,
|
|
63149
63157
|
profile,
|
|
@@ -63160,8 +63168,8 @@ var WellEquipmentTab = class {
|
|
|
63160
63168
|
return matching.sort((a, b) => a.label.localeCompare(b.label));
|
|
63161
63169
|
}
|
|
63162
63170
|
render() {
|
|
63163
|
-
const options = (
|
|
63164
|
-
const eligible = this.equipment.filter((item) => item.profile ===
|
|
63171
|
+
const options = (kind, code, existing) => {
|
|
63172
|
+
const eligible = this.equipment.filter((item) => kindOf(item.profile) === kind);
|
|
63165
63173
|
const missing = existing && !eligible.some((item) => item.tbId === existing.tbId) ? `<option value="${escapeHtml6(existing.tbId)}" selected data-unavailable="true">V\xEDnculo atual indispon\xEDvel \u2014 ${escapeHtml6(existing.label)}</option>` : "";
|
|
63166
63174
|
const items = eligible.map(
|
|
63167
63175
|
(item) => `<option value="${escapeHtml6(item.tbId)}"${item.tbId === existing?.tbId ? " selected" : ""}>${escapeHtml6(item.label)}</option>`
|
|
@@ -63176,9 +63184,9 @@ var WellEquipmentTab = class {
|
|
|
63176
63184
|
<section class="wet-tab">
|
|
63177
63185
|
<p>Configure as bombas e o solenoide associados a este po\xE7o. O mesmo equipamento pode ser usado em outros po\xE7os.</p>
|
|
63178
63186
|
<div class="wet-grid">
|
|
63179
|
-
<label for="wet-b1-device">Bomba B1</label>${options("
|
|
63180
|
-
<label for="wet-b2-device">Bomba B2</label>${options("
|
|
63181
|
-
<label for="wet-s-device">Solenoide S</label>${options("
|
|
63187
|
+
<label for="wet-b1-device">Bomba B1</label>${options("pump", "B1", binding(this.bindings.pumps, "B1"))}${labelInput("B1", binding(this.bindings.pumps, "B1"))}
|
|
63188
|
+
<label for="wet-b2-device">Bomba B2</label>${options("pump", "B2", binding(this.bindings.pumps, "B2"))}${labelInput("B2", binding(this.bindings.pumps, "B2"))}
|
|
63189
|
+
<label for="wet-s-device">Solenoide S</label>${options("valve", "S", binding(this.bindings.valves, "S"))}${labelInput("S", binding(this.bindings.valves, "S"))}
|
|
63182
63190
|
</div>
|
|
63183
63191
|
<p id="wet-message" class="wet-message" role="status" aria-live="polite"></p>
|
|
63184
63192
|
<button type="button" id="wet-save" ${this.loaded ? "" : "disabled"}>Salvar v\xEDnculos</button>
|
|
@@ -63215,14 +63223,14 @@ var WellEquipmentTab = class {
|
|
|
63215
63223
|
return;
|
|
63216
63224
|
}
|
|
63217
63225
|
const selected = [
|
|
63218
|
-
...b1 ? [{ id: b1,
|
|
63219
|
-
...b2 ? [{ id: b2,
|
|
63220
|
-
...solenoid ? [{ id: solenoid,
|
|
63226
|
+
...b1 ? [{ id: b1, kind: "pump", code: "B1" }] : [],
|
|
63227
|
+
...b2 ? [{ id: b2, kind: "pump", code: "B2" }] : [],
|
|
63228
|
+
...solenoid ? [{ id: solenoid, kind: "valve", code: "S" }] : []
|
|
63221
63229
|
];
|
|
63222
63230
|
for (const item of selected) {
|
|
63223
63231
|
const current = item.code === "S" ? this.bindings.valves.find((binding) => binding.code === item.code) : this.bindings.pumps.find((binding) => binding.code === item.code);
|
|
63224
63232
|
const unchangedUnavailableBinding = current?.tbId === item.id && !this.equipment.some((equipment) => equipment.tbId === item.id);
|
|
63225
|
-
if (!unchangedUnavailableBinding && !this.equipment.some((equipment) => equipment.tbId === item.id && equipment.profile === item.
|
|
63233
|
+
if (!unchangedUnavailableBinding && !this.equipment.some((equipment) => equipment.tbId === item.id && kindOf(equipment.profile) === item.kind)) {
|
|
63226
63234
|
this.showMessage(`O equipamento selecionado para ${item.code} n\xE3o pertence ao cat\xE1logo v\xE1lido.`, true);
|
|
63227
63235
|
return;
|
|
63228
63236
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -924,6 +924,7 @@ declare const DeviceIconType: {
|
|
|
924
924
|
readonly BOMBA_INCENDIO: "BOMBA_INCENDIO";
|
|
925
925
|
readonly BOMBA: "BOMBA";
|
|
926
926
|
readonly BOMBA_POCO: "BOMBA_POCO";
|
|
927
|
+
readonly BOMBA_CISTERNA: "BOMBA_CISTERNA";
|
|
927
928
|
readonly MEDIDOR_3F: "3F_MEDIDOR";
|
|
928
929
|
readonly RELOGIO: "RELOGIO";
|
|
929
930
|
readonly ENTRADA: "ENTRADA";
|
package/dist/index.d.ts
CHANGED
|
@@ -924,6 +924,7 @@ declare const DeviceIconType: {
|
|
|
924
924
|
readonly BOMBA_INCENDIO: "BOMBA_INCENDIO";
|
|
925
925
|
readonly BOMBA: "BOMBA";
|
|
926
926
|
readonly BOMBA_POCO: "BOMBA_POCO";
|
|
927
|
+
readonly BOMBA_CISTERNA: "BOMBA_CISTERNA";
|
|
927
928
|
readonly MEDIDOR_3F: "3F_MEDIDOR";
|
|
928
929
|
readonly RELOGIO: "RELOGIO";
|
|
929
930
|
readonly ENTRADA: "ENTRADA";
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
// package.json
|
|
11
11
|
var package_default = {
|
|
12
12
|
name: "myio-js-library",
|
|
13
|
-
version: "0.1.
|
|
13
|
+
version: "0.1.569",
|
|
14
14
|
description: "A clean, standalone JS SDK for MYIO projects",
|
|
15
15
|
license: "MIT",
|
|
16
16
|
repository: "github:gh-myio/myio-js-library",
|
|
@@ -1395,6 +1395,7 @@ var DeviceIconType = {
|
|
|
1395
1395
|
BOMBA_INCENDIO: "BOMBA_INCENDIO",
|
|
1396
1396
|
BOMBA: "BOMBA",
|
|
1397
1397
|
BOMBA_POCO: "BOMBA_POCO",
|
|
1398
|
+
BOMBA_CISTERNA: "BOMBA_CISTERNA",
|
|
1398
1399
|
MEDIDOR_3F: "3F_MEDIDOR",
|
|
1399
1400
|
RELOGIO: "RELOGIO",
|
|
1400
1401
|
ENTRADA: "ENTRADA",
|
|
@@ -1432,6 +1433,8 @@ var deviceIcons = {
|
|
|
1432
1433
|
BOMBA: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
1433
1434
|
// BOMBA_POCO (ED-1354): bomba de poço artesiano — sem arte própria ainda, usa a do MOTOR/BOMBA.
|
|
1434
1435
|
BOMBA_POCO: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
1436
|
+
// BOMBA_CISTERNA: mesmo comportamento/arte de BOMBA_POCO.
|
|
1437
|
+
BOMBA_CISTERNA: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
1435
1438
|
"3F_MEDIDOR": "https://dashboard.myio-bas.com/api/images/public/f9Ce4meybsdaAhAkUlAfy5ei3I4kcN4k",
|
|
1436
1439
|
RELOGIO: "https://dashboard.myio-bas.com/api/images/public/ljHZostWg0G5AfKiyM8oZixWRIIGRASB",
|
|
1437
1440
|
ENTRADA: "https://dashboard.myio-bas.com/api/images/public/TQHPFqiejMW6lOSVsb8Pi85WtC0QKOLU",
|
|
@@ -1471,6 +1474,7 @@ var deviceIconLabels = {
|
|
|
1471
1474
|
BOMBA_INCENDIO: "Bomba Inc\xEAndio",
|
|
1472
1475
|
BOMBA: "Bomba",
|
|
1473
1476
|
BOMBA_POCO: "Bomba de Po\xE7o",
|
|
1477
|
+
BOMBA_CISTERNA: "Bomba de Cisterna",
|
|
1474
1478
|
"3F_MEDIDOR": "Medidor 3F",
|
|
1475
1479
|
RELOGIO: "Rel\xF3gio",
|
|
1476
1480
|
ENTRADA: "Entrada",
|
|
@@ -1534,6 +1538,8 @@ var DEVICE_TYPE_CONFIG = {
|
|
|
1534
1538
|
CISTERNA_ENTRADA: { category: "water", image: deviceIcons.CISTERNA_ENTRADA },
|
|
1535
1539
|
BOMBA_POCO: { category: "energy", image: deviceIcons.BOMBA_POCO },
|
|
1536
1540
|
// ED-1354: bomba do poço (consumption W)
|
|
1541
|
+
BOMBA_CISTERNA: { category: "energy", image: deviceIcons.BOMBA_CISTERNA },
|
|
1542
|
+
// mesmo comportamento de BOMBA_POCO
|
|
1537
1543
|
// Tank devices (dynamic images based on level)
|
|
1538
1544
|
TANK: { category: "tank", image: null },
|
|
1539
1545
|
// Temperature devices (dynamic images based on status)
|
|
@@ -3089,7 +3095,7 @@ function isEntradaDevice(device) {
|
|
|
3089
3095
|
}
|
|
3090
3096
|
|
|
3091
3097
|
// src/utils/devices/deviceClassificationProfile.ts
|
|
3092
|
-
var WELL_AUTOMATION_PROFILES = /* @__PURE__ */ new Set(["BOMBA_POCO", "SOLENOIDE"]);
|
|
3098
|
+
var WELL_AUTOMATION_PROFILES = /* @__PURE__ */ new Set(["BOMBA_POCO", "BOMBA_CISTERNA", "SOLENOIDE"]);
|
|
3093
3099
|
function filterWellAutomationItems(items) {
|
|
3094
3100
|
return (items || []).filter(
|
|
3095
3101
|
(item) => !WELL_AUTOMATION_PROFILES.has(String(item?.deviceProfile || "").trim().toUpperCase())
|
|
@@ -61373,6 +61379,8 @@ var DeviceProfileTab = class {
|
|
|
61373
61379
|
};
|
|
61374
61380
|
|
|
61375
61381
|
// src/components/premium-modals/settings/well-equipment/WellEquipmentTab.ts
|
|
61382
|
+
var PUMP_EQUIPMENT_PROFILES = /* @__PURE__ */ new Set(["BOMBA_POCO", "BOMBA_CISTERNA"]);
|
|
61383
|
+
var kindOf = (profile) => PUMP_EQUIPMENT_PROFILES.has(profile) ? "pump" : "valve";
|
|
61376
61384
|
var ATTRIBUTE_KEYS = "deviceProfile,gcdrDeviceId,pumpBindings";
|
|
61377
61385
|
var MAX_CUSTOMER_DEVICE_PAGES = 100;
|
|
61378
61386
|
function escapeHtml6(value) {
|
|
@@ -61475,7 +61483,7 @@ var WellEquipmentTab = class {
|
|
|
61475
61483
|
try {
|
|
61476
61484
|
const attributes = await this.fetchAttributes(item.tbId, ATTRIBUTE_KEYS);
|
|
61477
61485
|
const profile = String(attributes.get("deviceProfile") || "").toUpperCase();
|
|
61478
|
-
if (profile
|
|
61486
|
+
if (!PUMP_EQUIPMENT_PROFILES.has(profile) && profile !== "SOLENOIDE") continue;
|
|
61479
61487
|
matching.push({
|
|
61480
61488
|
tbId: item.tbId,
|
|
61481
61489
|
profile,
|
|
@@ -61492,8 +61500,8 @@ var WellEquipmentTab = class {
|
|
|
61492
61500
|
return matching.sort((a, b) => a.label.localeCompare(b.label));
|
|
61493
61501
|
}
|
|
61494
61502
|
render() {
|
|
61495
|
-
const options = (
|
|
61496
|
-
const eligible = this.equipment.filter((item) => item.profile ===
|
|
61503
|
+
const options = (kind, code, existing) => {
|
|
61504
|
+
const eligible = this.equipment.filter((item) => kindOf(item.profile) === kind);
|
|
61497
61505
|
const missing = existing && !eligible.some((item) => item.tbId === existing.tbId) ? `<option value="${escapeHtml6(existing.tbId)}" selected data-unavailable="true">V\xEDnculo atual indispon\xEDvel \u2014 ${escapeHtml6(existing.label)}</option>` : "";
|
|
61498
61506
|
const items = eligible.map(
|
|
61499
61507
|
(item) => `<option value="${escapeHtml6(item.tbId)}"${item.tbId === existing?.tbId ? " selected" : ""}>${escapeHtml6(item.label)}</option>`
|
|
@@ -61508,9 +61516,9 @@ var WellEquipmentTab = class {
|
|
|
61508
61516
|
<section class="wet-tab">
|
|
61509
61517
|
<p>Configure as bombas e o solenoide associados a este po\xE7o. O mesmo equipamento pode ser usado em outros po\xE7os.</p>
|
|
61510
61518
|
<div class="wet-grid">
|
|
61511
|
-
<label for="wet-b1-device">Bomba B1</label>${options("
|
|
61512
|
-
<label for="wet-b2-device">Bomba B2</label>${options("
|
|
61513
|
-
<label for="wet-s-device">Solenoide S</label>${options("
|
|
61519
|
+
<label for="wet-b1-device">Bomba B1</label>${options("pump", "B1", binding(this.bindings.pumps, "B1"))}${labelInput("B1", binding(this.bindings.pumps, "B1"))}
|
|
61520
|
+
<label for="wet-b2-device">Bomba B2</label>${options("pump", "B2", binding(this.bindings.pumps, "B2"))}${labelInput("B2", binding(this.bindings.pumps, "B2"))}
|
|
61521
|
+
<label for="wet-s-device">Solenoide S</label>${options("valve", "S", binding(this.bindings.valves, "S"))}${labelInput("S", binding(this.bindings.valves, "S"))}
|
|
61514
61522
|
</div>
|
|
61515
61523
|
<p id="wet-message" class="wet-message" role="status" aria-live="polite"></p>
|
|
61516
61524
|
<button type="button" id="wet-save" ${this.loaded ? "" : "disabled"}>Salvar v\xEDnculos</button>
|
|
@@ -61547,14 +61555,14 @@ var WellEquipmentTab = class {
|
|
|
61547
61555
|
return;
|
|
61548
61556
|
}
|
|
61549
61557
|
const selected = [
|
|
61550
|
-
...b1 ? [{ id: b1,
|
|
61551
|
-
...b2 ? [{ id: b2,
|
|
61552
|
-
...solenoid ? [{ id: solenoid,
|
|
61558
|
+
...b1 ? [{ id: b1, kind: "pump", code: "B1" }] : [],
|
|
61559
|
+
...b2 ? [{ id: b2, kind: "pump", code: "B2" }] : [],
|
|
61560
|
+
...solenoid ? [{ id: solenoid, kind: "valve", code: "S" }] : []
|
|
61553
61561
|
];
|
|
61554
61562
|
for (const item of selected) {
|
|
61555
61563
|
const current = item.code === "S" ? this.bindings.valves.find((binding) => binding.code === item.code) : this.bindings.pumps.find((binding) => binding.code === item.code);
|
|
61556
61564
|
const unchangedUnavailableBinding = current?.tbId === item.id && !this.equipment.some((equipment) => equipment.tbId === item.id);
|
|
61557
|
-
if (!unchangedUnavailableBinding && !this.equipment.some((equipment) => equipment.tbId === item.id && equipment.profile === item.
|
|
61565
|
+
if (!unchangedUnavailableBinding && !this.equipment.some((equipment) => equipment.tbId === item.id && kindOf(equipment.profile) === item.kind)) {
|
|
61558
61566
|
this.showMessage(`O equipamento selecionado para ${item.code} n\xE3o pertence ao cat\xE1logo v\xE1lido.`, true);
|
|
61559
61567
|
return;
|
|
61560
61568
|
}
|
|
@@ -5524,7 +5524,7 @@
|
|
|
5524
5524
|
|
|
5525
5525
|
// package.json
|
|
5526
5526
|
var package_default = {
|
|
5527
|
-
version: "0.1.
|
|
5527
|
+
version: "0.1.569"};
|
|
5528
5528
|
|
|
5529
5529
|
// src/utils/format/energy.ts
|
|
5530
5530
|
function formatPower(value, decimals = 2) {
|
|
@@ -6829,6 +6829,7 @@
|
|
|
6829
6829
|
BOMBA_INCENDIO: "BOMBA_INCENDIO",
|
|
6830
6830
|
BOMBA: "BOMBA",
|
|
6831
6831
|
BOMBA_POCO: "BOMBA_POCO",
|
|
6832
|
+
BOMBA_CISTERNA: "BOMBA_CISTERNA",
|
|
6832
6833
|
MEDIDOR_3F: "3F_MEDIDOR",
|
|
6833
6834
|
RELOGIO: "RELOGIO",
|
|
6834
6835
|
ENTRADA: "ENTRADA",
|
|
@@ -6866,6 +6867,8 @@
|
|
|
6866
6867
|
BOMBA: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
6867
6868
|
// BOMBA_POCO (ED-1354): bomba de poço artesiano — sem arte própria ainda, usa a do MOTOR/BOMBA.
|
|
6868
6869
|
BOMBA_POCO: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
6870
|
+
// BOMBA_CISTERNA: mesmo comportamento/arte de BOMBA_POCO.
|
|
6871
|
+
BOMBA_CISTERNA: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
6869
6872
|
"3F_MEDIDOR": "https://dashboard.myio-bas.com/api/images/public/f9Ce4meybsdaAhAkUlAfy5ei3I4kcN4k",
|
|
6870
6873
|
RELOGIO: "https://dashboard.myio-bas.com/api/images/public/ljHZostWg0G5AfKiyM8oZixWRIIGRASB",
|
|
6871
6874
|
ENTRADA: "https://dashboard.myio-bas.com/api/images/public/TQHPFqiejMW6lOSVsb8Pi85WtC0QKOLU",
|
|
@@ -6905,6 +6908,7 @@
|
|
|
6905
6908
|
BOMBA_INCENDIO: "Bomba Inc\xEAndio",
|
|
6906
6909
|
BOMBA: "Bomba",
|
|
6907
6910
|
BOMBA_POCO: "Bomba de Po\xE7o",
|
|
6911
|
+
BOMBA_CISTERNA: "Bomba de Cisterna",
|
|
6908
6912
|
"3F_MEDIDOR": "Medidor 3F",
|
|
6909
6913
|
RELOGIO: "Rel\xF3gio",
|
|
6910
6914
|
ENTRADA: "Entrada",
|
|
@@ -6968,6 +6972,8 @@
|
|
|
6968
6972
|
CISTERNA_ENTRADA: { category: "water", image: deviceIcons.CISTERNA_ENTRADA },
|
|
6969
6973
|
BOMBA_POCO: { category: "energy", image: deviceIcons.BOMBA_POCO },
|
|
6970
6974
|
// ED-1354: bomba do poço (consumption W)
|
|
6975
|
+
BOMBA_CISTERNA: { category: "energy", image: deviceIcons.BOMBA_CISTERNA },
|
|
6976
|
+
// mesmo comportamento de BOMBA_POCO
|
|
6971
6977
|
// Tank devices (dynamic images based on level)
|
|
6972
6978
|
TANK: { category: "tank", image: null },
|
|
6973
6979
|
// Temperature devices (dynamic images based on status)
|
|
@@ -8521,7 +8527,7 @@
|
|
|
8521
8527
|
}
|
|
8522
8528
|
|
|
8523
8529
|
// src/utils/devices/deviceClassificationProfile.ts
|
|
8524
|
-
var WELL_AUTOMATION_PROFILES = /* @__PURE__ */ new Set(["BOMBA_POCO", "SOLENOIDE"]);
|
|
8530
|
+
var WELL_AUTOMATION_PROFILES = /* @__PURE__ */ new Set(["BOMBA_POCO", "BOMBA_CISTERNA", "SOLENOIDE"]);
|
|
8525
8531
|
function filterWellAutomationItems(items) {
|
|
8526
8532
|
return (items || []).filter(
|
|
8527
8533
|
(item) => !WELL_AUTOMATION_PROFILES.has(String(item?.deviceProfile || "").trim().toUpperCase())
|
|
@@ -66731,6 +66737,8 @@ ${kpiRows}` : ""}
|
|
|
66731
66737
|
};
|
|
66732
66738
|
|
|
66733
66739
|
// src/components/premium-modals/settings/well-equipment/WellEquipmentTab.ts
|
|
66740
|
+
var PUMP_EQUIPMENT_PROFILES = /* @__PURE__ */ new Set(["BOMBA_POCO", "BOMBA_CISTERNA"]);
|
|
66741
|
+
var kindOf = (profile) => PUMP_EQUIPMENT_PROFILES.has(profile) ? "pump" : "valve";
|
|
66734
66742
|
var ATTRIBUTE_KEYS = "deviceProfile,gcdrDeviceId,pumpBindings";
|
|
66735
66743
|
var MAX_CUSTOMER_DEVICE_PAGES = 100;
|
|
66736
66744
|
function escapeHtml6(value) {
|
|
@@ -66833,7 +66841,7 @@ ${kpiRows}` : ""}
|
|
|
66833
66841
|
try {
|
|
66834
66842
|
const attributes = await this.fetchAttributes(item.tbId, ATTRIBUTE_KEYS);
|
|
66835
66843
|
const profile = String(attributes.get("deviceProfile") || "").toUpperCase();
|
|
66836
|
-
if (profile
|
|
66844
|
+
if (!PUMP_EQUIPMENT_PROFILES.has(profile) && profile !== "SOLENOIDE") continue;
|
|
66837
66845
|
matching.push({
|
|
66838
66846
|
tbId: item.tbId,
|
|
66839
66847
|
profile,
|
|
@@ -66850,8 +66858,8 @@ ${kpiRows}` : ""}
|
|
|
66850
66858
|
return matching.sort((a, b) => a.label.localeCompare(b.label));
|
|
66851
66859
|
}
|
|
66852
66860
|
render() {
|
|
66853
|
-
const options = (
|
|
66854
|
-
const eligible = this.equipment.filter((item) => item.profile ===
|
|
66861
|
+
const options = (kind, code, existing) => {
|
|
66862
|
+
const eligible = this.equipment.filter((item) => kindOf(item.profile) === kind);
|
|
66855
66863
|
const missing = existing && !eligible.some((item) => item.tbId === existing.tbId) ? `<option value="${escapeHtml6(existing.tbId)}" selected data-unavailable="true">V\xEDnculo atual indispon\xEDvel \u2014 ${escapeHtml6(existing.label)}</option>` : "";
|
|
66856
66864
|
const items = eligible.map(
|
|
66857
66865
|
(item) => `<option value="${escapeHtml6(item.tbId)}"${item.tbId === existing?.tbId ? " selected" : ""}>${escapeHtml6(item.label)}</option>`
|
|
@@ -66866,9 +66874,9 @@ ${kpiRows}` : ""}
|
|
|
66866
66874
|
<section class="wet-tab">
|
|
66867
66875
|
<p>Configure as bombas e o solenoide associados a este po\xE7o. O mesmo equipamento pode ser usado em outros po\xE7os.</p>
|
|
66868
66876
|
<div class="wet-grid">
|
|
66869
|
-
<label for="wet-b1-device">Bomba B1</label>${options("
|
|
66870
|
-
<label for="wet-b2-device">Bomba B2</label>${options("
|
|
66871
|
-
<label for="wet-s-device">Solenoide S</label>${options("
|
|
66877
|
+
<label for="wet-b1-device">Bomba B1</label>${options("pump", "B1", binding(this.bindings.pumps, "B1"))}${labelInput("B1", binding(this.bindings.pumps, "B1"))}
|
|
66878
|
+
<label for="wet-b2-device">Bomba B2</label>${options("pump", "B2", binding(this.bindings.pumps, "B2"))}${labelInput("B2", binding(this.bindings.pumps, "B2"))}
|
|
66879
|
+
<label for="wet-s-device">Solenoide S</label>${options("valve", "S", binding(this.bindings.valves, "S"))}${labelInput("S", binding(this.bindings.valves, "S"))}
|
|
66872
66880
|
</div>
|
|
66873
66881
|
<p id="wet-message" class="wet-message" role="status" aria-live="polite"></p>
|
|
66874
66882
|
<button type="button" id="wet-save" ${this.loaded ? "" : "disabled"}>Salvar v\xEDnculos</button>
|
|
@@ -66905,14 +66913,14 @@ ${kpiRows}` : ""}
|
|
|
66905
66913
|
return;
|
|
66906
66914
|
}
|
|
66907
66915
|
const selected = [
|
|
66908
|
-
...b1 ? [{ id: b1,
|
|
66909
|
-
...b2 ? [{ id: b2,
|
|
66910
|
-
...solenoid ? [{ id: solenoid,
|
|
66916
|
+
...b1 ? [{ id: b1, kind: "pump", code: "B1" }] : [],
|
|
66917
|
+
...b2 ? [{ id: b2, kind: "pump", code: "B2" }] : [],
|
|
66918
|
+
...solenoid ? [{ id: solenoid, kind: "valve", code: "S" }] : []
|
|
66911
66919
|
];
|
|
66912
66920
|
for (const item of selected) {
|
|
66913
66921
|
const current = item.code === "S" ? this.bindings.valves.find((binding) => binding.code === item.code) : this.bindings.pumps.find((binding) => binding.code === item.code);
|
|
66914
66922
|
const unchangedUnavailableBinding = current?.tbId === item.id && !this.equipment.some((equipment) => equipment.tbId === item.id);
|
|
66915
|
-
if (!unchangedUnavailableBinding && !this.equipment.some((equipment) => equipment.tbId === item.id && equipment.profile === item.
|
|
66923
|
+
if (!unchangedUnavailableBinding && !this.equipment.some((equipment) => equipment.tbId === item.id && kindOf(equipment.profile) === item.kind)) {
|
|
66916
66924
|
this.showMessage(`O equipamento selecionado para ${item.code} n\xE3o pertence ao cat\xE1logo v\xE1lido.`, true);
|
|
66917
66925
|
return;
|
|
66918
66926
|
}
|