@riil-frontend/component-topology 0.3.1 → 0.3.2
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/build/1.js +1 -1
- package/build/index.css +1 -1
- package/build/index.html +1 -1
- package/build/index.js +14 -14
- package/demo/3/344/270/232/345/212/241/347/233/221/346/216/247/346/213/223/346/211/221/src/AppInstallTopo.jsx +66 -30
- package/demo/3/344/270/232/345/212/241/347/233/221/346/216/247/346/213/223/346/211/221/src/DataStreamTopo.jsx +4 -9
- package/demo/3/344/270/232/345/212/241/347/233/221/346/216/247/346/213/223/346/211/221/src/data/dataStream/data1.json +2 -1
- package/demo/3/344/270/232/345/212/241/347/233/221/346/216/247/346/213/223/346/211/221//345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221.md +2 -1
- package/demo/3/344/270/232/345/212/241/347/233/221/346/216/247/346/213/223/346/211/221//346/225/260/346/215/256/346/265/201/346/213/223/346/211/221.md +1 -0
- package/demo/3/344/270/232/345/212/241/347/233/221/346/216/247/346/213/223/346/211/221//346/226/260/345/273/272.md +1 -0
- package/demo/API/API.md +68 -5
- package/es/components/TopoView/settings/GroupNodeList/GroupNodeList.js +18 -0
- package/es/components/TopoView/settings/{ResourceList.js → GroupNodeList/ResourceList.js} +2 -52
- package/es/components/TopoView/settings/{ResourceList.module.scss → GroupNodeList/ResourceList.module.scss} +0 -0
- package/es/components/TopoView/settings/{SelectResource → GroupNodeList/SelectResource}/index.js +0 -0
- package/es/components/TopoView/settings/{SelectResource → GroupNodeList/SelectResource}/index.module.scss +0 -0
- package/es/components/TopoView/settings/LayerSettingsForm.js +8 -3
- package/es/components/TopoView/settings/Settings.js +1 -0
- package/es/components/TopoView/toolbar/index.js +2 -1
- package/es/core/models/TopoApp.js +136 -68
- package/es/core/models/common/TopoClient.js +9 -1
- package/es/icons/icons.js +1 -0
- package/es/utils/htElementUtils.js +53 -0
- package/es/utils/topoData.js +1 -1
- package/lib/components/TopoView/settings/GroupNodeList/GroupNodeList.js +33 -0
- package/lib/components/TopoView/settings/{ResourceList.js → GroupNodeList/ResourceList.js} +2 -52
- package/lib/components/TopoView/settings/{ResourceList.module.scss → GroupNodeList/ResourceList.module.scss} +0 -0
- package/lib/components/TopoView/settings/{SelectResource → GroupNodeList/SelectResource}/index.js +0 -0
- package/lib/components/TopoView/settings/{SelectResource → GroupNodeList/SelectResource}/index.module.scss +0 -0
- package/lib/components/TopoView/settings/LayerSettingsForm.js +9 -3
- package/lib/components/TopoView/settings/Settings.js +1 -0
- package/lib/components/TopoView/toolbar/index.js +5 -1
- package/lib/core/models/TopoApp.js +137 -68
- package/lib/core/models/common/TopoClient.js +9 -1
- package/lib/icons/icons.js +3 -0
- package/lib/utils/htElementUtils.js +66 -0
- package/lib/utils/topoData.js +1 -1
- package/package.json +4 -3
|
@@ -10,6 +10,7 @@ import TopoGraphView from './TopoGraphView';
|
|
|
10
10
|
import createStore from '../store/createStore';
|
|
11
11
|
import buildProvider from '../components/buildProvider';
|
|
12
12
|
import { formatTreeDataSelect } from '../../utils/format';
|
|
13
|
+
import { getNodes as _getNodes, getEdges as _getEdges } from '../../utils/htElementUtils';
|
|
13
14
|
import Test from '../test/Test';
|
|
14
15
|
var topoDebug = {};
|
|
15
16
|
window.topoDebug = topoDebug;
|
|
@@ -99,7 +100,8 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
99
100
|
|
|
100
101
|
_proto.load = /*#__PURE__*/function () {
|
|
101
102
|
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data, options) {
|
|
102
|
-
var topoDispatchers;
|
|
103
|
+
var _data$groups, groups, _data$nodes, nodes, links, lines, topoDispatchers;
|
|
104
|
+
|
|
103
105
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
104
106
|
while (1) {
|
|
105
107
|
switch (_context2.prev = _context2.next) {
|
|
@@ -108,13 +110,18 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
108
110
|
options = {};
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
_data$groups = data.groups, groups = _data$groups === void 0 ? [] : _data$groups, _data$nodes = data.nodes, nodes = _data$nodes === void 0 ? [] : _data$nodes, links = data.links, lines = data.lines;
|
|
111
114
|
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
|
112
|
-
_context2.next =
|
|
115
|
+
_context2.next = 5;
|
|
113
116
|
return topoDispatchers.openTopoPage(_extends({
|
|
114
|
-
data: data
|
|
117
|
+
data: _extends({}, data, {
|
|
118
|
+
groups: groups,
|
|
119
|
+
nodes: nodes,
|
|
120
|
+
links: links || lines || []
|
|
121
|
+
})
|
|
115
122
|
}, options));
|
|
116
123
|
|
|
117
|
-
case
|
|
124
|
+
case 5:
|
|
118
125
|
case "end":
|
|
119
126
|
return _context2.stop();
|
|
120
127
|
}
|
|
@@ -147,14 +154,78 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
147
154
|
}
|
|
148
155
|
|
|
149
156
|
return clear;
|
|
150
|
-
}()
|
|
157
|
+
}()
|
|
158
|
+
/**
|
|
159
|
+
* 全量更新数据
|
|
160
|
+
*
|
|
161
|
+
* @param data {{groups: [], nodes: [], lines: []}}
|
|
162
|
+
*/
|
|
163
|
+
;
|
|
164
|
+
|
|
165
|
+
_proto.updateData =
|
|
166
|
+
/*#__PURE__*/
|
|
167
|
+
function () {
|
|
168
|
+
var _updateData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
|
|
169
|
+
var _data$groups2, groups, _data$nodes2, nodes, links, lines;
|
|
151
170
|
|
|
152
|
-
_proto.open = /*#__PURE__*/function () {
|
|
153
|
-
var _open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(id, mode) {
|
|
154
|
-
var lastId;
|
|
155
171
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
156
172
|
while (1) {
|
|
157
173
|
switch (_context4.prev = _context4.next) {
|
|
174
|
+
case 0:
|
|
175
|
+
_data$groups2 = data.groups, groups = _data$groups2 === void 0 ? [] : _data$groups2, _data$nodes2 = data.nodes, nodes = _data$nodes2 === void 0 ? [] : _data$nodes2, links = data.links, lines = data.lines;
|
|
176
|
+
this.view.topoClient.updateElements({
|
|
177
|
+
groups: groups,
|
|
178
|
+
nodes: nodes,
|
|
179
|
+
links: links || lines || []
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
case 2:
|
|
183
|
+
case "end":
|
|
184
|
+
return _context4.stop();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}, _callee4, this);
|
|
188
|
+
}));
|
|
189
|
+
|
|
190
|
+
function updateData(_x3) {
|
|
191
|
+
return _updateData.apply(this, arguments);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return updateData;
|
|
195
|
+
}()
|
|
196
|
+
/**
|
|
197
|
+
* 获取数据
|
|
198
|
+
* @return {{nodes: [], lines: [], customNodes: [], customLines: []}}
|
|
199
|
+
*/
|
|
200
|
+
;
|
|
201
|
+
|
|
202
|
+
_proto.getData = function getData() {
|
|
203
|
+
return {
|
|
204
|
+
nodes: this.getNodes(),
|
|
205
|
+
lines: this.getLines(),
|
|
206
|
+
customNodes: [],
|
|
207
|
+
customLines: []
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
_proto.getNodes = function getNodes() {
|
|
212
|
+
return _getNodes(this.getDataModel());
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
_proto.getLines = function getLines() {
|
|
216
|
+
return this.getEdges();
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
_proto.getEdges = function getEdges() {
|
|
220
|
+
return _getEdges(this.getDataModel());
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
_proto.open = /*#__PURE__*/function () {
|
|
224
|
+
var _open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id, mode) {
|
|
225
|
+
var lastId;
|
|
226
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
227
|
+
while (1) {
|
|
228
|
+
switch (_context5.prev = _context5.next) {
|
|
158
229
|
case 0:
|
|
159
230
|
rlog.info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
|
|
160
231
|
|
|
@@ -168,13 +239,13 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
168
239
|
|
|
169
240
|
case 4:
|
|
170
241
|
case "end":
|
|
171
|
-
return
|
|
242
|
+
return _context5.stop();
|
|
172
243
|
}
|
|
173
244
|
}
|
|
174
|
-
},
|
|
245
|
+
}, _callee5, this);
|
|
175
246
|
}));
|
|
176
247
|
|
|
177
|
-
function open(
|
|
248
|
+
function open(_x4, _x5) {
|
|
178
249
|
return _open.apply(this, arguments);
|
|
179
250
|
}
|
|
180
251
|
|
|
@@ -182,19 +253,19 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
182
253
|
}();
|
|
183
254
|
|
|
184
255
|
_proto.close = /*#__PURE__*/function () {
|
|
185
|
-
var _close = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
186
|
-
return _regeneratorRuntime.wrap(function
|
|
256
|
+
var _close = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
257
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
187
258
|
while (1) {
|
|
188
|
-
switch (
|
|
259
|
+
switch (_context6.prev = _context6.next) {
|
|
189
260
|
case 0:
|
|
190
261
|
rlog.info('关闭拓扑图', this.id);
|
|
191
262
|
|
|
192
263
|
if (this.id) {
|
|
193
|
-
|
|
264
|
+
_context6.next = 3;
|
|
194
265
|
break;
|
|
195
266
|
}
|
|
196
267
|
|
|
197
|
-
return
|
|
268
|
+
return _context6.abrupt("return");
|
|
198
269
|
|
|
199
270
|
case 3:
|
|
200
271
|
this.alarm.close();
|
|
@@ -202,10 +273,10 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
202
273
|
|
|
203
274
|
case 5:
|
|
204
275
|
case "end":
|
|
205
|
-
return
|
|
276
|
+
return _context6.stop();
|
|
206
277
|
}
|
|
207
278
|
}
|
|
208
|
-
},
|
|
279
|
+
}, _callee6, this);
|
|
209
280
|
}));
|
|
210
281
|
|
|
211
282
|
function close() {
|
|
@@ -216,16 +287,16 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
216
287
|
}();
|
|
217
288
|
|
|
218
289
|
_proto.refresh = /*#__PURE__*/function () {
|
|
219
|
-
var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
220
|
-
return _regeneratorRuntime.wrap(function
|
|
290
|
+
var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
291
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
221
292
|
while (1) {
|
|
222
|
-
switch (
|
|
293
|
+
switch (_context7.prev = _context7.next) {
|
|
223
294
|
case 0:
|
|
224
295
|
case "end":
|
|
225
|
-
return
|
|
296
|
+
return _context7.stop();
|
|
226
297
|
}
|
|
227
298
|
}
|
|
228
|
-
},
|
|
299
|
+
}, _callee7);
|
|
229
300
|
}));
|
|
230
301
|
|
|
231
302
|
function refresh() {
|
|
@@ -236,10 +307,7 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
236
307
|
}();
|
|
237
308
|
|
|
238
309
|
_proto.getDataModel = function getDataModel() {
|
|
239
|
-
return this.view.topoClient.
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
_proto.updateData = function updateData() {// TODO
|
|
310
|
+
return this.view.topoClient.getDataModel();
|
|
243
311
|
};
|
|
244
312
|
|
|
245
313
|
_proto.getSelectionModel = function getSelectionModel() {
|
|
@@ -260,19 +328,19 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
260
328
|
};
|
|
261
329
|
|
|
262
330
|
_proto.openViewMode = /*#__PURE__*/function () {
|
|
263
|
-
var _openViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
264
|
-
return _regeneratorRuntime.wrap(function
|
|
331
|
+
var _openViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(id) {
|
|
332
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
265
333
|
while (1) {
|
|
266
|
-
switch (
|
|
334
|
+
switch (_context8.prev = _context8.next) {
|
|
267
335
|
case 0:
|
|
268
336
|
case "end":
|
|
269
|
-
return
|
|
337
|
+
return _context8.stop();
|
|
270
338
|
}
|
|
271
339
|
}
|
|
272
|
-
},
|
|
340
|
+
}, _callee8);
|
|
273
341
|
}));
|
|
274
342
|
|
|
275
|
-
function openViewMode(
|
|
343
|
+
function openViewMode(_x6) {
|
|
276
344
|
return _openViewMode.apply(this, arguments);
|
|
277
345
|
}
|
|
278
346
|
|
|
@@ -286,11 +354,11 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
286
354
|
_proto.enterEditMode =
|
|
287
355
|
/*#__PURE__*/
|
|
288
356
|
function () {
|
|
289
|
-
var _enterEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
357
|
+
var _enterEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
290
358
|
var topoDispatchers, editDispatchers, ciSetDoc, linkDynamicStyleDispatcher, iconManageDispatchers, topoTreeData;
|
|
291
|
-
return _regeneratorRuntime.wrap(function
|
|
359
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
292
360
|
while (1) {
|
|
293
|
-
switch (
|
|
361
|
+
switch (_context9.prev = _context9.next) {
|
|
294
362
|
case 0:
|
|
295
363
|
this.view.topoClient.enterEditMode();
|
|
296
364
|
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
|
@@ -321,10 +389,10 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
321
389
|
|
|
322
390
|
case 14:
|
|
323
391
|
case "end":
|
|
324
|
-
return
|
|
392
|
+
return _context9.stop();
|
|
325
393
|
}
|
|
326
394
|
}
|
|
327
|
-
},
|
|
395
|
+
}, _callee9, this);
|
|
328
396
|
}));
|
|
329
397
|
|
|
330
398
|
function enterEditMode() {
|
|
@@ -335,11 +403,11 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
335
403
|
}();
|
|
336
404
|
|
|
337
405
|
_proto.exitEditMode = /*#__PURE__*/function () {
|
|
338
|
-
var _exitEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
406
|
+
var _exitEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
339
407
|
var editDispatchers;
|
|
340
|
-
return _regeneratorRuntime.wrap(function
|
|
408
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
341
409
|
while (1) {
|
|
342
|
-
switch (
|
|
410
|
+
switch (_context10.prev = _context10.next) {
|
|
343
411
|
case 0:
|
|
344
412
|
this.view.topoClient.exitEditMode();
|
|
345
413
|
editDispatchers = this.store.getModelDispatchers('topoCreateMod');
|
|
@@ -351,10 +419,10 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
351
419
|
|
|
352
420
|
case 4:
|
|
353
421
|
case "end":
|
|
354
|
-
return
|
|
422
|
+
return _context10.stop();
|
|
355
423
|
}
|
|
356
424
|
}
|
|
357
|
-
},
|
|
425
|
+
}, _callee10, this);
|
|
358
426
|
}));
|
|
359
427
|
|
|
360
428
|
function exitEditMode() {
|
|
@@ -365,19 +433,19 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
365
433
|
}();
|
|
366
434
|
|
|
367
435
|
_proto.triggerSaveEvent = /*#__PURE__*/function () {
|
|
368
|
-
var _triggerSaveEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
369
|
-
return _regeneratorRuntime.wrap(function
|
|
436
|
+
var _triggerSaveEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
437
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
370
438
|
while (1) {
|
|
371
|
-
switch (
|
|
439
|
+
switch (_context11.prev = _context11.next) {
|
|
372
440
|
case 0:
|
|
373
441
|
this.view.topoClient.saveExternal();
|
|
374
442
|
|
|
375
443
|
case 1:
|
|
376
444
|
case "end":
|
|
377
|
-
return
|
|
445
|
+
return _context11.stop();
|
|
378
446
|
}
|
|
379
447
|
}
|
|
380
|
-
},
|
|
448
|
+
}, _callee11, this);
|
|
381
449
|
}));
|
|
382
450
|
|
|
383
451
|
function triggerSaveEvent() {
|
|
@@ -388,19 +456,19 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
388
456
|
}();
|
|
389
457
|
|
|
390
458
|
_proto.save = /*#__PURE__*/function () {
|
|
391
|
-
var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
392
|
-
return _regeneratorRuntime.wrap(function
|
|
459
|
+
var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
460
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
393
461
|
while (1) {
|
|
394
|
-
switch (
|
|
462
|
+
switch (_context12.prev = _context12.next) {
|
|
395
463
|
case 0:
|
|
396
464
|
this.triggerSaveEvent();
|
|
397
465
|
|
|
398
466
|
case 1:
|
|
399
467
|
case "end":
|
|
400
|
-
return
|
|
468
|
+
return _context12.stop();
|
|
401
469
|
}
|
|
402
470
|
}
|
|
403
|
-
},
|
|
471
|
+
}, _callee12, this);
|
|
404
472
|
}));
|
|
405
473
|
|
|
406
474
|
function save() {
|
|
@@ -411,19 +479,19 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
411
479
|
}();
|
|
412
480
|
|
|
413
481
|
_proto.exportImage = /*#__PURE__*/function () {
|
|
414
|
-
var _exportImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
415
|
-
return _regeneratorRuntime.wrap(function
|
|
482
|
+
var _exportImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
483
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
416
484
|
while (1) {
|
|
417
|
-
switch (
|
|
485
|
+
switch (_context13.prev = _context13.next) {
|
|
418
486
|
case 0:
|
|
419
487
|
this.view.topoClient.exportImage();
|
|
420
488
|
|
|
421
489
|
case 1:
|
|
422
490
|
case "end":
|
|
423
|
-
return
|
|
491
|
+
return _context13.stop();
|
|
424
492
|
}
|
|
425
493
|
}
|
|
426
|
-
},
|
|
494
|
+
}, _callee13, this);
|
|
427
495
|
}));
|
|
428
496
|
|
|
429
497
|
function exportImage() {
|
|
@@ -434,16 +502,16 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
434
502
|
}();
|
|
435
503
|
|
|
436
504
|
_proto.switchToViewMode = /*#__PURE__*/function () {
|
|
437
|
-
var _switchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
438
|
-
return _regeneratorRuntime.wrap(function
|
|
505
|
+
var _switchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
506
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
439
507
|
while (1) {
|
|
440
|
-
switch (
|
|
508
|
+
switch (_context14.prev = _context14.next) {
|
|
441
509
|
case 0:
|
|
442
510
|
case "end":
|
|
443
|
-
return
|
|
511
|
+
return _context14.stop();
|
|
444
512
|
}
|
|
445
513
|
}
|
|
446
|
-
},
|
|
514
|
+
}, _callee14);
|
|
447
515
|
}));
|
|
448
516
|
|
|
449
517
|
function switchToViewMode() {
|
|
@@ -454,16 +522,16 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
454
522
|
}();
|
|
455
523
|
|
|
456
524
|
_proto.switchToEditMode = /*#__PURE__*/function () {
|
|
457
|
-
var _switchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
458
|
-
return _regeneratorRuntime.wrap(function
|
|
525
|
+
var _switchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
|
526
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
459
527
|
while (1) {
|
|
460
|
-
switch (
|
|
528
|
+
switch (_context15.prev = _context15.next) {
|
|
461
529
|
case 0:
|
|
462
530
|
case "end":
|
|
463
|
-
return
|
|
531
|
+
return _context15.stop();
|
|
464
532
|
}
|
|
465
533
|
}
|
|
466
|
-
},
|
|
534
|
+
}, _callee15);
|
|
467
535
|
}));
|
|
468
536
|
|
|
469
537
|
function switchToEditMode() {
|
|
@@ -43,7 +43,15 @@ var TopoClient = /*#__PURE__*/function () {
|
|
|
43
43
|
this.emitEvent('', null);
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
_proto.clear = function clear() {}
|
|
46
|
+
_proto.clear = function clear() {};
|
|
47
|
+
|
|
48
|
+
_proto.getDataModel = function getDataModel() {
|
|
49
|
+
return this.htTopoClient._mainView._graphView.getDataModel();
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
_proto.updateElements = function updateElements(elements) {
|
|
53
|
+
this.emitEvent('topo_update_elements', elements);
|
|
54
|
+
}
|
|
47
55
|
/**
|
|
48
56
|
* 搜索元素
|
|
49
57
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var map = {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
function getElementData(element) {
|
|
4
|
+
var className = element.getClassName();
|
|
5
|
+
var commonData = {
|
|
6
|
+
className: className,
|
|
7
|
+
id: element.getId(),
|
|
8
|
+
tag: element.getTag(),
|
|
9
|
+
// 业务id
|
|
10
|
+
name: element.getName(),
|
|
11
|
+
attrObject: element.getAttrObject(),
|
|
12
|
+
styleMap: element.getStyleMap()
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
if (className === 'ht.Edge') {
|
|
16
|
+
return _extends({}, commonData);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return _extends({}, commonData, {
|
|
20
|
+
position: element.getPosition()
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function getElements(dataModel) {
|
|
25
|
+
console.error(111, dataModel.getDatas().getArray());
|
|
26
|
+
return dataModel.getDatas().getArray();
|
|
27
|
+
}
|
|
28
|
+
export function getNodes(dataModel) {
|
|
29
|
+
return getElements(dataModel).filter(function (element) {
|
|
30
|
+
return element.getClassName() === 'ht.Node';
|
|
31
|
+
}).map(function (element) {
|
|
32
|
+
var host = element.getHost();
|
|
33
|
+
return _extends({}, element.getAttrObject(), {
|
|
34
|
+
tag: element.getId(),
|
|
35
|
+
image: element.getImage(),
|
|
36
|
+
groupTag: host ? host.getId() : undefined
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export function getEdges(dataModel) {
|
|
41
|
+
return getElements(dataModel).filter(function (element) {
|
|
42
|
+
return element.getClassName() === 'ht.Edge';
|
|
43
|
+
}).map(function (element) {
|
|
44
|
+
return _extends({}, element.getAttrObject(), {
|
|
45
|
+
tag: element.getId()
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function getGroupNodes(dataModel, groupIdOrTag) {
|
|
50
|
+
return getNodes(dataModel).filter(function (element) {
|
|
51
|
+
return element.groupId === groupIdOrTag || element.groupTag === groupIdOrTag;
|
|
52
|
+
});
|
|
53
|
+
}
|
package/es/utils/topoData.js
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports["default"] = GroupNodeList;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _ResourceList = _interopRequireDefault(require("./ResourceList"));
|
|
11
|
+
|
|
12
|
+
var _htElementUtils = require("../../../../utils/htElementUtils");
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
function GroupNodeList(props) {
|
|
19
|
+
var topo = props.topo,
|
|
20
|
+
group = props.group;
|
|
21
|
+
var nodes = (0, _htElementUtils.getGroupNodes)(topo.getDataModel(), group.id);
|
|
22
|
+
var data = nodes.map(function (node) {
|
|
23
|
+
return {
|
|
24
|
+
title: node.name,
|
|
25
|
+
img: '/ht/image/topo/s/交换机_48.png'
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_ResourceList["default"], {
|
|
29
|
+
data: data
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
;
|
|
@@ -20,55 +20,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
22
|
function ResourceList(props) {
|
|
23
|
-
var data =
|
|
24
|
-
title: 'S6252G-24',
|
|
25
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
26
|
-
money: '$20'
|
|
27
|
-
}, {
|
|
28
|
-
title: 'S6252G-24',
|
|
29
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
30
|
-
money: '$10'
|
|
31
|
-
}, {
|
|
32
|
-
title: 'S6252G-24',
|
|
33
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
34
|
-
money: '$20'
|
|
35
|
-
}, {
|
|
36
|
-
title: 'S6252G-24',
|
|
37
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
38
|
-
money: '$20'
|
|
39
|
-
}, {
|
|
40
|
-
title: 'S6252G-24',
|
|
41
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
42
|
-
money: '$20'
|
|
43
|
-
}, {
|
|
44
|
-
title: 'S6252G-24',
|
|
45
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
46
|
-
money: '$10'
|
|
47
|
-
}, {
|
|
48
|
-
title: 'S6252G-24',
|
|
49
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
50
|
-
money: '$20'
|
|
51
|
-
}, {
|
|
52
|
-
title: 'S6252G-24',
|
|
53
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
54
|
-
money: '$20'
|
|
55
|
-
}, {
|
|
56
|
-
title: 'S6252G-24',
|
|
57
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
58
|
-
money: '$20'
|
|
59
|
-
}, {
|
|
60
|
-
title: 'S6252G-24',
|
|
61
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
62
|
-
money: '$10'
|
|
63
|
-
}, {
|
|
64
|
-
title: 'S6252G-24',
|
|
65
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
66
|
-
money: '$20'
|
|
67
|
-
}, {
|
|
68
|
-
title: 'S6252G-24',
|
|
69
|
-
img: '/ht/image/topo/s/交换机_48.png',
|
|
70
|
-
money: '$20'
|
|
71
|
-
}];
|
|
23
|
+
var data = props.data;
|
|
72
24
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
73
25
|
className: _ResourceListModule["default"].list
|
|
74
26
|
}, data.map(function (item, key) {
|
|
@@ -84,8 +36,6 @@ function ResourceList(props) {
|
|
|
84
36
|
})));
|
|
85
37
|
}
|
|
86
38
|
|
|
87
|
-
;
|
|
88
|
-
|
|
89
39
|
ResourceList.Select = function Select(props) {
|
|
90
40
|
var _useState = (0, _react.useState)(false),
|
|
91
41
|
isSelectResource = _useState[0],
|
|
@@ -95,8 +45,8 @@ ResourceList.Select = function Select(props) {
|
|
|
95
45
|
text: true,
|
|
96
46
|
type: "primary",
|
|
97
47
|
onClick: function onClick(e) {
|
|
98
|
-
setIsSelectResource(true);
|
|
99
48
|
e.stopPropagation();
|
|
49
|
+
setIsSelectResource(true);
|
|
100
50
|
}
|
|
101
51
|
}, "\u9009\u62E9"), /*#__PURE__*/_react["default"].createElement(_SelectResource["default"] // mode="single"
|
|
102
52
|
, {
|
|
File without changes
|
package/lib/components/TopoView/settings/{SelectResource → GroupNodeList/SelectResource}/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -31,7 +31,9 @@ var _ColorPicker = _interopRequireDefault(require("../../edit/LinkDynamicStyleSe
|
|
|
31
31
|
|
|
32
32
|
var _RuleStyleModule = _interopRequireDefault(require("../../edit/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss"));
|
|
33
33
|
|
|
34
|
-
var _ResourceList = _interopRequireDefault(require("./ResourceList"));
|
|
34
|
+
var _ResourceList = _interopRequireDefault(require("./GroupNodeList/ResourceList"));
|
|
35
|
+
|
|
36
|
+
var _GroupNodeList = _interopRequireDefault(require("./GroupNodeList/GroupNodeList"));
|
|
35
37
|
|
|
36
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
39
|
|
|
@@ -102,7 +104,8 @@ function parseValues(values) {
|
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
function LayerSettingsForm(props) {
|
|
105
|
-
var
|
|
107
|
+
var topo = props.topo,
|
|
108
|
+
values = props.values,
|
|
106
109
|
_onChange = props.onChange;
|
|
107
110
|
|
|
108
111
|
var field = _field["default"].useField({
|
|
@@ -145,7 +148,10 @@ function LayerSettingsForm(props) {
|
|
|
145
148
|
flex: 1
|
|
146
149
|
}
|
|
147
150
|
}, "\u5173\u8054\u8D44\u6E90"), /*#__PURE__*/_react["default"].createElement(_ResourceList["default"].Select, null))
|
|
148
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
151
|
+
}, /*#__PURE__*/_react["default"].createElement(_GroupNodeList["default"], {
|
|
152
|
+
topo: topo,
|
|
153
|
+
group: values
|
|
154
|
+
}));
|
|
149
155
|
};
|
|
150
156
|
|
|
151
157
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_form["default"], {
|
|
@@ -77,6 +77,7 @@ function Settings(props) {
|
|
|
77
77
|
}, "\u5C5E\u6027\u9762\u677F"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
78
78
|
className: _SettingsModule["default"].settings
|
|
79
79
|
}, /*#__PURE__*/_react["default"].createElement(Component, {
|
|
80
|
+
topo: topo,
|
|
80
81
|
values: values,
|
|
81
82
|
onChange: updateElementProperty
|
|
82
83
|
})));
|
|
@@ -14,4 +14,8 @@ exports.SearchWidget = _SearchWidget["default"];
|
|
|
14
14
|
|
|
15
15
|
var _TitleWidget = _interopRequireDefault(require("./widgets/TitleWidget"));
|
|
16
16
|
|
|
17
|
-
exports.TitleWidget = _TitleWidget["default"];
|
|
17
|
+
exports.TitleWidget = _TitleWidget["default"];
|
|
18
|
+
|
|
19
|
+
var _ViewTools = _interopRequireDefault(require("./ViewTools"));
|
|
20
|
+
|
|
21
|
+
exports.ViewerTools = _ViewTools["default"];
|