@riil-frontend/component-topology 11.0.0 → 11.0.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.
Files changed (34) hide show
  1. package/build/index.js +1 -1
  2. package/es/components/BatchAttrMetric2/SelectTable.js +21 -0
  3. package/es/components/BatchAttrMetric2/constant.js +30 -0
  4. package/es/components/BatchAttrMetric2/index.js +75 -0
  5. package/es/components/BatchAttrMetric2/index.module.scss +76 -0
  6. package/es/components/BatchAttrMetric2/setting.js +188 -0
  7. package/es/components/BatchAttrMetric2/utils.js +80 -0
  8. package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelect.js +7 -0
  9. package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +36 -0
  10. package/es/components/ModelAttrSelectDrawer/index.js +2 -0
  11. package/es/core/components/DisplaySettingDrawer/NodeTag.js +1 -0
  12. package/es/core/hooks/useTopoEdit.js +139 -95
  13. package/es/core/models/TopoApp.js +1 -1
  14. package/es/core/models/tagstips/ElementTagTipConfig.js +15 -5
  15. package/es/core/utils/showGraphManageStatusUtil.js +3 -3
  16. package/es/utils/tree.js +2 -9
  17. package/es/utils/treeUtil.js +13 -0
  18. package/lib/components/BatchAttrMetric2/SelectTable.js +29 -0
  19. package/lib/components/BatchAttrMetric2/constant.js +36 -0
  20. package/lib/components/BatchAttrMetric2/index.js +93 -0
  21. package/lib/components/BatchAttrMetric2/index.module.scss +76 -0
  22. package/lib/components/BatchAttrMetric2/setting.js +216 -0
  23. package/lib/components/BatchAttrMetric2/utils.js +97 -0
  24. package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelect.js +15 -0
  25. package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +51 -0
  26. package/lib/components/ModelAttrSelectDrawer/index.js +11 -0
  27. package/lib/core/components/DisplaySettingDrawer/NodeTag.js +1 -0
  28. package/lib/core/hooks/useTopoEdit.js +139 -95
  29. package/lib/core/models/TopoApp.js +1 -1
  30. package/lib/core/models/tagstips/ElementTagTipConfig.js +15 -5
  31. package/lib/core/utils/showGraphManageStatusUtil.js +3 -3
  32. package/lib/utils/tree.js +3 -11
  33. package/lib/utils/treeUtil.js +20 -0
  34. package/package.json +6 -4
@@ -230,9 +230,14 @@ var useTopoEdit = function useTopoEdit(params) {
230
230
 
231
231
  _Dialog.confirm({
232
232
  title: "删除",
233
- content: "若执行相关操作,此区域包含的内容也会一同被删除,确定删除吗?",
233
+ // content: "若执行相关操作,此区域包含的内容也会一同被删除,确定删除吗?",
234
+ content: "是否仅删除区域或将区域包含的内容一同删除?",
235
+ //footer:()=>{return <><Button type="primary" onClick={doDeleteOnlyGroup}>仅删除区域</Button><Button type="primary" onClick={doDeleteOnlyGroup}>确定</Button></>},
234
236
  okProps: {
235
- children: "确定"
237
+ children: "仅删除区域"
238
+ },
239
+ cancelProps: {
240
+ children: "全部删除"
236
241
  },
237
242
  messageProps: {
238
243
  type: "warning"
@@ -243,7 +248,7 @@ var useTopoEdit = function useTopoEdit(params) {
243
248
  while (1) {
244
249
  switch (_context4.prev = _context4.next) {
245
250
  case 0:
246
- doDelete();
251
+ doDeleteOnlyGroup();
247
252
 
248
253
  case 1:
249
254
  case "end":
@@ -258,9 +263,48 @@ var useTopoEdit = function useTopoEdit(params) {
258
263
  }
259
264
 
260
265
  return onOk;
266
+ }(),
267
+ onCancel: function () {
268
+ var _onCancel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
269
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
270
+ while (1) {
271
+ switch (_context5.prev = _context5.next) {
272
+ case 0:
273
+ doDelete();
274
+
275
+ case 1:
276
+ case "end":
277
+ return _context5.stop();
278
+ }
279
+ }
280
+ }, _callee5);
281
+ }));
282
+
283
+ function onCancel() {
284
+ return _onCancel.apply(this, arguments);
285
+ }
286
+
287
+ return onCancel;
261
288
  }()
262
289
  });
263
290
 
291
+ function doDeleteOnlyGroup() {
292
+ // console.log("仅删除区域", topo.view.topoClient, data);
293
+ var children = getGroupChildren(group);
294
+ children.map(function (child) {
295
+ child.setParent(null);
296
+ var viewRect = topo.getGraphView().getViewRect();
297
+ var nodeRect = child.getRect();
298
+ child.setPosition(viewRect.x + nodeRect.width + 2, viewRect.y + nodeRect.height + 4); // 解决集群从区域内移出时,连线位置未更新的问题
299
+
300
+ setTimeout(function () {
301
+ child.iv();
302
+ topo.historyManager.endTransaction();
303
+ }, 50);
304
+ });
305
+ topo.view.topoClient.deleteGroup(data); // console.log("仅删除区域", children, group);
306
+ }
307
+
264
308
  function doDelete() {
265
309
  topo.historyManager.beginTransaction(); // FIXME 。如果命中其他的动态条件,则立即显示
266
310
 
@@ -296,20 +340,20 @@ var useTopoEdit = function useTopoEdit(params) {
296
340
 
297
341
 
298
342
  var deleteExLink = /*#__PURE__*/function () {
299
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(node) {
343
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(node) {
300
344
  var _node$getEdges$toArra, _node$getEdges;
301
345
 
302
346
  var config, edges, exportLinkIdList;
303
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
347
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
304
348
  while (1) {
305
- switch (_context5.prev = _context5.next) {
349
+ switch (_context6.prev = _context6.next) {
306
350
  case 0:
307
351
  config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
308
352
 
309
353
  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 = [];
310
354
 
311
355
  if (!(edges.length > 0)) {
312
- _context5.next = 8;
356
+ _context6.next = 8;
313
357
  break;
314
358
  }
315
359
 
@@ -323,15 +367,15 @@ var useTopoEdit = function useTopoEdit(params) {
323
367
  }
324
368
  });
325
369
  config.exportLinkIdList = exportLinkIdList;
326
- _context5.next = 8;
370
+ _context6.next = 8;
327
371
  return resourceConfig.updateConfig(config);
328
372
 
329
373
  case 8:
330
374
  case "end":
331
- return _context5.stop();
375
+ return _context6.stop();
332
376
  }
333
377
  }
334
- }, _callee5);
378
+ }, _callee6);
335
379
  }));
336
380
 
337
381
  return function deleteExLink(_x3) {
@@ -416,25 +460,25 @@ var useTopoEdit = function useTopoEdit(params) {
416
460
  }
417
461
 
418
462
  function _bindGroupResources() {
419
- _bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(group, resources) {
463
+ _bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(group, resources) {
420
464
  var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
421
465
 
422
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
466
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
423
467
  while (1) {
424
- switch (_context11.prev = _context11.next) {
468
+ switch (_context12.prev = _context12.next) {
425
469
  case 0:
426
470
  id = group.id, tag = group.tag;
427
471
  rlog.debug("bindGroupResources--id, tag", id, tag);
428
472
  topo.historyManager.beginTransaction();
429
- _context11.next = 5;
473
+ _context12.next = 5;
430
474
  return resourceConfig.updateGroupResources(group, resources);
431
475
 
432
476
  case 5:
433
- _context11.next = 7;
477
+ _context12.next = 7;
434
478
  return editDispatchers.fetchDataByConfig();
435
479
 
436
480
  case 7:
437
- _yield$editDispatcher2 = _context11.sent;
481
+ _yield$editDispatcher2 = _context12.sent;
438
482
  elements = _yield$editDispatcher2.elements;
439
483
  // 区域里的子区域及子区域的节点、新增的链路
440
484
  nodeElements = findGroupChildren(elements, group);
@@ -453,10 +497,10 @@ var useTopoEdit = function useTopoEdit(params) {
453
497
 
454
498
  case 14:
455
499
  case "end":
456
- return _context11.stop();
500
+ return _context12.stop();
457
501
  }
458
502
  }
459
- }, _callee11);
503
+ }, _callee12);
460
504
  }));
461
505
  return _bindGroupResources.apply(this, arguments);
462
506
  }
@@ -470,11 +514,11 @@ var useTopoEdit = function useTopoEdit(params) {
470
514
 
471
515
 
472
516
  function _addGroupResources() {
473
- _addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(group, newResourceIds) {
517
+ _addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(group, newResourceIds) {
474
518
  var groupConfig, resources, groupData;
475
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
519
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
476
520
  while (1) {
477
- switch (_context12.prev = _context12.next) {
521
+ switch (_context13.prev = _context13.next) {
478
522
  case 0:
479
523
  groupConfig = resourceConfig.getGroupConfigByElement(group);
480
524
  resources = {
@@ -484,15 +528,15 @@ var useTopoEdit = function useTopoEdit(params) {
484
528
  id: group.getTag(),
485
529
  tag: group.a("tag")
486
530
  };
487
- _context12.next = 5;
531
+ _context13.next = 5;
488
532
  return bindGroupResources(groupData, resources, newResourceIds);
489
533
 
490
534
  case 5:
491
535
  case "end":
492
- return _context12.stop();
536
+ return _context13.stop();
493
537
  }
494
538
  }
495
- }, _callee12);
539
+ }, _callee13);
496
540
  }));
497
541
  return _addGroupResources.apply(this, arguments);
498
542
  }
@@ -509,25 +553,25 @@ var useTopoEdit = function useTopoEdit(params) {
509
553
 
510
554
 
511
555
  function _bindViewResources() {
512
- _bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(data) {
556
+ _bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(data) {
513
557
  var config, _yield$editDispatcher3, elements;
514
558
 
515
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
559
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
516
560
  while (1) {
517
- switch (_context13.prev = _context13.next) {
561
+ switch (_context14.prev = _context14.next) {
518
562
  case 0:
519
563
  // console.log("关联视图的资源", data);
520
564
  config = resourceConfig.getConfig();
521
565
  config.resources = data;
522
- _context13.next = 4;
566
+ _context14.next = 4;
523
567
  return resourceConfig.updateConfig(config);
524
568
 
525
569
  case 4:
526
- _context13.next = 6;
570
+ _context14.next = 6;
527
571
  return editDispatchers.fetchDataByConfig();
528
572
 
529
573
  case 6:
530
- _yield$editDispatcher3 = _context13.sent;
574
+ _yield$editDispatcher3 = _context14.sent;
531
575
  elements = _yield$editDispatcher3.elements;
532
576
  saveBind(TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
533
577
 
@@ -537,10 +581,10 @@ var useTopoEdit = function useTopoEdit(params) {
537
581
 
538
582
  case 10:
539
583
  case "end":
540
- return _context13.stop();
584
+ return _context14.stop();
541
585
  }
542
586
  }
543
- }, _callee13);
587
+ }, _callee14);
544
588
  }));
545
589
  return _bindViewResources.apply(this, arguments);
546
590
  }
@@ -550,24 +594,24 @@ var useTopoEdit = function useTopoEdit(params) {
550
594
  }
551
595
 
552
596
  function _addLayerResources() {
553
- _addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(group, newResourceIds) {
597
+ _addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(group, newResourceIds) {
554
598
  var _yield$editDispatcher4, elements, newElements;
555
599
 
556
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
600
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
557
601
  while (1) {
558
- switch (_context14.prev = _context14.next) {
602
+ switch (_context15.prev = _context15.next) {
559
603
  case 0:
560
604
  topo.historyManager.beginTransaction(); // 构造新的配置
561
605
 
562
- _context14.next = 3;
606
+ _context15.next = 3;
563
607
  return resourceConfig.addLayerStaticResources(group, newResourceIds);
564
608
 
565
609
  case 3:
566
- _context14.next = 5;
610
+ _context15.next = 5;
567
611
  return editDispatchers.fetchDataByConfig();
568
612
 
569
613
  case 5:
570
- _yield$editDispatcher4 = _context14.sent;
614
+ _yield$editDispatcher4 = _context15.sent;
571
615
  elements = _yield$editDispatcher4.elements;
572
616
  // 2022-11-10 修复 添加资源后分层重新布局问题,仅布局新增资源。替换api topo.updateElements(data)
573
617
  newElements = findUNExistedElements(elements);
@@ -590,10 +634,10 @@ var useTopoEdit = function useTopoEdit(params) {
590
634
 
591
635
  case 14:
592
636
  case "end":
593
- return _context14.stop();
637
+ return _context15.stop();
594
638
  }
595
639
  }
596
- }, _callee14);
640
+ }, _callee15);
597
641
  }));
598
642
  return _addLayerResources.apply(this, arguments);
599
643
  }
@@ -603,22 +647,22 @@ var useTopoEdit = function useTopoEdit(params) {
603
647
  }
604
648
 
605
649
  function _addResourceToFirstLayer() {
606
- _addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(data) {
650
+ _addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(data) {
607
651
  var group;
608
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
652
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
609
653
  while (1) {
610
- switch (_context15.prev = _context15.next) {
654
+ switch (_context16.prev = _context16.next) {
611
655
  case 0:
612
656
  group = resourceConfig.getGroups()[0];
613
- _context15.next = 3;
657
+ _context16.next = 3;
614
658
  return addLayerResources(group, data);
615
659
 
616
660
  case 3:
617
661
  case "end":
618
- return _context15.stop();
662
+ return _context16.stop();
619
663
  }
620
664
  }
621
- }, _callee15);
665
+ }, _callee16);
622
666
  }));
623
667
  return _addResourceToFirstLayer.apply(this, arguments);
624
668
  }
@@ -650,28 +694,28 @@ var useTopoEdit = function useTopoEdit(params) {
650
694
 
651
695
 
652
696
  var onSaveComboRes = /*#__PURE__*/function () {
653
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(data) {
654
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
697
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
698
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
655
699
  while (1) {
656
- switch (_context6.prev = _context6.next) {
700
+ switch (_context7.prev = _context7.next) {
657
701
  case 0:
658
702
  rlog.debug("关联资源-----onSaveComboRes", data);
659
703
  topo.historyManager.beginTransaction();
660
704
 
661
705
  if (!(getAddResourceType() === "addToFirstLayer")) {
662
- _context6.next = 7;
706
+ _context7.next = 7;
663
707
  break;
664
708
  }
665
709
 
666
- _context6.next = 5;
710
+ _context7.next = 5;
667
711
  return addResourceToFirstLayer(data);
668
712
 
669
713
  case 5:
670
- _context6.next = 9;
714
+ _context7.next = 9;
671
715
  break;
672
716
 
673
717
  case 7:
674
- _context6.next = 9;
718
+ _context7.next = 9;
675
719
  return bindViewResources(data);
676
720
 
677
721
  case 9:
@@ -683,10 +727,10 @@ var useTopoEdit = function useTopoEdit(params) {
683
727
 
684
728
  case 12:
685
729
  case "end":
686
- return _context6.stop();
730
+ return _context7.stop();
687
731
  }
688
732
  }
689
- }, _callee6);
733
+ }, _callee7);
690
734
  }));
691
735
 
692
736
  return function onSaveComboRes(_x12) {
@@ -695,12 +739,12 @@ var useTopoEdit = function useTopoEdit(params) {
695
739
  }();
696
740
 
697
741
  var onSaveTopo = /*#__PURE__*/function () {
698
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data) {
742
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data) {
699
743
  var id, config, serialize, _config$layout, template, layout, saveConfig;
700
744
 
701
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
745
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
702
746
  while (1) {
703
- switch (_context8.prev = _context8.next) {
747
+ switch (_context9.prev = _context9.next) {
704
748
  case 0:
705
749
  id = data.id, config = data.config, serialize = data.serialize;
706
750
  _config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
@@ -708,12 +752,12 @@ var useTopoEdit = function useTopoEdit(params) {
708
752
  if (onSave) {
709
753
  // 自定义保存
710
754
  saveConfig = /*#__PURE__*/function () {
711
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
712
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
755
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
756
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
713
757
  while (1) {
714
- switch (_context7.prev = _context7.next) {
758
+ switch (_context8.prev = _context8.next) {
715
759
  case 0:
716
- _context7.next = 2;
760
+ _context8.next = 2;
717
761
  return editDispatchers.saveTopo({
718
762
  id: id,
719
763
  layout: layout,
@@ -722,10 +766,10 @@ var useTopoEdit = function useTopoEdit(params) {
722
766
 
723
767
  case 2:
724
768
  case "end":
725
- return _context7.stop();
769
+ return _context8.stop();
726
770
  }
727
771
  }
728
- }, _callee7);
772
+ }, _callee8);
729
773
  }));
730
774
 
731
775
  return function saveConfig() {
@@ -742,10 +786,10 @@ var useTopoEdit = function useTopoEdit(params) {
742
786
 
743
787
  case 3:
744
788
  case "end":
745
- return _context8.stop();
789
+ return _context9.stop();
746
790
  }
747
791
  }
748
- }, _callee8);
792
+ }, _callee9);
749
793
  }));
750
794
 
751
795
  return function onSaveTopo(_x13) {
@@ -775,12 +819,12 @@ var useTopoEdit = function useTopoEdit(params) {
775
819
 
776
820
 
777
821
  var bindNodeResource = /*#__PURE__*/function () {
778
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(params) {
822
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(params) {
779
823
  var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
780
824
 
781
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
825
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
782
826
  while (1) {
783
- switch (_context10.prev = _context10.next) {
827
+ switch (_context11.prev = _context11.next) {
784
828
  case 0:
785
829
  replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
786
830
  return _extends({}, resources, {
@@ -791,11 +835,11 @@ var useTopoEdit = function useTopoEdit(params) {
791
835
  };
792
836
 
793
837
  _doBind = function _doBind3() {
794
- _doBind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
838
+ _doBind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
795
839
  var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
796
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
840
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
797
841
  while (1) {
798
- switch (_context9.prev = _context9.next) {
842
+ switch (_context10.prev = _context10.next) {
799
843
  case 0:
800
844
  dm = htTopo.getGraphView().dm(); // 创建
801
845
 
@@ -864,7 +908,7 @@ var useTopoEdit = function useTopoEdit(params) {
864
908
  // node.a("customName", null);
865
909
  // 删除关联在节点上的出口链路
866
910
 
867
- _context9.next = 12;
911
+ _context10.next = 12;
868
912
  return deleteExLink(node);
869
913
 
870
914
  case 12:
@@ -875,10 +919,10 @@ var useTopoEdit = function useTopoEdit(params) {
875
919
 
876
920
  case 13:
877
921
  case "end":
878
- return _context9.stop();
922
+ return _context10.stop();
879
923
  }
880
924
  }
881
- }, _callee9);
925
+ }, _callee10);
882
926
  }));
883
927
  return _doBind.apply(this, arguments);
884
928
  };
@@ -918,22 +962,22 @@ var useTopoEdit = function useTopoEdit(params) {
918
962
  config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
919
963
  }
920
964
 
921
- _context10.next = 13;
965
+ _context11.next = 13;
922
966
  return resourceConfig.updateConfig(config);
923
967
 
924
968
  case 13:
925
- _context10.next = 15;
969
+ _context11.next = 15;
926
970
  return editDispatchers.fetchDataByConfig();
927
971
 
928
972
  case 15:
929
- _yield$editDispatcher = _context10.sent;
973
+ _yield$editDispatcher = _context11.sent;
930
974
  elements = _yield$editDispatcher.elements;
931
975
  newData = elements.find(function (item) {
932
976
  return item.id === newResId;
933
977
  });
934
978
 
935
979
  if (newData) {
936
- _context10.next = 23;
980
+ _context11.next = 23;
937
981
  break;
938
982
  }
939
983
 
@@ -941,10 +985,10 @@ var useTopoEdit = function useTopoEdit(params) {
941
985
 
942
986
  rlog.warn("关联资源失败");
943
987
  topo.historyManager.endTransaction();
944
- return _context10.abrupt("return", false);
988
+ return _context11.abrupt("return", false);
945
989
 
946
990
  case 23:
947
- _context10.next = 25;
991
+ _context11.next = 25;
948
992
  return doBind();
949
993
 
950
994
  case 25:
@@ -952,10 +996,10 @@ var useTopoEdit = function useTopoEdit(params) {
952
996
 
953
997
  case 26:
954
998
  case "end":
955
- return _context10.stop();
999
+ return _context11.stop();
956
1000
  }
957
1001
  }
958
- }, _callee10);
1002
+ }, _callee11);
959
1003
  }));
960
1004
 
961
1005
  return function bindNodeResource(_x14) {
@@ -972,19 +1016,19 @@ var useTopoEdit = function useTopoEdit(params) {
972
1016
  }
973
1017
 
974
1018
  function _relateNodeIp() {
975
- _relateNodeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(txtValue, nodeElement) {
1019
+ _relateNodeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(txtValue, nodeElement) {
976
1020
  var dm, isUnique, ip, configObj, configData, _elements, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
977
1021
 
978
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
1022
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
979
1023
  while (1) {
980
- switch (_context16.prev = _context16.next) {
1024
+ switch (_context17.prev = _context17.next) {
981
1025
  case 0:
982
1026
  if (txtValue) {
983
- _context16.next = 2;
1027
+ _context17.next = 2;
984
1028
  break;
985
1029
  }
986
1030
 
987
- return _context16.abrupt("return");
1031
+ return _context17.abrupt("return");
988
1032
 
989
1033
  case 2:
990
1034
  // if (txtValue === nodeElement.a('bindIp')) {
@@ -996,12 +1040,12 @@ var useTopoEdit = function useTopoEdit(params) {
996
1040
  isUnique = isUniqueIp(dm, txtValue, nodeElement); // 获取关联链路
997
1041
 
998
1042
  if (!isUnique) {
999
- _context16.next = 23;
1043
+ _context17.next = 23;
1000
1044
  break;
1001
1045
  }
1002
1046
 
1003
1047
  ip = buildIpNode(txtValue);
1004
- _context16.next = 8;
1048
+ _context17.next = 8;
1005
1049
  return deleteExLink(nodeElement);
1006
1050
 
1007
1051
  case 8:
@@ -1010,15 +1054,15 @@ var useTopoEdit = function useTopoEdit(params) {
1010
1054
  nodeElement.setTag("ip:" + txtValue); // 获取配置
1011
1055
 
1012
1056
  configObj = topo.resourceConfig.getConfig();
1013
- _context16.next = 14;
1057
+ _context17.next = 14;
1014
1058
  return resourceConfig.updateConfig(configObj);
1015
1059
 
1016
1060
  case 14:
1017
- _context16.next = 16;
1061
+ _context17.next = 16;
1018
1062
  return editDispatchers.fetchDataByConfig();
1019
1063
 
1020
1064
  case 16:
1021
- configData = _context16.sent;
1065
+ configData = _context17.sent;
1022
1066
  // console.log("configData",configObj, configData);
1023
1067
  _elements = configData.elements;
1024
1068
  newLinkElements = findUNExistedLinkElements(_elements); // console.log("configData", configData, newLinkElements);
@@ -1046,10 +1090,10 @@ var useTopoEdit = function useTopoEdit(params) {
1046
1090
 
1047
1091
  case 23:
1048
1092
  case "end":
1049
- return _context16.stop();
1093
+ return _context17.stop();
1050
1094
  }
1051
1095
  }
1052
- }, _callee16);
1096
+ }, _callee17);
1053
1097
  }));
1054
1098
  return _relateNodeIp.apply(this, arguments);
1055
1099
  }
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
26
26
 
27
- var version = typeof "11.0.0" === 'string' ? "11.0.0" : null;
27
+ var version = typeof "11.0.2" === 'string' ? "11.0.2" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -85,7 +85,7 @@ var ElementTagTipConfig = /*#__PURE__*/function () {
85
85
  _proto.getLinkConfigItems = function getLinkConfigItems() {
86
86
  var mtCodes = getLinkMtCodes(this.topoData);
87
87
  var linkFidldMap = this.getLinkFidldMap();
88
- return [{
88
+ var list = [{
89
89
  id: 'm.critical_link',
90
90
  label: '关键链路'
91
91
  }, {
@@ -100,6 +100,14 @@ var ElementTagTipConfig = /*#__PURE__*/function () {
100
100
  list: linkFidldMap[t.id] || []
101
101
  });
102
102
  });
103
+ return list; // return [
104
+ // { id: 'ax1', label: '本级平台', children: list, type: 'folder', disabled: true },
105
+ // {
106
+ // id: 'bb22', label: '下级平台', type: 'folder', children: [
107
+ // { id: 'xvdafa', label: '关键链路', icon: '/img/model/networkLink.svg' },
108
+ // ]
109
+ // },
110
+ // ]
103
111
  };
104
112
 
105
113
  _proto.getFiedldMapByType = function getFiedldMapByType(mtCodes, type) {
@@ -127,16 +135,18 @@ var ElementTagTipConfig = /*#__PURE__*/function () {
127
135
  map[mtCode] = [].concat(extItems, attributes.map(function (item) {
128
136
  return {
129
137
  type: 'attribute',
130
- typeName: '属性',
138
+ id: "attribute:" + item.code,
139
+ code: "attribute:" + item.code,
131
140
  name: item.name,
132
- code: "attribute:" + item.code
141
+ typeName: '属性'
133
142
  };
134
143
  }), metrics.map(function (item) {
135
144
  return {
136
145
  type: 'metric',
137
- typeName: '指标',
146
+ id: "metric:" + item.code,
147
+ code: "metric:" + item.code,
138
148
  name: item.name,
139
- code: "metric:" + item.code
149
+ typeName: '指标'
140
150
  };
141
151
  }));
142
152
  });
@@ -23,12 +23,12 @@ export function showManageStatus(options) {
23
23
  var readable = !!(permission !== null && permission !== void 0 && permission.readable);
24
24
  var showUnMoniteStatus = !hasAlarm(id) && isNotMonite && readable;
25
25
  var element = topo.getDataModel().getDataByTag(id);
26
- if (!element) return;
26
+ if (!element) return; // ht元素设置是否显示监控状态,是否展示,用于缩小色块时显示未监控颜色
27
+
28
+ element.a('ci.isMonitoring', !showUnMoniteStatus);
27
29
 
28
30
  if (type === 'node') {
29
31
  try {
30
- element.a('isMonitoring', showUnMoniteStatus); // 用于缩小色块时显示未监控颜色
31
-
32
32
  if (showUnMoniteStatus) {
33
33
  topo.getHtTopo().setNodeStyleIcon(element, {
34
34
  styleIcon: 'unMoniter',