@riil-frontend/component-topology 9.0.0-a.9 → 9.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 (104) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +18 -18
  5. package/es/core/components/TopoView/GraphViewPanel.js +17 -4
  6. package/es/core/components/TopoView/TopoView.module.scss +17 -3
  7. package/es/core/editor/components/BackgroundView/index.module.scss +2 -0
  8. package/es/core/editor/components/EditorPlugin.js +4 -1
  9. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
  10. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +20 -5
  11. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
  12. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
  13. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
  14. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
  15. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
  16. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
  17. package/es/core/editor/components/settings/core/getPropertyViewType.js +3 -0
  18. package/es/core/editor/components/settings/core/updateElementProperty.js +6 -1
  19. package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -3
  20. package/es/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +3 -2
  21. package/es/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +95 -0
  22. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +46 -14
  23. package/es/core/editor/config/themes.js +53 -2
  24. package/es/core/editor/utils/edgeTypeStyleUtil.js +38 -0
  25. package/es/core/hooks/useCanvasTheme.js +12 -4
  26. package/es/core/hooks/useResourceConfig.js +2 -1
  27. package/es/core/hooks/useTopoEdit.js +120 -19
  28. package/es/core/hooks/useTopoFullscreen.js +32 -0
  29. package/es/core/models/AttributeMetricDisplay.js +91 -79
  30. package/es/core/models/TopoApp.js +1 -1
  31. package/es/core/models/attributeFormatter/index.js +16 -16
  32. package/es/core/models/topoData.js +16 -9
  33. package/es/core/models/utils/linkUtils.js +52 -27
  34. package/es/core/store/models/topoConfig.js +51 -20
  35. package/es/core/test/Test.js +52 -0
  36. package/es/core/utils/graphLinkUtil.js +11 -6
  37. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +16 -2
  38. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +8 -78
  39. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
  40. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +27 -37
  41. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +57 -1
  42. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +6 -0
  43. package/es/networkTopo/getTopoData.js +2 -1
  44. package/es/networkTopo/models/IpNodeTagsTipsBuilder.js +164 -0
  45. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +8 -8
  46. package/es/networkTopo/models/TopoCenter.js +4 -3
  47. package/es/networkTopo/services/link.js +1 -1
  48. package/es/networkTopo/services/topo/basic.js +27 -26
  49. package/es/networkTopo/services/topo/networkLink.js +45 -3
  50. package/es/networkTopo/utils/exitLinkUtil.js +257 -0
  51. package/es/style.js +1 -0
  52. package/es/utils/ResourceConfigUtil.js +5 -4
  53. package/es/utils/htElementDataUtil.js +1 -7
  54. package/es/utils/htElementUtils.js +21 -21
  55. package/lib/core/components/TopoView/GraphViewPanel.js +18 -3
  56. package/lib/core/components/TopoView/TopoView.module.scss +17 -3
  57. package/lib/core/editor/components/BackgroundView/index.module.scss +2 -0
  58. package/lib/core/editor/components/EditorPlugin.js +7 -1
  59. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
  60. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +19 -3
  61. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
  62. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
  63. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
  64. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
  65. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
  66. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
  67. package/lib/core/editor/components/settings/core/getPropertyViewType.js +3 -0
  68. package/lib/core/editor/components/settings/core/updateElementProperty.js +6 -1
  69. package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +3 -3
  70. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +3 -1
  71. package/lib/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +111 -0
  72. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +48 -14
  73. package/lib/core/editor/config/themes.js +53 -2
  74. package/lib/core/editor/utils/edgeTypeStyleUtil.js +39 -0
  75. package/lib/core/hooks/useCanvasTheme.js +12 -4
  76. package/lib/core/hooks/useResourceConfig.js +2 -1
  77. package/lib/core/hooks/useTopoEdit.js +121 -18
  78. package/lib/core/hooks/useTopoFullscreen.js +42 -0
  79. package/lib/core/models/AttributeMetricDisplay.js +87 -79
  80. package/lib/core/models/TopoApp.js +1 -1
  81. package/lib/core/models/attributeFormatter/index.js +14 -14
  82. package/lib/core/models/topoData.js +16 -9
  83. package/lib/core/models/utils/linkUtils.js +53 -26
  84. package/lib/core/store/models/topoConfig.js +56 -19
  85. package/lib/core/test/Test.js +52 -0
  86. package/lib/core/utils/graphLinkUtil.js +10 -5
  87. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +15 -1
  88. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +7 -78
  89. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
  90. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +27 -36
  91. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +58 -1
  92. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +6 -0
  93. package/lib/networkTopo/getTopoData.js +2 -1
  94. package/lib/networkTopo/models/IpNodeTagsTipsBuilder.js +174 -0
  95. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +8 -8
  96. package/lib/networkTopo/models/TopoCenter.js +4 -3
  97. package/lib/networkTopo/services/topo/basic.js +28 -28
  98. package/lib/networkTopo/services/topo/networkLink.js +45 -3
  99. package/lib/networkTopo/utils/exitLinkUtil.js +269 -0
  100. package/lib/style.js +1 -0
  101. package/lib/utils/ResourceConfigUtil.js +4 -4
  102. package/lib/utils/htElementDataUtil.js +0 -10
  103. package/lib/utils/htElementUtils.js +21 -21
  104. package/package.json +2 -2
@@ -30,12 +30,12 @@ var _attributeFormatter = _interopRequireDefault(require("./attributeFormatter")
30
30
  var _DictCache = _interopRequireDefault(require("./cache/DictCache"));
31
31
 
32
32
  function isGraphField(item) {
33
- return item.type === 'graph';
33
+ return item.type === "graph";
34
34
  }
35
35
 
36
36
  function filterUnExistedFields(fields, ciTypeMeta) {
37
37
  function isFieldExisted(item, ciTypeMeta) {
38
- return item.type === 'attribute' && ciTypeMeta.attributeMap[item.code] || item.type === 'metric' && ciTypeMeta.metricMap[item.code] || item.type !== 'attribute' && item.type !== 'metric';
38
+ return item.type === "attribute" && ciTypeMeta.attributeMap[item.code] || item.type === "metric" && ciTypeMeta.metricMap[item.code] || item.type !== "attribute" && item.type !== "metric";
39
39
  }
40
40
 
41
41
  return fields.filter(function (item) {
@@ -62,7 +62,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
62
62
  var _proto = AttributeMetricDisplay.prototype;
63
63
 
64
64
  _proto.getConfig = function getConfig() {
65
- var _this$topo$store$getM = this.topo.store.getModelState('displayConfig'),
65
+ var _this$topo$store$getM = this.topo.store.getModelState("displayConfig"),
66
66
  nodeTag = _this$topo$store$getM.nodeTag,
67
67
  nodeTip = _this$topo$store$getM.nodeTip,
68
68
  linkTag = _this$topo$store$getM.linkTag,
@@ -77,10 +77,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
77
77
  }
78
78
  /**
79
79
  * 获得节点资源类型的配置,只包含属性和指标字段
80
- *
81
- * @param {*} ciType
82
- * @param {*} config
83
- * @returns
80
+ *
81
+ * @param {*} ciType
82
+ * @param {*} config
83
+ * @returns
84
84
  */
85
85
  ;
86
86
 
@@ -112,9 +112,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
112
112
  }
113
113
  /**
114
114
  * 查询需要查询数据的连线
115
- *
116
- * @param {*} data
117
- * @returns
115
+ *
116
+ * @param {*} data
117
+ * @returns
118
118
  */
119
119
  ;
120
120
 
@@ -126,7 +126,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
126
126
 
127
127
  return [].concat(links.map(function (link) {
128
128
  return (0, _extends2["default"])({}, link, {
129
- type: 'edge'
129
+ type: "edge"
130
130
  });
131
131
  }));
132
132
  };
@@ -135,23 +135,27 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
135
135
  var _this = this;
136
136
 
137
137
  var _this$topo$dataModel$2 = this.topo.dataModel.getData(),
138
- nodes = _this$topo$dataModel$2.nodes;
138
+ nodes = _this$topo$dataModel$2.nodes; // console.log("getNodesTagTipConfig", nodes);
139
139
 
140
- return nodes.filter(function (node) {
141
- return !!node.ciType;
142
- }).map(function (node) {
143
- var ciType = node.ciType;
144
140
 
145
- var ciTypeConfig = _this.getNodeCiTypeConfig(ciType);
141
+ var nodeArr = [];
142
+ nodes.map(function (node) {
143
+ if (!!node.ciType) {
144
+ var ciType = node.ciType;
146
145
 
147
- return {
148
- type: 'node',
149
- id: node.id,
150
- ciType: ciType,
151
- tags: _this.filterCiFiledConfigItems(node, ciTypeConfig.tags),
152
- tips: _this.filterCiFiledConfigItems(node, ciTypeConfig.tips)
153
- };
154
- });
146
+ var ciTypeConfig = _this.getNodeCiTypeConfig(ciType);
147
+
148
+ nodeArr.push({
149
+ type: "node",
150
+ id: node.id,
151
+ ciType: ciType,
152
+ tags: _this.filterCiFiledConfigItems(node, ciTypeConfig.tags),
153
+ tips: _this.filterCiFiledConfigItems(node, ciTypeConfig.tips)
154
+ });
155
+ }
156
+ }); // console.log("nodeArr", nodeArr);
157
+
158
+ return nodeArr;
155
159
  } // eslint-disable-next-line class-methods-use-this
156
160
  ;
157
161
 
@@ -165,7 +169,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
165
169
 
166
170
  if (!(0, _manageStatusUtil.isMonitoring)(data)) {
167
171
  list = list.filter(function (item) {
168
- return item.type !== 'metric';
172
+ return item.type !== "metric";
169
173
  });
170
174
  }
171
175
 
@@ -174,7 +178,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
174
178
  ;
175
179
 
176
180
  _proto.getModelType = function getModelType(ci) {
177
- if (ci.ciType === 'network_link') {
181
+ if (ci.ciType === "network_link") {
178
182
  return ci.attributes.support_templates;
179
183
  }
180
184
 
@@ -182,8 +186,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
182
186
  }
183
187
  /**
184
188
  * 按链路类型获取对应的属性、指标配置
185
- * @param {*} link
186
- * @returns
189
+ * @param {*} link
190
+ * @returns
187
191
  */
188
192
  ;
189
193
 
@@ -214,9 +218,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
214
218
  return {
215
219
  tags: getItems(linkTagConfig),
216
220
  tagLinkArrow: {
217
- 1: 'both',
218
- 2: 'from',
219
- 3: 'to'
221
+ 1: "both",
222
+ 2: "from",
223
+ 3: "to"
220
224
  }[linkTagConfig === null || linkTagConfig === void 0 ? void 0 : linkTagConfig.type] || undefined,
221
225
  tips: getItems(linkTip || defaultLinkTipConfig)
222
226
  };
@@ -242,10 +246,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
242
246
  }
243
247
  /**
244
248
  * 获取资源的标注、悬浮框配置,只包含属性和指标字段。无权限的资源无配置
245
- *
249
+ *
246
250
  * @param {?*} data 可选参数
247
251
  * @param {?*} config 可选参数
248
- * @returns
252
+ * @returns
249
253
  */
250
254
  ;
251
255
 
@@ -258,6 +262,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
258
262
  var _this3 = this;
259
263
 
260
264
  return this.getResourceTagTipConfig().map(function (ciConfig) {
265
+ // console.log("ciConfig-----------", ciConfig);
261
266
  var fields = {
262
267
  ciType: ciConfig.ciType,
263
268
  type: ciConfig.type,
@@ -275,7 +280,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
275
280
  }
276
281
  }); // 增加概览需要的指标字段
277
282
 
278
- var overviewState = _this3.topo.store.getModelState('topoBaseInfoOverview');
283
+ var overviewState = _this3.topo.store.getModelState("topoBaseInfoOverview");
279
284
 
280
285
  if (overviewState.id === fields.id) {
281
286
  overviewState.metricCodes.forEach(function (code) {
@@ -296,7 +301,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
296
301
 
297
302
  _proto.getResourceMetricCodes = function getResourceMetricCodes() {
298
303
  var metricCodes = [];
299
- var resourceFields = this.getResourceFields();
304
+ var resourceFields = this.getResourceFields(); // console.log("getResourceMetricCodes", resourceFields);
305
+
300
306
  resourceFields.forEach(function (resource) {
301
307
  resource.metrics.forEach(function (metric) {
302
308
  if (metricCodes.indexOf(metric) === -1) {
@@ -308,16 +314,15 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
308
314
  }
309
315
  /**
310
316
  * 从配置获得节点名称是否显示
311
- * @param {*} node
312
- * @returns
317
+ * @param {*} node
318
+ * @returns
313
319
  */
314
320
  ;
315
321
 
316
322
  _proto.getNodeNameVisible = function getNodeNameVisible(node) {
317
- if (!this.topo.isViewMode()) {
318
- return true;
319
- }
320
-
323
+ // if (!this.topo.isViewMode()) {
324
+ // return true;
325
+ // }
321
326
  var _this$getConfig3 = this.getConfig(),
322
327
  nodeTag = _this$getConfig3.nodeTag;
323
328
 
@@ -328,8 +333,16 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
328
333
  data = nodeTag.data;
329
334
  var items = (isCustom ? data[node.ciType] : data) || [];
330
335
  visible = !!items.filter(function (item) {
331
- return item.type === 'graph';
332
- }).length;
336
+ return item.type === "graph";
337
+ }).length; // ipNode逻辑
338
+
339
+ if (isCustom) {
340
+ return true;
341
+ } else {
342
+ return !!(data || []).filter(function (item) {
343
+ return item.type === "graph";
344
+ }).length;
345
+ }
333
346
  }
334
347
 
335
348
  return visible;
@@ -340,6 +353,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
340
353
 
341
354
  var nodes = this.topo.dataModel.getNodes();
342
355
  return nodes.map(function (node) {
356
+ // console.log("getNodesNameVisible", node);
343
357
  return {
344
358
  id: node.id,
345
359
  visible: _this4.getNodeNameVisible(node)
@@ -356,16 +370,16 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
356
370
  this.getNodesNameVisible().forEach(function (_ref) {
357
371
  var id = _ref.id,
358
372
  visible = _ref.visible;
359
- var ele = dm.getDataByTag(id); //
373
+ var ele = dm.getDataByTag(id); //
360
374
 
361
375
  if (ele) {
362
- ele.a('isShowName', visible);
376
+ ele.a("isShowName", visible);
363
377
  }
364
378
  });
365
379
  }
366
380
  /**
367
381
  * 加载标注、悬浮框数据
368
- *
382
+ *
369
383
  * @param {array<{id, attributeMap: {}, metricMap: {}}>} data
370
384
  */
371
385
  ;
@@ -396,7 +410,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
396
410
 
397
411
  case 4:
398
412
  ciDatas = _context.sent;
399
- bizDispatchers = topo.store.getModelDispatchers('topoBizMod');
413
+ bizDispatchers = topo.store.getModelDispatchers("topoBizMod");
400
414
  _context.next = 8;
401
415
  return bizDispatchers.setAttrsAndMetrics(ciDatas);
402
416
 
@@ -424,7 +438,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
424
438
  /**
425
439
  * 加载标注、悬浮框数据
426
440
  * 业务拓扑使用
427
- *
441
+ *
428
442
  * @param {array<{id, attributes: [], attributeMap: {}, metrics: [], metricMap: {}}>} data
429
443
  */
430
444
  ;
@@ -456,8 +470,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
456
470
  }()
457
471
  /**
458
472
  * 临时由前端翻译引用属性名称
459
- * @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
460
- * @returns
473
+ * @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
474
+ * @returns
461
475
  */
462
476
  ;
463
477
 
@@ -517,14 +531,6 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
517
531
 
518
532
  case 8:
519
533
  refCiMap = _context3.sent;
520
-
521
- _rlog["default"].debug('translateRefAttribute', {
522
- ciRefAttributeMap: ciRefAttributeMap,
523
- refIds: refIds,
524
- refCiMap: refCiMap
525
- }); // 引用对象设置到数据
526
-
527
-
528
534
  return _context3.abrupt("return", ciDatas.map(function (ciData) {
529
535
  var id = ciData.id;
530
536
  var attributeMap = (0, _extends2["default"])({}, ciData.attributeMap);
@@ -542,7 +548,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
542
548
  });
543
549
  }));
544
550
 
545
- case 11:
551
+ case 10:
546
552
  case "end":
547
553
  return _context3.stop();
548
554
  }
@@ -558,7 +564,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
558
564
  }()
559
565
  /**
560
566
  * 推送标注、悬浮框数据 => ht
561
- * @returns
567
+ * @returns
562
568
  */
563
569
  ;
564
570
 
@@ -571,7 +577,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
571
577
 
572
578
  var elementTagsAndTips = this.buildTagsTips() // 开锁状态下禁用悬停展示悬浮框
573
579
  .map(function (item) {
574
- var _topo$store$getModelS = topo.store.getModelState('lock'),
580
+ var _topo$store$getModelS = topo.store.getModelState("lock"),
575
581
  lock = _topo$store$getModelS.lock;
576
582
 
577
583
  return lock ? item : (0, _extends2["default"])({}, item, {
@@ -581,9 +587,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
581
587
  .map(function (item) {
582
588
  var tags = item.tags;
583
589
 
584
- if (item.type === 'edge') {
590
+ if (item.type === "edge") {
585
591
  var allNoValue = tags.data.filter(function (tItem) {
586
- return tItem.value === '- ';
592
+ return tItem.value === "- ";
587
593
  }).length === tags.data.length;
588
594
 
589
595
  if (allNoValue) {
@@ -594,32 +600,30 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
594
600
  return (0, _extends2["default"])({}, item, {
595
601
  tags: tags
596
602
  });
597
- });
598
-
599
- _rlog["default"].debug("AttributeMetricDisplay.updateTagsTips " + new Date().toLocaleString(), elementTagsAndTips);
603
+ }); // rlog.debug(`AttributeMetricDisplay.updateTagsTips ${new Date().toLocaleString()}`, elementTagsAndTips);
600
604
 
601
605
  var htTopo = topo.getHtTopo();
602
606
 
603
607
  if (htTopo) {
604
608
  var _topo$historyManager, _topo$historyManager2;
605
609
 
606
- (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '加载标注');
610
+ (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, "加载标注");
607
611
  htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
608
- (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '加载标注');
612
+ (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, "加载标注");
609
613
  }
610
614
  }
611
615
  /**
612
616
  * 从store获取属性、指标数据
613
- * @returns
617
+ * @returns
614
618
  */
615
619
  ;
616
620
 
617
621
  _proto.getData = function getData() {
618
- return this.topo.store.getModelState('topoBizMod').attrsAndMetrics;
622
+ return this.topo.store.getModelState("topoBizMod").attrsAndMetrics;
619
623
  }
620
624
  /**
621
625
  * 构造标注、悬浮框数据
622
- * @returns
626
+ * @returns
623
627
  */
624
628
  ;
625
629
 
@@ -628,9 +632,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
628
632
 
629
633
  var data = this.getData(); // 获取标注、悬浮框配置
630
634
 
631
- var ciConfigs = this.getResourceTagTipConfig();
635
+ var ciConfigs = this.getResourceTagTipConfig(); // console.log("buildTagsTips---ciConfigs", ciConfigs);
636
+
632
637
  var ciTagsAndTips = ciConfigs.map(function (ciConfig) {
633
- var ciDataItem = (0, _topoData.findItem)(data, 'id', ciConfig.id);
638
+ var ciDataItem = (0, _topoData.findItem)(data, "id", ciConfig.id); // console.log("buildTagsTips-ciDataItem", ciDataItem);
634
639
 
635
640
  if (!ciDataItem) {
636
641
  return {
@@ -641,13 +646,14 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
641
646
  } // 获取ci数据
642
647
 
643
648
 
644
- var ciData = (0, _extends2["default"])({}, (0, _topoData.findItem)(data, 'id', ciConfig.id), {
649
+ var ciData = (0, _extends2["default"])({}, (0, _topoData.findItem)(data, "id", ciConfig.id), {
645
650
  ciType: ciConfig.ciType
646
651
  });
647
- var formatter = new _attributeFormatter["default"](_this6.topo);
652
+ var formatter = new _attributeFormatter["default"](_this6.topo); // console.log("AttributeFormatter-----", ciData, ciConfig);
653
+
648
654
  var tags = formatter.formatAttrs(ciConfig.tags, ciData); // 链路标注箭头
649
655
 
650
- if (ciConfig.type === 'edge') {
656
+ if (ciConfig.type === "edge") {
651
657
  tags = {
652
658
  data: tags,
653
659
  linkArrow: ciConfig.tagLinkArrow
@@ -660,8 +666,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
660
666
  tags: tags,
661
667
  tips: formatter.formatAttrs(ciConfig.tips, ciData)
662
668
  };
663
- });
664
- var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []); // 刷新标注、浮层
669
+ }); // console.log("ciTagsAndTips", ciTagsAndTips);
670
+
671
+ var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []);
672
+ console.log("ciTagsAndTips", elementTagsAndTips); // 刷新标注、浮层
665
673
  // rlog.debug('AttributeMetricDisplay.buildTagsTips', {tagsAndTips: elementTagsAndTips, ciConfigs});
666
674
 
667
675
  return elementTagsAndTips;
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
56
56
  var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
57
57
 
58
58
  // eslint-disable-next-line no-undef
59
- var version = typeof "9.0.0-a.9" === 'string' ? "9.0.0-a.9" : null;
59
+ var version = typeof "9.0.2" === 'string' ? "9.0.2" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑
@@ -13,11 +13,11 @@ var _utils = require("@riil-frontend/utils");
13
13
  var _DictCache = _interopRequireDefault(require("../cache/DictCache"));
14
14
 
15
15
  /**
16
- * 格式化指标
17
- * @param {*} val
18
- * @param {*} metricInfo
19
- * @returns
20
- */
16
+ * 格式化指标
17
+ * @param {*} val
18
+ * @param {*} metricInfo
19
+ * @returns
20
+ */
21
21
  function formatMetric(val, metricInfo) {
22
22
  // rlog.debug('formatMetric', item, metricInfo);
23
23
  if (metricInfo) {
@@ -28,7 +28,7 @@ function formatMetric(val, metricInfo) {
28
28
  unit: metricInfo.unit,
29
29
  code: metricInfo.code
30
30
  });
31
- return result.value + " " + (result.value === '-' ? '' : result.unit);
31
+ return result.value + " " + (result.value === "-" ? "" : result.unit);
32
32
  } else {
33
33
  return "" + val;
34
34
  }
@@ -68,7 +68,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
68
68
  var fieldMeta = this.topo.ciTyeCache.getCiType(ciData.ciType)[attrType + "Map"][fieldCode];
69
69
  var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
70
70
 
71
- if (attrType === 'attribute') {
71
+ if (attrType === "attribute") {
72
72
  if (ciData[attrType + "Map"][fieldCode + "_object"]) {
73
73
  fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
74
74
  }
@@ -78,7 +78,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
78
78
  type: item.type,
79
79
  code: item.code,
80
80
  // 属性code
81
- name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || '',
81
+ name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || "",
82
82
  // 属性名称
83
83
  value: formatMetric(fieldValue, fieldMeta),
84
84
  // 属性值
@@ -87,11 +87,11 @@ var AttributeFormatter = /*#__PURE__*/function () {
87
87
  };
88
88
 
89
89
  _proto.attributeTransform = function attributeTransform(item, ciData) {
90
- return this.commonTransform(item, ciData, 'attribute');
90
+ return this.commonTransform(item, ciData, "attribute");
91
91
  };
92
92
 
93
93
  _proto.metricTransform = function metricTransform(item, ciData) {
94
- return this.commonTransform(item, ciData, 'metric');
94
+ return this.commonTransform(item, ciData, "metric");
95
95
  };
96
96
 
97
97
  _proto.ciTypeAttrTransform = function ciTypeAttrTransform(item, ciData) {
@@ -100,7 +100,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
100
100
  type: item.type,
101
101
  code: item.code,
102
102
  // 属性code
103
- name: '资源类型',
103
+ name: "资源类型",
104
104
  // 属性名称
105
105
  value: ciTypeMeta.name // 属性数值
106
106
 
@@ -108,11 +108,11 @@ var AttributeFormatter = /*#__PURE__*/function () {
108
108
  };
109
109
 
110
110
  _proto.graphTransform = function graphTransform(item, ciData) {
111
- var value = '-';
111
+ var value = "-";
112
112
 
113
113
  try {
114
114
  var node = this.topo.getDataModel().getDataByTag(ciData.id);
115
- value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
115
+ value = (node === null || node === void 0 ? void 0 : node.a("customName")) || (node === null || node === void 0 ? void 0 : node.a("name")) || "-";
116
116
  } catch (error) {
117
117
  _rlog["default"].error(error);
118
118
  }
@@ -121,7 +121,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
121
121
  type: item.type,
122
122
  code: item.code,
123
123
  // 属性code
124
- name: '图片名称',
124
+ name: "图片名称",
125
125
  // 属性名称
126
126
  value: value // 属性值
127
127
 
@@ -25,8 +25,8 @@ function getLayoutId(layout) {
25
25
 
26
26
  if (typeof layout === "string") {
27
27
  return {
28
- v: 'towardeast',
29
- h: 'towardsouth'
28
+ v: "towardeast",
29
+ h: "towardsouth"
30
30
  }[layout] || layout;
31
31
  }
32
32
 
@@ -57,7 +57,7 @@ function saveTopo(_x) {
57
57
 
58
58
  function _saveTopo() {
59
59
  _saveTopo = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
60
- var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources;
60
+ var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources, linkIps;
61
61
  return _regenerator["default"].wrap(function _callee$(_context) {
62
62
  while (1) {
63
63
  switch (_context.prev = _context.next) {
@@ -91,7 +91,7 @@ function _saveTopo() {
91
91
 
92
92
  case 8:
93
93
  if (!(resources || groups)) {
94
- _context.next = 15;
94
+ _context.next = 16;
95
95
  break;
96
96
  }
97
97
 
@@ -113,25 +113,32 @@ function _saveTopo() {
113
113
  });
114
114
  }
115
115
 
116
+ linkIps = []; // resources?.static.map((nodeId) => {
117
+ // if (nodeId.startsWith("ip_")) {
118
+ // linkIps.push(nodeId.replace("ip_", ""));
119
+ // }
120
+ // });
121
+
116
122
  _rlog["default"].debug("saveTopo-groupInfo", groupInfo);
117
123
 
118
- _context.next = 15;
124
+ _context.next = 16;
119
125
  return topoService.bindResourceToTopo(topoId, {
120
126
  groups: groupInfo,
127
+ linkIps: linkIps,
121
128
  exportLinkIdList: exportLinkIdList,
122
129
  relateTopoIdList: relateTopoIdList
123
130
  });
124
131
 
125
- case 15:
132
+ case 16:
126
133
  if (!serialize) {
127
- _context.next = 18;
134
+ _context.next = 19;
128
135
  break;
129
136
  }
130
137
 
131
- _context.next = 18;
138
+ _context.next = 19;
132
139
  return topoService.saveSerializeData(topoId, serialize);
133
140
 
134
- case 18:
141
+ case 19:
135
142
  case "end":
136
143
  return _context.stop();
137
144
  }