@ganwei-web/gw-base-components-plus 1.0.0
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/echartList/barEchart/dist/index.es.js +152 -0
- package/echartList/barEchart/dist/index.umd.js +1 -0
- package/echartList/barEchart/dist/style.css +1 -0
- package/echartList/curve/dist/index.es.js +217 -0
- package/echartList/curve/dist/index.umd.js +1 -0
- package/echartList/curve/dist/style.css +1 -0
- package/echartList/historyEchart/dist/index.es.js +292 -0
- package/echartList/historyEchart/dist/index.umd.js +10 -0
- package/echartList/historyEchart/dist/style.css +1 -0
- package/echartList/solid-bar/dist/index.es.js +290 -0
- package/echartList/solid-bar/dist/index.umd.js +1 -0
- package/echartList/solid-bar/dist/style.css +1 -0
- package/echartList/solid-circle/dist/index.es.js +332 -0
- package/echartList/solid-circle/dist/index.umd.js +6 -0
- package/echartList/solid-circle/dist/style.css +1 -0
- package/echartList/solid-pie/dist/index.es.js +336 -0
- package/echartList/solid-pie/dist/index.umd.js +6 -0
- package/echartList/solid-pie/dist/style.css +1 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.cjs +902 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.cjs.map +1 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.css +789 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.iife.js +903 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.iife.js.map +1 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.js +902 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.js.map +1 -0
- package/equip-list-vue2/dist/index.es.js +1275 -0
- package/equip-list-vue2/dist/index.umd.js +1 -0
- package/equip-list-vue2/dist/style.css +1 -0
- package/equip-list-vue3/dist/index.es.js +1510 -0
- package/equip-list-vue3/dist/index.umd.js +1 -0
- package/equip-list-vue3/dist/style.css +1 -0
- package/equip-select-vue2/dist/index.es.js +231 -0
- package/equip-select-vue2/dist/index.umd.js +1 -0
- package/equip-select-vue2/dist/style.css +1 -0
- package/equip-select-vue3/dist/index.es.js +231 -0
- package/equip-select-vue3/dist/index.umd.js +1 -0
- package/equip-select-vue3/dist/style.css +1 -0
- package/equipProcessing/dist/index.es.js +203 -0
- package/equipProcessing/dist/index.umd.js +1 -0
- package/loadMore/dist/index.es.js +12 -0
- package/loadMore/dist/index.umd.js +1 -0
- package/loading/dist/index.es.js +25 -0
- package/loading/dist/index.umd.js +1 -0
- package/loading/dist/style.css +1 -0
- package/package.json +11 -0
- package/player/dist/index.es.js +1080 -0
- package/player/dist/index.umd.js +14 -0
- package/player/dist/style.css +1 -0
- package/selectV2/dist/index.es.js +190 -0
- package/selectV2/dist/index.umd.js +1 -0
- package/selectV2/dist/style.css +1 -0
- package/showPassword/dist/index.es.js +72 -0
- package/showPassword/dist/index.umd.js +1 -0
- package/table/dist/index.es.js +182 -0
- package/table/dist/index.umd.js +1 -0
- package/table/dist/style.css +1 -0
- package/widthSetting/dist/index.es.js +113 -0
- package/widthSetting/dist/index.umd.js +1 -0
- package/widthSetting/dist/style.css +1 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import * as w from "@aspnet/signalr";
|
|
2
|
+
class a {
|
|
3
|
+
constructor(o, i, t) {
|
|
4
|
+
this.url = o, this.connectionId = i, this.equipNo = t, this.signalr = null;
|
|
5
|
+
}
|
|
6
|
+
openConnect() {
|
|
7
|
+
return this.signalr && (this.signalr.stop(), this.signalr = null), this.signalr = new w.HubConnectionBuilder().withUrl(this.url).build(), this.signalr.serverTimeoutInMilliseconds = 5e8, this.signalr.keepaliveintervalinmilliseconds = 5e8, new Promise((o) => {
|
|
8
|
+
this.signalr.start().then(() => {
|
|
9
|
+
this.connectionId && this.send(), o(this.signalr);
|
|
10
|
+
}).catch((i) => {
|
|
11
|
+
console.log(i);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async send() {
|
|
16
|
+
try {
|
|
17
|
+
await this.signalr.invoke(this.connectionId, this.equipNo);
|
|
18
|
+
} catch (o) {
|
|
19
|
+
console.log("connectHub 连接失败" + o);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
class c {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.eGroupNotify = new a("/eGroupNotify", "", ""), this.alreadyUpdate = {}, this.notify = null, this.window = window;
|
|
26
|
+
try {
|
|
27
|
+
window.top.equipGroup, this.window = window.top;
|
|
28
|
+
} catch {
|
|
29
|
+
this.window = window;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
stop() {
|
|
33
|
+
this.notify && this.notify.stop();
|
|
34
|
+
}
|
|
35
|
+
Init() {
|
|
36
|
+
this.eGroupNotify.openConnect().then((o) => {
|
|
37
|
+
this.notify = o;
|
|
38
|
+
try {
|
|
39
|
+
o.invoke("GetEquipGroupTree"), o.invoke("GetAllEquipGroupTree");
|
|
40
|
+
} catch (i) {
|
|
41
|
+
console.log(i);
|
|
42
|
+
}
|
|
43
|
+
this.subscribeTo(o, "GetEquipGroupTree"), this.subscribeTo(o, "AddEquipGroup"), this.subscribeTo(o, "EditEquipGroup"), this.subscribeTo(o, "DeleteEquipGroup");
|
|
44
|
+
try {
|
|
45
|
+
o.invoke("GetGroupEquips");
|
|
46
|
+
} catch (i) {
|
|
47
|
+
console.log(i);
|
|
48
|
+
}
|
|
49
|
+
this.subscribeTo(o, "GetGroupEquips"), this.subscribeTo(o, "AddEquip"), this.subscribeTo(o, "DeleteEquip"), this.subscribeTo(o, "EditEquip"), this.subscribeTo(o, "moveEquips"), this.subscribeTo(o, "GetAllEquipGroupTree"), o.onclose((i) => {
|
|
50
|
+
try {
|
|
51
|
+
this.Init();
|
|
52
|
+
} catch (t) {
|
|
53
|
+
console.log(t);
|
|
54
|
+
}
|
|
55
|
+
console.log("重连", i);
|
|
56
|
+
});
|
|
57
|
+
}).catch((o) => {
|
|
58
|
+
console.error(o);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
subscribeTo(o, i) {
|
|
62
|
+
o.off(i), o.on(i, (t) => {
|
|
63
|
+
t && t.isSuccess && (this[i] ? this[i](t.data) : this.notice({ func: i, data: t.data, key: t.groupId }));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// 获取分组---无权限管理的分组列表--空设备分组不展示
|
|
67
|
+
GetEquipGroupTree(o) {
|
|
68
|
+
this.window.groupList || (this.window.groupList = o, this.notice({ type: "GetEquipGroupTree" }));
|
|
69
|
+
}
|
|
70
|
+
// 获取全量分组---设备管理使用
|
|
71
|
+
GetAllEquipGroupTree(o) {
|
|
72
|
+
this.window.groupList_manageMent || (this.window.groupList_manageMent = o, this.notice({ type: "GetEquipGroupTreeWidthTreeType" }));
|
|
73
|
+
}
|
|
74
|
+
// 新增分组
|
|
75
|
+
AddEquipGroup(o) {
|
|
76
|
+
const { parentGroupId: i, groupId: t, groupName: e } = o || {};
|
|
77
|
+
t && (this.window.groupList_manageMent || (this.window.groupList_manageMent = []), this.window.groupList_manageMent.push({
|
|
78
|
+
parentId: i,
|
|
79
|
+
id: t,
|
|
80
|
+
name: e,
|
|
81
|
+
equipCount: 0
|
|
82
|
+
}), this.notice({ type: "AddEquipGroup", data: o }));
|
|
83
|
+
}
|
|
84
|
+
// 编辑分组
|
|
85
|
+
EditEquipGroup(o) {
|
|
86
|
+
const { groupId: i, groupName: t } = o;
|
|
87
|
+
this.window.groupList && window.groupList.forEach((e) => {
|
|
88
|
+
e.id == i && (e.name = t);
|
|
89
|
+
}), this.window.groupList_manageMent && window.groupList_manageMent.forEach((e) => {
|
|
90
|
+
e.id == i && (e.name = t);
|
|
91
|
+
}), this.notice({ type: "EditEquipGroup", data: o });
|
|
92
|
+
}
|
|
93
|
+
deleteChildGroup(o, i) {
|
|
94
|
+
let t = [];
|
|
95
|
+
i.forEach((e) => {
|
|
96
|
+
e.parentId == o && t.push(e.id);
|
|
97
|
+
}), t.forEach((e) => {
|
|
98
|
+
let n = i.findIndex((s) => s.id == e);
|
|
99
|
+
n > -1 && i.splice(n, 1), this.deleteChildGroup(e, i);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// 删除分组
|
|
103
|
+
DeleteEquipGroup(o) {
|
|
104
|
+
o.forEach((i) => {
|
|
105
|
+
if (this.window.groupList) {
|
|
106
|
+
let t = this.window.groupList.findIndex((e) => e.id == i.groupId);
|
|
107
|
+
t > -1 && this.window.groupList.splice(t, 1), this.deleteChildGroup(i.groupId, this.window.groupList);
|
|
108
|
+
}
|
|
109
|
+
if (this.window.groupList_manageMent) {
|
|
110
|
+
let t = this.window.groupList_manageMent.findIndex((e) => e.id == i.groupId);
|
|
111
|
+
t > -1 && this.window.groupList_manageMent.splice(t, 1), this.deleteChildGroup(i.groupId, this.window.groupList_manageMent);
|
|
112
|
+
}
|
|
113
|
+
}), this.notice({ type: "DeleteEquipGroup", data: o });
|
|
114
|
+
}
|
|
115
|
+
// 获取设备
|
|
116
|
+
GetGroupEquips(o) {
|
|
117
|
+
const { groupId: i, equips: t } = o || {};
|
|
118
|
+
this.alreadyUpdate[i] || (this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[i] = {}, i && t && t instanceof Array && (t.forEach((e) => {
|
|
119
|
+
e.title = e.name, e.groupId = i, e.equipNo = e.id, delete e.name, window.equipCache || (this.window.equipCache = {}), this.window.equipCache[e.id] = e, this.window.groupCache[i][e.id] = e;
|
|
120
|
+
}), this.window[`group-${i}`] = t, this.notice({ type: "GetGroupEquips", data: { groupId: i } }), this.alreadyUpdate[i] = !0));
|
|
121
|
+
}
|
|
122
|
+
// 新增设备
|
|
123
|
+
AddEquip(o) {
|
|
124
|
+
const { groupId: i, equips: t } = o || {};
|
|
125
|
+
this.window[`group-${i}`] || (this.window[`group-${i}`] = []), this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[i] || (this.window.groupCache[i] = {}), this.window.equipCache || (this.window.equipCache = {});
|
|
126
|
+
let e = this.window[`group-${i}`].length;
|
|
127
|
+
if (i && t) {
|
|
128
|
+
if (t.forEach((n, s) => {
|
|
129
|
+
this.window[`group-${i}`].push(
|
|
130
|
+
{
|
|
131
|
+
equipNo: n.id,
|
|
132
|
+
groupId: i,
|
|
133
|
+
id: n.id,
|
|
134
|
+
title: n.name
|
|
135
|
+
}
|
|
136
|
+
), this.window.equipCache[n.id] = this.window[`group-${i}`][e + s], this.window.groupCache[i][n.id] = this.window[`group-${i}`][e + s];
|
|
137
|
+
}), !this.exist(i, this.window.groupList)) {
|
|
138
|
+
let n = this.findParentList(i, this.window.groupList_manageMent);
|
|
139
|
+
this.window.groupList.push(...n);
|
|
140
|
+
}
|
|
141
|
+
this.notice({ type: "AddEquip", data: o });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
moveEquips(o) {
|
|
145
|
+
let i = [], t = !0, e = [];
|
|
146
|
+
const { sourceGroup: n, targetGroupId: s } = o || {};
|
|
147
|
+
s && i.push(s), n.forEach((r) => {
|
|
148
|
+
if (i.push(r.groupId), (!this.window[`group-${s}`] || !this.window[`group-${s}`].length) && (this.window[`group-${s}`] = [], e.push(s)), this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[s] || (this.window.groupCache[s] = {}), r.equips.forEach((d) => {
|
|
149
|
+
if (d.title = d.name, d.groupId = s, d.equipNo = d.id, this.window[`group-${r.groupId}`]) {
|
|
150
|
+
let p = this.window[`group-${r.groupId}`].findIndex((u) => u.id == d.id);
|
|
151
|
+
p > -1 && this.window[`group-${r.groupId}`].splice(p, 1);
|
|
152
|
+
}
|
|
153
|
+
window.equipCache || (this.window.equipCache = {}), this.window.equipCache[d.id] = d, this.window.groupCache[s][d.id] = d, this.window[`group-${s}`].push(d);
|
|
154
|
+
}), !this.window[`group-${r.groupId}`].length) {
|
|
155
|
+
let d = this.window.groupList.findIndex((p) => p.id == r.groupId);
|
|
156
|
+
d > -1 && this.window.groupList.splice(d, 1), this.deleteChildGroup(r.groupId, this.window.groupList);
|
|
157
|
+
}
|
|
158
|
+
}), e.forEach((r) => {
|
|
159
|
+
if (!this.exist(r, this.window.groupList)) {
|
|
160
|
+
let d = this.findParentList(r, this.window.groupList_manageMent);
|
|
161
|
+
this.window.groupList.push(...d);
|
|
162
|
+
}
|
|
163
|
+
}), this.notice({ type: "moveEquips", data: { updateGroups: i, buildTree: t } });
|
|
164
|
+
}
|
|
165
|
+
exist(o, i) {
|
|
166
|
+
return i ? i.some((t) => t.id == o) : !1;
|
|
167
|
+
}
|
|
168
|
+
findParentList(o, i) {
|
|
169
|
+
let t = [];
|
|
170
|
+
if (i) {
|
|
171
|
+
let e = i.findIndex((n) => n.id == o);
|
|
172
|
+
e > -1 && t.push({ ...i[e] }), i[e].parentId && !this.exist(i[e].parentId, this.window.groupList) && t.push(...this.findParentList(i[e].parentId, this.window.groupList_manageMent));
|
|
173
|
+
}
|
|
174
|
+
return t;
|
|
175
|
+
}
|
|
176
|
+
// 删除设备
|
|
177
|
+
DeleteEquip(o) {
|
|
178
|
+
const { groupId: i, equips: t } = o || {};
|
|
179
|
+
if (i && t && t instanceof Array) {
|
|
180
|
+
if (this.window[`group-${i}`]) {
|
|
181
|
+
for (let e = 0, n = t.length; e < n; e++) {
|
|
182
|
+
let s = this.window[`group-${i}`].findIndex((r) => r.id == t[e].id);
|
|
183
|
+
s > -1 && this.window[`group-${i}`].splice(s, 1), delete this.window.equipCache[t[e].id], delete this.window.groupCache[i][t[e].id];
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
this.notice({ type: "DeleteEquip", data: o });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// 编辑设备
|
|
190
|
+
EditEquip(o) {
|
|
191
|
+
const { equipNo: i, groupId: t, equipName: e } = o || {};
|
|
192
|
+
t && i && (window[`group-${t}`] && (this.window.equipCache[i] = e), this.notice({ type: "EditEquip", data: o }));
|
|
193
|
+
}
|
|
194
|
+
notice(o) {
|
|
195
|
+
if (this.window.hasIframe) {
|
|
196
|
+
let i = document.getElementsByTagName("iframe");
|
|
197
|
+
for (let t of i) { t.contentWindow.postMessage(o); }
|
|
198
|
+
} else { window.postMessage(o, "*"); }
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
export {
|
|
202
|
+
c as equipCache,
|
|
203
|
+
a as Signalr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(p, h){ typeof exports == "object" && typeof module < "u" ? h(exports, require("@aspnet/signalr")) : typeof define == "function" && define.amd ? define(["exports", "@aspnet/signalr"], h) : (p = typeof globalThis < "u" ? globalThis : p || self, h(p.index = {}, p.SignalR)) })(this, function(p, h){ "use strict";function c(u){ const e = Object.create(null, {[Symbol.toStringTag]: {value: "Module"}});if(u){ for(const i in u){ if(i !== "default"){ const t = Object.getOwnPropertyDescriptor(u, i);Object.defineProperty(e, i, t.get ? t : {enumerable: !0, get: ()=>u[i]}) } } }return e.default = u, Object.freeze(e) }const g = c(h);class a{constructor(e, i, t){ this.url = e, this.connectionId = i, this.equipNo = t, this.signalr = null }openConnect(){ return this.signalr && (this.signalr.stop(), this.signalr = null), this.signalr = new g.HubConnectionBuilder().withUrl(this.url).build(), this.signalr.serverTimeoutInMilliseconds = 5e8, this.signalr.keepaliveintervalinmilliseconds = 5e8, new Promise(e=>{ this.signalr.start().then(()=>{ this.connectionId && this.send(), e(this.signalr) }).catch(i=>{ console.log(i) }) }) }async send(){ try{ await this.signalr.invoke(this.connectionId, this.equipNo) }catch(e){ console.log("connectHub 连接失败" + e) } }}class l{constructor(){ this.eGroupNotify = new a("/eGroupNotify", "", ""), this.alreadyUpdate = {}, this.notify = null, this.window = window;try{ window.top.equipGroup, this.window = window.top }catch{ this.window = window } }stop(){ this.notify && this.notify.stop() }Init(){ this.eGroupNotify.openConnect().then(e=>{ this.notify = e;try{ e.invoke("GetEquipGroupTree"), e.invoke("GetAllEquipGroupTree") }catch(i){ console.log(i) }this.subscribeTo(e, "GetEquipGroupTree"), this.subscribeTo(e, "AddEquipGroup"), this.subscribeTo(e, "EditEquipGroup"), this.subscribeTo(e, "DeleteEquipGroup");try{ e.invoke("GetGroupEquips") }catch(i){ console.log(i) }this.subscribeTo(e, "GetGroupEquips"), this.subscribeTo(e, "AddEquip"), this.subscribeTo(e, "DeleteEquip"), this.subscribeTo(e, "EditEquip"), this.subscribeTo(e, "moveEquips"), this.subscribeTo(e, "GetAllEquipGroupTree"), e.onclose(i=>{ try{ this.Init() }catch(t){ console.log(t) }console.log("重连", i) }) }).catch(e=>{ console.error(e) }) }subscribeTo(e, i){ e.off(i), e.on(i, t=>{ t && t.isSuccess && (this[i] ? this[i](t.data) : this.notice({func: i, data: t.data, key: t.groupId})) }) }GetEquipGroupTree(e){ this.window.groupList || (this.window.groupList = e, this.notice({type: "GetEquipGroupTree"})) }GetAllEquipGroupTree(e){ this.window.groupList_manageMent || (this.window.groupList_manageMent = e, this.notice({type: "GetEquipGroupTreeWidthTreeType"})) }AddEquipGroup(e){ const{parentGroupId: i, groupId: t, groupName: o} = e || {};t && (this.window.groupList_manageMent || (this.window.groupList_manageMent = []), this.window.groupList_manageMent.push({parentId: i, id: t, name: o, equipCount: 0}), this.notice({type: "AddEquipGroup", data: e})) }EditEquipGroup(e){ const{groupId: i, groupName: t} = e;this.window.groupList && window.groupList.forEach(o=>{ o.id == i && (o.name = t) }), this.window.groupList_manageMent && window.groupList_manageMent.forEach(o=>{ o.id == i && (o.name = t) }), this.notice({type: "EditEquipGroup", data: e}) }deleteChildGroup(e, i){ let t = [];i.forEach(o=>{ o.parentId == e && t.push(o.id) }), t.forEach(o=>{ let s = i.findIndex(n=>n.id == o);s > -1 && i.splice(s, 1), this.deleteChildGroup(o, i) }) }DeleteEquipGroup(e){ e.forEach(i=>{ if(this.window.groupList){ let t = this.window.groupList.findIndex(o=>o.id == i.groupId);t > -1 && this.window.groupList.splice(t, 1), this.deleteChildGroup(i.groupId, this.window.groupList) }if(this.window.groupList_manageMent){ let t = this.window.groupList_manageMent.findIndex(o=>o.id == i.groupId);t > -1 && this.window.groupList_manageMent.splice(t, 1), this.deleteChildGroup(i.groupId, this.window.groupList_manageMent) } }), this.notice({type: "DeleteEquipGroup", data: e}) }GetGroupEquips(e){ const{groupId: i, equips: t} = e || {};this.alreadyUpdate[i] || (this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[i] = {}, i && t && t instanceof Array && (t.forEach(o=>{ o.title = o.name, o.groupId = i, o.equipNo = o.id, delete o.name, window.equipCache || (this.window.equipCache = {}), this.window.equipCache[o.id] = o, this.window.groupCache[i][o.id] = o }), this.window[`group-${i}`] = t, this.notice({type: "GetGroupEquips", data: {groupId: i}}), this.alreadyUpdate[i] = !0)) }AddEquip(e){ const{groupId: i, equips: t} = e || {};this.window[`group-${i}`] || (this.window[`group-${i}`] = []), this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[i] || (this.window.groupCache[i] = {}), this.window.equipCache || (this.window.equipCache = {});let o = this.window[`group-${i}`].length;if(i && t){ if(t.forEach((s, n)=>{ this.window[`group-${i}`].push({equipNo: s.id, groupId: i, id: s.id, title: s.name}), this.window.equipCache[s.id] = this.window[`group-${i}`][o + n], this.window.groupCache[i][s.id] = this.window[`group-${i}`][o + n] }), !this.exist(i, this.window.groupList)){ let s = this.findParentList(i, this.window.groupList_manageMent);this.window.groupList.push(...s) }this.notice({type: "AddEquip", data: e}) } }moveEquips(e){ let i = [], t = !0, o = [];const{sourceGroup: s, targetGroupId: n} = e || {};n && i.push(n), s.forEach(r=>{ if(i.push(r.groupId), (!this.window[`group-${n}`] || !this.window[`group-${n}`].length) && (this.window[`group-${n}`] = [], o.push(n)), this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[n] || (this.window.groupCache[n] = {}), r.equips.forEach(d=>{ if(d.title = d.name, d.groupId = n, d.equipNo = d.id, this.window[`group-${r.groupId}`]){ let w = this.window[`group-${r.groupId}`].findIndex(f=>f.id == d.id);w > -1 && this.window[`group-${r.groupId}`].splice(w, 1) }window.equipCache || (this.window.equipCache = {}), this.window.equipCache[d.id] = d, this.window.groupCache[n][d.id] = d, this.window[`group-${n}`].push(d) }), !this.window[`group-${r.groupId}`].length){ let d = this.window.groupList.findIndex(w=>w.id == r.groupId);d > -1 && this.window.groupList.splice(d, 1), this.deleteChildGroup(r.groupId, this.window.groupList) } }), o.forEach(r=>{ if(!this.exist(r, this.window.groupList)){ let d = this.findParentList(r, this.window.groupList_manageMent);this.window.groupList.push(...d) } }), this.notice({type: "moveEquips", data: {updateGroups: i, buildTree: t}}) }exist(e, i){ return i ? i.some(t=>t.id == e) : !1 }findParentList(e, i){ let t = [];if(i){ let o = i.findIndex(s=>s.id == e);o > -1 && t.push({...i[o]}), i[o].parentId && !this.exist(i[o].parentId, this.window.groupList) && t.push(...this.findParentList(i[o].parentId, this.window.groupList_manageMent)) }return t }DeleteEquip(e){ const{groupId: i, equips: t} = e || {};if(i && t && t instanceof Array){ if(this.window[`group-${i}`]){ for(let o = 0, s = t.length;o < s;o++){ let n = this.window[`group-${i}`].findIndex(r=>r.id == t[o].id);n > -1 && this.window[`group-${i}`].splice(n, 1), delete this.window.equipCache[t[o].id], delete this.window.groupCache[i][t[o].id] } }this.notice({type: "DeleteEquip", data: e}) } }EditEquip(e){ const{equipNo: i, groupId: t, equipName: o} = e || {};t && i && (window[`group-${t}`] && (this.window.equipCache[i] = o), this.notice({type: "EditEquip", data: e})) }notice(e){ if(this.window.hasIframe){ let i = document.getElementsByTagName("iframe");for(let t of i){ t.contentWindow.postMessage(e) } }else { window.postMessage(e, "*") } }}p.Signalr = a, p.equipCache = l, Object.defineProperty(p, Symbol.toStringTag, {value: "Module"}) });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const i = (e, l = {}) => {
|
|
2
|
+
e.directive("loadmore", {
|
|
3
|
+
inserted(o, t) {
|
|
4
|
+
o.querySelector(".el-select-dropdown .el-select-dropdown__wrap").addEventListener("scroll", function() {
|
|
5
|
+
this.scrollHeight - this.scrollTop <= this.clientHeight && t.value();
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
i as default
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(o, e){ typeof exports == "object" && typeof module < "u" ? module.exports = e() : typeof define == "function" && define.amd ? define(e) : (o = typeof globalThis < "u" ? globalThis : o || self, o.index = e()) })(this, function(){ "use strict";return(e, i = {})=>{ e.directive("loadmore", {inserted(t, n){ t.querySelector(".el-select-dropdown .el-select-dropdown__wrap").addEventListener("scroll", function(){ this.scrollHeight - this.scrollTop <= this.clientHeight && n.value() }) }}) } });
|