@riil-frontend/component-topology 2.15.44 → 2.15.45

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 (125) hide show
  1. package/build/index.css +1 -1
  2. package/build/index.js +2 -2
  3. package/es/components/Drawer/index.js +8 -2
  4. package/es/components/TemplateButton/index.module.scss +1 -0
  5. package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
  6. package/es/core/common/icons/icon.js +1 -1
  7. package/es/core/common/icons/useIcons.js +1 -1
  8. package/es/core/components/TopoView/topoView.js +8 -18
  9. package/es/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
  10. package/es/core/editor/components/BackgroundView/index.module.scss +1 -0
  11. package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
  12. package/es/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
  13. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +16 -2
  14. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
  15. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
  16. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
  17. package/es/core/editor/components/CustomIconPlugin/index.js +2 -0
  18. package/es/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
  19. package/es/core/editor/components/EditorPlugin.js +2 -2
  20. package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
  21. package/es/core/models/TopoApp.js +9 -5
  22. package/es/core/store/coreModels.js +32 -26
  23. package/es/core/store/createStore.js +1 -1
  24. package/es/core/test/Test.js +3 -1
  25. package/es/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
  26. package/es/createTopo.js +1 -1
  27. package/es/hooks/useAlarm.js +3 -6
  28. package/es/hooks/useResourceConfig.js +1 -1
  29. package/es/hooks/useTopoEdit.js +4 -8
  30. package/es/models/{iconManage.js → customIcon.js} +1 -1
  31. package/es/models/topoBizMod.js +22 -52
  32. package/es/models/{topoCreateMod.js → topoConfig.js} +8 -4
  33. package/es/models/topoMod.js +32 -69
  34. package/es/{components → topoCenter/components}/Link/form.js +0 -0
  35. package/es/{components → topoCenter/components}/Link/hook.js +0 -0
  36. package/es/{components → topoCenter/components}/Link/index copy.js +1 -1
  37. package/es/{components → topoCenter/components}/Link/index.js +1 -1
  38. package/es/{components → topoCenter/components}/Link/index.module.scss +0 -0
  39. package/es/{components → topoCenter/components}/Link/setting.js +0 -0
  40. package/es/topoCenter/components/TopoView.js +16 -3
  41. package/es/topoCenter/components/Topology.js +0 -5
  42. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
  43. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
  44. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
  45. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
  46. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
  47. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
  48. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
  49. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
  50. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
  51. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
  52. package/es/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -1
  53. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +3 -3
  54. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
  55. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
  56. package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +1 -1
  57. package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
  58. package/es/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
  59. package/es/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
  60. package/es/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
  61. package/es/{models → topoCenter/store}/linkManager.js +0 -0
  62. package/lib/components/Drawer/index.js +7 -2
  63. package/lib/components/TemplateButton/index.module.scss +1 -0
  64. package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
  65. package/lib/core/common/icons/icon.js +1 -1
  66. package/lib/core/common/icons/useIcons.js +1 -1
  67. package/lib/core/components/TopoView/topoView.js +9 -20
  68. package/lib/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
  69. package/lib/core/editor/components/BackgroundView/index.module.scss +1 -0
  70. package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
  71. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
  72. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +17 -2
  73. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
  74. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
  75. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
  76. package/lib/core/editor/components/CustomIconPlugin/index.js +11 -0
  77. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
  78. package/lib/core/editor/components/EditorPlugin.js +2 -2
  79. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
  80. package/lib/core/models/TopoApp.js +9 -5
  81. package/lib/core/store/coreModels.js +35 -26
  82. package/lib/core/store/createStore.js +2 -2
  83. package/lib/core/test/Test.js +3 -1
  84. package/lib/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
  85. package/lib/createTopo.js +1 -1
  86. package/lib/hooks/useAlarm.js +3 -6
  87. package/lib/hooks/useResourceConfig.js +1 -1
  88. package/lib/hooks/useTopoEdit.js +4 -8
  89. package/lib/models/{iconManage.js → customIcon.js} +1 -1
  90. package/lib/models/topoBizMod.js +22 -52
  91. package/lib/models/{topoCreateMod.js → topoConfig.js} +7 -4
  92. package/lib/models/topoMod.js +32 -69
  93. package/lib/{components → topoCenter/components}/Link/form.js +0 -0
  94. package/lib/{components → topoCenter/components}/Link/hook.js +0 -0
  95. package/lib/{components → topoCenter/components}/Link/index copy.js +1 -1
  96. package/lib/{components → topoCenter/components}/Link/index.js +1 -1
  97. package/lib/{components → topoCenter/components}/Link/index.module.scss +0 -0
  98. package/lib/{components → topoCenter/components}/Link/setting.js +0 -0
  99. package/lib/topoCenter/components/TopoView.js +19 -3
  100. package/lib/topoCenter/components/Topology.js +0 -7
  101. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
  102. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
  103. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
  104. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
  105. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
  106. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
  107. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
  108. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
  109. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
  110. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
  111. package/lib/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -2
  112. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -8
  113. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
  114. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
  115. package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +4 -4
  116. package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
  117. package/lib/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
  118. package/lib/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
  119. package/lib/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
  120. package/lib/{models → topoCenter/store}/linkManager.js +0 -0
  121. package/package.json +2 -2
  122. package/es/core/editor/LinkDynamicStyleConfig.js +0 -16
  123. package/es/core/store/getStoreModels.js +0 -40
  124. package/lib/core/editor/LinkDynamicStyleConfig.js +0 -21
  125. package/lib/core/store/getStoreModels.js +0 -67
@@ -39,7 +39,7 @@ var useTopoEdit = function useTopoEdit(params) {
39
39
  topoEditState = _store$useModel[0],
40
40
  topoEditDispatchers = _store$useModel[1];
41
41
 
42
- var _store$useModel2 = store.useModel('topoCreateMod'),
42
+ var _store$useModel2 = store.useModel('topoConfig'),
43
43
  editState = _store$useModel2[0],
44
44
  editDispatchers = _store$useModel2[1];
45
45
 
@@ -105,9 +105,7 @@ var useTopoEdit = function useTopoEdit(params) {
105
105
  }); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
106
106
 
107
107
  if (!isLayerTopo && config.layers.length) {
108
- topoDispatchers.update({
109
- type: TPL_TREE
110
- });
108
+ topoDispatchers.setTopoType(TPL_TREE);
111
109
  } // 更新配置
112
110
 
113
111
 
@@ -125,9 +123,7 @@ var useTopoEdit = function useTopoEdit(params) {
125
123
  }); // 如果没有分层,将拓扑类型切换为空白模板
126
124
 
127
125
  if (!config.layers.length) {
128
- topoDispatchers.update({
129
- type: TPL_BLANK
130
- });
126
+ topoDispatchers.setTopoType(TPL_BLANK);
131
127
  } // 更新配置
132
128
 
133
129
 
@@ -921,7 +917,7 @@ var useTopoEdit = function useTopoEdit(params) {
921
917
  }
922
918
  };
923
919
 
924
- var effectsState = store.useModelEffectsState('topoCreateMod');
920
+ var effectsState = store.useModelEffectsState('topoConfig');
925
921
  var topoLoading = effectsState.getTopoByConditions.isLoading;
926
922
  return {
927
923
  resourceConfig: resourceConfig,
@@ -163,7 +163,7 @@ export default function (engine) {
163
163
  _this3.update({
164
164
  visible: false,
165
165
  icons: {
166
- node: [].concat(rootState.iconManage.icons.node, data.map(addIconUrlData)),
166
+ node: [].concat(rootState.customIcon.icons.node, data.map(addIconUrlData)),
167
167
  container: []
168
168
  }
169
169
  });
@@ -67,105 +67,75 @@ export default function (engine) {
67
67
  }, _callee);
68
68
  }))();
69
69
  },
70
- getCiInfo: function getCiInfo(conditions, state) {
71
- var _this2 = this;
72
-
73
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
74
- var result;
75
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
76
- while (1) {
77
- switch (_context2.prev = _context2.next) {
78
- case 0:
79
- _context2.next = 2;
80
- return getCiMeta(conditions);
81
-
82
- case 2:
83
- result = _context2.sent;
84
-
85
- // rlog.debug('getCiInfo', result);
86
- _this2.update({
87
- // alarmList: result.datas,
88
- currentCiInfo: result // drawerAlarmPageInfo,
89
-
90
- });
91
-
92
- case 4:
93
- case "end":
94
- return _context2.stop();
95
- }
96
- }
97
- }, _callee2);
98
- }))();
99
- },
100
70
  // 根据ci的id获取属性的值
101
71
  getCiArrByIds: function getCiArrByIds(conditions, state) {
102
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
72
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
103
73
  var resIdsList, result;
104
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
74
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
105
75
  while (1) {
106
- switch (_context3.prev = _context3.next) {
76
+ switch (_context2.prev = _context2.next) {
107
77
  case 0:
108
78
  resIdsList = state.topoBizMod.resAndMetrics.resIdsList; // rlog.debug('根据ci的id获取属性的值-getCiArrByIds', resIdsList);
109
79
  // const ciIds = encodeURIComponent(resIdsList);
110
80
 
111
- _context3.prev = 1;
112
- _context3.next = 4;
81
+ _context2.prev = 1;
82
+ _context2.next = 4;
113
83
  return topoServer.getBatchCiArr({
114
84
  ids: resIdsList
115
85
  });
116
86
 
117
87
  case 4:
118
- result = _context3.sent;
119
- return _context3.abrupt("return", result.content);
88
+ result = _context2.sent;
89
+ return _context2.abrupt("return", result.content);
120
90
 
121
91
  case 8:
122
- _context3.prev = 8;
123
- _context3.t0 = _context3["catch"](1);
124
- return _context3.abrupt("return", null);
92
+ _context2.prev = 8;
93
+ _context2.t0 = _context2["catch"](1);
94
+ return _context2.abrupt("return", null);
125
95
 
126
96
  case 11:
127
97
  case "end":
128
- return _context3.stop();
98
+ return _context2.stop();
129
99
  }
130
100
  }
131
- }, _callee3, null, [[1, 8]]);
101
+ }, _callee2, null, [[1, 8]]);
132
102
  }))();
133
103
  },
134
104
  // 初始化,统一获取指标和属性
135
105
  getCiBizByIds: function getCiBizByIds(conditions, state) {
136
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
106
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
137
107
  var _conditions$ciIds, _conditions$codes;
138
108
 
139
109
  var _state$topoBizMod$res, resIdsList, metrics, ciIds, codes, metricResult, arrResult;
140
110
 
141
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
111
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
142
112
  while (1) {
143
- switch (_context4.prev = _context4.next) {
113
+ switch (_context3.prev = _context3.next) {
144
114
  case 0:
145
115
  _state$topoBizMod$res = state.topoBizMod.resAndMetrics, resIdsList = _state$topoBizMod$res.resIdsList, metrics = _state$topoBizMod$res.metrics;
146
116
  ciIds = encodeURIComponent((_conditions$ciIds = conditions === null || conditions === void 0 ? void 0 : conditions.ciIds) !== null && _conditions$ciIds !== void 0 ? _conditions$ciIds : resIdsList);
147
117
  codes = encodeURIComponent((_conditions$codes = conditions === null || conditions === void 0 ? void 0 : conditions.codes) !== null && _conditions$codes !== void 0 ? _conditions$codes : metrics);
148
- _context4.next = 5;
118
+ _context3.next = 5;
149
119
  return getLatestMetrics(ciIds, codes);
150
120
 
151
121
  case 5:
152
- metricResult = _context4.sent;
153
- _context4.next = 8;
122
+ metricResult = _context3.sent;
123
+ _context3.next = 8;
154
124
  return topoServer.getBatchCiArr(ciIds);
155
125
 
156
126
  case 8:
157
- arrResult = _context4.sent;
158
- return _context4.abrupt("return", {
127
+ arrResult = _context3.sent;
128
+ return _context3.abrupt("return", {
159
129
  metricResult: metricResult,
160
130
  arrResult: arrResult
161
131
  });
162
132
 
163
133
  case 10:
164
134
  case "end":
165
- return _context4.stop();
135
+ return _context3.stop();
166
136
  }
167
137
  }
168
- }, _callee4);
138
+ }, _callee3);
169
139
  }))();
170
140
  },
171
141
 
@@ -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