@ganwei-web/gw-base-components-plus 1.0.20 → 1.0.22
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/customDirective/getUserPermissionList.js +53 -0
- package/customDirective/index.js +15 -0
- package/customDirective/interfaceDefinition.ts +10 -0
- package/customDirective/permission.js +61 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.cjs +3 -1
- package/element-plus-adapter/dist/ElementPlusAdapter.cjs.map +1 -1
- package/element-plus-adapter/dist/ElementPlusAdapter.css +21 -9
- package/element-plus-adapter/dist/ElementPlusAdapter.iife.js +3 -1
- package/element-plus-adapter/dist/ElementPlusAdapter.iife.js.map +1 -1
- package/element-plus-adapter/dist/ElementPlusAdapter.js +5 -3
- package/element-plus-adapter/dist/ElementPlusAdapter.js.map +1 -1
- package/equip-list-vue3/dist/index.es.js +696 -616
- package/equip-list-vue3/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { createBlock as
|
|
1
|
+
import { createBlock as E, createCommentVNode as w, createElementBlock as d, createElementVNode as S, createTextVNode as M, createVNode as b, mergeProps as L, normalizeClass as y, normalizeStyle as G, openBlock as p, resolveComponent as C, toDisplayString as N, toHandlers as _, withCtx as q, withModifiers as k } from "vue";
|
|
2
2
|
import I from "vue3-virtual-scroll-list";
|
|
3
|
-
import * as
|
|
3
|
+
import * as T from "@aspnet/signalr";
|
|
4
4
|
|
|
5
5
|
import "./style.css";
|
|
6
|
-
class
|
|
6
|
+
class v {
|
|
7
7
|
// 分组节点扁平化对象、设备扁平化对象、window缓存设备扁平化对象
|
|
8
|
-
constructor(
|
|
9
|
-
this.groupNodeObject =
|
|
8
|
+
constructor(t, e, i) {
|
|
9
|
+
this.groupNodeObject = t, this.nodesMap = e, this.controlObject = i;
|
|
10
10
|
}
|
|
11
11
|
// 增加映射
|
|
12
|
-
addNodesMap(
|
|
13
|
-
|
|
14
|
-
this.nodesMap[
|
|
12
|
+
addNodesMap(t) {
|
|
13
|
+
t && t.forEach((e) => {
|
|
14
|
+
this.nodesMap[e.key] = e;
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
// 移除映射
|
|
18
|
-
removeNodesMap(
|
|
19
|
-
|
|
20
|
-
delete this.nodesMap[
|
|
18
|
+
removeNodesMap(t) {
|
|
19
|
+
t && t.forEach((e) => {
|
|
20
|
+
delete this.nodesMap[e.key];
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
// 回收所有分组节点缓存
|
|
24
|
-
recycleAllNodeCache(
|
|
25
|
-
for (let
|
|
24
|
+
recycleAllNodeCache(t) {
|
|
25
|
+
for (let e in this.groupNodeObject) { this.groupNodeObject[e].expand = !1, this.groupNodeObject[e].count = 0, this.recycleGroupCache(this.groupNodeObject[e].key), t && delete this.groupNodeObject[e]; }
|
|
26
26
|
}
|
|
27
27
|
// 回收分组节点内存
|
|
28
|
-
recycleGroupCache(
|
|
29
|
-
if (this.groupNodeObject[
|
|
30
|
-
this.groupNodeObject[
|
|
31
|
-
for (let
|
|
28
|
+
recycleGroupCache(t) {
|
|
29
|
+
if (this.groupNodeObject[t]) {
|
|
30
|
+
this.groupNodeObject[t].children = [], this.removeNodesMap(this.groupNodeObject[t].equips), this.groupNodeObject[t].equips = [], this.groupNodeObject[t].equips.length = 0, this.groupNodeObject[t].expand = !1;
|
|
31
|
+
for (let e in this.groupNodeObject) { this.groupNodeObject[e].groupId == t && this.recycleGroupCache(this.groupNodeObject[e].key); }
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
// 关闭兄弟分组节点及回收内存
|
|
35
|
-
closeBrotherNode(
|
|
36
|
-
if (
|
|
37
|
-
let
|
|
38
|
-
for (let i in this.groupNodeObject) { this.groupNodeObject[i].groupId ==
|
|
35
|
+
closeBrotherNode(t) {
|
|
36
|
+
if (t && this.groupNodeObject[t]) {
|
|
37
|
+
let e = this.groupNodeObject[t].groupId;
|
|
38
|
+
for (let i in this.groupNodeObject) { this.groupNodeObject[i].groupId == e && this.groupNodeObject[i].key != t && this.groupNodeObject[i].expand && (this.groupNodeObject[i].expand = !1, this.recycleGroupCache(this.groupNodeObject[i].key)); }
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
class
|
|
42
|
+
class m {
|
|
43
43
|
constructor() {
|
|
44
44
|
this.window = window;
|
|
45
45
|
try {
|
|
@@ -49,7 +49,7 @@ class N {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const x = {
|
|
53
53
|
data() {
|
|
54
54
|
return {
|
|
55
55
|
window: null
|
|
@@ -64,117 +64,141 @@ const m = {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
class
|
|
68
|
-
constructor(
|
|
69
|
-
super(), this.equipControllObject = i, this.groupNodeObject =
|
|
67
|
+
class A extends m {
|
|
68
|
+
constructor(t, e, i, o, u, a) {
|
|
69
|
+
super(), this.equipControllObject = i, this.groupNodeObject = t, this.nodesMap = e, this.controlObject = o, this.equipCheckObject = u, this.isSearchStatus = !1, this.searchStatusGroupObject = {}, this.aliasName = a;
|
|
70
70
|
}
|
|
71
71
|
resetCheckedStatus() {
|
|
72
|
-
Object.values(this.nodesMap).forEach((
|
|
73
|
-
this.setCheckStatus(
|
|
74
|
-
}), Object.keys(this.equipCheckObject).forEach((
|
|
75
|
-
this.setEquipCheckObject(e, !1, !1, this.equipCheckObject[e].groupId);
|
|
76
|
-
});
|
|
72
|
+
Object.values(this.nodesMap).forEach((t) => {
|
|
73
|
+
this.setCheckStatus(t.key, !1, !1);
|
|
74
|
+
}), Object.keys(this.equipCheckObject).forEach((t) => delete this.equipCheckObject[t]), this.updateGroupCheckStatus();
|
|
77
75
|
}
|
|
78
|
-
|
|
76
|
+
|
|
79
77
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this.isSearchStatus = e, this.isSearchStatus ? (Object.values(this.groupNodeObject).forEach((t) => {
|
|
86
|
-
this.searchStatusGroupObject[t.key] = {
|
|
87
|
-
groupId: t.groupId,
|
|
88
|
-
equipSelectCount: t.equipSelectCount,
|
|
89
|
-
halfCheckedEquips: t.halfCheckedEquips,
|
|
90
|
-
...this.searchStatusGroupObject[t.key]
|
|
91
|
-
};
|
|
92
|
-
}), Object.values(this.groupNodeObject).forEach((t) => {
|
|
93
|
-
this.updateEquipSelectCount(t.key, !0), t.halfCheckedEquips = [];
|
|
94
|
-
}), Object.values(this.groupNodeObject).forEach((t) => {
|
|
95
|
-
(this.window[`group-${t.key}-search`] || []).forEach((o) => {
|
|
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
|
-
});
|
|
98
|
-
})) : (Object.values(this.groupNodeObject).forEach((t) => {
|
|
99
|
-
let i = this.searchStatusGroupObject[t.key];
|
|
100
|
-
i && (t.equipSelectCount = i.equipSelectCount, t.halfCheckedEquips = [...i.halfCheckedEquips, ...t.halfCheckedEquips], t.halfCheckedEquips = [...new Set(t.halfCheckedEquips)]);
|
|
101
|
-
}), this.searchStatusGroupObject = {});
|
|
78
|
+
* 搜索状态下,更新分组选中状态
|
|
79
|
+
* 新方案:直接调用 updateGroupCheckStatus 重新计算
|
|
80
|
+
*/
|
|
81
|
+
reComputedCheckNum(t) {
|
|
82
|
+
this.isSearchStatus = t, this.updateGroupCheckStatus();
|
|
102
83
|
}
|
|
103
84
|
// 根据传过来的设备选中数据、回显选中状态
|
|
104
85
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
86
|
+
* 支持两种数据格式:
|
|
87
|
+
* 格式1:纯 equipNo 数组,如 [1, 2, 3],选中该设备在所有分组下的实例
|
|
88
|
+
* 格式2:{ groupId: [equipNo1, equipNo2] } 对象,如 { 2: [1, 2], 3: [5] },只选中指定分组下的设备
|
|
89
|
+
*
|
|
90
|
+
* 注意:此方法只负责将选中状态写入 equipCheckObject,不调用 updateGroupCheckStatus。
|
|
91
|
+
* 分组状态的更新由调用方在合适的时机(数据就绪后)统一调用。
|
|
92
|
+
*/
|
|
93
|
+
updateCheckedStatusWithEquips(t) {
|
|
94
|
+
let e = [];
|
|
95
|
+
Array.isArray(t) ? e = t.map((i) => ({ equipNo: i, groupId: null })) : t !== null && typeof t == "object" && Object.keys(t).forEach((i) => {
|
|
96
|
+
Array.isArray(t[i]) && t[i].forEach((o) => {
|
|
97
|
+
e.push({ equipNo: o, groupId: Number(i) });
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
for (let i = 0, o = e.length; i < o; i++) {
|
|
101
|
+
const { equipNo: u, groupId: a } = e[i];
|
|
102
|
+
if (a != null) {
|
|
103
|
+
const h = `${a}-${u}`;
|
|
104
|
+
this.setEquipCheckObject(h, !0, !1, a), this.setCheckStatus(h, !0, !1), this.updateExpandControlCheckStatus(a, u);
|
|
105
|
+
} else {
|
|
106
|
+
const h = this.window.equipCache && this.window.equipCache[u];
|
|
107
|
+
h && (h.groupIds || (h.groupId ? [h.groupId] : [])).forEach((n) => {
|
|
108
|
+
const c = `${n}-${u}`;
|
|
109
|
+
this.setEquipCheckObject(c, !0, !1, n), this.setCheckStatus(c, !0, !1), this.updateExpandControlCheckStatus(n, u);
|
|
110
|
+
});
|
|
116
111
|
}
|
|
117
|
-
|
|
118
|
-
}, 200);
|
|
112
|
+
}
|
|
119
113
|
}
|
|
120
114
|
// 更新展开的设备控制项选中状态
|
|
121
|
-
updateExpandControlCheckStatus(
|
|
122
|
-
let i = this.nodesMap[`${
|
|
115
|
+
updateExpandControlCheckStatus(t, e) {
|
|
116
|
+
let i = this.nodesMap[`${t}-${e}`];
|
|
123
117
|
i && i.settings && i.settings.length && i.settings.forEach((o) => {
|
|
124
|
-
this.nodesMap[`${
|
|
118
|
+
this.nodesMap[`${t}-${e}-${o.setNo}`] && this.setCheckStatus(`${t}-${e}-${o.setNo}`, !0, !1);
|
|
125
119
|
});
|
|
126
120
|
}
|
|
127
121
|
// 根据传过来的设备控制项,回显设备分组选中状态
|
|
128
122
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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)), this.window.equipCache && this.window.equipCache[u]) {
|
|
140
|
-
let r = this.window.equipCache[u].groupId, h = `${r}-${u}-${a}`;
|
|
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
|
-
}
|
|
123
|
+
* 注意:此方法只负责将控制项状态写入 equipControllObject/equipCheckObject,不调用 updateGroupCheckStatus。
|
|
124
|
+
* 分组状态的更新由调用方在合适的时机(数据就绪后)统一调用。
|
|
125
|
+
*/
|
|
126
|
+
updateCheckedStatusWithControls(t) {
|
|
127
|
+
for (let e = 0, i = t.length; e < i; e++) {
|
|
128
|
+
let o = t[e], u, a, h;
|
|
129
|
+
if (o !== null && typeof o == "object" && !Array.isArray(o)) { u = o.equipNo, a = o.setNo, h = o.groupId; } else {
|
|
130
|
+
let n = o.split(".");
|
|
131
|
+
u = n[0], a = n[1], h = null;
|
|
143
132
|
}
|
|
144
|
-
this.
|
|
145
|
-
|
|
133
|
+
this.equipControllObject[u] || (this.equipControllObject[u] = []), this.equipControllObject[u].push(Number(a));
|
|
134
|
+
const r = this.window.equipCache && this.window.equipCache[u];
|
|
135
|
+
r && (h != null ? [h] : r.groupIds || (r.groupId ? [r.groupId] : [])).forEach((c) => {
|
|
136
|
+
const g = `${c}-${u}`, l = `${c}-${u}-${a}`;
|
|
137
|
+
this.nodesMap[l] && this.setCheckStatus(l, !0, !1), this.nodesMap[g] && this.setCheckStatus(g, !1, !0), this.setEquipCheckObject(g, !1, !0, c);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
146
140
|
}
|
|
147
|
-
//
|
|
141
|
+
// 更新分组选中状态------------------------------------------------------------------------------------
|
|
142
|
+
/**
|
|
143
|
+
* 新方案:基于 equipCheckObject 实时计算分组状态,而不是依赖中间状态
|
|
144
|
+
* 优点:状态判断准确,不会累积误差
|
|
145
|
+
*/
|
|
148
146
|
updateGroupCheckStatus() {
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
this.getSortedGroupsByLevel().forEach((e) => {
|
|
148
|
+
const i = this.computeGroupStatus(e.key);
|
|
149
|
+
this.setCheckStatus(e.key, i.checked, i.indeterminate), e.equipSelectCount = i.selectCount;
|
|
151
150
|
});
|
|
152
151
|
}
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
// 按层级排序分组(从深到浅,确保子分组先处理)
|
|
153
|
+
getSortedGroupsByLevel() {
|
|
154
|
+
return Object.values(this.groupNodeObject).sort((t, e) => e.level - t.level);
|
|
155
|
+
}
|
|
156
|
+
// 计算单个分组的选中状态
|
|
157
|
+
/**
|
|
158
|
+
* @returns {Object} { checked, indeterminate, selectCount }
|
|
159
|
+
*/
|
|
160
|
+
computeGroupStatus(t) {
|
|
161
|
+
const e = this.groupNodeObject[t];
|
|
162
|
+
if (!e) { return { checked: !1, indeterminate: !1, selectCount: 0 }; }
|
|
163
|
+
const i = this.isSearchStatus ? this.window[`group-${t}-search`] || [] : this.window[`group-${t}${this.aliasName}`] || [];
|
|
164
|
+
let o = 0;
|
|
165
|
+
i.forEach((g) => {
|
|
166
|
+
const l = `${t}-${g.equipNo}`;
|
|
167
|
+
this.equipCheckObject[l] && this.equipCheckObject[l].checked && o++;
|
|
168
|
+
});
|
|
169
|
+
let u = 0, a = 0, h = !1, r = !1;
|
|
170
|
+
e.groups && e.groups.length > 0 && e.groups.forEach((g) => {
|
|
171
|
+
const l = this.nodesMap[g.key];
|
|
172
|
+
l && (l.checked ? (u += l.count || 0, h = !0) : l.indeterminate ? (r = !0, h = !0) : r = !0, a += l.count || 0);
|
|
173
|
+
});
|
|
174
|
+
const n = o + u, c = e.count || 0;
|
|
175
|
+
return c === 0 ? { checked: !1, indeterminate: !1, selectCount: 0 } : n === 0 ? h ? { checked: !1, indeterminate: !0, selectCount: n } : { checked: !1, indeterminate: !1, selectCount: 0 } : n === c && !r ? { checked: !0, indeterminate: !1, selectCount: n } : { checked: !1, indeterminate: !0, selectCount: n };
|
|
156
176
|
}
|
|
157
177
|
// 设置设备控制项状态
|
|
158
|
-
setControlStatus(
|
|
159
|
-
|
|
160
|
-
this.nodesMap[`${
|
|
178
|
+
setControlStatus(t, e, i, o) {
|
|
179
|
+
t && t.forEach((u) => {
|
|
180
|
+
this.nodesMap[`${e}-${i}-${u.setNo}`] && this.setCheckStatus(`${e}-${i}-${u.setNo}`, o, !1);
|
|
161
181
|
});
|
|
162
182
|
}
|
|
163
183
|
// 更新设备控制项选中状态
|
|
184
|
+
/**
|
|
185
|
+
* 改造点:controlObject 键格式统一为 ${groupId}-${equipNo}
|
|
186
|
+
* */
|
|
164
187
|
updateControlCheckStatus() {
|
|
165
|
-
Object.keys(this.controlObject).forEach((
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
188
|
+
Object.keys(this.controlObject).forEach((t) => {
|
|
189
|
+
const [e, i] = t.split("-");
|
|
190
|
+
let o = this.nodesMap[t];
|
|
191
|
+
if (o) {
|
|
192
|
+
if (o.checked) {
|
|
193
|
+
let u = o.settings;
|
|
194
|
+
this.setControlStatus(u, e, i, !0);
|
|
195
|
+
} else if (!o.checked && !o.indeterminate) {
|
|
196
|
+
let u = o.settings;
|
|
197
|
+
this.setControlStatus(u, e, i, !1);
|
|
174
198
|
} else {
|
|
175
|
-
this.equipControllObject[
|
|
176
|
-
let
|
|
177
|
-
this.nodesMap[
|
|
199
|
+
this.equipControllObject[i] && this.equipControllObject[i].forEach((u) => {
|
|
200
|
+
let a = `${e}-${i}-${u}`;
|
|
201
|
+
this.nodesMap[a] && this.setCheckStatus(a, !0, !1);
|
|
178
202
|
});
|
|
179
203
|
}
|
|
180
204
|
}
|
|
@@ -182,358 +206,340 @@ class L extends N {
|
|
|
182
206
|
}
|
|
183
207
|
// 获取选中的分组
|
|
184
208
|
getGroupChecked() {
|
|
185
|
-
let
|
|
186
|
-
return Object.keys(this.groupNodeObject).forEach((
|
|
187
|
-
this.groupNodeObject[
|
|
188
|
-
}),
|
|
209
|
+
let t = [];
|
|
210
|
+
return Object.keys(this.groupNodeObject).forEach((e) => {
|
|
211
|
+
this.groupNodeObject[e].checked && t.push(e);
|
|
212
|
+
}), t;
|
|
189
213
|
}
|
|
190
214
|
// 获取选中设备
|
|
191
215
|
getEquipSelectd() {
|
|
192
|
-
let
|
|
193
|
-
return Object.keys(this.equipCheckObject).forEach((
|
|
194
|
-
this.equipCheckObject[
|
|
216
|
+
let t = [], e = /* @__PURE__ */ new Set();
|
|
217
|
+
return Object.keys(this.equipCheckObject).forEach((i) => {
|
|
218
|
+
if (this.equipCheckObject[i].checked) {
|
|
219
|
+
try {
|
|
220
|
+
e.add(Number(i.split("-")[1]));
|
|
221
|
+
} catch (o) {
|
|
222
|
+
console.log(o);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}), t = Array.from(e), t;
|
|
226
|
+
}
|
|
227
|
+
// 获取选中设备(携带分组)
|
|
228
|
+
getEquipGroupSelectd() {
|
|
229
|
+
let t = Object.keys(this.equipCheckObject);
|
|
230
|
+
return t.length > 0 && (t = this.returnArray(t)), t;
|
|
231
|
+
}
|
|
232
|
+
returnArray(t) {
|
|
233
|
+
const e = [];
|
|
234
|
+
return t.forEach((i) => {
|
|
235
|
+
const [o, u] = i.split("-"), a = parseInt(u);
|
|
236
|
+
isNaN(a) || e.push(a);
|
|
195
237
|
}), e;
|
|
196
238
|
}
|
|
197
|
-
//
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return
|
|
201
|
-
|
|
239
|
+
// 解析设备数组为分组格式
|
|
240
|
+
parseEquipArrayToGroupFormat(t) {
|
|
241
|
+
const e = {};
|
|
242
|
+
return t.forEach((i) => {
|
|
243
|
+
const [o, u] = i.split("-"), a = parseInt(o);
|
|
244
|
+
isNaN(a) || (e[a] || (e[a] = []), e[a].push(parseInt(u)));
|
|
202
245
|
}), e;
|
|
203
246
|
}
|
|
247
|
+
// 获取选中的设备控制项
|
|
248
|
+
getControlSelected() {
|
|
249
|
+
let t = [];
|
|
250
|
+
return Object.keys(this.equipControllObject).forEach((e) => {
|
|
251
|
+
t.push(...this.equipControllObject[e].map((i) => `${e}.${i}`));
|
|
252
|
+
}), t;
|
|
253
|
+
}
|
|
204
254
|
// 点击选中
|
|
205
255
|
/**
|
|
206
256
|
* 1:如果是分组选择,触发分组选中事件
|
|
207
257
|
* 2:如果是设备选择,触发设备选中事件
|
|
208
258
|
* 3:如果是设备控制项选择,触发设备控制项选中事件
|
|
209
259
|
* */
|
|
210
|
-
onChecked(
|
|
211
|
-
this.isSearchStatus =
|
|
260
|
+
onChecked(t, e) {
|
|
261
|
+
this.isSearchStatus = e || !1, t.isGroup && !t.isEquip ? this.selectGroup(t) : t.isEquip ? this.selectEquip(t) : t.isSetting && this.selectControl(t);
|
|
212
262
|
}
|
|
213
263
|
// 从全局映射中,设置节点选中状态
|
|
214
|
-
setCheckStatus(e,
|
|
215
|
-
this.nodesMap[
|
|
216
|
-
}
|
|
217
|
-
// 清除选中的设备
|
|
218
|
-
clearCheckedEquips(e) {
|
|
219
|
-
this.groupNodeObject[e] && (this.groupNodeObject[e].equipSelectCount = 0, this.groupNodeObject[e].halfCheckedEquips && this.groupNodeObject[e].halfCheckedEquips.forEach((t) => {
|
|
220
|
-
this.equipControllObject[t] && this.equipControllObject[t].forEach((i) => {
|
|
221
|
-
this.setCheckStatus(`${e}-${t}-${i}`, !1, !1);
|
|
222
|
-
});
|
|
223
|
-
}), this.groupNodeObject[e].halfCheckedEquips = [], this.groupNodeObject[e].groupId && this.clearCheckedEquips(this.groupNodeObject[e].groupId));
|
|
224
|
-
}
|
|
225
|
-
// 搜索状态下,更新分组选中的设备数量
|
|
226
|
-
updateSearchStatusObject(e, t) {
|
|
227
|
-
this.searchStatusGroupObject[e] && (this.searchStatusGroupObject[e].equipSelectCount = this.searchStatusGroupObject[e].equipSelectCount + t, this.searchStatusGroupObject[e].groupId && this.updateSearchStatusObject(this.searchStatusGroupObject[e].groupId, t));
|
|
228
|
-
}
|
|
229
|
-
// 更新分组设备选中数量
|
|
230
|
-
updateEquipSelectCount(e, t, i) {
|
|
231
|
-
this.nodesMap[e] && (t ? this.nodesMap[e].equipSelectCount = 0 : this.nodesMap[e].equipSelectCount = this.nodesMap[e].equipSelectCount + i, this.nodesMap[e].groupId && this.updateEquipSelectCount(this.nodesMap[e].groupId, t, i));
|
|
264
|
+
setCheckStatus(t, e, i, o) {
|
|
265
|
+
this.nodesMap[t] && (this.nodesMap[t].checked = e, this.nodesMap[t].isGroup && (this.nodesMap[t].indeterminate = i));
|
|
232
266
|
}
|
|
233
267
|
// 保存全局设备选中状态
|
|
234
|
-
setEquipCheckObject(
|
|
235
|
-
this.equipCheckObject[
|
|
236
|
-
}
|
|
237
|
-
// 更新当前展开的分组所选中的设备、设置分组选中的设备数量、更新选中状态(已经实例化的节点)
|
|
238
|
-
updateEquipSelect(e, t, i, o) {
|
|
239
|
-
this.nodesMap[e] && t.length && t.forEach((u) => {
|
|
240
|
-
i ? (this.setEquipCheckObject(u.equipNo, !0, !1, e), this.nodesMap[`${e}-${u.equipNo}`] && this.setCheckStatus(`${e}-${u.equipNo}`, !0, !1)) : (this.setEquipCheckObject(u.equipNo, !1, !1, e), this.nodesMap[`${e}-${u.equipNo}`] && this.setCheckStatus(`${e}-${u.equipNo}`, !1, !1)), this.equipControllObject[u.equipNo] && delete this.equipControllObject[u.equipNo], this.nodesMap[e].halfCheckedEquips.includes(u.equipNo) && (this.nodesMap[e].halfCheckedEquips = this.nodesMap[e].halfCheckedEquips.filter((a) => a != u.equipNo), this.searchStatusGroupObject[e] && (this.searchStatusGroupObject[e].halfCheckedEquips = this.nodesMap[e].halfCheckedEquips));
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
// 根据分组更新选中的设备,全选分组或者取消选择分组时调用
|
|
244
|
-
/**
|
|
245
|
-
* 1:统计需要更新的设备数量
|
|
246
|
-
* 2:把所有子孙分组设备全部统计,并且记录所有当前分组选中的设备,更新除分组之外的选中状态(已经实例化的节点)
|
|
247
|
-
* 3:更新自身设备选择数量、向上级分组累加已经选中的设备数量
|
|
248
|
-
* 4:更新搜索状态下分组副本数据
|
|
249
|
-
* */
|
|
250
|
-
// list(Array):所要更新的分组,type(String):更新类型,add为新增,delete为删除;
|
|
251
|
-
updateGroupSelect(e, t) {
|
|
252
|
-
e.forEach((i) => {
|
|
253
|
-
if (this.groupNodeObject[i]) {
|
|
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 = this.window[`group-${i}${this.aliasName}`] || [];
|
|
256
|
-
this.isSearchStatus && (o = this.window[`group-${i}-search`] || []);
|
|
257
|
-
let u = 0, a = 0;
|
|
258
|
-
o.forEach((h) => {
|
|
259
|
-
let c = this.equipCheckObject[h.equipNo];
|
|
260
|
-
!c || !c.checked ? u++ : a--;
|
|
261
|
-
});
|
|
262
|
-
let r = t ? u : a;
|
|
263
|
-
this.updateEquipSelect(i, o, t, r), this.updateEquipSelectCount(i, !1, r), this.updateSearchStatusObject(i, r);
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
// 清除分组挂载的半选设备
|
|
268
|
-
clearHalfCheckedEquips(e) {
|
|
269
|
-
e.forEach((t) => {
|
|
270
|
-
this.groupNodeObject[t].halfCheckedEquips && this.groupNodeObject[t].halfCheckedEquips.forEach((i) => {
|
|
271
|
-
this.equipControllObject[i] && this.equipControllObject[i].forEach((o) => {
|
|
272
|
-
this.setCheckStatus(`${t}-${i}-${o}`, !1, !1);
|
|
273
|
-
});
|
|
274
|
-
}), this.groupNodeObject[t].halfCheckedEquips = [], this.groupNodeObject[t].groups && this.groupNodeObject[t].groups.length > 0 && this.clearHalfCheckedEquips(this.groupNodeObject[t].groups.map((i) => i.key));
|
|
275
|
-
});
|
|
268
|
+
setEquipCheckObject(t, e, i, o) {
|
|
269
|
+
this.equipCheckObject[t] || (this.equipCheckObject[t] = {}), this.equipCheckObject[t].checked = e, this.equipCheckObject[t].indeterminate = i, this.equipCheckObject[t].groupId = o, !e && !i && delete this.equipCheckObject[t];
|
|
276
270
|
}
|
|
277
271
|
// 触发分组选择
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
this.
|
|
272
|
+
selectGroup(t) {
|
|
273
|
+
this.updateAllEquipStatus(t.key, t.checked), this.updateControlCheckStatus(), this.updateGroupCheckStatus();
|
|
274
|
+
}
|
|
275
|
+
// 更新分组下所有设备的选中状态
|
|
276
|
+
updateAllEquipStatus(t, e) {
|
|
277
|
+
const i = this.groupNodeObject[t];
|
|
278
|
+
if (!i) { return; }
|
|
279
|
+
(this.isSearchStatus ? this.window[`group-${t}-search`] || [] : this.window[`group-${t}${this.aliasName}`] || []).forEach((u) => {
|
|
280
|
+
const a = `${t}-${u.equipNo}`;
|
|
281
|
+
this.setEquipCheckObject(a, e, !1, t), this.nodesMap[a] && this.setCheckStatus(a, e, !1);
|
|
282
|
+
}), i.groups && i.groups.length > 0 && i.groups.forEach((u) => {
|
|
283
|
+
this.updateAllEquipStatus(u.key, e);
|
|
284
|
+
});
|
|
286
285
|
}
|
|
287
286
|
// 触发设备选择
|
|
288
287
|
/**
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
selectEquip(e) {
|
|
295
|
-
if (this.nodesMap[e.groupId]) {
|
|
296
|
-
let t = [{ equipNo: e.equipNo }], i = (e.checked ? 1 : -1) * t.length;
|
|
297
|
-
this.updateEquipSelect(e.groupId, t, e.checked, i), this.updateEquipSelectCount(e.groupId, !1, i), this.updateSearchStatusObject(e.groupId, i), this.updateControlCheckStatus(), this.updateGroupCheckStatus();
|
|
298
|
-
}
|
|
288
|
+
* 新方案:简化逻辑,只更新设备状态,分组状态由 updateGroupCheckStatus 统一计算
|
|
289
|
+
*/
|
|
290
|
+
selectEquip(t) {
|
|
291
|
+
const e = `${t.groupId}-${t.equipNo}`;
|
|
292
|
+
this.setEquipCheckObject(e, t.checked, !1, t.groupId), this.nodesMap[e] && this.setCheckStatus(e, t.checked, !1), this.updateControlCheckStatus(), this.updateGroupCheckStatus();
|
|
299
293
|
}
|
|
300
294
|
// 更新设备控制项存储
|
|
301
|
-
updateEquipControl(
|
|
302
|
-
this.equipControllObject[
|
|
295
|
+
updateEquipControl(t, e, i) {
|
|
296
|
+
this.equipControllObject[t] || (this.equipControllObject[t] = []), i ? this.equipControllObject[t].push(e) : this.equipControllObject[t] = this.equipControllObject[t].filter((o) => o != e);
|
|
303
297
|
}
|
|
304
298
|
// 触发控制项选择
|
|
305
299
|
/**
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
1)如果不仅有一个测点,设备半选分组+1,设备控制项(equipControllObject)记录剩余设备,设置设备半选
|
|
315
|
-
2)如果仅有一个测点,设置设备不选
|
|
316
|
-
2) 如果设备是半选情况下,如果还是半选,不做处理,如果从半选到不选情况下,分组挂载的半选分组-1,设备控制项有则-1,设置设备不选
|
|
317
|
-
* 3:更新分组状态
|
|
318
|
-
* */
|
|
319
|
-
selectControl(e) {
|
|
320
|
-
let t = this.nodesMap[`${e.groupId}-${e.equipNo}`];
|
|
321
|
-
t && (this.updateEquipControl(e.equipNo, e.setNo, e.checked), e.checked ? t.settings && t.settings.length == this.equipControllObject[e.equipNo].length ? (delete this.equipControllObject[e.equipNo], this.updateEquipSelectCount(e.groupId, !1, 1), this.updateSearchStatusObject(e.groupId, 1), this.nodesMap[e.groupId].halfCheckedEquips = this.nodesMap[e.groupId].halfCheckedEquips.filter((i) => i != e.equipNo), this.setEquipCheckObject(e.equipNo, !0, !1, e.groupId), this.setCheckStatus(`${e.groupId}-${e.equipNo}`, !0, !1)) : t && !t.indeterminate && (this.nodesMap[`${e.groupId}`].halfCheckedEquips.push(e.equipNo), this.setCheckStatus(`${e.groupId}-${e.equipNo}`, !1, !0), this.setEquipCheckObject(e.equipNo, !1, !0, e.groupId)) : t.checked ? (this.updateEquipSelectCount(e.groupId, !1, -1), this.updateSearchStatusObject(e.groupId, -1), t.settings.length > 1 ? (this.nodesMap[e.groupId].halfCheckedEquips.push(e.equipNo), t.settings.map((o) => o.setNo).filter((o) => o != e.setNo).forEach((o) => {
|
|
322
|
-
this.updateEquipControl(e.equipNo, o, !0);
|
|
323
|
-
}), this.setEquipCheckObject(e.equipNo, !1, !0, e.groupId), this.setCheckStatus(`${e.groupId}-${e.equipNo}`, !1, !0)) : (this.setEquipCheckObject(e.equipNo, !1, !1, e.groupId), this.setCheckStatus(`${e.groupId}-${e.equipNo}`, !1, !1))) : t.indeterminate && this.equipControllObject[e.equipNo] && !this.equipControllObject[e.equipNo].length && (this.nodesMap[e.groupId].halfCheckedEquips = this.nodesMap[e.groupId].halfCheckedEquips.filter((i) => i != e.equipNo), this.setEquipCheckObject(e.equipNo, !1, !1, e.groupId), this.setCheckStatus(`${e.groupId}-${e.equipNo}`, !1, !1)), this.updateGroupCheckStatus());
|
|
300
|
+
* 新方案:简化逻辑,只更新控制项和设备状态,分组状态由 updateGroupCheckStatus 统一计算
|
|
301
|
+
*/
|
|
302
|
+
selectControl(t) {
|
|
303
|
+
const e = `${t.groupId}-${t.equipNo}`, i = `${t.groupId}-${t.equipNo}-${t.setNo}`, o = this.nodesMap[e];
|
|
304
|
+
if (!o) { return; }
|
|
305
|
+
this.updateEquipControl(t.equipNo, t.setNo, t.checked), this.setCheckStatus(i, t.checked, !1);
|
|
306
|
+
const u = o.settings || [], a = this.equipControllObject[t.equipNo] || [], h = u.length, r = a.length;
|
|
307
|
+
t.checked ? r === h ? (delete this.equipControllObject[t.equipNo], this.setEquipCheckObject(e, !0, !1, t.groupId), this.setCheckStatus(e, !0, !1)) : (this.setEquipCheckObject(e, !1, !0, t.groupId), this.setCheckStatus(e, !1, !0)) : r === 0 ? (this.setEquipCheckObject(e, !1, !1, t.groupId), this.setCheckStatus(e, !1, !1)) : (this.setEquipCheckObject(e, !1, !0, t.groupId), this.setCheckStatus(e, !1, !0)), this.updateGroupCheckStatus();
|
|
324
308
|
}
|
|
325
309
|
}
|
|
326
|
-
class
|
|
310
|
+
class B extends m {
|
|
327
311
|
// 分组节点扁平化对象、设备扁平化对象、window缓存设备扁平化对象
|
|
328
|
-
constructor(
|
|
329
|
-
super(), this.aliasName =
|
|
312
|
+
constructor(t, e) {
|
|
313
|
+
super(), this.aliasName = e, this.groupNodeObject = t;
|
|
330
314
|
}
|
|
331
315
|
// 重新计算分组设备数量
|
|
332
|
-
resetGroupNum(e) {
|
|
316
|
+
resetGroupNum(t, e, i) {
|
|
333
317
|
this.clearAllEquipNum();
|
|
334
|
-
for (let
|
|
335
|
-
let
|
|
336
|
-
|
|
337
|
-
let
|
|
338
|
-
|
|
318
|
+
for (let o in this.groupNodeObject) {
|
|
319
|
+
let u = [];
|
|
320
|
+
t ? u = this.window[`group-${o}-search`] : u = this.window[`group-${o}${this.aliasName}`], e && u && u.length && (u = u.filter((h) => i[h.equipNo] === 2));
|
|
321
|
+
let a = u ? u.length : 0;
|
|
322
|
+
this.groupNodeObject[o].equipCount = a, a && this.setGroupNum(o, a);
|
|
339
323
|
}
|
|
340
324
|
}
|
|
341
325
|
clearAllEquipNum() {
|
|
342
|
-
for (let
|
|
326
|
+
for (let t in this.groupNodeObject) { this.groupNodeObject[t].equipCount = 0, this.groupNodeObject[t].count = 0; }
|
|
343
327
|
}
|
|
344
328
|
// 设置分组设备数量
|
|
345
|
-
setGroupNum(
|
|
346
|
-
this.groupNodeObject[
|
|
329
|
+
setGroupNum(t, e) {
|
|
330
|
+
this.groupNodeObject[t] && (this.groupNodeObject[t].count = Number(this.groupNodeObject[t].count) + Number(e), this.setGroupNum(this.groupNodeObject[t].groupId, e));
|
|
347
331
|
}
|
|
348
332
|
// 获取设备总数
|
|
349
333
|
getAllEquipsNum() {
|
|
350
|
-
let
|
|
351
|
-
for (let
|
|
352
|
-
return
|
|
334
|
+
let t = 0;
|
|
335
|
+
for (let e in this.groupNodeObject) { this.window[`group-${this.groupNodeObject[e].key}${this.aliasName}`] && (t = t + this.window[`group-${this.groupNodeObject[e].key}${this.aliasName}`].length); }
|
|
336
|
+
return t;
|
|
353
337
|
}
|
|
354
338
|
}
|
|
355
339
|
class $ {
|
|
356
|
-
constructor(
|
|
357
|
-
this.url =
|
|
340
|
+
constructor(t, e, i) {
|
|
341
|
+
this.url = t, this.connectionId = e, this.equipNo = i, this.signalr = null;
|
|
358
342
|
}
|
|
359
343
|
openConnect() {
|
|
360
|
-
return this.signalr && (this.signalr.stop(), this.signalr = null), this.signalr = new
|
|
344
|
+
return this.signalr && (this.signalr.stop(), this.signalr = null), this.signalr = new T.HubConnectionBuilder().withUrl(this.url).build(), this.signalr.serverTimeoutInMilliseconds = 5e8, this.signalr.keepaliveintervalinmilliseconds = 5e8, new Promise((t) => {
|
|
361
345
|
this.signalr.start().then(() => {
|
|
362
|
-
this.connectionId && this.send(),
|
|
363
|
-
}).catch((
|
|
364
|
-
console.log(
|
|
346
|
+
this.connectionId && this.send(), t(this.signalr);
|
|
347
|
+
}).catch((e) => {
|
|
348
|
+
console.log(e);
|
|
365
349
|
});
|
|
366
350
|
});
|
|
367
351
|
}
|
|
368
352
|
async send() {
|
|
369
353
|
try {
|
|
370
354
|
await this.signalr.invoke(this.connectionId, this.equipNo);
|
|
371
|
-
} catch (
|
|
372
|
-
console.log("connectHub 连接失败" +
|
|
355
|
+
} catch (t) {
|
|
356
|
+
console.log("connectHub 连接失败" + t);
|
|
373
357
|
}
|
|
374
358
|
}
|
|
375
359
|
}
|
|
376
|
-
class
|
|
377
|
-
constructor(
|
|
378
|
-
super(), this.equipStatusObject =
|
|
360
|
+
class U extends m {
|
|
361
|
+
constructor(t, e, i, o, u) {
|
|
362
|
+
super(), this.equipStatusObject = e, this.groupNodeObject = i, this.aleadyUpdateStatus = {}, this.isGetAllEquipStatus = !1, this.nodesMap = t, this.statusChange = o, this.openSignlr(), this.aliasName = u;
|
|
379
363
|
}
|
|
380
364
|
openSignlr() {
|
|
381
|
-
this.equipStatusSignlr = new $("/equipStatusMonitor", "", ""), this.equipStatusSignlr.openConnect().then((
|
|
365
|
+
this.equipStatusSignlr = new $("/equipStatusMonitor", "", ""), this.equipStatusSignlr.openConnect().then((t) => {
|
|
382
366
|
try {
|
|
383
|
-
|
|
384
|
-
} catch (
|
|
385
|
-
console.log(
|
|
367
|
+
t.invoke("GetAllEquipStatus");
|
|
368
|
+
} catch (e) {
|
|
369
|
+
console.log(e);
|
|
386
370
|
}
|
|
387
|
-
this.subscribeTo(
|
|
371
|
+
this.subscribeTo(t, "GetAllEquipStatus");
|
|
388
372
|
try {
|
|
389
|
-
|
|
390
|
-
} catch (
|
|
391
|
-
console.log(
|
|
373
|
+
t.invoke("GetEquipChangeStatus");
|
|
374
|
+
} catch (e) {
|
|
375
|
+
console.log(e);
|
|
392
376
|
}
|
|
393
|
-
|
|
377
|
+
t.onclose(() => {
|
|
394
378
|
this.openSignlr();
|
|
395
|
-
}), this.subscribeTo(
|
|
379
|
+
}), this.subscribeTo(t, "GetEquipChangeStatus");
|
|
396
380
|
});
|
|
397
381
|
}
|
|
398
|
-
subscribeTo(
|
|
399
|
-
|
|
400
|
-
i && i.isSuccess && i.data && (this[
|
|
382
|
+
subscribeTo(t, e) {
|
|
383
|
+
t.off(e), t.on(e, (i) => {
|
|
384
|
+
i && i.isSuccess && i.data && (this[e] ? this[e](i.data) : this.notice({ func: e, data: i.data, key: i.groupId }));
|
|
401
385
|
});
|
|
402
386
|
}
|
|
403
|
-
GetAllEquipStatus(
|
|
404
|
-
this.isGetAllEquipStatus = !0, this.resetGroupStatus(), Object.keys(
|
|
405
|
-
this.equipStatusObject[
|
|
406
|
-
}), Object.keys(this.groupNodeObject).forEach((
|
|
407
|
-
this.updateByGroup(
|
|
387
|
+
GetAllEquipStatus(t) {
|
|
388
|
+
this.isGetAllEquipStatus = !0, this.resetGroupStatus(), Object.keys(t).forEach((e) => {
|
|
389
|
+
this.equipStatusObject[e] = t[e];
|
|
390
|
+
}), Object.keys(this.groupNodeObject).forEach((e) => {
|
|
391
|
+
this.updateByGroup(e);
|
|
408
392
|
});
|
|
409
393
|
}
|
|
410
|
-
updateByGroup(
|
|
411
|
-
if (!this.aleadyUpdateStatus[
|
|
412
|
-
let
|
|
413
|
-
|
|
414
|
-
this.equipStatusObject[i.equipNo] ==
|
|
394
|
+
updateByGroup(t) {
|
|
395
|
+
if (!this.aleadyUpdateStatus[t]) {
|
|
396
|
+
let e = this.window[`group-${t}${this.aliasName}`] || [];
|
|
397
|
+
e.length && (this.aleadyUpdateStatus[t] = !0, e.some((i) => this.equipStatusObject[i.equipNo] == 0) && !e.some((i) => this.equipStatusObject[i.equipNo] == 2 || this.equipStatusObject[i.equipNo] == 6) && this.setOfflineStatus(t, e), e.forEach((i) => {
|
|
398
|
+
this.equipStatusObject[i.equipNo] == 2 ? this.setGroupStatus(t, !0, 2) : this.equipStatusObject[i.equipNo] == 6 && this.setGroupStatus(t, !0, 6), this.nodesMap[`${t}-${i.equipNo}`] && (this.nodesMap[`${t}-${i.equipNo}`].status = this.equipStatusObject[i.equipNo]);
|
|
415
399
|
}));
|
|
416
400
|
}
|
|
417
401
|
}
|
|
418
|
-
updateGroupStatus(
|
|
419
|
-
this.isGetAllEquipStatus && this.updateByGroup(
|
|
402
|
+
updateGroupStatus(t) {
|
|
403
|
+
this.isGetAllEquipStatus && this.updateByGroup(t);
|
|
420
404
|
}
|
|
421
|
-
GetEquipChangeStatus(
|
|
422
|
-
this.setStatus(
|
|
405
|
+
GetEquipChangeStatus(t) {
|
|
406
|
+
this.setStatus(t);
|
|
423
407
|
}
|
|
424
408
|
// 设置分组状态 key:扁平化数据中节点索引;type:类型(增加,减少);status:状态(报警2、双机热备6)
|
|
425
|
-
setGroupStatus(
|
|
426
|
-
|
|
409
|
+
setGroupStatus(t, e, i) {
|
|
410
|
+
e ? i == 2 ? (this.nodesMap[t].alarmCounts = this.nodesMap[t].alarmCounts + 1, this.nodesMap[t].alarmCounts > 0 && (this.nodesMap[t].status = 2)) : (this.nodesMap[t].backUpCounts = this.nodesMap[t].backUpCounts + 1, this.nodesMap[t].alarmCounts == 0 && this.nodesMap[t].backUpCounts > 0 && (this.nodesMap[t].status = 6)) : i == 2 ? (this.nodesMap[t].alarmCounts = this.nodesMap[t].alarmCounts - 1, this.nodesMap[t].alarmCounts == 0 && (this.nodesMap[t].status = 1)) : (this.nodesMap[t].backUpCounts = this.nodesMap[t].backUpCounts - 1, this.nodesMap[t].alarmCounts == 0 && (this.nodesMap[t].backUpCounts == 0 ? this.nodesMap[t].status = 1 : this.nodesMap[t].status = 6)), this.nodesMap[t].groupId && this.setGroupStatus(this.nodesMap[t].groupId, e, i);
|
|
411
|
+
}
|
|
412
|
+
setOfflineStatus(t) {
|
|
413
|
+
this.nodesMap[t].status != 2 && this.nodesMap[t].status != 6 && (this.nodesMap[t].status = 0, this.nodesMap[t].groupId && this.setOfflineStatus(this.nodesMap[t].groupId));
|
|
414
|
+
}
|
|
415
|
+
// 获取设备所属的所有分组ID
|
|
416
|
+
// 优先从 groupCache 反查(按分组隔离存储,数据准确),兜底从 equipCache 获取
|
|
417
|
+
getEquipGroupIds(t) {
|
|
418
|
+
const e = [];
|
|
419
|
+
if (this.window.groupCache && Object.keys(this.window.groupCache).forEach((i) => {
|
|
420
|
+
this.window.groupCache[i] && this.window.groupCache[i][t] && e.push(Number(i));
|
|
421
|
+
}), e.length === 0) {
|
|
422
|
+
const i = this.window.equipCache && this.window.equipCache[t];
|
|
423
|
+
if (i) {
|
|
424
|
+
if (i.groupIds && i.groupIds.length > 0) { return i.groupIds; }
|
|
425
|
+
i.groupId && e.push(i.groupId);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return e;
|
|
427
429
|
}
|
|
428
|
-
setStatus(
|
|
429
|
-
let
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
setStatus(t) {
|
|
431
|
+
let e = this.equipStatusObject[t.equipNo];
|
|
432
|
+
const i = this.getEquipGroupIds(t.equipNo);
|
|
433
|
+
t.status != 3 && i.length > 0 && (i.forEach((o) => {
|
|
434
|
+
switch (t.status) {
|
|
432
435
|
case 0:
|
|
433
|
-
|
|
436
|
+
e == 6 && this.setGroupStatus(o, !1, 6);
|
|
434
437
|
break;
|
|
435
438
|
case 1:
|
|
436
|
-
|
|
439
|
+
e == 6 ? this.setGroupStatus(o, !1, 6) : e == 2 && this.setGroupStatus(o, !1, 2);
|
|
437
440
|
break;
|
|
438
441
|
case 2:
|
|
439
|
-
|
|
442
|
+
e != 2 && this.setGroupStatus(o, !0, 2), e == 6 && this.setGroupStatus(o, !1, 6);
|
|
440
443
|
break;
|
|
441
444
|
case 6:
|
|
442
|
-
|
|
445
|
+
e == 2 && this.setGroupStatus(o, !1, 2), e != 6 && this.setGroupStatus(o, !0, 6);
|
|
443
446
|
break;
|
|
444
447
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
}
|
|
448
|
+
let u = `${o}-${t.equipNo}`;
|
|
449
|
+
this.nodesMap[u] && (this.nodesMap[u].status = t.status);
|
|
450
|
+
}), this.equipStatusObject[t.equipNo] = t.status, this.statusChange(i[0], t.equipNo, t.status));
|
|
449
451
|
}
|
|
450
452
|
// 重置分组状态
|
|
451
453
|
resetGroupStatus() {
|
|
452
|
-
for (let
|
|
454
|
+
for (let t in this.groupNodeObject) { this.groupNodeObject[t].alarmCounts = 0, this.groupNodeObject[t].backUpCount = 0; }
|
|
453
455
|
}
|
|
454
456
|
}
|
|
455
|
-
const
|
|
457
|
+
const W = {
|
|
456
458
|
getSetParm(s) {
|
|
457
|
-
if (window.axios) {
|
|
458
|
-
return window.axios({
|
|
459
|
+
if (window.AxiosBuilder.axios) {
|
|
460
|
+
return window.AxiosBuilder.axios({
|
|
459
461
|
method: "post",
|
|
460
462
|
url: "/IoT/api/v3/EquipList/GetFullSetParmByEquipNo",
|
|
461
463
|
params: s,
|
|
462
|
-
data: s
|
|
464
|
+
data: s,
|
|
465
|
+
headers: {
|
|
466
|
+
"Content-Type": "application/json;charset=UTF-8",
|
|
467
|
+
"Accept-Language": window.sessionStorage.languageType || "zh-CN"
|
|
468
|
+
}
|
|
463
469
|
});
|
|
464
470
|
}
|
|
465
471
|
}
|
|
466
|
-
},
|
|
472
|
+
}, K = Object.assign(
|
|
467
473
|
{},
|
|
468
|
-
|
|
474
|
+
W
|
|
469
475
|
);
|
|
470
|
-
class
|
|
471
|
-
constructor(
|
|
472
|
-
this.nodesMap =
|
|
476
|
+
class D {
|
|
477
|
+
constructor(t, e) {
|
|
478
|
+
this.nodesMap = t, this.equipControllObject = e;
|
|
473
479
|
}
|
|
474
480
|
// 获取设备控制项
|
|
475
|
-
async getSetting(
|
|
476
|
-
let [u, a] = String(
|
|
481
|
+
async getSetting(t, e, i, o) {
|
|
482
|
+
let [u, a] = String(t).split("-"), h = {
|
|
477
483
|
equipNo: a
|
|
478
484
|
};
|
|
479
|
-
await
|
|
480
|
-
if (
|
|
481
|
-
let
|
|
482
|
-
this.nodesMap[
|
|
483
|
-
|
|
484
|
-
}), this.nodesMap[
|
|
485
|
+
await K.getSetParm(h).then((r) => {
|
|
486
|
+
if (r.data.code == 200) {
|
|
487
|
+
let n = r && r.data && r.data.data && r.data.data.rows || [];
|
|
488
|
+
this.nodesMap[t].settings || (this.nodesMap[t].settings = []), n && n.length > 0 && this.nodesMap[t] && (n.forEach((c) => {
|
|
489
|
+
c.title = c.setNm, c.key = `${u}-${a}-${c.setNo}`, c.level = Number(i) + 1, c.checked = o || this.equipControllObject[a] && this.equipControllObject[a].includes(c.setNo), c.isSetting = !0, c.equipNo = a, c.groupId = u, c.setNo = c.setNo, c.equipName = e;
|
|
490
|
+
}), this.nodesMap[t].settings = [...n]);
|
|
485
491
|
}
|
|
486
492
|
});
|
|
487
493
|
}
|
|
488
494
|
}
|
|
489
|
-
class
|
|
490
|
-
static formateList(
|
|
495
|
+
class f {
|
|
496
|
+
static formateList(t, e) {
|
|
491
497
|
let i = [];
|
|
492
|
-
for (const o of
|
|
498
|
+
for (const o of t) {
|
|
493
499
|
let u = {};
|
|
494
|
-
u.count = 0, u.equipSelectCount = 0, u.controlSelectCount = 0, u.equipCount = o.equipCount || 0, u.title = o.name, u.key = o.id, u.isGroup = !0, u.children = [], u.status = 1, u.level =
|
|
495
|
-
...this.formateList(o.children,
|
|
500
|
+
u.count = 0, u.equipSelectCount = 0, u.controlSelectCount = 0, u.equipCount = o.equipCount || 0, u.title = o.name, u.key = o.id, u.isGroup = !0, u.children = [], u.status = 1, u.level = e || 1, u.expand = !e, u.equips = [], u.groupId = o.parentId, u.groups = [], u.alarmCounts = 0, u.backUpCounts = 0, u.indeterminate = !1, u.checked = !1, u.visible = !0, u.nodeEquipSelectCount = 0, u.checkedEquips = [], u.halfCheckedEquips = [], u.selectControlCount = 0, o.children && o.children.length > 0 && (u.groups = [
|
|
501
|
+
...this.formateList(o.children, e ? e + 1 : 2)
|
|
496
502
|
]), i.push(u);
|
|
497
503
|
}
|
|
498
504
|
return i;
|
|
499
505
|
}
|
|
500
|
-
static deepClone(
|
|
501
|
-
let
|
|
502
|
-
if (
|
|
503
|
-
for (let
|
|
504
|
-
|
|
506
|
+
static deepClone(t, e, i, o, u, a) {
|
|
507
|
+
let h = [];
|
|
508
|
+
if (t) {
|
|
509
|
+
for (let r = 0, n = t.length; r < n; r++) {
|
|
510
|
+
h.push(
|
|
505
511
|
{
|
|
506
512
|
isGroup: i,
|
|
507
|
-
key: `${o}-${
|
|
508
|
-
status: a[
|
|
509
|
-
title:
|
|
510
|
-
level:
|
|
513
|
+
key: `${o}-${t[r].id}`,
|
|
514
|
+
status: a[t[r].id] || 0,
|
|
515
|
+
title: t[r].title,
|
|
516
|
+
level: e,
|
|
511
517
|
expand: !1,
|
|
512
518
|
isEquip: !0,
|
|
513
519
|
loading: !1,
|
|
514
|
-
indeterminate: u[
|
|
515
|
-
checked: u[
|
|
520
|
+
indeterminate: u[`${t[r].groupId}-${t[r].equipNo}`] && u[`${t[r].groupId}-${t[r].equipNo}`].indeterminate || !1,
|
|
521
|
+
checked: u[`${t[r].groupId}-${t[r].equipNo}`] && u[`${t[r].groupId}-${t[r].equipNo}`].checked || !1,
|
|
516
522
|
groupId: o,
|
|
517
|
-
equipNo:
|
|
523
|
+
equipNo: t[r].id,
|
|
518
524
|
visible: !0,
|
|
519
525
|
settings: []
|
|
520
526
|
}
|
|
521
527
|
);
|
|
522
528
|
}
|
|
523
529
|
}
|
|
524
|
-
return
|
|
530
|
+
return h;
|
|
525
531
|
}
|
|
526
|
-
static copyOrigin(
|
|
527
|
-
let
|
|
528
|
-
return
|
|
529
|
-
|
|
530
|
-
}),
|
|
532
|
+
static copyOrigin(t) {
|
|
533
|
+
let e = [];
|
|
534
|
+
return t.forEach((i) => {
|
|
535
|
+
e.push({ ...i });
|
|
536
|
+
}), e;
|
|
531
537
|
}
|
|
532
538
|
// 获取分组位置
|
|
533
|
-
static getPosition(
|
|
539
|
+
static getPosition(t, e) {
|
|
534
540
|
let i = 0;
|
|
535
|
-
for (let o = 0, u =
|
|
536
|
-
if (
|
|
541
|
+
for (let o = 0, u = e.length; o < u; o++) {
|
|
542
|
+
if (e[o].key == t) {
|
|
537
543
|
i = o - 30;
|
|
538
544
|
break;
|
|
539
545
|
}
|
|
@@ -541,9 +547,9 @@ class d {
|
|
|
541
547
|
return i;
|
|
542
548
|
}
|
|
543
549
|
// 扁平化
|
|
544
|
-
static flattern(
|
|
545
|
-
|
|
546
|
-
i.isGroup && (
|
|
550
|
+
static flattern(t, e) {
|
|
551
|
+
t.forEach((i) => {
|
|
552
|
+
i.isGroup && (e[`${i.key}`] = null, e[`${i.key}`] = i), i.groups && i.groups.length && this.flattern(i.groups, e);
|
|
547
553
|
});
|
|
548
554
|
}
|
|
549
555
|
|
|
@@ -553,10 +559,10 @@ class d {
|
|
|
553
559
|
* @return {string}
|
|
554
560
|
*/
|
|
555
561
|
static generateUUID() {
|
|
556
|
-
let
|
|
557
|
-
return window.performance && typeof window.performance.now == "function" && (
|
|
558
|
-
let o = (
|
|
559
|
-
return
|
|
562
|
+
let t = (/* @__PURE__ */ new Date()).getTime();
|
|
563
|
+
return window.performance && typeof window.performance.now == "function" && (t += performance.now()), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(i) {
|
|
564
|
+
let o = (t + Math.random() * 16) % 16 | 0;
|
|
565
|
+
return t = Math.floor(t / 16), (i === "x" ? o : o & 3 | 8).toString(16);
|
|
560
566
|
});
|
|
561
567
|
}
|
|
562
568
|
|
|
@@ -565,97 +571,107 @@ class d {
|
|
|
565
571
|
* @param {list} 可构建树形结构的普通列表
|
|
566
572
|
* @return {string}
|
|
567
573
|
*/
|
|
568
|
-
static listToTreeList(
|
|
569
|
-
const
|
|
570
|
-
return
|
|
574
|
+
static listToTreeList(t) {
|
|
575
|
+
const e = t, i = [], o = {};
|
|
576
|
+
return e.forEach((u) => {
|
|
571
577
|
o[u.id] = u;
|
|
572
|
-
}),
|
|
578
|
+
}), e.forEach((u) => {
|
|
573
579
|
const a = o[u.parentId];
|
|
574
580
|
a ? (a.children || (a.children = [])).push(u) : i.push(u);
|
|
575
581
|
}), i;
|
|
576
582
|
}
|
|
577
583
|
}
|
|
578
|
-
class
|
|
584
|
+
class F extends m {
|
|
579
585
|
// 分组节点扁平化对象、设备扁平化对象、window缓存设备扁平化对象
|
|
580
|
-
constructor(
|
|
581
|
-
super(), this.showSettings =
|
|
586
|
+
constructor(t, e, i) {
|
|
587
|
+
super(), this.showSettings = e, this.groupNodeObject = t, this.aliasName = i;
|
|
582
588
|
}
|
|
583
589
|
// 触发搜索
|
|
584
|
-
filterMethod(
|
|
585
|
-
for (let
|
|
590
|
+
filterMethod(t) {
|
|
591
|
+
for (let e in this.groupNodeObject) { t && this.updateBySearch(e, t); }
|
|
586
592
|
}
|
|
587
593
|
// 搜索状态将搜索的结果存放缓存中
|
|
588
|
-
updateBySearch(
|
|
589
|
-
let i = this.window[`group-${this.groupNodeObject[
|
|
590
|
-
i && (i = i.filter((o) => o.title.includes(
|
|
594
|
+
updateBySearch(t, e) {
|
|
595
|
+
let i = this.window[`group-${this.groupNodeObject[t].key}${this.aliasName}`];
|
|
596
|
+
i && (i = i.filter((o) => o.title.includes(e)), this.window[`group-${this.groupNodeObject[t].key}-search`] = f.copyOrigin(i));
|
|
591
597
|
}
|
|
592
598
|
}
|
|
593
|
-
const
|
|
594
|
-
const
|
|
595
|
-
for (const [i, o] of
|
|
596
|
-
return
|
|
597
|
-
},
|
|
599
|
+
const O = (s, t) => {
|
|
600
|
+
const e = s.__vccOpts || s;
|
|
601
|
+
for (const [i, o] of t) { e[i] = o; }
|
|
602
|
+
return e;
|
|
603
|
+
}, J = {
|
|
598
604
|
props: {
|
|
599
605
|
source: {
|
|
600
|
-
type: Object
|
|
606
|
+
type: Object,
|
|
607
|
+
default: () => {
|
|
608
|
+
}
|
|
601
609
|
},
|
|
602
610
|
groupEditAndNew: {
|
|
603
|
-
type: Function
|
|
611
|
+
type: Function,
|
|
612
|
+
default: () => {
|
|
613
|
+
}
|
|
604
614
|
},
|
|
605
615
|
deleteGroup: {
|
|
606
|
-
type: Function
|
|
616
|
+
type: Function,
|
|
617
|
+
default: () => {
|
|
618
|
+
}
|
|
607
619
|
}
|
|
608
620
|
}
|
|
609
|
-
},
|
|
610
|
-
function
|
|
611
|
-
const a =
|
|
612
|
-
return
|
|
613
|
-
|
|
621
|
+
}, V = { class: "operates" };
|
|
622
|
+
function P(s, t, e, i, o, u) {
|
|
623
|
+
const a = C("el-button"), h = C("el-button-group"), r = C("el-popover");
|
|
624
|
+
return p(), d("div", V, [
|
|
625
|
+
b(r, {
|
|
614
626
|
placement: "bottom",
|
|
615
627
|
trigger: "hover"
|
|
616
628
|
}, {
|
|
617
|
-
reference:
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
629
|
+
reference: q(() => [
|
|
630
|
+
S("i", {
|
|
631
|
+
class: "el-icon-more",
|
|
632
|
+
onClick: t[3] || (t[3] = k(() => {
|
|
633
|
+
}, ["stop"]))
|
|
634
|
+
})
|
|
635
|
+
]),
|
|
636
|
+
default: q(() => [
|
|
637
|
+
b(h, { class: "new-button-group setModule" }, {
|
|
638
|
+
default: q(() => [
|
|
639
|
+
b(a, {
|
|
624
640
|
type: "text",
|
|
625
641
|
size: "small",
|
|
626
642
|
class: "elBtn",
|
|
627
643
|
icon: " iconfont icon-tubiao20_bianji",
|
|
628
|
-
onClick:
|
|
644
|
+
onClick: t[0] || (t[0] = k((n) => e.groupEditAndNew(!1, e.source), ["stop"]))
|
|
629
645
|
}, {
|
|
630
|
-
default:
|
|
631
|
-
|
|
646
|
+
default: q(() => [
|
|
647
|
+
M(N(s.$t("equipInfo.poverTips.rename")), 1)
|
|
632
648
|
]),
|
|
633
649
|
_: 1
|
|
634
650
|
}),
|
|
635
|
-
|
|
651
|
+
b(a, {
|
|
636
652
|
type: "text",
|
|
637
653
|
size: "small",
|
|
638
654
|
class: "elBtn",
|
|
639
655
|
icon: " iconfont icon-gw-icon-tianjia1",
|
|
640
|
-
onClick:
|
|
656
|
+
onClick: t[1] || (t[1] = (n) => e.groupEditAndNew(!0, e.source))
|
|
641
657
|
}, {
|
|
642
|
-
default:
|
|
643
|
-
|
|
658
|
+
default: q(() => [
|
|
659
|
+
M(N(s.$t("equipInfo.poverTips.newChildGroup")), 1)
|
|
644
660
|
]),
|
|
645
661
|
_: 1
|
|
646
662
|
}),
|
|
647
|
-
|
|
663
|
+
e.source.level != 1 ? (p(), E(a, {
|
|
648
664
|
key: 0,
|
|
649
665
|
type: "danger",
|
|
650
666
|
size: "small",
|
|
651
|
-
onClick:
|
|
667
|
+
onClick: t[2] || (t[2] = k((n) => e.deleteGroup(e.source), ["stop"])),
|
|
652
668
|
icon: " iconfont icon-tubiao20_shanchu"
|
|
653
669
|
}, {
|
|
654
|
-
default:
|
|
655
|
-
|
|
670
|
+
default: q(() => [
|
|
671
|
+
M(N(s.$t("publics.button.deletes")), 1)
|
|
656
672
|
]),
|
|
657
673
|
_: 1
|
|
658
|
-
})) :
|
|
674
|
+
})) : w("", !0)
|
|
659
675
|
]),
|
|
660
676
|
_: 1
|
|
661
677
|
})
|
|
@@ -664,7 +680,7 @@ function J(s, e, t, i, o, u) {
|
|
|
664
680
|
})
|
|
665
681
|
]);
|
|
666
682
|
}
|
|
667
|
-
const
|
|
683
|
+
const z = /* @__PURE__ */ O(J, [["render", P]]), R = {
|
|
668
684
|
name: "ElTreeVirtualNode",
|
|
669
685
|
componentName: "ElTreeVirtualNode",
|
|
670
686
|
props: {
|
|
@@ -718,8 +734,16 @@ const V = /* @__PURE__ */ E(K, [["render", J]]), P = {
|
|
|
718
734
|
deleteGroup: {
|
|
719
735
|
type: Function
|
|
720
736
|
},
|
|
737
|
+
childrenResetGroupNum: {
|
|
738
|
+
type: Function
|
|
739
|
+
},
|
|
740
|
+
getEquipStatus: {
|
|
741
|
+
type: Function
|
|
742
|
+
},
|
|
721
743
|
colorConfig: {
|
|
722
|
-
type: Object
|
|
744
|
+
type: Object,
|
|
745
|
+
default: () => {
|
|
746
|
+
}
|
|
723
747
|
},
|
|
724
748
|
index: {
|
|
725
749
|
type: Number,
|
|
@@ -727,39 +751,48 @@ const V = /* @__PURE__ */ E(K, [["render", J]]), P = {
|
|
|
727
751
|
}
|
|
728
752
|
},
|
|
729
753
|
components: {
|
|
730
|
-
oparate:
|
|
754
|
+
oparate: z
|
|
731
755
|
},
|
|
732
756
|
computed: {
|
|
733
757
|
getColor() {
|
|
734
758
|
return function(s) {
|
|
735
|
-
|
|
759
|
+
this.colorConfig || (this.colorConfig = {
|
|
760
|
+
noComm: "#a0a0a0",
|
|
761
|
+
normal: "#63e03f",
|
|
762
|
+
alarm: "#f22433",
|
|
763
|
+
lsSet: "#bebcaa",
|
|
764
|
+
initialize: "#289ac0",
|
|
765
|
+
withdraw: "#ffc0cb",
|
|
766
|
+
BackUp: "#f8901c"
|
|
767
|
+
});
|
|
768
|
+
let t;
|
|
736
769
|
switch (s) {
|
|
737
770
|
case 0:
|
|
738
|
-
|
|
771
|
+
t = this.colorConfig.noComm;
|
|
739
772
|
break;
|
|
740
773
|
case 1:
|
|
741
|
-
|
|
774
|
+
t = this.colorConfig.normal;
|
|
742
775
|
break;
|
|
743
776
|
case 2:
|
|
744
|
-
|
|
777
|
+
t = this.colorConfig.alarm;
|
|
745
778
|
break;
|
|
746
779
|
case 3:
|
|
747
|
-
|
|
780
|
+
t = this.colorConfig.lsSet;
|
|
748
781
|
break;
|
|
749
782
|
case 4:
|
|
750
|
-
|
|
783
|
+
t = this.colorConfig.initialize;
|
|
751
784
|
break;
|
|
752
785
|
case 5:
|
|
753
|
-
|
|
786
|
+
t = this.colorConfig.withdraw;
|
|
754
787
|
break;
|
|
755
788
|
case 6:
|
|
756
|
-
|
|
789
|
+
t = this.colorConfig.BackUp;
|
|
757
790
|
break;
|
|
758
791
|
default:
|
|
759
|
-
|
|
792
|
+
t = this.colorConfig.noComm;
|
|
760
793
|
break;
|
|
761
794
|
}
|
|
762
|
-
return
|
|
795
|
+
return t;
|
|
763
796
|
};
|
|
764
797
|
}
|
|
765
798
|
},
|
|
@@ -776,83 +809,85 @@ const V = /* @__PURE__ */ E(K, [["render", J]]), P = {
|
|
|
776
809
|
this.onChecked(this.source);
|
|
777
810
|
}
|
|
778
811
|
}
|
|
779
|
-
}, H = { class: "el-tree-node__content" },
|
|
812
|
+
}, H = { class: "el-tree-node__content" }, Q = { class: "nodeContent" }, X = {
|
|
780
813
|
key: 1,
|
|
781
814
|
class: "circle"
|
|
782
|
-
},
|
|
815
|
+
}, Y = { class: "label" }, Z = {
|
|
783
816
|
key: 2,
|
|
784
817
|
class: "equipNumber"
|
|
785
|
-
},
|
|
818
|
+
}, tt = {
|
|
786
819
|
key: 4,
|
|
787
820
|
class: "el-tree-node__loading-icon el-icon-loading"
|
|
788
821
|
};
|
|
789
|
-
function
|
|
790
|
-
const a =
|
|
791
|
-
return
|
|
792
|
-
class:
|
|
793
|
-
parent_tag:
|
|
794
|
-
child_tags: !
|
|
795
|
-
selectedColor:
|
|
822
|
+
function et(s, t, e, i, o, u) {
|
|
823
|
+
const a = C("el-checkbox"), h = C("oparate");
|
|
824
|
+
return p(), d("div", {
|
|
825
|
+
class: y(["el-tree-node", {
|
|
826
|
+
parent_tag: e.source.isGroup,
|
|
827
|
+
child_tags: !e.source.isGroup,
|
|
828
|
+
selectedColor: e.currentSelect === e.source.key && !e.source.isGroup
|
|
796
829
|
}]),
|
|
797
|
-
onClick:
|
|
830
|
+
onClick: t[2] || (t[2] = (...r) => u.clickFunction && u.clickFunction(...r))
|
|
798
831
|
}, [
|
|
799
|
-
|
|
800
|
-
|
|
832
|
+
S("div", H, [
|
|
833
|
+
S("span", {
|
|
801
834
|
class: "el-tree__indent",
|
|
802
835
|
"aria-hidden": "true",
|
|
803
|
-
style:
|
|
836
|
+
style: G({ width: (e.source.level - 1) * o.indent + "px" })
|
|
804
837
|
}, null, 4),
|
|
805
|
-
|
|
838
|
+
e.source.isGroup ? (p(), d("span", {
|
|
806
839
|
key: 0,
|
|
807
|
-
class:
|
|
840
|
+
class: y([
|
|
808
841
|
{
|
|
809
|
-
"is-leaf": !
|
|
810
|
-
expanded:
|
|
842
|
+
"is-leaf": !e.source.isGroup,
|
|
843
|
+
expanded: e.source.isGroup && e.source.expand
|
|
811
844
|
},
|
|
812
845
|
"el-tree-node__expand-icon",
|
|
813
|
-
"
|
|
846
|
+
"iconfont icon-fangxiangL"
|
|
814
847
|
])
|
|
815
|
-
}, null, 2)) :
|
|
816
|
-
|
|
817
|
-
|
|
848
|
+
}, null, 2)) : w("", !0),
|
|
849
|
+
S("div", Q, [
|
|
850
|
+
e.showCheckbox ? (p(), E(a, {
|
|
818
851
|
key: 0,
|
|
819
|
-
|
|
820
|
-
"
|
|
821
|
-
|
|
852
|
+
onClick: t[0] || (t[0] = k(() => {
|
|
853
|
+
}, ["stop"])),
|
|
854
|
+
modelValue: e.source.checked,
|
|
855
|
+
"onUpdate:modelValue": t[1] || (t[1] = (r) => e.source.checked = r),
|
|
856
|
+
indeterminate: e.source.indeterminate,
|
|
822
857
|
onChange: u.checkedChange
|
|
823
|
-
}, null, 8, ["modelValue", "indeterminate", "onChange"])) :
|
|
824
|
-
|
|
825
|
-
|
|
858
|
+
}, null, 8, ["modelValue", "indeterminate", "onChange"])) : w("", !0),
|
|
859
|
+
e.showStatus ? (p(), d("span", X, [
|
|
860
|
+
e.source.status != 6 ? (p(), d("span", {
|
|
826
861
|
key: 0,
|
|
827
862
|
class: "yd",
|
|
828
|
-
style:
|
|
829
|
-
}, null, 4)) : (
|
|
863
|
+
style: G({ backgroundColor: u.getColor(e.source.status) })
|
|
864
|
+
}, null, 4)) : (p(), d("i", {
|
|
830
865
|
key: 1,
|
|
831
|
-
style:
|
|
866
|
+
style: G({ color: e.colorConfig.BackUp }),
|
|
832
867
|
class: "iconfont icon-gw-icon-beiji2"
|
|
833
868
|
}, null, 4))
|
|
834
|
-
])) :
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
869
|
+
])) : w("", !0),
|
|
870
|
+
S("span", Y, N(e.source.title), 1),
|
|
871
|
+
e.source.isGroup && !e.source.isEquip || e.source.isGroup && !e.source.isEquip ? (p(), d("span", Z, N(e.source.count), 1)) : w("", !0),
|
|
872
|
+
e.source.isGroup && e.showOperate ? (p(), E(h, {
|
|
838
873
|
key: 3,
|
|
839
|
-
source:
|
|
840
|
-
groupEditAndNew:
|
|
841
|
-
deleteGroup:
|
|
842
|
-
}, null, 8, ["source", "groupEditAndNew", "deleteGroup"])) :
|
|
843
|
-
|
|
874
|
+
source: e.source,
|
|
875
|
+
groupEditAndNew: e.groupEditAndNew,
|
|
876
|
+
deleteGroup: e.deleteGroup
|
|
877
|
+
}, null, 8, ["source", "groupEditAndNew", "deleteGroup"])) : w("", !0),
|
|
878
|
+
e.source.loading ? (p(), d("span", tt)) : w("", !0)
|
|
844
879
|
])
|
|
845
880
|
])
|
|
846
881
|
], 2);
|
|
847
882
|
}
|
|
848
|
-
const
|
|
883
|
+
const it = /* @__PURE__ */ O(R, [["render", et]]), st = {
|
|
849
884
|
components: {
|
|
850
885
|
VirtualList: I
|
|
851
886
|
},
|
|
852
|
-
mixins: [
|
|
887
|
+
mixins: [x],
|
|
853
888
|
data() {
|
|
854
889
|
return {
|
|
855
|
-
itemComponent:
|
|
890
|
+
itemComponent: it,
|
|
856
891
|
//节点组件
|
|
857
892
|
visibleList: [],
|
|
858
893
|
//虚拟滚动所需要的列表
|
|
@@ -886,7 +921,9 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
886
921
|
//绑定所有的已选中的设备控制项
|
|
887
922
|
expandGroup: [],
|
|
888
923
|
//记录已展开的分组
|
|
889
|
-
updateJob: null
|
|
924
|
+
updateJob: null,
|
|
925
|
+
filterEquipList: []
|
|
926
|
+
//过滤条件下新增的设备列表,由于设备开始状态都是0,因而需要单独维护
|
|
890
927
|
};
|
|
891
928
|
},
|
|
892
929
|
props: {
|
|
@@ -895,8 +932,8 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
895
932
|
type: Array
|
|
896
933
|
},
|
|
897
934
|
selectEquips: {
|
|
898
|
-
|
|
899
|
-
type: Array,
|
|
935
|
+
//设备选中列表,用于回显,如权限管理。支持数组格式 [equipNo] 或对象格式 { groupId: [equipNo] }
|
|
936
|
+
type: [Array, Object],
|
|
900
937
|
default: () => []
|
|
901
938
|
},
|
|
902
939
|
controllList: {
|
|
@@ -926,6 +963,11 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
926
963
|
type: Boolean,
|
|
927
964
|
default: !1
|
|
928
965
|
},
|
|
966
|
+
filterEquip: {
|
|
967
|
+
//是否过滤
|
|
968
|
+
type: Boolean,
|
|
969
|
+
default: !1
|
|
970
|
+
},
|
|
929
971
|
showOperate: {
|
|
930
972
|
// 是否展示操作按钮
|
|
931
973
|
type: Boolean,
|
|
@@ -953,10 +995,14 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
953
995
|
default: ""
|
|
954
996
|
},
|
|
955
997
|
buildTree: {
|
|
956
|
-
type: Function
|
|
998
|
+
type: Function,
|
|
999
|
+
default: () => {
|
|
1000
|
+
}
|
|
957
1001
|
},
|
|
958
1002
|
filterData: {
|
|
959
|
-
type: Function
|
|
1003
|
+
type: Function,
|
|
1004
|
+
default: () => {
|
|
1005
|
+
}
|
|
960
1006
|
},
|
|
961
1007
|
alias: {
|
|
962
1008
|
type: String,
|
|
@@ -965,13 +1011,20 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
965
1011
|
},
|
|
966
1012
|
watch: {
|
|
967
1013
|
data(s) {
|
|
968
|
-
s && s.length && (
|
|
1014
|
+
s && s.length && (f.flattern(this.data, this.groupNodeObject), this.cacheManage.addNodesMap(Object.values(this.groupNodeObject).map((t) => t)), this.init());
|
|
969
1015
|
},
|
|
970
1016
|
controllList(s) {
|
|
971
1017
|
this.updateCheckedStatusWithControls();
|
|
972
1018
|
},
|
|
973
1019
|
selectEquips(s) {
|
|
974
|
-
this.updateCheckedStatusWithEquips()
|
|
1020
|
+
this.updateCheckedStatusWithEquips(), this.$nextTick(() => {
|
|
1021
|
+
this.checkStatusManage && this.checkStatusManage.updateGroupCheckStatus();
|
|
1022
|
+
});
|
|
1023
|
+
},
|
|
1024
|
+
filterEquip(s) {
|
|
1025
|
+
this.$nextTick(() => {
|
|
1026
|
+
this.visibleList = [], this.$refs.virtualList.scrollToIndex(0), this.updateTreeList(this.data), this.equipNumManage.resetGroupNum(this.isSearchStatus, s, this.equipStatusObject);
|
|
1027
|
+
});
|
|
975
1028
|
}
|
|
976
1029
|
},
|
|
977
1030
|
computed: {
|
|
@@ -980,7 +1033,7 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
980
1033
|
}
|
|
981
1034
|
},
|
|
982
1035
|
created() {
|
|
983
|
-
this.showCheckbox && (this.checkStatusManage = new
|
|
1036
|
+
this.showCheckbox && (this.checkStatusManage = new A(this.groupNodeObject, this.nodesMap, this.equipControllObject, this.controlObject, this.equipCheckObject, this.aliasName)), this.cacheManage = new v(this.groupNodeObject, this.nodesMap, this.controlObject, this.equipCheckObject), this.searchManage = new F(this.groupNodeObject, this.showSettings, this.aliasName), this.equipNumManage = new B(this.groupNodeObject, this.aliasName), this.requestManage = new D(this.nodesMap, this.equipControllObject);
|
|
984
1037
|
},
|
|
985
1038
|
mounted() {
|
|
986
1039
|
this.updateCheckedStatusWithControls(), this.updateCheckedStatusWithEquips(), window.addEventListener("message", (s) => {
|
|
@@ -991,16 +1044,16 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
991
1044
|
// 初始化
|
|
992
1045
|
init() {
|
|
993
1046
|
this.data[0].expand = !0, this.updateTreeList(), setTimeout(() => {
|
|
994
|
-
Object.values(this.groupNodeObject).forEach((s) => {
|
|
1047
|
+
Object.values(this.groupNodeObject).forEach((s, t) => {
|
|
995
1048
|
!s.expand && this.expandGroup.includes(s.key) && (s.expand = !0), this.filterWithAlias(s.key), this.updateGroupEquips(s.key, !0);
|
|
996
|
-
}), this.
|
|
997
|
-
},
|
|
1049
|
+
}), this.showCheckbox && this.checkStatusManage && this.checkStatusManage.updateGroupCheckStatus(), this.showStatus && !this.equipStatusManage && (this.equipStatusManage = new U(this.nodesMap, this.equipStatusObject, this.groupNodeObject, this.statusChange, this.aliasName));
|
|
1050
|
+
}, 500);
|
|
998
1051
|
},
|
|
999
1052
|
// 根据条件过滤
|
|
1000
1053
|
filterWithAlias(s) {
|
|
1001
1054
|
if (this.aliasName) {
|
|
1002
|
-
let
|
|
1003
|
-
this.window[`group-${s}${this.aliasName}`] = this.filterData(
|
|
1055
|
+
let t = this.window[`group-${s}`] || [];
|
|
1056
|
+
this.window[`group-${s}${this.aliasName}`] = this.filterData(t);
|
|
1004
1057
|
}
|
|
1005
1058
|
},
|
|
1006
1059
|
// 更新当前选中
|
|
@@ -1008,53 +1061,49 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
1008
1061
|
this.window.equipCache && this.window.equipCache[this.currentNodeKey] && (this.currentSelect = `${this.window.equipCache[this.currentNodeKey].groupId}-${this.currentNodeKey}`);
|
|
1009
1062
|
},
|
|
1010
1063
|
// 设备状态变化
|
|
1011
|
-
statusChange(s,
|
|
1012
|
-
this.currentSelect == `${s}-${
|
|
1064
|
+
statusChange(s, t, e) {
|
|
1065
|
+
this.currentSelect == `${s}-${t}` && this.$emit("statusChange", t, e);
|
|
1013
1066
|
},
|
|
1014
1067
|
// 更新checkbox选中状态
|
|
1015
1068
|
updateCheckWidthJob() {
|
|
1016
|
-
this.showCheckbox && (this.checkStatusManage.resetCheckedStatus(), this.updateCheckedStatusWithControls(), this.updateCheckedStatusWithEquips());
|
|
1069
|
+
this.showCheckbox && (this.checkStatusManage.resetCheckedStatus(), this.updateCheckedStatusWithControls(), this.updateCheckedStatusWithEquips(), this.checkStatusManage && this.checkStatusManage.updateGroupCheckStatus());
|
|
1017
1070
|
},
|
|
1018
1071
|
// 通过外框更新设备
|
|
1019
|
-
updateGroupEquips(s,
|
|
1072
|
+
updateGroupEquips(s, t) {
|
|
1020
1073
|
if (!this.isSearchStatus && this.groupNodeObject[s]) {
|
|
1021
|
-
let
|
|
1022
|
-
this.$emit("getTotal",
|
|
1023
|
-
}
|
|
1024
|
-
if (e) {
|
|
1025
|
-
let t = this.window[`group-${s}${this.aliasName}`] || [];
|
|
1026
|
-
this.equipNumManage.setGroupNum(s, t.length);
|
|
1074
|
+
let e = this.equipNumManage.getAllEquipsNum();
|
|
1075
|
+
this.$emit("getTotal", e);
|
|
1027
1076
|
}
|
|
1028
|
-
this.groupNodeObject[s].expand && this.updateList(s, this.groupNodeObject[s].level, null, !1);
|
|
1077
|
+
this.equipNumManage.resetGroupNum(this.isSearchStatus, this.filterEquip, this.equipStatusObject), this.groupNodeObject[s].expand && this.updateList(s, this.groupNodeObject[s].level, null, !1);
|
|
1029
1078
|
},
|
|
1030
1079
|
// 展开的时候从缓存中拿设备数据到equips中并更新视图
|
|
1031
1080
|
updateList(s) {
|
|
1032
1081
|
if (this.groupNodeObject[s]) {
|
|
1033
|
-
let
|
|
1034
|
-
this.isSearchStatus ? (
|
|
1082
|
+
let t = [];
|
|
1083
|
+
this.isSearchStatus ? (t = this.window[`group-${s}-search`], this.groupNodeObject[s].equips = [...f.deepClone(t, Number(this.groupNodeObject[s].level) + 1, this.showSettings, s, this.equipCheckObject, this.equipStatusObject)]) : (t = this.window[`group-${s}${this.aliasName}`], this.groupNodeObject[s].equips = [...f.deepClone(t, 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.showCheckbox && this.checkStatusManage && t && t.length && this.checkStatusManage.updateGroupCheckStatus(), this.showStatus && this.equipStatusManage && this.equipStatusManage.updateGroupStatus(s), this.updateCurrentSelect();
|
|
1035
1084
|
}
|
|
1036
1085
|
},
|
|
1037
1086
|
// 更新整个树形结构
|
|
1038
1087
|
updateTreeList(s) {
|
|
1039
|
-
s && s.forEach((
|
|
1040
|
-
this.visibleList.push(
|
|
1088
|
+
s && s.length > 0 && s.forEach((t) => {
|
|
1089
|
+
this.filterEquip && t.status === 2 ? this.filterEquipList.includes(t.equipNo) || this.visibleList.push(t) : this.filterEquip || this.visibleList.push(t), t.expand ? t.isEquip ? (t.children || (t.children = []), t.settings && (t.children = [...t.settings || []])) : t.children = [...t.equips || [], ...t.groups || []] : t.children = [], this.updateTreeList(t.children || []);
|
|
1041
1090
|
});
|
|
1042
1091
|
},
|
|
1043
1092
|
// 节点点击事件
|
|
1044
|
-
nodeClick(s,
|
|
1045
|
-
this.$emit("node-click", { ...s, key: s.isEquip ? s.equipNo : s.key }), s.isGroup ? s.isEquip ? this.equipClick(s,
|
|
1093
|
+
nodeClick(s, t, e, i) {
|
|
1094
|
+
this.$emit("node-click", { ...s, key: s.isEquip ? s.equipNo : s.key }), s.isGroup ? s.isEquip ? this.equipClick(s, t, i) : this.groupClick(s, t, i) : this.currentSelect = s.key;
|
|
1046
1095
|
},
|
|
1047
|
-
groupClick(s,
|
|
1048
|
-
s.expand ? this.updateList(s.key, s.level,
|
|
1096
|
+
groupClick(s, t, e) {
|
|
1097
|
+
s.expand ? this.updateList(s.key, s.level, t, e) : (this.cacheManage.recycleGroupCache(s.key), this.visibleList = [], this.updateTreeList(this.data));
|
|
1049
1098
|
},
|
|
1050
|
-
async equipClick(s,
|
|
1051
|
-
this.showSettings && (s.expand ? (s.loading = !0, await this.requestManage.getSetting(s.key, s.title, s.level,
|
|
1099
|
+
async equipClick(s, t, e) {
|
|
1100
|
+
this.showSettings && (s.expand ? (s.loading = !0, await this.requestManage.getSetting(s.key, s.title, s.level, e), this.controlObject[`${s.groupId}-${s.equipNo}`] = { groupId: s.groupId }, s.loading = !1, this.visibleList.splice(t + 1, 0, ...this.nodesMap[s.key].settings), this.cacheManage.addNodesMap(this.nodesMap[s.key].settings)) : (this.visibleList.splice(t + 1, this.nodesMap[s.key].settings.length), this.cacheManage.removeNodesMap(this.nodesMap[s.key].settings), this.nodesMap[s.key].settings = [], delete this.controlObject[`${s.groupId}-${s.equipNo}`]));
|
|
1052
1101
|
},
|
|
1053
1102
|
onChecked(s) {
|
|
1054
1103
|
this.checkStatusManage && this.checkStatusManage.onChecked(s, this.isSearchStatus), this.$emit("onCheck");
|
|
1055
1104
|
},
|
|
1056
|
-
groupEditAndNew(s,
|
|
1057
|
-
this.$emit("groupEditAndNew", { isGroupNew: s, node:
|
|
1105
|
+
groupEditAndNew(s, t) {
|
|
1106
|
+
this.$emit("groupEditAndNew", { isGroupNew: s, node: t });
|
|
1058
1107
|
},
|
|
1059
1108
|
deleteGroup(s) {
|
|
1060
1109
|
this.$emit("deleteGroup", s);
|
|
@@ -1063,7 +1112,7 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
1063
1112
|
this.controllList && this.controllList.length && this.checkStatusManage && this.checkStatusManage && this.checkStatusManage.updateCheckedStatusWithControls(this.controllList);
|
|
1064
1113
|
},
|
|
1065
1114
|
updateCheckedStatusWithEquips() {
|
|
1066
|
-
this.selectEquips && this.selectEquips.length && this.checkStatusManage && this.checkStatusManage && this.checkStatusManage.updateCheckedStatusWithEquips(this.selectEquips);
|
|
1115
|
+
this.selectEquips && (this.selectEquips.length || Object.keys(this.selectEquips).length) && this.checkStatusManage && this.checkStatusManage && this.checkStatusManage.updateCheckedStatusWithEquips(this.selectEquips);
|
|
1067
1116
|
},
|
|
1068
1117
|
resetCheckedStatus() {
|
|
1069
1118
|
this.checkStatusManage && this.checkStatusManage.resetCheckedStatus();
|
|
@@ -1077,6 +1126,14 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
1077
1126
|
return this.checkStatusManage && this.checkStatusManage.getEquipSelectd();
|
|
1078
1127
|
},
|
|
1079
1128
|
|
|
1129
|
+
/**
|
|
1130
|
+
* @description 获取选择的设备(携带分组)
|
|
1131
|
+
* @return Array
|
|
1132
|
+
*/
|
|
1133
|
+
getEquipGroupSelectd() {
|
|
1134
|
+
return this.checkStatusManage && this.checkStatusManage.getEquipGroupSelectd();
|
|
1135
|
+
},
|
|
1136
|
+
|
|
1080
1137
|
/**
|
|
1081
1138
|
* @description 获取选择的设备控制项
|
|
1082
1139
|
* @return Array
|
|
@@ -1116,7 +1173,7 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
1116
1173
|
filterMethod(s) {
|
|
1117
1174
|
this.visibleList = [], this.cacheManage.recycleAllNodeCache(), s ? (this.isSearchStatus = !0, this.searchManage.filterMethod(s)) : this.isSearchStatus = !1, this.init(), this.$nextTick(() => {
|
|
1118
1175
|
this.$refs.virtualList.scrollToIndex(0);
|
|
1119
|
-
}), this.equipNumManage.resetGroupNum(this.isSearchStatus), this.showCheckbox && (this.checkStatusManage && this.checkStatusManage.reComputedCheckNum(this.isSearchStatus), this.checkStatusManage && this.checkStatusManage.updateGroupCheckStatus());
|
|
1176
|
+
}), this.equipNumManage.resetGroupNum(this.isSearchStatus, this.filterEquip, this.equipStatusObject), this.showCheckbox && (this.checkStatusManage && this.checkStatusManage.reComputedCheckNum(this.isSearchStatus), this.checkStatusManage && this.checkStatusManage.updateGroupCheckStatus());
|
|
1120
1177
|
},
|
|
1121
1178
|
// 重新构建树
|
|
1122
1179
|
rebuildTree() {
|
|
@@ -1146,10 +1203,10 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
1146
1203
|
* @return 无返回值
|
|
1147
1204
|
*/
|
|
1148
1205
|
DeleteEquip(s) {
|
|
1149
|
-
const { groupId:
|
|
1150
|
-
|
|
1151
|
-
let o = this.nodesMap[`${
|
|
1152
|
-
o && (this.currentSelect.toString().includes(i.id) && this.$emit("currentDelete"), this.showStatus && (o.status == 2
|
|
1206
|
+
const { groupId: t, equips: e } = s || {};
|
|
1207
|
+
t && this.groupNodeObject[t] && (this.updateGroupEquips(s.groupId), this.equipNumManage.resetGroupNum(), this.checkStatusManage && this.checkStatusManage.resetCheckedStatus()), e.length && e.forEach((i) => {
|
|
1208
|
+
let o = this.nodesMap[`${t}-${i.id}`];
|
|
1209
|
+
o && (this.currentSelect.toString().includes(i.id) && this.$emit("currentDelete"), this.showStatus && (o.status == 2 ? this.equipStatusManage.setGroupStatus(t, !1, 2) : o.status == 6 && this.equipStatusManage.setGroupStatus(t, !1, 6)), delete this.nodesMap[`${t}-${i.id}`], delete this.equipCheckObject[i.id]), delete this.equipStatusObject[i.id];
|
|
1153
1210
|
});
|
|
1154
1211
|
},
|
|
1155
1212
|
|
|
@@ -1159,10 +1216,10 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
1159
1216
|
* @return 无返回值
|
|
1160
1217
|
*/
|
|
1161
1218
|
moveEquips(s) {
|
|
1162
|
-
const { updateGroups:
|
|
1163
|
-
!
|
|
1219
|
+
const { updateGroups: t, buildTree: e } = s || {};
|
|
1220
|
+
!e && t ? t.forEach((i) => {
|
|
1164
1221
|
i && this.groupNodeObject[i] && (this.updateGroupEquips(i), this.equipNumManage.resetGroupNum(), this.checkStatusManage && this.checkStatusManage.resetCheckedStatus());
|
|
1165
|
-
}) :
|
|
1222
|
+
}) : e && this.rebuildTree();
|
|
1166
1223
|
},
|
|
1167
1224
|
|
|
1168
1225
|
/**
|
|
@@ -1171,8 +1228,8 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
1171
1228
|
* @return 无返回值
|
|
1172
1229
|
*/
|
|
1173
1230
|
DeleteEquipGroup(s) {
|
|
1174
|
-
s.forEach((
|
|
1175
|
-
|
|
1231
|
+
s.forEach((t) => {
|
|
1232
|
+
t.groupId && this.nodesMap[t.groupId] && (this.isSearchStatus || this.rebuildTree());
|
|
1176
1233
|
});
|
|
1177
1234
|
},
|
|
1178
1235
|
|
|
@@ -1182,8 +1239,8 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
1182
1239
|
* @return 无返回值
|
|
1183
1240
|
*/
|
|
1184
1241
|
AddEquipGroup(s) {
|
|
1185
|
-
const { parentGroupId:
|
|
1186
|
-
|
|
1242
|
+
const { parentGroupId: t, groupId: e } = s || {};
|
|
1243
|
+
e && this.nodesMap[t] && this.treeType && (this.isSearchStatus || this.rebuildTree());
|
|
1187
1244
|
},
|
|
1188
1245
|
|
|
1189
1246
|
/** 编辑分组
|
|
@@ -1192,8 +1249,8 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
1192
1249
|
* @return 无返回值
|
|
1193
1250
|
*/
|
|
1194
1251
|
EditEquipGroup(s) {
|
|
1195
|
-
const { groupId:
|
|
1196
|
-
this.nodesMap[
|
|
1252
|
+
const { groupId: t, groupName: e } = s;
|
|
1253
|
+
this.nodesMap[t] && (this.nodesMap[t].title = e);
|
|
1197
1254
|
},
|
|
1198
1255
|
|
|
1199
1256
|
/**
|
|
@@ -1202,33 +1259,50 @@ const ee = /* @__PURE__ */ E(P, [["render", Z]]), te = {
|
|
|
1202
1259
|
* @return 无返回值
|
|
1203
1260
|
*/
|
|
1204
1261
|
AddEquip(s) {
|
|
1205
|
-
|
|
1206
|
-
e && (this.isSearchStatus || this.rebuildTree());
|
|
1262
|
+
this.filterEquip && (this.filterEquipList = s == null ? void 0 : s.equips.map((t) => t.id)), this.init();
|
|
1207
1263
|
},
|
|
1208
1264
|
|
|
1209
1265
|
/**
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1266
|
+
* @description 新增分组设备
|
|
1267
|
+
* @param {data} {分组Id,设备}
|
|
1268
|
+
* @return 无返回值
|
|
1213
1269
|
*/
|
|
1214
1270
|
EditEquip(s) {
|
|
1215
|
-
const { equipNo:
|
|
1216
|
-
this.nodesMap[`${
|
|
1271
|
+
const { equipNo: t, groupId: e, equipName: i } = s || {};
|
|
1272
|
+
this.nodesMap[`${e}-${t}`] && (this.isSearchStatus || (this.nodesMap[`${e}-${t}`].title = i));
|
|
1273
|
+
},
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* @description 重置分组数量
|
|
1277
|
+
* @param {isSearchStatus} {是否查询状态}
|
|
1278
|
+
* @return 无返回值
|
|
1279
|
+
*/
|
|
1280
|
+
childrenResetGroupNum(s) {
|
|
1281
|
+
this.equipNumManage.resetGroupNum(s, this.filterEquip, this.equipStatusObject);
|
|
1282
|
+
},
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* @description 获取设备状态
|
|
1286
|
+
* @param {data} {equipNo}
|
|
1287
|
+
* @return arry[equipNo]
|
|
1288
|
+
*/
|
|
1289
|
+
getEquipStatus(s) {
|
|
1290
|
+
return this.equipStatusManage.equipStatusObject[s];
|
|
1217
1291
|
}
|
|
1218
1292
|
// 通过外框事件更新树形结构数据--end
|
|
1219
1293
|
}
|
|
1220
|
-
},
|
|
1294
|
+
}, ot = {
|
|
1221
1295
|
class: "gw-tree",
|
|
1222
1296
|
style: { height: "100%" }
|
|
1223
|
-
},
|
|
1297
|
+
}, ut = {
|
|
1224
1298
|
class: "tree",
|
|
1225
1299
|
style: { height: "100%" }
|
|
1226
1300
|
};
|
|
1227
|
-
function
|
|
1228
|
-
const a =
|
|
1229
|
-
return
|
|
1230
|
-
|
|
1231
|
-
|
|
1301
|
+
function at(s, t, e, i, o, u) {
|
|
1302
|
+
const a = C("virtual-list", !0);
|
|
1303
|
+
return p(), d("div", ot, [
|
|
1304
|
+
S("div", ut, [
|
|
1305
|
+
b(a, {
|
|
1232
1306
|
ref: "virtualList",
|
|
1233
1307
|
class: "virtualList",
|
|
1234
1308
|
"data-key": "key",
|
|
@@ -1238,21 +1312,24 @@ function oe(s, e, t, i, o, u) {
|
|
|
1238
1312
|
"extra-props": {
|
|
1239
1313
|
currentSelect: o.currentSelect,
|
|
1240
1314
|
nodeClick: u.nodeClick,
|
|
1241
|
-
showStatus:
|
|
1242
|
-
|
|
1243
|
-
|
|
1315
|
+
showStatus: e.showStatus,
|
|
1316
|
+
filterEquip: e.filterEquip,
|
|
1317
|
+
showSettings: e.showSettings,
|
|
1318
|
+
showCheckbox: e.showCheckbox,
|
|
1244
1319
|
onChecked: u.onChecked,
|
|
1245
|
-
showOperate:
|
|
1320
|
+
showOperate: e.showOperate,
|
|
1246
1321
|
groupEditAndNew: u.groupEditAndNew,
|
|
1247
1322
|
deleteGroup: u.deleteGroup,
|
|
1248
|
-
colorConfig:
|
|
1323
|
+
colorConfig: e.colorConfig,
|
|
1324
|
+
childrenResetGroupNum: u.childrenResetGroupNum,
|
|
1325
|
+
getEquipStatus: u.getEquipStatus
|
|
1249
1326
|
}
|
|
1250
1327
|
}, null, 8, ["data-sources", "data-component", "extra-props"])
|
|
1251
1328
|
])
|
|
1252
1329
|
]);
|
|
1253
1330
|
}
|
|
1254
|
-
const
|
|
1255
|
-
class
|
|
1331
|
+
const rt = /* @__PURE__ */ O(st, [["render", at]]);
|
|
1332
|
+
class ht {
|
|
1256
1333
|
constructor() {
|
|
1257
1334
|
this.eGroupNotify = new $("/eGroupNotify", "", ""), this.alreadyUpdate = {}, this.notify = null, this.window = window;
|
|
1258
1335
|
try {
|
|
@@ -1265,181 +1342,181 @@ class ae {
|
|
|
1265
1342
|
this.notify && this.notify.stop();
|
|
1266
1343
|
}
|
|
1267
1344
|
Init() {
|
|
1268
|
-
this.eGroupNotify.openConnect().then((
|
|
1269
|
-
this.notify =
|
|
1345
|
+
this.eGroupNotify.openConnect().then((t) => {
|
|
1346
|
+
this.notify = t;
|
|
1270
1347
|
try {
|
|
1271
|
-
|
|
1272
|
-
} catch (
|
|
1273
|
-
console.log(
|
|
1348
|
+
t.invoke("GetEquipGroupTree"), t.invoke("GetAllEquipGroupTree");
|
|
1349
|
+
} catch (e) {
|
|
1350
|
+
console.log(e);
|
|
1274
1351
|
}
|
|
1275
|
-
this.subscribeTo(
|
|
1352
|
+
this.subscribeTo(t, "GetEquipGroupTree"), this.subscribeTo(t, "AddEquipGroup"), this.subscribeTo(t, "EditEquipGroup"), this.subscribeTo(t, "DeleteEquipGroup");
|
|
1276
1353
|
try {
|
|
1277
|
-
|
|
1278
|
-
} catch (
|
|
1279
|
-
console.log(
|
|
1354
|
+
t.invoke("GetGroupEquips");
|
|
1355
|
+
} catch (e) {
|
|
1356
|
+
console.log(e);
|
|
1280
1357
|
}
|
|
1281
|
-
this.subscribeTo(
|
|
1358
|
+
this.subscribeTo(t, "GetGroupEquips"), this.subscribeTo(t, "AddEquip"), this.subscribeTo(t, "DeleteEquip"), this.subscribeTo(t, "EditEquip"), this.subscribeTo(t, "moveEquips"), this.subscribeTo(t, "GetAllEquipGroupTree"), t.onclose((e) => {
|
|
1282
1359
|
try {
|
|
1283
1360
|
this.Init();
|
|
1284
1361
|
} catch (i) {
|
|
1285
1362
|
console.log(i);
|
|
1286
1363
|
}
|
|
1287
|
-
console.log("重连",
|
|
1364
|
+
console.log("重连", e);
|
|
1288
1365
|
});
|
|
1289
|
-
}).catch((
|
|
1290
|
-
console.error(
|
|
1366
|
+
}).catch((t) => {
|
|
1367
|
+
console.error(t);
|
|
1291
1368
|
});
|
|
1292
1369
|
}
|
|
1293
|
-
subscribeTo(
|
|
1294
|
-
|
|
1295
|
-
i && i.isSuccess && (this[
|
|
1370
|
+
subscribeTo(t, e) {
|
|
1371
|
+
t.off(e), t.on(e, (i) => {
|
|
1372
|
+
i && i.isSuccess && (this[e] ? this[e](i.data) : this.notice({ func: e, data: i.data, key: i.groupId }));
|
|
1296
1373
|
});
|
|
1297
1374
|
}
|
|
1298
1375
|
// 获取分组---无权限管理的分组列表--空设备分组不展示
|
|
1299
|
-
GetEquipGroupTree(
|
|
1300
|
-
this.window.groupList || (this.window.groupList =
|
|
1376
|
+
GetEquipGroupTree(t) {
|
|
1377
|
+
this.window.groupList || (this.window.groupList = t, this.notice({ type: "GetEquipGroupTree" }));
|
|
1301
1378
|
}
|
|
1302
1379
|
// 获取全量分组---设备管理使用
|
|
1303
|
-
GetAllEquipGroupTree(
|
|
1304
|
-
this.window.groupList_manageMent || (this.window.groupList_manageMent =
|
|
1380
|
+
GetAllEquipGroupTree(t) {
|
|
1381
|
+
this.window.groupList_manageMent || (this.window.groupList_manageMent = t, this.notice({ type: "GetEquipGroupTreeWidthTreeType" }));
|
|
1305
1382
|
}
|
|
1306
1383
|
// 新增分组
|
|
1307
|
-
AddEquipGroup(
|
|
1308
|
-
const { parentGroupId:
|
|
1384
|
+
AddEquipGroup(t) {
|
|
1385
|
+
const { parentGroupId: e, groupId: i, groupName: o } = t || {};
|
|
1309
1386
|
i && (this.window.groupList_manageMent || (this.window.groupList_manageMent = []), this.window.groupList_manageMent.push({
|
|
1310
|
-
parentId:
|
|
1387
|
+
parentId: e,
|
|
1311
1388
|
id: i,
|
|
1312
1389
|
name: o,
|
|
1313
1390
|
equipCount: 0
|
|
1314
|
-
}), this.notice({ type: "AddEquipGroup", data:
|
|
1391
|
+
}), this.notice({ type: "AddEquipGroup", data: t }));
|
|
1315
1392
|
}
|
|
1316
1393
|
// 编辑分组
|
|
1317
|
-
EditEquipGroup(
|
|
1318
|
-
const { groupId:
|
|
1394
|
+
EditEquipGroup(t) {
|
|
1395
|
+
const { groupId: e, groupName: i } = t;
|
|
1319
1396
|
this.window.groupList && window.groupList.forEach((o) => {
|
|
1320
|
-
o.id ==
|
|
1397
|
+
o.id == e && (o.name = i);
|
|
1321
1398
|
}), this.window.groupList_manageMent && window.groupList_manageMent.forEach((o) => {
|
|
1322
|
-
o.id ==
|
|
1323
|
-
}), this.notice({ type: "EditEquipGroup", data:
|
|
1399
|
+
o.id == e && (o.name = i);
|
|
1400
|
+
}), this.notice({ type: "EditEquipGroup", data: t });
|
|
1324
1401
|
}
|
|
1325
|
-
deleteChildGroup(
|
|
1402
|
+
deleteChildGroup(t, e) {
|
|
1326
1403
|
let i = [];
|
|
1327
|
-
|
|
1328
|
-
o.parentId ==
|
|
1404
|
+
e.forEach((o) => {
|
|
1405
|
+
o.parentId == t && i.push(o.id);
|
|
1329
1406
|
}), i.forEach((o) => {
|
|
1330
|
-
let u =
|
|
1331
|
-
u > -1 &&
|
|
1407
|
+
let u = e.findIndex((a) => a.id == o);
|
|
1408
|
+
u > -1 && e.splice(u, 1), this.deleteChildGroup(o, e);
|
|
1332
1409
|
});
|
|
1333
1410
|
}
|
|
1334
1411
|
// 删除分组
|
|
1335
|
-
DeleteEquipGroup(
|
|
1336
|
-
|
|
1412
|
+
DeleteEquipGroup(t) {
|
|
1413
|
+
t.forEach((e) => {
|
|
1337
1414
|
if (this.window.groupList) {
|
|
1338
|
-
let i = this.window.groupList.findIndex((o) => o.id ==
|
|
1339
|
-
i > -1 && this.window.groupList.splice(i, 1), this.deleteChildGroup(
|
|
1415
|
+
let i = this.window.groupList.findIndex((o) => o.id == e.groupId);
|
|
1416
|
+
i > -1 && this.window.groupList.splice(i, 1), this.deleteChildGroup(e.groupId, this.window.groupList);
|
|
1340
1417
|
}
|
|
1341
1418
|
if (this.window.groupList_manageMent) {
|
|
1342
|
-
let i = this.window.groupList_manageMent.findIndex((o) => o.id ==
|
|
1343
|
-
i > -1 && this.window.groupList_manageMent.splice(i, 1), this.deleteChildGroup(
|
|
1419
|
+
let i = this.window.groupList_manageMent.findIndex((o) => o.id == e.groupId);
|
|
1420
|
+
i > -1 && this.window.groupList_manageMent.splice(i, 1), this.deleteChildGroup(e.groupId, this.window.groupList_manageMent);
|
|
1344
1421
|
}
|
|
1345
|
-
}), this.notice({ type: "DeleteEquipGroup", data:
|
|
1422
|
+
}), this.notice({ type: "DeleteEquipGroup", data: t });
|
|
1346
1423
|
}
|
|
1347
1424
|
// 获取设备
|
|
1348
|
-
GetGroupEquips(
|
|
1349
|
-
const { groupId:
|
|
1350
|
-
this.alreadyUpdate[
|
|
1351
|
-
o.title = o.name, o.groupId =
|
|
1352
|
-
}), this.window[`group-${
|
|
1425
|
+
GetGroupEquips(t) {
|
|
1426
|
+
const { groupId: e, equips: i } = t || {};
|
|
1427
|
+
this.alreadyUpdate[e] || (this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[e] = {}, e && i && i instanceof Array && (i.forEach((o) => {
|
|
1428
|
+
o.title = o.name, o.groupId = e, o.equipNo = o.id, delete o.name, window.equipCache || (this.window.equipCache = {}), this.window.equipCache[o.id] = o, this.window.groupCache[e][o.id] = o;
|
|
1429
|
+
}), this.window[`group-${e}`] = i, this.notice({ type: "GetGroupEquips", data: { groupId: e } }), this.alreadyUpdate[e] = !0));
|
|
1353
1430
|
}
|
|
1354
1431
|
// 新增设备
|
|
1355
|
-
AddEquip(
|
|
1356
|
-
const { groupId:
|
|
1357
|
-
this.window[`group-${
|
|
1358
|
-
let o = this.window[`group-${
|
|
1359
|
-
if (
|
|
1432
|
+
AddEquip(t) {
|
|
1433
|
+
const { groupId: e, equips: i } = t || {};
|
|
1434
|
+
this.window[`group-${e}`] || (this.window[`group-${e}`] = []), this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[e] || (this.window.groupCache[e] = {}), this.window.equipCache || (this.window.equipCache = {});
|
|
1435
|
+
let o = this.window[`group-${e}`].length;
|
|
1436
|
+
if (e && i) {
|
|
1360
1437
|
if (i.forEach((u, a) => {
|
|
1361
|
-
this.window[`group-${
|
|
1438
|
+
this.window[`group-${e}`].push(
|
|
1362
1439
|
{
|
|
1363
1440
|
equipNo: u.id,
|
|
1364
|
-
groupId:
|
|
1441
|
+
groupId: e,
|
|
1365
1442
|
id: u.id,
|
|
1366
1443
|
title: u.name
|
|
1367
1444
|
}
|
|
1368
|
-
), this.window.equipCache[u.id] = this.window[`group-${
|
|
1369
|
-
}), !this.exist(
|
|
1370
|
-
let u = this.findParentList(
|
|
1445
|
+
), this.window.equipCache[u.id] = this.window[`group-${e}`][o + a], this.window.groupCache[e][u.id] = this.window[`group-${e}`][o + a];
|
|
1446
|
+
}), !this.exist(e, this.window.groupList)) {
|
|
1447
|
+
let u = this.findParentList(e, this.window.groupList_manageMent);
|
|
1371
1448
|
this.window.groupList.push(...u);
|
|
1372
1449
|
}
|
|
1373
|
-
this.notice({ type: "AddEquip", data:
|
|
1450
|
+
this.notice({ type: "AddEquip", data: t });
|
|
1374
1451
|
}
|
|
1375
1452
|
}
|
|
1376
|
-
moveEquips(
|
|
1377
|
-
let
|
|
1378
|
-
const { sourceGroup: u, targetGroupId: a } =
|
|
1379
|
-
a &&
|
|
1380
|
-
if (
|
|
1381
|
-
if (
|
|
1382
|
-
let
|
|
1383
|
-
|
|
1453
|
+
moveEquips(t) {
|
|
1454
|
+
let e = [], i = !0, o = [];
|
|
1455
|
+
const { sourceGroup: u, targetGroupId: a } = t || {};
|
|
1456
|
+
a && e.push(a), u.forEach((h) => {
|
|
1457
|
+
if (e.push(h.groupId), (!this.window[`group-${a}`] || !this.window[`group-${a}`].length) && (this.window[`group-${a}`] = [], o.push(a)), this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[a] || (this.window.groupCache[a] = {}), h.equips.forEach((r) => {
|
|
1458
|
+
if (r.title = r.name, r.groupId = a, r.equipNo = r.id, this.window[`group-${h.groupId}`]) {
|
|
1459
|
+
let n = this.window[`group-${h.groupId}`].findIndex((c) => c.id == r.id);
|
|
1460
|
+
n > -1 && this.window[`group-${h.groupId}`].splice(n, 1);
|
|
1384
1461
|
}
|
|
1385
|
-
window.equipCache || (this.window.equipCache = {}), this.window.equipCache[
|
|
1386
|
-
}), !this.window[`group-${
|
|
1387
|
-
let
|
|
1388
|
-
|
|
1462
|
+
window.equipCache || (this.window.equipCache = {}), this.window.equipCache[r.id] = r, this.window.groupCache[a][r.id] = r, this.window[`group-${a}`].push(r);
|
|
1463
|
+
}), !this.window[`group-${h.groupId}`].length) {
|
|
1464
|
+
let r = this.window.groupList.findIndex((n) => n.id == h.groupId);
|
|
1465
|
+
r > -1 && this.window.groupList.splice(r, 1), this.deleteChildGroup(h.groupId, this.window.groupList);
|
|
1389
1466
|
}
|
|
1390
|
-
}), o.forEach((
|
|
1391
|
-
if (!this.exist(
|
|
1392
|
-
let
|
|
1393
|
-
this.window.groupList.push(...
|
|
1467
|
+
}), o.forEach((h) => {
|
|
1468
|
+
if (!this.exist(h, this.window.groupList)) {
|
|
1469
|
+
let r = this.findParentList(h, this.window.groupList_manageMent);
|
|
1470
|
+
this.window.groupList.push(...r);
|
|
1394
1471
|
}
|
|
1395
|
-
}), this.notice({ type: "moveEquips", data: { updateGroups:
|
|
1472
|
+
}), this.notice({ type: "moveEquips", data: { updateGroups: e, buildTree: i } });
|
|
1396
1473
|
}
|
|
1397
|
-
exist(
|
|
1398
|
-
return
|
|
1474
|
+
exist(t, e) {
|
|
1475
|
+
return e ? e.some((i) => i.id == t) : !1;
|
|
1399
1476
|
}
|
|
1400
|
-
findParentList(
|
|
1477
|
+
findParentList(t, e) {
|
|
1401
1478
|
let i = [];
|
|
1402
|
-
if (
|
|
1403
|
-
let o =
|
|
1404
|
-
o > -1 && i.push({ ...
|
|
1479
|
+
if (e) {
|
|
1480
|
+
let o = e.findIndex((u) => u.id == t);
|
|
1481
|
+
o > -1 && i.push({ ...e[o] }), e[o].parentId && !this.exist(e[o].parentId, this.window.groupList) && i.push(...this.findParentList(e[o].parentId, this.window.groupList_manageMent));
|
|
1405
1482
|
}
|
|
1406
1483
|
return i;
|
|
1407
1484
|
}
|
|
1408
1485
|
// 删除设备
|
|
1409
|
-
DeleteEquip(
|
|
1410
|
-
const { groupId:
|
|
1411
|
-
if (
|
|
1412
|
-
if (this.window[`group-${
|
|
1486
|
+
DeleteEquip(t) {
|
|
1487
|
+
const { groupId: e, equips: i } = t || {};
|
|
1488
|
+
if (e && i && i instanceof Array) {
|
|
1489
|
+
if (this.window[`group-${e}`]) {
|
|
1413
1490
|
for (let o = 0, u = i.length; o < u; o++) {
|
|
1414
|
-
let a = this.window[`group-${
|
|
1415
|
-
a > -1 && this.window[`group-${
|
|
1491
|
+
let a = this.window[`group-${e}`].findIndex((h) => h.id == i[o].id);
|
|
1492
|
+
a > -1 && this.window[`group-${e}`].splice(a, 1), delete this.window.equipCache[i[o].id], delete this.window.groupCache[e][i[o].id];
|
|
1416
1493
|
}
|
|
1417
1494
|
}
|
|
1418
|
-
this.notice({ type: "DeleteEquip", data:
|
|
1495
|
+
this.notice({ type: "DeleteEquip", data: t });
|
|
1419
1496
|
}
|
|
1420
1497
|
}
|
|
1421
1498
|
// 编辑设备
|
|
1422
|
-
EditEquip(
|
|
1423
|
-
const { equipNo:
|
|
1424
|
-
i &&
|
|
1499
|
+
EditEquip(t) {
|
|
1500
|
+
const { equipNo: e, groupId: i, equipName: o } = t || {};
|
|
1501
|
+
i && e && (window[`group-${i}`] && (this.window.equipCache[e] = o), this.notice({ type: "EditEquip", data: t }));
|
|
1425
1502
|
}
|
|
1426
|
-
notice(
|
|
1503
|
+
notice(t) {
|
|
1427
1504
|
if (this.window.hasIframe) {
|
|
1428
|
-
let
|
|
1429
|
-
for (let i of
|
|
1430
|
-
} else { window.postMessage(
|
|
1505
|
+
let e = document.getElementsByTagName("iframe");
|
|
1506
|
+
for (let i of e) { i.contentWindow.postMessage(t); }
|
|
1507
|
+
} else { window.postMessage(t, "*"); }
|
|
1431
1508
|
}
|
|
1432
1509
|
}
|
|
1433
|
-
const
|
|
1510
|
+
const nt = {
|
|
1434
1511
|
name: "treeV2",
|
|
1435
1512
|
components: {
|
|
1436
|
-
tree:
|
|
1513
|
+
tree: rt
|
|
1437
1514
|
},
|
|
1438
|
-
mixins: [
|
|
1515
|
+
mixins: [x],
|
|
1439
1516
|
data() {
|
|
1440
1517
|
return {
|
|
1441
1518
|
list: [],
|
|
1442
|
-
refId:
|
|
1519
|
+
refId: f.generateUUID(),
|
|
1443
1520
|
treeKey: null,
|
|
1444
1521
|
listKey: null,
|
|
1445
1522
|
hasBuildTree: !1
|
|
@@ -1452,7 +1529,7 @@ const he = {
|
|
|
1452
1529
|
}
|
|
1453
1530
|
},
|
|
1454
1531
|
mounted() {
|
|
1455
|
-
this.treeKey = `equipGroup${this.treeType}`, this.listKey = `groupList${this.treeType}`, this.window[this.treeKey] ? this.list =
|
|
1532
|
+
this.treeKey = `equipGroup${this.treeType}`, this.listKey = `groupList${this.treeType}`, this.window[this.treeKey] ? this.list = f.formateList(JSON.parse(JSON.stringify(this.window[this.treeKey]))) : this.window[this.listKey] && this.buildTree(), window.executeQueue || (window.executeQueues = {}), window.executeQueues[this.refId] = this.destroyTree, window.addEventListener("message", (s) => {
|
|
1456
1533
|
s && s.data && s.data.type && this[s.data.type] && this[s.data.type]();
|
|
1457
1534
|
});
|
|
1458
1535
|
try {
|
|
@@ -1463,7 +1540,7 @@ const he = {
|
|
|
1463
1540
|
},
|
|
1464
1541
|
methods: {
|
|
1465
1542
|
selfRequest() {
|
|
1466
|
-
new
|
|
1543
|
+
new ht().Init();
|
|
1467
1544
|
},
|
|
1468
1545
|
GetEquipGroupTreeWidthTreeType() {
|
|
1469
1546
|
this.treeType && this.window[this.listKey] && this.buildTree();
|
|
@@ -1473,8 +1550,8 @@ const he = {
|
|
|
1473
1550
|
},
|
|
1474
1551
|
buildTree() {
|
|
1475
1552
|
if (this.window[this.listKey]) {
|
|
1476
|
-
let s =
|
|
1477
|
-
this.list =
|
|
1553
|
+
let s = f.listToTreeList(JSON.parse(JSON.stringify(this.window[this.listKey])));
|
|
1554
|
+
this.list = f.formateList(JSON.parse(JSON.stringify(s))), this.window[`equipGroup${this.treeType}`] = s, this.hasBuildTree = !0;
|
|
1478
1555
|
}
|
|
1479
1556
|
},
|
|
1480
1557
|
filterMethod(s) {
|
|
@@ -1486,6 +1563,9 @@ const he = {
|
|
|
1486
1563
|
getEquipSelectd() {
|
|
1487
1564
|
return this.$refs[this.refId].getEquipSelectd();
|
|
1488
1565
|
},
|
|
1566
|
+
getEquipGroupSelectd() {
|
|
1567
|
+
return this.$refs[this.refId].getEquipGroupSelectd();
|
|
1568
|
+
},
|
|
1489
1569
|
getControlSelected() {
|
|
1490
1570
|
return this.$refs[this.refId].getControlSelected();
|
|
1491
1571
|
},
|
|
@@ -1494,14 +1574,14 @@ const he = {
|
|
|
1494
1574
|
}
|
|
1495
1575
|
}
|
|
1496
1576
|
};
|
|
1497
|
-
function
|
|
1498
|
-
const a =
|
|
1499
|
-
return
|
|
1577
|
+
function ct(s, t, e, i, o, u) {
|
|
1578
|
+
const a = C("tree");
|
|
1579
|
+
return p(), E(a, L({
|
|
1500
1580
|
ref: o.refId,
|
|
1501
1581
|
data: o.list
|
|
1502
|
-
}, { ...s.$attrs, ...s.$props },
|
|
1582
|
+
}, { ...s.$attrs, ...s.$props }, _(s.$listeners), { buildTree: u.buildTree }), null, 16, ["data", "buildTree"]);
|
|
1503
1583
|
}
|
|
1504
|
-
const j = /* @__PURE__ */
|
|
1584
|
+
const j = /* @__PURE__ */ O(nt, [["render", ct]]);
|
|
1505
1585
|
j.install = function(s) {
|
|
1506
1586
|
s.component(j.name, j);
|
|
1507
1587
|
};
|