@riil-frontend/component-topology 2.15.43 → 2.15.46

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 (139) hide show
  1. package/build/index.css +1 -1
  2. package/build/index.js +22 -22
  3. package/es/components/Drawer/index.js +8 -2
  4. package/es/components/TagImageSelect/index.js +3 -1
  5. package/es/components/TagSelect/index.js +3 -3
  6. package/es/components/TemplateButton/index.module.scss +1 -0
  7. package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
  8. package/es/core/common/icons/icon.js +1 -1
  9. package/es/core/common/icons/useIcons.js +1 -1
  10. package/es/core/components/TopoView/topoView.js +8 -18
  11. package/es/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
  12. package/es/core/editor/components/BackgroundView/index.js +80 -44
  13. package/es/core/editor/components/BackgroundView/index.module.scss +1 -0
  14. package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
  15. package/es/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
  16. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +16 -2
  17. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
  18. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
  19. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
  20. package/es/core/editor/components/CustomIconPlugin/index.js +2 -0
  21. package/es/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
  22. package/es/core/editor/components/EditorPlugin.js +2 -2
  23. package/es/core/editor/components/settings/common/LayoutSettings.js +11 -19
  24. package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -4
  25. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +13 -8
  26. package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
  27. package/es/core/models/TopoApp.js +9 -5
  28. package/es/core/services/background.js +26 -1
  29. package/es/core/store/coreModels.js +32 -26
  30. package/es/core/store/createStore.js +1 -1
  31. package/es/core/test/Test.js +3 -1
  32. package/es/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
  33. package/es/createTopo.js +1 -1
  34. package/es/hooks/useAlarm.js +3 -6
  35. package/es/hooks/useResourceConfig.js +1 -1
  36. package/es/hooks/useTopoEdit.js +4 -8
  37. package/es/models/{iconManage.js → customIcon.js} +1 -1
  38. package/es/models/topoBizMod.js +22 -52
  39. package/es/models/{topoCreateMod.js → topoConfig.js} +8 -4
  40. package/es/models/topoMod.js +32 -69
  41. package/es/{components → topoCenter/components}/Link/form.js +0 -0
  42. package/es/{components → topoCenter/components}/Link/hook.js +0 -0
  43. package/es/{components → topoCenter/components}/Link/index copy.js +1 -1
  44. package/es/{components → topoCenter/components}/Link/index.js +1 -1
  45. package/es/{components → topoCenter/components}/Link/index.module.scss +0 -0
  46. package/es/{components → topoCenter/components}/Link/setting.js +0 -0
  47. package/es/topoCenter/components/TopoView.js +16 -3
  48. package/es/topoCenter/components/Topology.js +0 -5
  49. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
  50. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
  51. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
  52. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
  53. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
  54. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
  55. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
  56. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
  57. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
  58. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
  59. package/es/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -1
  60. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +3 -3
  61. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
  62. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
  63. package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +1 -1
  64. package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
  65. package/es/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
  66. package/es/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
  67. package/es/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
  68. package/es/{models → topoCenter/store}/linkManager.js +0 -0
  69. package/lib/components/Drawer/index.js +7 -2
  70. package/lib/components/TagImageSelect/index.js +3 -1
  71. package/lib/components/TagSelect/index.js +3 -3
  72. package/lib/components/TemplateButton/index.module.scss +1 -0
  73. package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
  74. package/lib/core/common/icons/icon.js +1 -1
  75. package/lib/core/common/icons/useIcons.js +1 -1
  76. package/lib/core/components/TopoView/topoView.js +9 -20
  77. package/lib/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
  78. package/lib/core/editor/components/BackgroundView/index.js +80 -44
  79. package/lib/core/editor/components/BackgroundView/index.module.scss +1 -0
  80. package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
  81. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
  82. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +17 -2
  83. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
  84. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
  85. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
  86. package/lib/core/editor/components/CustomIconPlugin/index.js +11 -0
  87. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
  88. package/lib/core/editor/components/EditorPlugin.js +2 -2
  89. package/lib/core/editor/components/settings/common/LayoutSettings.js +10 -18
  90. package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +2 -4
  91. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +12 -7
  92. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
  93. package/lib/core/models/TopoApp.js +9 -5
  94. package/lib/core/services/background.js +26 -1
  95. package/lib/core/store/coreModels.js +35 -26
  96. package/lib/core/store/createStore.js +2 -2
  97. package/lib/core/test/Test.js +3 -1
  98. package/lib/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
  99. package/lib/createTopo.js +1 -1
  100. package/lib/hooks/useAlarm.js +3 -6
  101. package/lib/hooks/useResourceConfig.js +1 -1
  102. package/lib/hooks/useTopoEdit.js +4 -8
  103. package/lib/models/{iconManage.js → customIcon.js} +1 -1
  104. package/lib/models/topoBizMod.js +22 -52
  105. package/lib/models/{topoCreateMod.js → topoConfig.js} +7 -4
  106. package/lib/models/topoMod.js +32 -69
  107. package/lib/{components → topoCenter/components}/Link/form.js +0 -0
  108. package/lib/{components → topoCenter/components}/Link/hook.js +0 -0
  109. package/lib/{components → topoCenter/components}/Link/index copy.js +1 -1
  110. package/lib/{components → topoCenter/components}/Link/index.js +1 -1
  111. package/lib/{components → topoCenter/components}/Link/index.module.scss +0 -0
  112. package/lib/{components → topoCenter/components}/Link/setting.js +0 -0
  113. package/lib/topoCenter/components/TopoView.js +19 -3
  114. package/lib/topoCenter/components/Topology.js +0 -7
  115. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
  116. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
  117. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
  118. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
  119. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
  120. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
  121. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
  122. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
  123. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
  124. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
  125. package/lib/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -2
  126. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -8
  127. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
  128. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
  129. package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +4 -4
  130. package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
  131. package/lib/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
  132. package/lib/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
  133. package/lib/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
  134. package/lib/{models → topoCenter/store}/linkManager.js +0 -0
  135. package/package.json +2 -2
  136. package/es/core/editor/LinkDynamicStyleConfig.js +0 -16
  137. package/es/core/store/getStoreModels.js +0 -40
  138. package/lib/core/editor/LinkDynamicStyleConfig.js +0 -21
  139. package/lib/core/store/getStoreModels.js +0 -67
@@ -1,6 +1,10 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
+
5
+ /**
6
+ * 拓扑配置
7
+ */
4
8
  import { getUUID, isAvailableArray } from "@riil-frontend/utils";
5
9
  import { transformTopoElements } from "@riil-frontend/component-topology-graph/es/utils";
6
10
  import topoService, { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
@@ -245,7 +249,7 @@ export default function (topoApp) {
245
249
  while (1) {
246
250
  switch (_context2.prev = _context2.next) {
247
251
  case 0:
248
- editState = rootState.topoCreateMod;
252
+ editState = rootState.topoConfig;
249
253
  resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups;
250
254
  query = {
251
255
  id: rootState.topoMod.topoId,
@@ -329,7 +333,7 @@ export default function (topoApp) {
329
333
  data = _context4.sent;
330
334
  rlog.debug("getTopoByConditions--------", data, groupInfo);
331
335
  _context4.next = 13;
332
- return Promise.all([topoApp.ciTyeCache.getCiTypeMap(getCiTypes(data)), dispatch.iconManage.loadCustomIcons()]);
336
+ return Promise.all([topoApp.ciTyeCache.getCiTypeMap(getCiTypes(data)), dispatch.customIcon.loadCustomIcons()]);
333
337
 
334
338
  case 13:
335
339
  _yield$Promise$all = _context4.sent;
@@ -397,7 +401,7 @@ export default function (topoApp) {
397
401
  var _this5 = this;
398
402
 
399
403
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
400
- var _state$topoCreateMod$;
404
+ var _state$topoConfig$vie;
401
405
 
402
406
  var currentBackground;
403
407
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
@@ -407,7 +411,7 @@ export default function (topoApp) {
407
411
  currentBackground = topoApp.store.getModelState('background').current;
408
412
  _context6.next = 3;
409
413
  return _saveTopo(_extends({}, data, {
410
- viewGroupId: (_state$topoCreateMod$ = state.topoCreateMod.viewGroup) === null || _state$topoCreateMod$ === void 0 ? void 0 : _state$topoCreateMod$.id,
414
+ viewGroupId: (_state$topoConfig$vie = state.topoConfig.viewGroup) === null || _state$topoConfig$vie === void 0 ? void 0 : _state$topoConfig$vie.id,
411
415
  template: state.topoMod.type,
412
416
  // 背景图
413
417
  backgroundId: currentBackground ? currentBackground.id : null
@@ -21,7 +21,6 @@ export default function (topoApp) {
21
21
  topoLoadError: false,
22
22
  id: undefined,
23
23
  topoId: "",
24
- topoName: "",
25
24
  type: undefined,
26
25
  data: null,
27
26
  // 后端返回的分组、连线、节点数据
@@ -29,22 +28,6 @@ export default function (topoApp) {
29
28
  // ht 拓扑数据,用于首次load
30
29
  currentTopo: undefined,
31
30
  topoPermission: undefined,
32
- currentNode: {
33
- id: "",
34
- name: "无数据"
35
- },
36
- topoAlarmIsOpen: false,
37
- // 拓扑通道是否打开
38
- alarmPanelIsOpen: false,
39
- // 告警弹窗是否打开
40
- alarmData: null,
41
- // 概览抽屉中告警列表相关数据 TODO 抽取
42
- currentCiInfo: null,
43
- // 概览抽屉当前CI元数据 TODO 抽取
44
- addLinkIsOpen: false,
45
- // 添加链路抽屉显示
46
- ciConnectable: [],
47
- // 可创建联系ci列表
48
31
  resAndMetrics: {
49
32
  res: [],
50
33
  metrics: [],
@@ -187,10 +170,19 @@ export default function (topoApp) {
187
170
  }, _callee2);
188
171
  }))();
189
172
  },
173
+
174
+ /**
175
+ * 设置拓扑类型
176
+ * @param {*} type
177
+ */
178
+ setTopoType: function setTopoType(type) {
179
+ this.update({
180
+ type: type
181
+ });
182
+ },
190
183
  clearData: function clearData() {
191
184
  this.update({
192
185
  topoId: "",
193
- topoName: "",
194
186
  topoData: null,
195
187
  graphLoaded: false,
196
188
  data: null,
@@ -417,7 +409,7 @@ export default function (topoApp) {
417
409
  result = parseTopoData(result);
418
410
  rlog.debug("topoMod.initTopoData 查询数据完成", topoId, linkTo, result);
419
411
  _context6.next = 40;
420
- return Promise.all([topoApp.ciTyeCache.getCiTypeMap(getCiTypes(result)), dispatch.iconManage.loadCustomIcons()]);
412
+ return Promise.all([topoApp.ciTyeCache.getCiTypeMap(getCiTypes(result)), dispatch.customIcon.loadCustomIcons()]);
421
413
 
422
414
  case 40:
423
415
  _yield$Promise$all = _context6.sent;
@@ -440,6 +432,7 @@ export default function (topoApp) {
440
432
 
441
433
  _this5.update({
442
434
  type: (_result$config = result.config) === null || _result$config === void 0 ? void 0 : _result$config.showType,
435
+ currentTopo: topoData.config,
443
436
  data: result,
444
437
  topoData: topoData,
445
438
  resAndMetrics: resAndMetrics,
@@ -577,95 +570,65 @@ export default function (topoApp) {
577
570
  }, _callee10);
578
571
  }))();
579
572
  },
580
- getCiInfo: function getCiInfo(conditions, state) {
573
+ getTopoPermission: function getTopoPermission(playload, rootState) {
581
574
  var _this8 = this;
582
575
 
583
576
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
584
- var result;
577
+ var id, update, topoPermission, getTopoPermission;
585
578
  return _regeneratorRuntime.wrap(function _callee11$(_context11) {
586
579
  while (1) {
587
580
  switch (_context11.prev = _context11.next) {
588
- case 0:
589
- _context11.next = 2;
590
- return getCiMeta(conditions);
591
-
592
- case 2:
593
- result = _context11.sent;
594
-
595
- // rlog.debug("getCiInfo", result);
596
- _this8.update({
597
- // alarmList: result.datas,
598
- currentCiInfo: result // drawerAlarmPageInfo,
599
-
600
- });
601
-
602
- case 4:
603
- case "end":
604
- return _context11.stop();
605
- }
606
- }
607
- }, _callee11);
608
- }))();
609
- },
610
- getTopoPermission: function getTopoPermission(playload, rootState) {
611
- var _this9 = this;
612
-
613
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
614
- var id, update, topoPermission, getTopoPermission;
615
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
616
- while (1) {
617
- switch (_context12.prev = _context12.next) {
618
581
  case 0:
619
582
  id = playload.id, update = playload.update;
620
- _context12.prev = 1;
583
+ _context11.prev = 1;
621
584
  getTopoPermission = topoApp.options.getTopoPermission || topoService.auth.getTopoPermission;
622
- _context12.next = 5;
585
+ _context11.next = 5;
623
586
  return getTopoPermission(id);
624
587
 
625
588
  case 5:
626
- topoPermission = _context12.sent;
627
- _context12.next = 11;
589
+ topoPermission = _context11.sent;
590
+ _context11.next = 11;
628
591
  break;
629
592
 
630
593
  case 8:
631
- _context12.prev = 8;
632
- _context12.t0 = _context12["catch"](1);
633
- rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context12.t0); // 尚未区分拓扑图不存在还是接口请求报错
594
+ _context11.prev = 8;
595
+ _context11.t0 = _context11["catch"](1);
596
+ rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context11.t0); // 尚未区分拓扑图不存在还是接口请求报错
634
597
 
635
598
  case 11:
636
- _context12.next = 13;
599
+ _context11.next = 13;
637
600
  return dispatch.functionAuth.checkAuth('createTopo');
638
601
 
639
602
  case 13:
640
- if (!_context12.sent) {
641
- _context12.next = 17;
603
+ if (!_context11.sent) {
604
+ _context11.next = 17;
642
605
  break;
643
606
  }
644
607
 
645
- _context12.t1 = 'delete';
646
- _context12.next = 18;
608
+ _context11.t1 = 'delete';
609
+ _context11.next = 18;
647
610
  break;
648
611
 
649
612
  case 17:
650
- _context12.t1 = 'read';
613
+ _context11.t1 = 'read';
651
614
 
652
615
  case 18:
653
- topoPermission = _context12.t1;
616
+ topoPermission = _context11.t1;
654
617
 
655
618
  if (update !== false) {
656
- _this9.update({
619
+ _this8.update({
657
620
  topoPermission: topoPermission
658
621
  });
659
622
  }
660
623
 
661
- return _context12.abrupt("return", topoPermission);
624
+ return _context11.abrupt("return", topoPermission);
662
625
 
663
626
  case 21:
664
627
  case "end":
665
- return _context12.stop();
628
+ return _context11.stop();
666
629
  }
667
630
  }
668
- }, _callee12, null, [[1, 8]]);
631
+ }, _callee11, null, [[1, 8]]);
669
632
  }))();
670
633
  }
671
634
  };
@@ -18,7 +18,7 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
18
18
  topo = props.topo;
19
19
  var store = topo.store;
20
20
 
21
- var _store$useModel = store.useModel('topoCreateMod'),
21
+ var _store$useModel = store.useModel('topoConfig'),
22
22
  editState = _store$useModel[0],
23
23
  editDispatchers = _store$useModel[1];
24
24
 
@@ -18,7 +18,7 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
18
18
  topo = props.topo;
19
19
  var store = topo.store;
20
20
 
21
- var _store$useModel = store.useModel('topoCreateMod'),
21
+ var _store$useModel = store.useModel('topoConfig'),
22
22
  editState = _store$useModel[0],
23
23
  editDispatchers = _store$useModel[1];
24
24
 
@@ -10,11 +10,13 @@ import Topo404 from "./Topo404";
10
10
  import TopoNoPermission from "./TopoNoPermission";
11
11
  import styles from "../../components/index.module.scss";
12
12
  import AlarmListPanel from "../../core/components/AlarmListPanel";
13
+ import useLinkDynamicStyle from "../hooks/useLinkDynamicStyle";
14
+ import useRelateTopo from "../hooks/viewer/useRelateTopo";
13
15
  /**
14
16
  * 拓扑组件。变化无权限、无数据显示
15
17
  */
16
18
 
17
- function NetworkTopology(props) {
19
+ function NetworkTopologyCore(props) {
18
20
  var topo = props.topo,
19
21
  titleBar = props.titleBar,
20
22
  onEnterEdit = props.onEnterEdit,
@@ -25,6 +27,12 @@ function NetworkTopology(props) {
25
27
  topoId = topoState.topoId,
26
28
  topoData = topoState.topoData,
27
29
  topoPermission = topoState.topoPermission;
30
+ useLinkDynamicStyle({
31
+ topo: topo
32
+ });
33
+ var relateTopo = useRelateTopo({
34
+ topo: topo
35
+ });
28
36
 
29
37
  var renderTopoView = function renderTopoView() {
30
38
  var viewerProps = _extends({}, props.viewerProps, {
@@ -34,11 +42,16 @@ function NetworkTopology(props) {
34
42
  plugins: []
35
43
  });
36
44
 
45
+ var handleEvent = function handleEvent(event) {
46
+ relateTopo.onEvent(event);
47
+ };
48
+
37
49
  return /*#__PURE__*/React.createElement(BasicTopoView, _extends({}, otherProps, {
38
50
  topo: topo,
39
51
  viewerProps: viewerProps,
40
52
  titleBar: titleBar,
41
- onEnterEdit: onEnterEdit
53
+ onEnterEdit: onEnterEdit,
54
+ onEvent: handleEvent
42
55
  }));
43
56
  };
44
57
 
@@ -77,4 +90,4 @@ function NetworkTopology(props) {
77
90
  }, renderContent()));
78
91
  }
79
92
 
80
- export default NetworkTopology;
93
+ export default NetworkTopologyCore;
@@ -1,20 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useState, useEffect, useRef, useCallback } from "react";
3
- import { TopoEvent } from "@riil-frontend/component-topology-graph";
4
3
  import TopoView from "./TopoView";
5
4
  import LayerRelatedResourceList from "./editor/propertyViews/LayerRelatedResourceList";
6
5
  import LayerConfigPlugin from "./editor/plugins/LayerConfigPlugin";
7
6
  import EdgeGroupPropertyView from "./editor/propertyViews/edge/EdgeGroupPropertyView";
8
7
  import LinkPropertyView from "./editor/propertyViews/edge/LinkPropertyView";
9
- import useLinkDynamicStyle from "../hooks/useLinkDynamicStyle";
10
8
  import AddLinkDrawer from "./editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer";
11
9
  import useTopoEdit from "../hooks/useTopoEdit";
12
10
  export default function NetworkTopologyFull(props) {
13
11
  var topo = props.topo,
14
12
  customEditorProps = props.editorProps;
15
- useLinkDynamicStyle({
16
- topo: topo
17
- });
18
13
  var topoEdit = useTopoEdit({
19
14
  topo: topo
20
15
  });
@@ -2,7 +2,7 @@ import _Tab from "@alifd/next/es/tab";
2
2
  import React, { useState, useEffect } from 'react';
3
3
  import TabView from "../../../../../core/editor/components/settings/common/tab/TabView";
4
4
  import EdgeGroupSetting from "../../../../../core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting";
5
- import LindInfoPreview from "./link/LindInfoPreview";
5
+ import LindInfoPreview from "./link/LinkInfoPreview";
6
6
  export default function EdgeGroupPropertyView(props) {
7
7
  var topo = props.topo,
8
8
  edge = props.edge,
@@ -1,7 +1,7 @@
1
1
  import _Button from "@alifd/next/es/button";
2
2
  import React from "react";
3
- import LindInfoPreview from "../../link/LindInfoPreview";
4
- import styles from "../../link/LindInfoPreview.module.scss";
3
+ import LindInfoPreview from "../../link/LinkInfoPreview";
4
+ import styles from "../../link/LinkInfoPreview.module.scss";
5
5
  import rlog from "@riil-frontend/component-topology-utils/es/rlog";
6
6
  import { getLinkPermission } from "../../../../../../utils/linPermissionUtil";
7
7
  export default function LinkDataTab(props) {
@@ -22,7 +22,7 @@ export default function LinkDataTab(props) {
22
22
  return item.id === edge.getTag();
23
23
  });
24
24
 
25
- var _topo$store$useModel = topo.store.useModel("topoCreateMod"),
25
+ var _topo$store$useModel = topo.store.useModel("topoConfig"),
26
26
  editState = _topo$store$useModel[0],
27
27
  editDispatchers = _topo$store$useModel[1];
28
28
 
@@ -22,7 +22,7 @@ function AddLinkDrawer(props) {
22
22
  lineData = props.lineData;
23
23
  var store = topo.store;
24
24
 
25
- var _store$useModel = store.useModel("topoCreateMod"),
25
+ var _store$useModel = store.useModel("topoConfig"),
26
26
  editState = _store$useModel[0],
27
27
  editDispatchers = _store$useModel[1];
28
28
 
@@ -74,7 +74,7 @@ export default function EditLinkInfo(props) {
74
74
  setSource(source);
75
75
  setTarget(target);
76
76
  field.setValues(attributes);
77
- }, [source, target, field, attributes]); // const [editState, editDispatchers] = store.useModel("topoCreateMod");
77
+ }, [source, target, field, attributes]); // const [editState, editDispatchers] = store.useModel("topoConfig");
78
78
 
79
79
  var labelAlign = "top";
80
80
  var formItemLayout = {
@@ -1,7 +1,7 @@
1
1
  import _Box from "@alifd/next/es/box";
2
2
  import _Collapse from "@alifd/next/es/collapse";
3
3
  import React, { useEffect } from "react";
4
- import styles from "./LindInfoPreview.module.scss";
4
+ import styles from "./LinkInfoPreview.module.scss";
5
5
  import { formatMetric } from "../../../../../../core/models/attributeFormatter";
6
6
  var CollapsePanel = _Collapse.Panel;
7
7
  export default function LindInfoPreview(props) {
@@ -2,9 +2,9 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { TopoEvent } from '@riil-frontend/component-topology-graph';
4
4
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
5
- import { loopTreeFun } from "../utils/tree";
5
+ import { loopTreeFun } from "../../../utils/tree";
6
6
  /**
7
- * 关联拓扑
7
+ * 关联拓扑:FIXME 移到拓扑中心
8
8
  *
9
9
  * 双击容器打开关联拓扑图
10
10
  * 双击缩略图返回原拓扑图
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
 
5
5
  /**
6
- * 动态设置链路样式 Model
6
+ * 动态设置链路样式 Model。-- 功能已废弃
7
7
  */
8
8
  import _ from 'lodash';
9
9
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
@@ -209,12 +209,12 @@ export default function (engine) {
209
209
 
210
210
  links = [];
211
211
 
212
- if (!(isEdit && rootState.topoCreateMod.topoData.links.length)) {
212
+ if (!(isEdit && rootState.topoConfig.topoData.links.length)) {
213
213
  _context3.next = 10;
214
214
  break;
215
215
  }
216
216
 
217
- links = rootState.topoCreateMod.topoData.links;
217
+ links = rootState.topoConfig.topoData.links;
218
218
  _context3.next = 13;
219
219
  break;
220
220
 
@@ -3,7 +3,8 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _extends from "@babel/runtime/helpers/extends";
4
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  import clone from 'lodash/cloneDeep';
6
- var ruleKey = 0;
6
+ var ruleKey = 0; // -- 功能已废弃
7
+
7
8
  export default {
8
9
  // 定义 model 的初始 state
9
10
  state: {
File without changes
@@ -11,12 +11,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
 
12
12
  var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
13
13
 
14
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
15
+
14
16
  var _react = _interopRequireDefault(require("react"));
15
17
 
16
18
  var _classnames = _interopRequireDefault(require("classnames"));
17
19
 
18
20
  var _indexModule = _interopRequireDefault(require("./index.module.scss"));
19
21
 
22
+ var _excluded = ["bodyClassName"];
20
23
  var headerStyle = {
21
24
  zIndex: 1000
22
25
  };
@@ -37,6 +40,8 @@ var Drawer = function Drawer(props) {
37
40
  onSave = props.onSave,
38
41
  drawerProps = props.drawerProps,
39
42
  children = props.children;
43
+ var bodyClassName = drawerProps.bodyClassName,
44
+ otherDrawerProps = (0, _objectWithoutPropertiesLoose2["default"])(drawerProps, _excluded);
40
45
  return /*#__PURE__*/_react["default"].createElement(_drawer["default"], (0, _extends2["default"])({
41
46
  title: title,
42
47
  placement: "right",
@@ -44,12 +49,12 @@ var Drawer = function Drawer(props) {
44
49
  headerStyle: headerStyle,
45
50
  bodyStyle: bodyStyle,
46
51
  closeMode: ['close', 'esc']
47
- }, drawerProps, {
52
+ }, otherDrawerProps, {
48
53
  className: (0, _classnames["default"])(_indexModule["default"].drawer, drawerProps.className),
49
54
  visible: visible,
50
55
  onClose: onClose
51
56
  }), /*#__PURE__*/_react["default"].createElement("div", {
52
- className: (0, _classnames["default"])(_indexModule["default"].content, drawerProps.bodyClassName)
57
+ className: (0, _classnames["default"])(_indexModule["default"].content, bodyClassName)
53
58
  }, children), footer && /*#__PURE__*/_react["default"].createElement("div", {
54
59
  className: _indexModule["default"].footer
55
60
  }, /*#__PURE__*/_react["default"].createElement(_button["default"], {
@@ -17,7 +17,7 @@ var _TagSelect = _interopRequireDefault(require("../TagSelect"));
17
17
 
18
18
  var _indexModule = _interopRequireDefault(require("./index.module.scss"));
19
19
 
20
- var _excluded = ["dataSource", "onChange", "size", "boxProps", "tagProps", "itemProps", "ItemComponent"];
20
+ var _excluded = ["dataSource", "onChange", "size", "boxProps", "tagProps", "itemProps", "ItemComponent", "value"];
21
21
 
22
22
  var TagImageSelect = function TagImageSelect(props) {
23
23
  var dataSource = props.dataSource,
@@ -27,11 +27,13 @@ var TagImageSelect = function TagImageSelect(props) {
27
27
  tagProps = props.tagProps,
28
28
  itemProps = props.itemProps,
29
29
  ItemComponent = props.ItemComponent,
30
+ value = props.value,
30
31
  otherProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
31
32
  var Item = ItemComponent || _TemplateButton["default"];
32
33
  return /*#__PURE__*/_react["default"].createElement(_TagSelect["default"], (0, _extends2["default"])({}, otherProps, {
33
34
  onChange: onChange,
34
35
  className: _indexModule["default"].tagSelect,
36
+ value: value,
35
37
  dataSource: dataSource.map(function (item) {
36
38
  return {
37
39
  key: item.id,
@@ -37,9 +37,9 @@ var TagSelect = function TagSelect(props) {
37
37
  setCurrent = _useState[1];
38
38
 
39
39
  (0, _react.useEffect)(function () {
40
- if (value) {
41
- setCurrent(value);
42
- }
40
+ // if (value) {
41
+ // }
42
+ setCurrent(value);
43
43
  }, [value]);
44
44
  return /*#__PURE__*/_react["default"].createElement("div", {
45
45
  className: "tag-select-wrap"
@@ -14,6 +14,7 @@
14
14
  display: flex;
15
15
  justify-content: center;
16
16
  align-items: center;
17
+ user-select: none;
17
18
  }
18
19
 
19
20
  .icon {
@@ -6,13 +6,22 @@ exports["default"] = void 0;
6
6
  var _react = require("react");
7
7
 
8
8
  var _default = function _default(topo, fn) {
9
+ var topoModState = topo.store.useModelState('topoMod');
10
+ var graphLoaded = topoModState.graphLoaded;
9
11
  (0, _react.useEffect)(function () {
10
- var dataModel = topo.getDataModel();
11
- dataModel.addDataPropertyChangeListener(fn);
12
+ var dataModel;
13
+
14
+ if (graphLoaded) {
15
+ dataModel = topo.getDataModel();
16
+ dataModel.addDataPropertyChangeListener(fn);
17
+ }
18
+
12
19
  return function () {
13
- dataModel.removeDataPropertyChangeListener(fn);
20
+ if (dataModel) {
21
+ dataModel.removeDataPropertyChangeListener(fn);
22
+ }
14
23
  };
15
- }, [fn]);
24
+ }, [topo, graphLoaded, fn]);
16
25
  };
17
26
 
18
27
  exports["default"] = _default;
@@ -93,7 +93,7 @@ function transformCustomIcons2HtIcons(icons) {
93
93
 
94
94
 
95
95
  function getUserCustomIcons(topo) {
96
- var uploadIcons = topo.store.getModelState('iconManage').icons;
96
+ var uploadIcons = topo.store.getModelState('customIcon').icons;
97
97
  return [].concat(transformCustomIcons2HtIcons(uploadIcons.node));
98
98
  } // 获得节点图标列表
99
99
 
@@ -7,7 +7,7 @@ exports.useNodeIcons = useNodeIcons;
7
7
  var _icon = require("./icon");
8
8
 
9
9
  function useCustomIcons(topo) {
10
- var _topo$store$useModelS = topo.store.useModelState('iconManage'),
10
+ var _topo$store$useModelS = topo.store.useModelState('customIcon'),
11
11
  icons = _topo$store$useModelS.icons;
12
12
 
13
13
  var customIcons = icons.node.map(_icon.transformCustomIcon2HtIcon);