@riil-frontend/component-topology 11.0.0 → 11.0.1
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.js +11 -11
- package/es/core/hooks/useTopoEdit.js +139 -95
- package/es/core/models/TopoApp.js +1 -1
- package/lib/core/hooks/useTopoEdit.js +139 -95
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +5 -4
@@ -259,9 +259,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
259
259
|
|
260
260
|
_dialog["default"].confirm({
|
261
261
|
title: "删除",
|
262
|
-
content: "若执行相关操作,此区域包含的内容也会一同被删除,确定删除吗?",
|
262
|
+
// content: "若执行相关操作,此区域包含的内容也会一同被删除,确定删除吗?",
|
263
|
+
content: "是否仅删除区域或将区域包含的内容一同删除?",
|
264
|
+
//footer:()=>{return <><Button type="primary" onClick={doDeleteOnlyGroup}>仅删除区域</Button><Button type="primary" onClick={doDeleteOnlyGroup}>确定</Button></>},
|
263
265
|
okProps: {
|
264
|
-
children: "
|
266
|
+
children: "仅删除区域"
|
267
|
+
},
|
268
|
+
cancelProps: {
|
269
|
+
children: "全部删除"
|
265
270
|
},
|
266
271
|
messageProps: {
|
267
272
|
type: "warning"
|
@@ -272,7 +277,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
272
277
|
while (1) {
|
273
278
|
switch (_context4.prev = _context4.next) {
|
274
279
|
case 0:
|
275
|
-
|
280
|
+
doDeleteOnlyGroup();
|
276
281
|
|
277
282
|
case 1:
|
278
283
|
case "end":
|
@@ -287,9 +292,48 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
287
292
|
}
|
288
293
|
|
289
294
|
return onOk;
|
295
|
+
}(),
|
296
|
+
onCancel: function () {
|
297
|
+
var _onCancel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
298
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
299
|
+
while (1) {
|
300
|
+
switch (_context5.prev = _context5.next) {
|
301
|
+
case 0:
|
302
|
+
doDelete();
|
303
|
+
|
304
|
+
case 1:
|
305
|
+
case "end":
|
306
|
+
return _context5.stop();
|
307
|
+
}
|
308
|
+
}
|
309
|
+
}, _callee5);
|
310
|
+
}));
|
311
|
+
|
312
|
+
function onCancel() {
|
313
|
+
return _onCancel.apply(this, arguments);
|
314
|
+
}
|
315
|
+
|
316
|
+
return onCancel;
|
290
317
|
}()
|
291
318
|
});
|
292
319
|
|
320
|
+
function doDeleteOnlyGroup() {
|
321
|
+
// console.log("仅删除区域", topo.view.topoClient, data);
|
322
|
+
var children = (0, _htElementUtils.getGroupChildren)(group);
|
323
|
+
children.map(function (child) {
|
324
|
+
child.setParent(null);
|
325
|
+
var viewRect = topo.getGraphView().getViewRect();
|
326
|
+
var nodeRect = child.getRect();
|
327
|
+
child.setPosition(viewRect.x + nodeRect.width + 2, viewRect.y + nodeRect.height + 4); // 解决集群从区域内移出时,连线位置未更新的问题
|
328
|
+
|
329
|
+
setTimeout(function () {
|
330
|
+
child.iv();
|
331
|
+
topo.historyManager.endTransaction();
|
332
|
+
}, 50);
|
333
|
+
});
|
334
|
+
topo.view.topoClient.deleteGroup(data); // console.log("仅删除区域", children, group);
|
335
|
+
}
|
336
|
+
|
293
337
|
function doDelete() {
|
294
338
|
topo.historyManager.beginTransaction(); // FIXME 。如果命中其他的动态条件,则立即显示
|
295
339
|
|
@@ -325,20 +369,20 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
325
369
|
|
326
370
|
|
327
371
|
var deleteExLink = /*#__PURE__*/function () {
|
328
|
-
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
372
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(node) {
|
329
373
|
var _node$getEdges$toArra, _node$getEdges;
|
330
374
|
|
331
375
|
var config, edges, exportLinkIdList;
|
332
|
-
return _regenerator["default"].wrap(function
|
376
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
333
377
|
while (1) {
|
334
|
-
switch (
|
378
|
+
switch (_context6.prev = _context6.next) {
|
335
379
|
case 0:
|
336
380
|
config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
|
337
381
|
|
338
382
|
edges = (_node$getEdges$toArra = (_node$getEdges = node.getEdges()) === null || _node$getEdges === void 0 ? void 0 : _node$getEdges.toArray()) !== null && _node$getEdges$toArra !== void 0 ? _node$getEdges$toArra : []; // const exLink = [];
|
339
383
|
|
340
384
|
if (!(edges.length > 0)) {
|
341
|
-
|
385
|
+
_context6.next = 8;
|
342
386
|
break;
|
343
387
|
}
|
344
388
|
|
@@ -352,15 +396,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
352
396
|
}
|
353
397
|
});
|
354
398
|
config.exportLinkIdList = exportLinkIdList;
|
355
|
-
|
399
|
+
_context6.next = 8;
|
356
400
|
return resourceConfig.updateConfig(config);
|
357
401
|
|
358
402
|
case 8:
|
359
403
|
case "end":
|
360
|
-
return
|
404
|
+
return _context6.stop();
|
361
405
|
}
|
362
406
|
}
|
363
|
-
},
|
407
|
+
}, _callee6);
|
364
408
|
}));
|
365
409
|
|
366
410
|
return function deleteExLink(_x3) {
|
@@ -446,27 +490,27 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
446
490
|
}
|
447
491
|
|
448
492
|
function _bindGroupResources() {
|
449
|
-
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
493
|
+
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(group, resources) {
|
450
494
|
var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
|
451
495
|
|
452
|
-
return _regenerator["default"].wrap(function
|
496
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
453
497
|
while (1) {
|
454
|
-
switch (
|
498
|
+
switch (_context12.prev = _context12.next) {
|
455
499
|
case 0:
|
456
500
|
id = group.id, tag = group.tag;
|
457
501
|
|
458
502
|
_rlog["default"].debug("bindGroupResources--id, tag", id, tag);
|
459
503
|
|
460
504
|
topo.historyManager.beginTransaction();
|
461
|
-
|
505
|
+
_context12.next = 5;
|
462
506
|
return resourceConfig.updateGroupResources(group, resources);
|
463
507
|
|
464
508
|
case 5:
|
465
|
-
|
509
|
+
_context12.next = 7;
|
466
510
|
return editDispatchers.fetchDataByConfig();
|
467
511
|
|
468
512
|
case 7:
|
469
|
-
_yield$editDispatcher2 =
|
513
|
+
_yield$editDispatcher2 = _context12.sent;
|
470
514
|
elements = _yield$editDispatcher2.elements;
|
471
515
|
// 区域里的子区域及子区域的节点、新增的链路
|
472
516
|
nodeElements = (0, _topoData.findGroupChildren)(elements, group);
|
@@ -485,10 +529,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
485
529
|
|
486
530
|
case 14:
|
487
531
|
case "end":
|
488
|
-
return
|
532
|
+
return _context12.stop();
|
489
533
|
}
|
490
534
|
}
|
491
|
-
},
|
535
|
+
}, _callee12);
|
492
536
|
}));
|
493
537
|
return _bindGroupResources.apply(this, arguments);
|
494
538
|
}
|
@@ -502,11 +546,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
502
546
|
|
503
547
|
|
504
548
|
function _addGroupResources() {
|
505
|
-
_addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
549
|
+
_addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(group, newResourceIds) {
|
506
550
|
var groupConfig, resources, groupData;
|
507
|
-
return _regenerator["default"].wrap(function
|
551
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
508
552
|
while (1) {
|
509
|
-
switch (
|
553
|
+
switch (_context13.prev = _context13.next) {
|
510
554
|
case 0:
|
511
555
|
groupConfig = resourceConfig.getGroupConfigByElement(group);
|
512
556
|
resources = {
|
@@ -516,15 +560,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
516
560
|
id: group.getTag(),
|
517
561
|
tag: group.a("tag")
|
518
562
|
};
|
519
|
-
|
563
|
+
_context13.next = 5;
|
520
564
|
return bindGroupResources(groupData, resources, newResourceIds);
|
521
565
|
|
522
566
|
case 5:
|
523
567
|
case "end":
|
524
|
-
return
|
568
|
+
return _context13.stop();
|
525
569
|
}
|
526
570
|
}
|
527
|
-
},
|
571
|
+
}, _callee13);
|
528
572
|
}));
|
529
573
|
return _addGroupResources.apply(this, arguments);
|
530
574
|
}
|
@@ -541,25 +585,25 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
541
585
|
|
542
586
|
|
543
587
|
function _bindViewResources() {
|
544
|
-
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
588
|
+
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(data) {
|
545
589
|
var config, _yield$editDispatcher3, elements;
|
546
590
|
|
547
|
-
return _regenerator["default"].wrap(function
|
591
|
+
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
548
592
|
while (1) {
|
549
|
-
switch (
|
593
|
+
switch (_context14.prev = _context14.next) {
|
550
594
|
case 0:
|
551
595
|
// console.log("关联视图的资源", data);
|
552
596
|
config = resourceConfig.getConfig();
|
553
597
|
config.resources = data;
|
554
|
-
|
598
|
+
_context14.next = 4;
|
555
599
|
return resourceConfig.updateConfig(config);
|
556
600
|
|
557
601
|
case 4:
|
558
|
-
|
602
|
+
_context14.next = 6;
|
559
603
|
return editDispatchers.fetchDataByConfig();
|
560
604
|
|
561
605
|
case 6:
|
562
|
-
_yield$editDispatcher3 =
|
606
|
+
_yield$editDispatcher3 = _context14.sent;
|
563
607
|
elements = _yield$editDispatcher3.elements;
|
564
608
|
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
|
565
609
|
|
@@ -569,10 +613,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
569
613
|
|
570
614
|
case 10:
|
571
615
|
case "end":
|
572
|
-
return
|
616
|
+
return _context14.stop();
|
573
617
|
}
|
574
618
|
}
|
575
|
-
},
|
619
|
+
}, _callee14);
|
576
620
|
}));
|
577
621
|
return _bindViewResources.apply(this, arguments);
|
578
622
|
}
|
@@ -582,24 +626,24 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
582
626
|
}
|
583
627
|
|
584
628
|
function _addLayerResources() {
|
585
|
-
_addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
629
|
+
_addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(group, newResourceIds) {
|
586
630
|
var _yield$editDispatcher4, elements, newElements;
|
587
631
|
|
588
|
-
return _regenerator["default"].wrap(function
|
632
|
+
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
589
633
|
while (1) {
|
590
|
-
switch (
|
634
|
+
switch (_context15.prev = _context15.next) {
|
591
635
|
case 0:
|
592
636
|
topo.historyManager.beginTransaction(); // 构造新的配置
|
593
637
|
|
594
|
-
|
638
|
+
_context15.next = 3;
|
595
639
|
return resourceConfig.addLayerStaticResources(group, newResourceIds);
|
596
640
|
|
597
641
|
case 3:
|
598
|
-
|
642
|
+
_context15.next = 5;
|
599
643
|
return editDispatchers.fetchDataByConfig();
|
600
644
|
|
601
645
|
case 5:
|
602
|
-
_yield$editDispatcher4 =
|
646
|
+
_yield$editDispatcher4 = _context15.sent;
|
603
647
|
elements = _yield$editDispatcher4.elements;
|
604
648
|
// 2022-11-10 修复 添加资源后分层重新布局问题,仅布局新增资源。替换api topo.updateElements(data)
|
605
649
|
newElements = findUNExistedElements(elements);
|
@@ -624,10 +668,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
624
668
|
|
625
669
|
case 14:
|
626
670
|
case "end":
|
627
|
-
return
|
671
|
+
return _context15.stop();
|
628
672
|
}
|
629
673
|
}
|
630
|
-
},
|
674
|
+
}, _callee15);
|
631
675
|
}));
|
632
676
|
return _addLayerResources.apply(this, arguments);
|
633
677
|
}
|
@@ -637,22 +681,22 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
637
681
|
}
|
638
682
|
|
639
683
|
function _addResourceToFirstLayer() {
|
640
|
-
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
684
|
+
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(data) {
|
641
685
|
var group;
|
642
|
-
return _regenerator["default"].wrap(function
|
686
|
+
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
643
687
|
while (1) {
|
644
|
-
switch (
|
688
|
+
switch (_context16.prev = _context16.next) {
|
645
689
|
case 0:
|
646
690
|
group = resourceConfig.getGroups()[0];
|
647
|
-
|
691
|
+
_context16.next = 3;
|
648
692
|
return addLayerResources(group, data);
|
649
693
|
|
650
694
|
case 3:
|
651
695
|
case "end":
|
652
|
-
return
|
696
|
+
return _context16.stop();
|
653
697
|
}
|
654
698
|
}
|
655
|
-
},
|
699
|
+
}, _callee16);
|
656
700
|
}));
|
657
701
|
return _addResourceToFirstLayer.apply(this, arguments);
|
658
702
|
}
|
@@ -684,29 +728,29 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
684
728
|
|
685
729
|
|
686
730
|
var onSaveComboRes = /*#__PURE__*/function () {
|
687
|
-
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
688
|
-
return _regenerator["default"].wrap(function
|
731
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(data) {
|
732
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
689
733
|
while (1) {
|
690
|
-
switch (
|
734
|
+
switch (_context7.prev = _context7.next) {
|
691
735
|
case 0:
|
692
736
|
_rlog["default"].debug("关联资源-----onSaveComboRes", data);
|
693
737
|
|
694
738
|
topo.historyManager.beginTransaction();
|
695
739
|
|
696
740
|
if (!(getAddResourceType() === "addToFirstLayer")) {
|
697
|
-
|
741
|
+
_context7.next = 7;
|
698
742
|
break;
|
699
743
|
}
|
700
744
|
|
701
|
-
|
745
|
+
_context7.next = 5;
|
702
746
|
return addResourceToFirstLayer(data);
|
703
747
|
|
704
748
|
case 5:
|
705
|
-
|
749
|
+
_context7.next = 9;
|
706
750
|
break;
|
707
751
|
|
708
752
|
case 7:
|
709
|
-
|
753
|
+
_context7.next = 9;
|
710
754
|
return bindViewResources(data);
|
711
755
|
|
712
756
|
case 9:
|
@@ -718,10 +762,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
718
762
|
|
719
763
|
case 12:
|
720
764
|
case "end":
|
721
|
-
return
|
765
|
+
return _context7.stop();
|
722
766
|
}
|
723
767
|
}
|
724
|
-
},
|
768
|
+
}, _callee7);
|
725
769
|
}));
|
726
770
|
|
727
771
|
return function onSaveComboRes(_x12) {
|
@@ -730,12 +774,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
730
774
|
}();
|
731
775
|
|
732
776
|
var onSaveTopo = /*#__PURE__*/function () {
|
733
|
-
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
777
|
+
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(data) {
|
734
778
|
var id, config, serialize, _config$layout, template, layout, saveConfig;
|
735
779
|
|
736
|
-
return _regenerator["default"].wrap(function
|
780
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
737
781
|
while (1) {
|
738
|
-
switch (
|
782
|
+
switch (_context9.prev = _context9.next) {
|
739
783
|
case 0:
|
740
784
|
id = data.id, config = data.config, serialize = data.serialize;
|
741
785
|
_config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
|
@@ -743,12 +787,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
743
787
|
if (onSave) {
|
744
788
|
// 自定义保存
|
745
789
|
saveConfig = /*#__PURE__*/function () {
|
746
|
-
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
747
|
-
return _regenerator["default"].wrap(function
|
790
|
+
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
791
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
748
792
|
while (1) {
|
749
|
-
switch (
|
793
|
+
switch (_context8.prev = _context8.next) {
|
750
794
|
case 0:
|
751
|
-
|
795
|
+
_context8.next = 2;
|
752
796
|
return editDispatchers.saveTopo({
|
753
797
|
id: id,
|
754
798
|
layout: layout,
|
@@ -757,10 +801,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
757
801
|
|
758
802
|
case 2:
|
759
803
|
case "end":
|
760
|
-
return
|
804
|
+
return _context8.stop();
|
761
805
|
}
|
762
806
|
}
|
763
|
-
},
|
807
|
+
}, _callee8);
|
764
808
|
}));
|
765
809
|
|
766
810
|
return function saveConfig() {
|
@@ -777,10 +821,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
777
821
|
|
778
822
|
case 3:
|
779
823
|
case "end":
|
780
|
-
return
|
824
|
+
return _context9.stop();
|
781
825
|
}
|
782
826
|
}
|
783
|
-
},
|
827
|
+
}, _callee9);
|
784
828
|
}));
|
785
829
|
|
786
830
|
return function onSaveTopo(_x13) {
|
@@ -812,12 +856,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
812
856
|
|
813
857
|
|
814
858
|
var bindNodeResource = /*#__PURE__*/function () {
|
815
|
-
var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
859
|
+
var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(params) {
|
816
860
|
var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
|
817
861
|
|
818
|
-
return _regenerator["default"].wrap(function
|
862
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
819
863
|
while (1) {
|
820
|
-
switch (
|
864
|
+
switch (_context11.prev = _context11.next) {
|
821
865
|
case 0:
|
822
866
|
replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
|
823
867
|
return (0, _extends2["default"])({}, resources, {
|
@@ -828,11 +872,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
828
872
|
};
|
829
873
|
|
830
874
|
_doBind = function _doBind3() {
|
831
|
-
_doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
875
|
+
_doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
|
832
876
|
var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
|
833
|
-
return _regenerator["default"].wrap(function
|
877
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
834
878
|
while (1) {
|
835
|
-
switch (
|
879
|
+
switch (_context10.prev = _context10.next) {
|
836
880
|
case 0:
|
837
881
|
dm = htTopo.getGraphView().dm(); // 创建
|
838
882
|
|
@@ -902,7 +946,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
902
946
|
// node.a("customName", null);
|
903
947
|
// 删除关联在节点上的出口链路
|
904
948
|
|
905
|
-
|
949
|
+
_context10.next = 12;
|
906
950
|
return deleteExLink(node);
|
907
951
|
|
908
952
|
case 12:
|
@@ -913,10 +957,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
913
957
|
|
914
958
|
case 13:
|
915
959
|
case "end":
|
916
|
-
return
|
960
|
+
return _context10.stop();
|
917
961
|
}
|
918
962
|
}
|
919
|
-
},
|
963
|
+
}, _callee10);
|
920
964
|
}));
|
921
965
|
return _doBind.apply(this, arguments);
|
922
966
|
};
|
@@ -958,22 +1002,22 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
958
1002
|
config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
|
959
1003
|
}
|
960
1004
|
|
961
|
-
|
1005
|
+
_context11.next = 13;
|
962
1006
|
return resourceConfig.updateConfig(config);
|
963
1007
|
|
964
1008
|
case 13:
|
965
|
-
|
1009
|
+
_context11.next = 15;
|
966
1010
|
return editDispatchers.fetchDataByConfig();
|
967
1011
|
|
968
1012
|
case 15:
|
969
|
-
_yield$editDispatcher =
|
1013
|
+
_yield$editDispatcher = _context11.sent;
|
970
1014
|
elements = _yield$editDispatcher.elements;
|
971
1015
|
newData = elements.find(function (item) {
|
972
1016
|
return item.id === newResId;
|
973
1017
|
});
|
974
1018
|
|
975
1019
|
if (newData) {
|
976
|
-
|
1020
|
+
_context11.next = 23;
|
977
1021
|
break;
|
978
1022
|
}
|
979
1023
|
|
@@ -982,10 +1026,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
982
1026
|
_rlog["default"].warn("关联资源失败");
|
983
1027
|
|
984
1028
|
topo.historyManager.endTransaction();
|
985
|
-
return
|
1029
|
+
return _context11.abrupt("return", false);
|
986
1030
|
|
987
1031
|
case 23:
|
988
|
-
|
1032
|
+
_context11.next = 25;
|
989
1033
|
return doBind();
|
990
1034
|
|
991
1035
|
case 25:
|
@@ -993,10 +1037,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
993
1037
|
|
994
1038
|
case 26:
|
995
1039
|
case "end":
|
996
|
-
return
|
1040
|
+
return _context11.stop();
|
997
1041
|
}
|
998
1042
|
}
|
999
|
-
},
|
1043
|
+
}, _callee11);
|
1000
1044
|
}));
|
1001
1045
|
|
1002
1046
|
return function bindNodeResource(_x14) {
|
@@ -1013,19 +1057,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1013
1057
|
}
|
1014
1058
|
|
1015
1059
|
function _relateNodeIp() {
|
1016
|
-
_relateNodeIp = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
1060
|
+
_relateNodeIp = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17(txtValue, nodeElement) {
|
1017
1061
|
var dm, isUnique, ip, configObj, configData, _elements, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
|
1018
1062
|
|
1019
|
-
return _regenerator["default"].wrap(function
|
1063
|
+
return _regenerator["default"].wrap(function _callee17$(_context17) {
|
1020
1064
|
while (1) {
|
1021
|
-
switch (
|
1065
|
+
switch (_context17.prev = _context17.next) {
|
1022
1066
|
case 0:
|
1023
1067
|
if (txtValue) {
|
1024
|
-
|
1068
|
+
_context17.next = 2;
|
1025
1069
|
break;
|
1026
1070
|
}
|
1027
1071
|
|
1028
|
-
return
|
1072
|
+
return _context17.abrupt("return");
|
1029
1073
|
|
1030
1074
|
case 2:
|
1031
1075
|
// if (txtValue === nodeElement.a('bindIp')) {
|
@@ -1037,12 +1081,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1037
1081
|
isUnique = (0, _exitLinkUtil.isUniqueIp)(dm, txtValue, nodeElement); // 获取关联链路
|
1038
1082
|
|
1039
1083
|
if (!isUnique) {
|
1040
|
-
|
1084
|
+
_context17.next = 23;
|
1041
1085
|
break;
|
1042
1086
|
}
|
1043
1087
|
|
1044
1088
|
ip = (0, _exitLinkUtil.buildIpNode)(txtValue);
|
1045
|
-
|
1089
|
+
_context17.next = 8;
|
1046
1090
|
return deleteExLink(nodeElement);
|
1047
1091
|
|
1048
1092
|
case 8:
|
@@ -1051,15 +1095,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1051
1095
|
nodeElement.setTag("ip:" + txtValue); // 获取配置
|
1052
1096
|
|
1053
1097
|
configObj = topo.resourceConfig.getConfig();
|
1054
|
-
|
1098
|
+
_context17.next = 14;
|
1055
1099
|
return resourceConfig.updateConfig(configObj);
|
1056
1100
|
|
1057
1101
|
case 14:
|
1058
|
-
|
1102
|
+
_context17.next = 16;
|
1059
1103
|
return editDispatchers.fetchDataByConfig();
|
1060
1104
|
|
1061
1105
|
case 16:
|
1062
|
-
configData =
|
1106
|
+
configData = _context17.sent;
|
1063
1107
|
// console.log("configData",configObj, configData);
|
1064
1108
|
_elements = configData.elements;
|
1065
1109
|
newLinkElements = findUNExistedLinkElements(_elements); // console.log("configData", configData, newLinkElements);
|
@@ -1087,10 +1131,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1087
1131
|
|
1088
1132
|
case 23:
|
1089
1133
|
case "end":
|
1090
|
-
return
|
1134
|
+
return _context17.stop();
|
1091
1135
|
}
|
1092
1136
|
}
|
1093
|
-
},
|
1137
|
+
}, _callee17);
|
1094
1138
|
}));
|
1095
1139
|
return _relateNodeIp.apply(this, arguments);
|
1096
1140
|
}
|
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
56
56
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
57
57
|
|
58
58
|
// eslint-disable-next-line no-undef
|
59
|
-
var version = typeof "11.0.
|
59
|
+
var version = typeof "11.0.1" === 'string' ? "11.0.1" : null;
|
60
60
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
61
61
|
/**
|
62
62
|
* 拓扑显示和编辑
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "11.0.
|
3
|
+
"version": "11.0.1",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -12,7 +12,8 @@
|
|
12
12
|
"eslint": "eslint --cache --ext .js,.jsx,.ts,.tsx ./",
|
13
13
|
"eslint:fix": "npm run eslint -- --fix",
|
14
14
|
"stylelint": "stylelint \"**/*.{css,scss,less}\"",
|
15
|
-
"lint": "npm run eslint && npm run stylelint"
|
15
|
+
"lint": "npm run eslint && npm run stylelint",
|
16
|
+
"react-devtools": "react-devtools"
|
16
17
|
},
|
17
18
|
"main": "lib/index.js",
|
18
19
|
"module": "es/index.js",
|
@@ -74,7 +75,7 @@
|
|
74
75
|
"@riil-frontend/component-table-filter-tags": "latest",
|
75
76
|
"@riil-frontend/component-table-layout": "^2.0.2",
|
76
77
|
"@riil-frontend/component-topology-common": "^1.1.2",
|
77
|
-
"@riil-frontend/component-topology-graph": "^2.8.
|
78
|
+
"@riil-frontend/component-topology-graph": "^2.8.2",
|
78
79
|
"@riil-frontend/css": "^2.0.2",
|
79
80
|
"@riil-frontend/hooks": "latest",
|
80
81
|
"@riil-frontend/next-collapse": "^1.0.1-a.0",
|
@@ -116,6 +117,6 @@
|
|
116
117
|
"access": "public"
|
117
118
|
},
|
118
119
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.
|
120
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.1/build/index.html",
|
120
121
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
122
|
}
|