@ganwei-web/gw-base-components-plus 1.0.27 → 1.0.28
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/element-plus-adapter/dist/ElementPlusAdapter.css +7 -4
- package/equip-list-plus/dist/index.es.js +93 -93
- package/equip-list-plus/dist/index.umd.js +1 -1
- package/equip-list-vue2/dist/index.es.js +147 -119
- package/equip-list-vue3/dist/index.es.js +1214 -1202
- package/equip-list-vue3/dist/index.umd.js +5 -5
- package/equip-select-vue3-java/dist/index.es.js +4723 -0
- package/equip-select-vue3-java/dist/index.umd.js +6 -0
- package/equip-select-vue3-java/dist/style.css +1 -0
- package/equipProcessing/dist/index.es.js +46 -45
- package/equipProcessing/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -691,11 +691,14 @@
|
|
|
691
691
|
.el-table tbody .el-table__row:nth-child(2n+1) td.el-table__cell {
|
|
692
692
|
background-color: var(--table-body-background__strip2);
|
|
693
693
|
}
|
|
694
|
-
.el-table tbody
|
|
695
|
-
background-color: var(--table-body-background__hover);
|
|
694
|
+
.el-table tbody .el-table__row:hover {
|
|
695
|
+
background-color: var(--table-body-background__hover) !important;
|
|
696
696
|
}
|
|
697
|
-
.el-table tbody
|
|
698
|
-
background-color:
|
|
697
|
+
.el-table tbody .el-table__row > td.el-table__cell {
|
|
698
|
+
background-color: transparent !important;
|
|
699
|
+
}
|
|
700
|
+
.el-table tbody .el-table__row > td.el-table__cell .cell {
|
|
701
|
+
background-color: transparent !important;
|
|
699
702
|
}
|
|
700
703
|
.el-table tbody .el-table__fixed-right::before,
|
|
701
704
|
.el-table tbody .el-table__fixed::before {
|
|
@@ -41,11 +41,11 @@ class _ {
|
|
|
41
41
|
}
|
|
42
42
|
class N {
|
|
43
43
|
constructor() {
|
|
44
|
-
|
|
44
|
+
window = window;
|
|
45
45
|
try {
|
|
46
|
-
window.top.equipGroup,
|
|
46
|
+
window.top.equipGroup, window = window.top;
|
|
47
47
|
} catch {
|
|
48
|
-
|
|
48
|
+
window = window;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -56,11 +56,11 @@ const m = {
|
|
|
56
56
|
};
|
|
57
57
|
},
|
|
58
58
|
created() {
|
|
59
|
-
|
|
59
|
+
window = window;
|
|
60
60
|
try {
|
|
61
|
-
window.top.equipGroup,
|
|
61
|
+
window.top.equipGroup, window = window.top;
|
|
62
62
|
} catch {
|
|
63
|
-
|
|
63
|
+
window = window;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
};
|
|
@@ -92,7 +92,7 @@ class L extends N {
|
|
|
92
92
|
}), Object.values(this.groupNodeObject).forEach((t) => {
|
|
93
93
|
this.updateEquipSelectCount(t.key, !0), t.halfCheckedEquips = [];
|
|
94
94
|
}), Object.values(this.groupNodeObject).forEach((t) => {
|
|
95
|
-
(
|
|
95
|
+
(window[`group-${t.key}-search`] || []).forEach((o) => {
|
|
96
96
|
this.equipCheckObject[o.equipNo] && this.equipCheckObject[o.equipNo].checked ? this.updateEquipSelectCount(t.key, !1, 1) : this.equipCheckObject[o.equipNo] && this.equipCheckObject[o.equipNo].indeterminate && t.halfCheckedEquips.push(o.equipNo);
|
|
97
97
|
});
|
|
98
98
|
})) : (Object.values(this.groupNodeObject).forEach((t) => {
|
|
@@ -111,7 +111,7 @@ class L extends N {
|
|
|
111
111
|
updateCheckedStatusWithEquips(e) {
|
|
112
112
|
window.setTimeout(() => {
|
|
113
113
|
for (let t = 0, i = e.length; t < i; t++) {
|
|
114
|
-
let o =
|
|
114
|
+
let o = window.equipCache && window.equipCache[e[t]];
|
|
115
115
|
o && o.groupId && (this.setEquipCheckObject(e[t], !0, !1, o.groupId), this.setCheckStatus(`${o.groupId}-${e[t]}`, !0, !1), this.updateEquipSelectCount(o.groupId, !1, 1), this.updateExpandControlCheckStatus(o.groupId, e[t]));
|
|
116
116
|
}
|
|
117
117
|
this.updateGroupCheckStatus();
|
|
@@ -136,8 +136,8 @@ class L extends N {
|
|
|
136
136
|
window.setTimeout(() => {
|
|
137
137
|
for (let t = 0, i = e.length; t < i; t++) {
|
|
138
138
|
let o = e[t].split("."), u = o[0], a = o[1];
|
|
139
|
-
if (this.equipControllObject[u] || (this.equipControllObject[u] = []), this.equipControllObject[u].push(Number(a)),
|
|
140
|
-
let r =
|
|
139
|
+
if (this.equipControllObject[u] || (this.equipControllObject[u] = []), this.equipControllObject[u].push(Number(a)), window.equipCache && window.equipCache[u]) {
|
|
140
|
+
let r = window.equipCache[u].groupId, h = `${r}-${u}-${a}`;
|
|
141
141
|
this.nodesMap[h] && this.setCheckStatus(h, !0, !1), this.nodesMap[`${r}-${u}`] && this.setCheckStatus(`${r}-${u}`, !1, !0), this.nodesMap[`${r}`].halfCheckedEquips && this.nodesMap[`${r}`].halfCheckedEquips.push(u), this.setEquipCheckObject(u, !1, !0, r);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -165,19 +165,19 @@ class L extends N {
|
|
|
165
165
|
Object.keys(this.controlObject).forEach((e) => {
|
|
166
166
|
let t = this.nodesMap[`${this.controlObject[e].groupId}-${e}`];
|
|
167
167
|
if (t) {
|
|
168
|
-
|
|
168
|
+
if (t.checked) {
|
|
169
169
|
let i = t.settings;
|
|
170
170
|
this.setControlStatus(i, this.controlObject[e].groupId, e, !0);
|
|
171
171
|
} else if (!t.checked && !t.indeterminate) {
|
|
172
172
|
let i = t.settings;
|
|
173
173
|
this.setControlStatus(i, this.controlObject[e].groupId, e, !1);
|
|
174
174
|
} else {
|
|
175
|
-
|
|
175
|
+
this.equipControllObject[e] && this.equipControllObject[e].forEach((i) => {
|
|
176
176
|
let o = `${this.controlObject[e].groupId}-${e}-${i}`;
|
|
177
177
|
this.nodesMap[o] && this.setCheckStatus(o, !0, !1);
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
// 获取选中的分组
|
|
@@ -252,8 +252,8 @@ class L extends N {
|
|
|
252
252
|
e.forEach((i) => {
|
|
253
253
|
if (this.groupNodeObject[i]) {
|
|
254
254
|
this.groupNodeObject[i].groups && this.groupNodeObject[i].groups.length > 0 && this.updateGroupSelect(this.groupNodeObject[i].groups.map((h) => h.key), t);
|
|
255
|
-
let o =
|
|
256
|
-
this.isSearchStatus && (o =
|
|
255
|
+
let o = window[`group-${i}${this.aliasName}`] || [];
|
|
256
|
+
this.isSearchStatus && (o = window[`group-${i}-search`] || []);
|
|
257
257
|
let u = 0, a = 0;
|
|
258
258
|
o.forEach((h) => {
|
|
259
259
|
let p = this.equipCheckObject[h.equipNo];
|
|
@@ -333,7 +333,7 @@ class v extends N {
|
|
|
333
333
|
this.clearAllEquipNum();
|
|
334
334
|
for (let t in this.groupNodeObject) {
|
|
335
335
|
let i = [];
|
|
336
|
-
e ? i =
|
|
336
|
+
e ? i = window[`group-${t}-search`] : i = window[`group-${t}${this.aliasName}`];
|
|
337
337
|
let o = i ? i.length : 0;
|
|
338
338
|
o && (this.groupNodeObject[t].equipCount = o, this.setGroupNum(t, o));
|
|
339
339
|
}
|
|
@@ -348,7 +348,7 @@ class v extends N {
|
|
|
348
348
|
// 获取设备总数
|
|
349
349
|
getAllEquipsNum() {
|
|
350
350
|
let e = 0;
|
|
351
|
-
for (let t in this.groupNodeObject) {
|
|
351
|
+
for (let t in this.groupNodeObject) { window[`group-${this.groupNodeObject[t].key}${this.aliasName}`] && (e = e + window[`group-${this.groupNodeObject[t].key}${this.aliasName}`].length); }
|
|
352
352
|
return e;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
@@ -409,7 +409,7 @@ class A extends N {
|
|
|
409
409
|
}
|
|
410
410
|
updateByGroup(e) {
|
|
411
411
|
if (!this.aleadyUpdateStatus[e]) {
|
|
412
|
-
let t =
|
|
412
|
+
let t = window[`group-${e}${this.aliasName}`] || [];
|
|
413
413
|
t.length && (this.aleadyUpdateStatus[e] = !0, t.forEach((i) => {
|
|
414
414
|
this.equipStatusObject[i.equipNo] == 0 || this.equipStatusObject[i.equipNo] == 2 ? this.setGroupStatus(e, !0, 2) : this.equipStatusObject[i.equipNo] == 6 && this.setGroupStatus(e, !0, 6), this.nodesMap[`${e}-${i.equipNo}`] && (this.nodesMap[`${e}-${i.equipNo}`].status = this.equipStatusObject[i.equipNo]);
|
|
415
415
|
}));
|
|
@@ -426,7 +426,7 @@ class A extends N {
|
|
|
426
426
|
t ? i == 2 ? (this.nodesMap[e].alarmCounts = this.nodesMap[e].alarmCounts + 1, this.nodesMap[e].alarmCounts > 0 && (this.nodesMap[e].status = 2)) : (this.nodesMap[e].backUpCounts = this.nodesMap[e].backUpCounts + 1, this.nodesMap[e].alarmCounts == 0 && this.nodesMap[e].backUpCounts > 0 && (this.nodesMap[e].status = 6)) : i == 2 ? (this.nodesMap[e].alarmCounts = this.nodesMap[e].alarmCounts - 1, this.nodesMap[e].alarmCounts == 0 && (this.nodesMap[e].status = 1)) : (this.nodesMap[e].backUpCounts = this.nodesMap[e].backUpCounts - 1, this.nodesMap[e].alarmCounts == 0 && (this.nodesMap[e].backUpCounts == 0 ? this.nodesMap[e].status = 1 : this.nodesMap[e].status = 6)), this.nodesMap[e].groupId && this.setGroupStatus(this.nodesMap[e].groupId, t, i);
|
|
427
427
|
}
|
|
428
428
|
setStatus(e) {
|
|
429
|
-
let t = this.equipStatusObject[e.equipNo], i =
|
|
429
|
+
let t = this.equipStatusObject[e.equipNo], i = window.equipCache && window.equipCache[e.equipNo] && window.equipCache[e.equipNo].groupId;
|
|
430
430
|
if (e.status != 3 && i) {
|
|
431
431
|
switch (e.status) {
|
|
432
432
|
case 0:
|
|
@@ -455,7 +455,7 @@ class A extends N {
|
|
|
455
455
|
const B = {
|
|
456
456
|
getSetParm(s) {
|
|
457
457
|
if (window.AxiosBuilder.axios) {
|
|
458
|
-
|
|
458
|
+
return window.AxiosBuilder.axios({
|
|
459
459
|
method: "post",
|
|
460
460
|
url: "/IoT/api/v3/EquipList/GetFullSetParmByEquipNo",
|
|
461
461
|
params: s,
|
|
@@ -464,8 +464,8 @@ const B = {
|
|
|
464
464
|
"Content-Type": "application/json;charset=UTF-8",
|
|
465
465
|
"Accept-Language": window.sessionStorage.languageType || "zh-CN"
|
|
466
466
|
}
|
|
467
|
-
});
|
|
468
|
-
}
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
469
|
}
|
|
470
470
|
}, U = Object.assign(
|
|
471
471
|
{},
|
|
@@ -504,8 +504,8 @@ class f {
|
|
|
504
504
|
static deepClone(e, t, i, o, u, a) {
|
|
505
505
|
let r = [];
|
|
506
506
|
if (e) {
|
|
507
|
-
|
|
508
|
-
|
|
507
|
+
for (let h = 0, p = e.length; h < p; h++) {
|
|
508
|
+
r.push(
|
|
509
509
|
{
|
|
510
510
|
isGroup: i,
|
|
511
511
|
key: `${o}-${e[h].id}`,
|
|
@@ -522,9 +522,9 @@ class f {
|
|
|
522
522
|
visible: !0,
|
|
523
523
|
settings: []
|
|
524
524
|
}
|
|
525
|
-
);
|
|
526
|
-
}
|
|
527
|
-
}
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
528
|
return r;
|
|
529
529
|
}
|
|
530
530
|
static copyOrigin(e) {
|
|
@@ -537,11 +537,11 @@ class f {
|
|
|
537
537
|
static getPosition(e, t) {
|
|
538
538
|
let i = 0;
|
|
539
539
|
for (let o = 0, u = t.length; o < u; o++) {
|
|
540
|
-
|
|
540
|
+
if (t[o].key == e) {
|
|
541
541
|
i = o - 30;
|
|
542
542
|
break;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
545
|
return i;
|
|
546
546
|
}
|
|
547
547
|
// 扁平化
|
|
@@ -558,7 +558,7 @@ class f {
|
|
|
558
558
|
*/
|
|
559
559
|
static generateUUID() {
|
|
560
560
|
let e = (/* @__PURE__ */ new Date()).getTime();
|
|
561
|
-
return window.performance && typeof window.performance.now == "function" && (e += performance.now()), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(i) {
|
|
561
|
+
return window.performance && typeof window.performance.now == "function" && (e += performance.now()), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (i) {
|
|
562
562
|
let o = (e + Math.random() * 16) % 16 | 0;
|
|
563
563
|
return e = Math.floor(e / 16), (i === "x" ? o : o & 3 | 8).toString(16);
|
|
564
564
|
});
|
|
@@ -590,8 +590,8 @@ class D extends N {
|
|
|
590
590
|
}
|
|
591
591
|
// 搜索状态将搜索的结果存放缓存中
|
|
592
592
|
updateBySearch(e, t) {
|
|
593
|
-
let i =
|
|
594
|
-
i && (i = i.filter((o) => o.title.includes(t)),
|
|
593
|
+
let i = window[`group-${this.groupNodeObject[e].key}${this.aliasName}`];
|
|
594
|
+
i && (i = i.filter((o) => o.title.includes(t)), window[`group-${this.groupNodeObject[e].key}-search`] = f.copyOrigin(i));
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
597
|
const E = (s, e) => {
|
|
@@ -628,7 +628,7 @@ function J(s, e, t, i, o, u) {
|
|
|
628
628
|
type: "text",
|
|
629
629
|
size: "small",
|
|
630
630
|
class: "elBtn",
|
|
631
|
-
icon: "
|
|
631
|
+
icon: "iconfont icon-tubiao20_bianji",
|
|
632
632
|
onClick: e[0] || (e[0] = M((p) => t.groupEditAndNew(!1, t.source), ["stop"]))
|
|
633
633
|
}, {
|
|
634
634
|
default: w(() => [
|
|
@@ -640,7 +640,7 @@ function J(s, e, t, i, o, u) {
|
|
|
640
640
|
type: "text",
|
|
641
641
|
size: "small",
|
|
642
642
|
class: "elBtn",
|
|
643
|
-
icon: "
|
|
643
|
+
icon: "iconfont icon-gw-icon-tianjia1",
|
|
644
644
|
onClick: e[1] || (e[1] = (p) => t.groupEditAndNew(!0, t.source))
|
|
645
645
|
}, {
|
|
646
646
|
default: w(() => [
|
|
@@ -1032,13 +1032,13 @@ const ee = /* @__PURE__ */ E(R, [["render", Z]]), te = {
|
|
|
1032
1032
|
// 根据条件过滤
|
|
1033
1033
|
filterWithAlias(s) {
|
|
1034
1034
|
if (this.aliasName) {
|
|
1035
|
-
let e =
|
|
1036
|
-
|
|
1035
|
+
let e = window[`group-${s}`] || [];
|
|
1036
|
+
window[`group-${s}${this.aliasName}`] = this.filterData(e);
|
|
1037
1037
|
}
|
|
1038
1038
|
},
|
|
1039
1039
|
// 更新当前选中
|
|
1040
1040
|
updateCurrentSelect() {
|
|
1041
|
-
|
|
1041
|
+
window.equipCache && window.equipCache[this.currentNodeKey] && (this.currentSelect = `${window.equipCache[this.currentNodeKey].groupId}-${this.currentNodeKey}`);
|
|
1042
1042
|
},
|
|
1043
1043
|
// 设备状态变化
|
|
1044
1044
|
statusChange(s, e, t) {
|
|
@@ -1060,7 +1060,7 @@ const ee = /* @__PURE__ */ E(R, [["render", Z]]), te = {
|
|
|
1060
1060
|
updateList(s) {
|
|
1061
1061
|
if (this.groupNodeObject[s]) {
|
|
1062
1062
|
let e = [];
|
|
1063
|
-
this.isSearchStatus ? (e =
|
|
1063
|
+
this.isSearchStatus ? (e = window[`group-${s}-search`], this.groupNodeObject[s].equips = [...f.deepClone(e, Number(this.groupNodeObject[s].level) + 1, this.showSettings, s, this.equipCheckObject, this.equipStatusObject)]) : (e = window[`group-${s}${this.aliasName}`], this.groupNodeObject[s].equips = [...f.deepClone(e, Number(this.groupNodeObject[s].level) + 1, this.showSettings, s, this.equipCheckObject, this.equipStatusObject)]), this.cacheManage.addNodesMap(this.groupNodeObject[s].equips), this.cacheManage.closeBrotherNode(s), this.visibleList = [], this.updateTreeList(this.data), this.showStatus && this.equipStatusManage && this.equipStatusManage.updateGroupStatus(s), this.updateCurrentSelect();
|
|
1064
1064
|
}
|
|
1065
1065
|
},
|
|
1066
1066
|
// 更新整个树形结构
|
|
@@ -1304,11 +1304,11 @@ function oe(s, e, t, i, o, u) {
|
|
|
1304
1304
|
const ue = /* @__PURE__ */ E(te, [["render", oe]]);
|
|
1305
1305
|
class ae {
|
|
1306
1306
|
constructor() {
|
|
1307
|
-
this.eGroupNotify = new y("/eGroupNotify", "", ""), this.alreadyUpdate = {}, this.notify = null,
|
|
1307
|
+
this.eGroupNotify = new y("/eGroupNotify", "", ""), this.alreadyUpdate = {}, this.notify = null, window = window;
|
|
1308
1308
|
try {
|
|
1309
|
-
window.top.equipGroup,
|
|
1309
|
+
window.top.equipGroup, window = window.top;
|
|
1310
1310
|
} catch {
|
|
1311
|
-
|
|
1311
|
+
window = window;
|
|
1312
1312
|
}
|
|
1313
1313
|
}
|
|
1314
1314
|
stop() {
|
|
@@ -1347,16 +1347,16 @@ class ae {
|
|
|
1347
1347
|
}
|
|
1348
1348
|
// 获取分组---无权限管理的分组列表--空设备分组不展示
|
|
1349
1349
|
GetEquipGroupTree(e) {
|
|
1350
|
-
|
|
1350
|
+
window.groupList || (window.groupList = e, this.notice({ type: "GetEquipGroupTree" }));
|
|
1351
1351
|
}
|
|
1352
1352
|
// 获取全量分组---设备管理使用
|
|
1353
1353
|
GetAllEquipGroupTree(e) {
|
|
1354
|
-
|
|
1354
|
+
window.groupList_manageMent || (window.groupList_manageMent = e, this.notice({ type: "GetEquipGroupTreeWidthTreeType" }));
|
|
1355
1355
|
}
|
|
1356
1356
|
// 新增分组
|
|
1357
1357
|
AddEquipGroup(e) {
|
|
1358
1358
|
const { parentGroupId: t, groupId: i, groupName: o } = e || {};
|
|
1359
|
-
i && (
|
|
1359
|
+
i && (window.groupList_manageMent || (window.groupList_manageMent = []), window.groupList_manageMent.push({
|
|
1360
1360
|
parentId: t,
|
|
1361
1361
|
id: i,
|
|
1362
1362
|
name: o,
|
|
@@ -1366,9 +1366,9 @@ class ae {
|
|
|
1366
1366
|
// 编辑分组
|
|
1367
1367
|
EditEquipGroup(e) {
|
|
1368
1368
|
const { groupId: t, groupName: i } = e;
|
|
1369
|
-
|
|
1369
|
+
window.groupList && window.groupList.forEach((o) => {
|
|
1370
1370
|
o.id == t && (o.name = i);
|
|
1371
|
-
}),
|
|
1371
|
+
}), window.groupList_manageMent && window.groupList_manageMent.forEach((o) => {
|
|
1372
1372
|
o.id == t && (o.name = i);
|
|
1373
1373
|
}), this.notice({ type: "EditEquipGroup", data: e });
|
|
1374
1374
|
}
|
|
@@ -1384,41 +1384,41 @@ class ae {
|
|
|
1384
1384
|
// 删除分组
|
|
1385
1385
|
DeleteEquipGroup(e) {
|
|
1386
1386
|
e.forEach((t) => {
|
|
1387
|
-
if (
|
|
1388
|
-
let i =
|
|
1389
|
-
i > -1 &&
|
|
1387
|
+
if (window.groupList) {
|
|
1388
|
+
let i = window.groupList.findIndex((o) => o.id == t.groupId);
|
|
1389
|
+
i > -1 && window.groupList.splice(i, 1), this.deleteChildGroup(t.groupId, window.groupList);
|
|
1390
1390
|
}
|
|
1391
|
-
if (
|
|
1392
|
-
let i =
|
|
1393
|
-
i > -1 &&
|
|
1391
|
+
if (window.groupList_manageMent) {
|
|
1392
|
+
let i = window.groupList_manageMent.findIndex((o) => o.id == t.groupId);
|
|
1393
|
+
i > -1 && window.groupList_manageMent.splice(i, 1), this.deleteChildGroup(t.groupId, window.groupList_manageMent);
|
|
1394
1394
|
}
|
|
1395
1395
|
}), this.notice({ type: "DeleteEquipGroup", data: e });
|
|
1396
1396
|
}
|
|
1397
1397
|
// 获取设备
|
|
1398
1398
|
GetGroupEquips(e) {
|
|
1399
1399
|
const { groupId: t, equips: i } = e || {};
|
|
1400
|
-
this.alreadyUpdate[t] || (
|
|
1401
|
-
o.title = o.name, o.groupId = t, o.equipNo = o.id, delete o.name, window.equipCache || (
|
|
1402
|
-
}),
|
|
1400
|
+
this.alreadyUpdate[t] || (window.groupCache || (window.groupCache = {}), window.groupCache[t] = {}, t && i && i instanceof Array && (i.forEach((o) => {
|
|
1401
|
+
o.title = o.name, o.groupId = t, o.equipNo = o.id, delete o.name, window.equipCache || (window.equipCache = {}), window.equipCache[o.id] = o, window.groupCache[t][o.id] = o;
|
|
1402
|
+
}), window[`group-${t}`] = i, this.notice({ type: "GetGroupEquips", data: { groupId: t } }), this.alreadyUpdate[t] = !0));
|
|
1403
1403
|
}
|
|
1404
1404
|
// 新增设备
|
|
1405
1405
|
AddEquip(e) {
|
|
1406
1406
|
const { groupId: t, equips: i } = e || {};
|
|
1407
|
-
|
|
1408
|
-
let o =
|
|
1407
|
+
window[`group-${t}`] || (window[`group-${t}`] = []), window.groupCache || (window.groupCache = {}), window.groupCache[t] || (window.groupCache[t] = {}), window.equipCache || (window.equipCache = {});
|
|
1408
|
+
let o = window[`group-${t}`].length;
|
|
1409
1409
|
if (t && i) {
|
|
1410
1410
|
if (i.forEach((u, a) => {
|
|
1411
|
-
|
|
1411
|
+
window[`group-${t}`].push(
|
|
1412
1412
|
{
|
|
1413
1413
|
equipNo: u.id,
|
|
1414
1414
|
groupId: t,
|
|
1415
1415
|
id: u.id,
|
|
1416
1416
|
title: u.name
|
|
1417
1417
|
}
|
|
1418
|
-
),
|
|
1419
|
-
}), !this.exist(t,
|
|
1420
|
-
let u = this.findParentList(t,
|
|
1421
|
-
|
|
1418
|
+
), window.equipCache[u.id] = window[`group-${t}`][o + a], window.groupCache[t][u.id] = window[`group-${t}`][o + a];
|
|
1419
|
+
}), !this.exist(t, window.groupList)) {
|
|
1420
|
+
let u = this.findParentList(t, window.groupList_manageMent);
|
|
1421
|
+
window.groupList.push(...u);
|
|
1422
1422
|
}
|
|
1423
1423
|
this.notice({ type: "AddEquip", data: e });
|
|
1424
1424
|
}
|
|
@@ -1427,20 +1427,20 @@ class ae {
|
|
|
1427
1427
|
let t = [], i = !0, o = [];
|
|
1428
1428
|
const { sourceGroup: u, targetGroupId: a } = e || {};
|
|
1429
1429
|
a && t.push(a), u.forEach((r) => {
|
|
1430
|
-
if (t.push(r.groupId), (!
|
|
1431
|
-
if (h.title = h.name, h.groupId = a, h.equipNo = h.id,
|
|
1432
|
-
let p =
|
|
1433
|
-
p > -1 &&
|
|
1430
|
+
if (t.push(r.groupId), (!window[`group-${a}`] || !window[`group-${a}`].length) && (window[`group-${a}`] = [], o.push(a)), window.groupCache || (window.groupCache = {}), window.groupCache[a] || (window.groupCache[a] = {}), r.equips.forEach((h) => {
|
|
1431
|
+
if (h.title = h.name, h.groupId = a, h.equipNo = h.id, window[`group-${r.groupId}`]) {
|
|
1432
|
+
let p = window[`group-${r.groupId}`].findIndex((c) => c.id == h.id);
|
|
1433
|
+
p > -1 && window[`group-${r.groupId}`].splice(p, 1);
|
|
1434
1434
|
}
|
|
1435
|
-
window.equipCache || (
|
|
1436
|
-
}), !
|
|
1437
|
-
let h =
|
|
1438
|
-
h > -1 &&
|
|
1435
|
+
window.equipCache || (window.equipCache = {}), window.equipCache[h.id] = h, window.groupCache[a][h.id] = h, window[`group-${a}`].push(h);
|
|
1436
|
+
}), !window[`group-${r.groupId}`].length) {
|
|
1437
|
+
let h = window.groupList.findIndex((p) => p.id == r.groupId);
|
|
1438
|
+
h > -1 && window.groupList.splice(h, 1), this.deleteChildGroup(r.groupId, window.groupList);
|
|
1439
1439
|
}
|
|
1440
1440
|
}), o.forEach((r) => {
|
|
1441
|
-
if (!this.exist(r,
|
|
1442
|
-
let h = this.findParentList(r,
|
|
1443
|
-
|
|
1441
|
+
if (!this.exist(r, window.groupList)) {
|
|
1442
|
+
let h = this.findParentList(r, window.groupList_manageMent);
|
|
1443
|
+
window.groupList.push(...h);
|
|
1444
1444
|
}
|
|
1445
1445
|
}), this.notice({ type: "moveEquips", data: { updateGroups: t, buildTree: i } });
|
|
1446
1446
|
}
|
|
@@ -1451,7 +1451,7 @@ class ae {
|
|
|
1451
1451
|
let i = [];
|
|
1452
1452
|
if (t) {
|
|
1453
1453
|
let o = t.findIndex((u) => u.id == e);
|
|
1454
|
-
o > -1 && i.push({ ...t[o] }), t[o].parentId && !this.exist(t[o].parentId,
|
|
1454
|
+
o > -1 && i.push({ ...t[o] }), t[o].parentId && !this.exist(t[o].parentId, window.groupList) && i.push(...this.findParentList(t[o].parentId, window.groupList_manageMent));
|
|
1455
1455
|
}
|
|
1456
1456
|
return i;
|
|
1457
1457
|
}
|
|
@@ -1459,22 +1459,22 @@ class ae {
|
|
|
1459
1459
|
DeleteEquip(e) {
|
|
1460
1460
|
const { groupId: t, equips: i } = e || {};
|
|
1461
1461
|
if (t && i && i instanceof Array) {
|
|
1462
|
-
if (
|
|
1463
|
-
|
|
1464
|
-
let a =
|
|
1465
|
-
a > -1 &&
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1462
|
+
if (window[`group-${t}`]) {
|
|
1463
|
+
for (let o = 0, u = i.length; o < u; o++) {
|
|
1464
|
+
let a = window[`group-${t}`].findIndex((r) => r.id == i[o].id);
|
|
1465
|
+
a > -1 && window[`group-${t}`].splice(a, 1), delete window.equipCache[i[o].id], delete window.groupCache[t][i[o].id];
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
1468
|
this.notice({ type: "DeleteEquip", data: e });
|
|
1469
1469
|
}
|
|
1470
1470
|
}
|
|
1471
1471
|
// 编辑设备
|
|
1472
1472
|
EditEquip(e) {
|
|
1473
1473
|
const { equipNo: t, groupId: i, equipName: o } = e || {};
|
|
1474
|
-
i && t && (window[`group-${i}`] && (
|
|
1474
|
+
i && t && (window[`group-${i}`] && (window.equipCache[t] = o), this.notice({ type: "EditEquip", data: e }));
|
|
1475
1475
|
}
|
|
1476
1476
|
notice(e) {
|
|
1477
|
-
if (
|
|
1477
|
+
if (window.hasIframe) {
|
|
1478
1478
|
let t = document.getElementsByTagName("iframe");
|
|
1479
1479
|
for (let i of t) { i.contentWindow.postMessage(e); }
|
|
1480
1480
|
} else { window.postMessage(e, "*"); }
|
|
@@ -1502,11 +1502,11 @@ const he = {
|
|
|
1502
1502
|
}
|
|
1503
1503
|
},
|
|
1504
1504
|
mounted() {
|
|
1505
|
-
this.treeKey = `equipGroup${this.treeType}`, this.listKey = `groupList${this.treeType}`,
|
|
1505
|
+
this.treeKey = `equipGroup${this.treeType}`, this.listKey = `groupList${this.treeType}`, window[this.treeKey] ? this.list = f.formateList(JSON.parse(JSON.stringify(window[this.treeKey]))) : window[this.listKey] && this.buildTree(), window.executeQueue || (window.executeQueues = {}), window.executeQueues[this.refId] = this.destroyTree, window.addEventListener("message", (s) => {
|
|
1506
1506
|
s && s.data && s.data.type && this[s.data.type] && this[s.data.type]();
|
|
1507
1507
|
});
|
|
1508
1508
|
try {
|
|
1509
|
-
|
|
1509
|
+
window.hasIframe || this.selfRequest();
|
|
1510
1510
|
} catch {
|
|
1511
1511
|
this.selfRequest();
|
|
1512
1512
|
}
|
|
@@ -1516,15 +1516,15 @@ const he = {
|
|
|
1516
1516
|
new ae().Init();
|
|
1517
1517
|
},
|
|
1518
1518
|
GetEquipGroupTreeWidthTreeType() {
|
|
1519
|
-
this.treeType &&
|
|
1519
|
+
this.treeType && window[this.listKey] && this.buildTree();
|
|
1520
1520
|
},
|
|
1521
1521
|
GetEquipGroupTree() {
|
|
1522
|
-
!this.treeType &&
|
|
1522
|
+
!this.treeType && window[this.listKey] && this.buildTree();
|
|
1523
1523
|
},
|
|
1524
1524
|
buildTree() {
|
|
1525
|
-
if (
|
|
1526
|
-
let s = f.listToTreeList(JSON.parse(JSON.stringify(
|
|
1527
|
-
this.list = f.formateList(JSON.parse(JSON.stringify(s))),
|
|
1525
|
+
if (window[this.listKey]) {
|
|
1526
|
+
let s = f.listToTreeList(JSON.parse(JSON.stringify(window[this.listKey])));
|
|
1527
|
+
this.list = f.formateList(JSON.parse(JSON.stringify(s))), window[`equipGroup${this.treeType}`] = s, this.hasBuildTree = !0;
|
|
1528
1528
|
}
|
|
1529
1529
|
},
|
|
1530
1530
|
filterMethod(s) {
|
|
@@ -1552,7 +1552,7 @@ function re(s, e, t, i, o, u) {
|
|
|
1552
1552
|
}, { ...s.$attrs, ...s.$props }, T(s.$listeners), { buildTree: u.buildTree }), null, 16, ["data", "buildTree"]);
|
|
1553
1553
|
}
|
|
1554
1554
|
const j = /* @__PURE__ */ E(he, [["render", re]]);
|
|
1555
|
-
j.install = function(s) {
|
|
1555
|
+
j.install = function (s) {
|
|
1556
1556
|
s.component(j.name, j);
|
|
1557
1557
|
};
|
|
1558
1558
|
export {
|