@riil-frontend/component-topology 9.0.0-a.8 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.css +1 -1
  3. package/build/index.js +15 -15
  4. package/es/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
  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 +3 -0
  8. package/es/core/editor/components/EditorPlugin.js +4 -1
  9. package/es/core/editor/components/Sidebar/Sidebar.module.scss +7 -7
  10. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
  11. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +1 -0
  12. package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
  13. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
  14. package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
  15. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +20 -5
  16. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
  17. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
  18. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
  19. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
  20. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
  21. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
  22. package/es/core/editor/components/settings/core/getPropertyViewType.js +3 -0
  23. package/es/core/editor/components/settings/core/updateElementProperty.js +6 -1
  24. package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -3
  25. package/es/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +3 -2
  26. package/es/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +95 -0
  27. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +46 -14
  28. package/es/core/editor/config/themes.js +53 -2
  29. package/es/core/editor/utils/edgeTypeStyleUtil.js +38 -0
  30. package/es/core/hooks/useCanvasTheme.js +12 -4
  31. package/es/core/hooks/useResourceConfig.js +2 -1
  32. package/es/core/hooks/useTopoEdit.js +120 -19
  33. package/es/core/hooks/useTopoFullscreen.js +32 -0
  34. package/es/core/models/AttributeMetricDisplay.js +89 -74
  35. package/es/core/models/TopoApp.js +1 -1
  36. package/es/core/models/attributeFormatter/index.js +16 -16
  37. package/es/core/models/topoData.js +16 -9
  38. package/es/core/models/utils/linkUtils.js +52 -27
  39. package/es/core/store/models/topoConfig.js +51 -20
  40. package/es/core/test/Test.js +52 -0
  41. package/es/core/utils/graphLinkUtil.js +11 -6
  42. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +16 -2
  43. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +8 -78
  44. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
  45. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +27 -37
  46. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +57 -1
  47. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +6 -0
  48. package/es/networkTopo/getTopoData.js +2 -1
  49. package/es/networkTopo/models/IpNodeTagsTipsBuilder.js +113 -0
  50. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +8 -8
  51. package/es/networkTopo/models/TopoCenter.js +4 -3
  52. package/es/networkTopo/services/link.js +1 -1
  53. package/es/networkTopo/services/topo/basic.js +27 -26
  54. package/es/networkTopo/services/topo/networkLink.js +45 -3
  55. package/es/networkTopo/utils/exitLinkUtil.js +257 -0
  56. package/es/style.js +1 -0
  57. package/es/utils/ResourceConfigUtil.js +5 -4
  58. package/es/utils/htElementDataUtil.js +1 -7
  59. package/es/utils/htElementUtils.js +21 -21
  60. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
  61. package/lib/core/components/TopoView/GraphViewPanel.js +18 -3
  62. package/lib/core/components/TopoView/TopoView.module.scss +17 -3
  63. package/lib/core/editor/components/BackgroundView/index.module.scss +3 -0
  64. package/lib/core/editor/components/EditorPlugin.js +7 -1
  65. package/lib/core/editor/components/Sidebar/Sidebar.module.scss +7 -7
  66. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
  67. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +1 -0
  68. package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
  69. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
  70. package/lib/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
  71. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +19 -3
  72. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
  73. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
  74. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
  75. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
  76. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
  77. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
  78. package/lib/core/editor/components/settings/core/getPropertyViewType.js +3 -0
  79. package/lib/core/editor/components/settings/core/updateElementProperty.js +6 -1
  80. package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +3 -3
  81. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +3 -1
  82. package/lib/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +111 -0
  83. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +48 -14
  84. package/lib/core/editor/config/themes.js +53 -2
  85. package/lib/core/editor/utils/edgeTypeStyleUtil.js +39 -0
  86. package/lib/core/hooks/useCanvasTheme.js +12 -4
  87. package/lib/core/hooks/useResourceConfig.js +2 -1
  88. package/lib/core/hooks/useTopoEdit.js +121 -18
  89. package/lib/core/hooks/useTopoFullscreen.js +42 -0
  90. package/lib/core/models/AttributeMetricDisplay.js +85 -74
  91. package/lib/core/models/TopoApp.js +1 -1
  92. package/lib/core/models/attributeFormatter/index.js +14 -14
  93. package/lib/core/models/topoData.js +16 -9
  94. package/lib/core/models/utils/linkUtils.js +53 -26
  95. package/lib/core/store/models/topoConfig.js +56 -19
  96. package/lib/core/test/Test.js +52 -0
  97. package/lib/core/utils/graphLinkUtil.js +10 -5
  98. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +15 -1
  99. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +7 -78
  100. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
  101. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +27 -36
  102. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +58 -1
  103. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +6 -0
  104. package/lib/networkTopo/getTopoData.js +2 -1
  105. package/lib/networkTopo/models/IpNodeTagsTipsBuilder.js +123 -0
  106. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +8 -8
  107. package/lib/networkTopo/models/TopoCenter.js +4 -3
  108. package/lib/networkTopo/services/topo/basic.js +28 -28
  109. package/lib/networkTopo/services/topo/networkLink.js +45 -3
  110. package/lib/networkTopo/utils/exitLinkUtil.js +269 -0
  111. package/lib/style.js +1 -0
  112. package/lib/utils/ResourceConfigUtil.js +4 -4
  113. package/lib/utils/htElementDataUtil.js +0 -10
  114. package/lib/utils/htElementUtils.js +21 -21
  115. package/package.json +2 -2
@@ -1,9 +1,9 @@
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
- import topoServer from '@riil-frontend/component-topology-common/es/services/topo';
5
- import rlog from '@riil-frontend/component-topology-utils/es/rlog';
6
- import { keyBy } from 'lodash';
4
+ import topoServer from "@riil-frontend/component-topology-common/es/services/topo";
5
+ import rlog from "@riil-frontend/component-topology-utils/es/rlog";
6
+ import { keyBy } from "lodash";
7
7
  import { DEFAULT_NODE_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../../constants/ResourceInfoDisplay";
8
8
  import { findItem } from "../../utils/topoData";
9
9
  import { queryCisByIds } from "../services";
@@ -12,12 +12,12 @@ import AttributeFormatter from "./attributeFormatter";
12
12
  import DictCache from "./cache/DictCache";
13
13
 
14
14
  function isGraphField(item) {
15
- return item.type === 'graph';
15
+ return item.type === "graph";
16
16
  }
17
17
 
18
18
  function filterUnExistedFields(fields, ciTypeMeta) {
19
19
  function isFieldExisted(item, ciTypeMeta) {
20
- return item.type === 'attribute' && ciTypeMeta.attributeMap[item.code] || item.type === 'metric' && ciTypeMeta.metricMap[item.code] || item.type !== 'attribute' && item.type !== 'metric';
20
+ return item.type === "attribute" && ciTypeMeta.attributeMap[item.code] || item.type === "metric" && ciTypeMeta.metricMap[item.code] || item.type !== "attribute" && item.type !== "metric";
21
21
  }
22
22
 
23
23
  return fields.filter(function (item) {
@@ -44,7 +44,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
44
44
  var _proto = AttributeMetricDisplay.prototype;
45
45
 
46
46
  _proto.getConfig = function getConfig() {
47
- var _this$topo$store$getM = this.topo.store.getModelState('displayConfig'),
47
+ var _this$topo$store$getM = this.topo.store.getModelState("displayConfig"),
48
48
  nodeTag = _this$topo$store$getM.nodeTag,
49
49
  nodeTip = _this$topo$store$getM.nodeTip,
50
50
  linkTag = _this$topo$store$getM.linkTag,
@@ -59,10 +59,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
59
59
  }
60
60
  /**
61
61
  * 获得节点资源类型的配置,只包含属性和指标字段
62
- *
63
- * @param {*} ciType
64
- * @param {*} config
65
- * @returns
62
+ *
63
+ * @param {*} ciType
64
+ * @param {*} config
65
+ * @returns
66
66
  */
67
67
  ;
68
68
 
@@ -94,9 +94,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
94
94
  }
95
95
  /**
96
96
  * 查询需要查询数据的连线
97
- *
98
- * @param {*} data
99
- * @returns
97
+ *
98
+ * @param {*} data
99
+ * @returns
100
100
  */
101
101
  ;
102
102
 
@@ -108,7 +108,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
108
108
 
109
109
  return [].concat(links.map(function (link) {
110
110
  return _extends({}, link, {
111
- type: 'edge'
111
+ type: "edge"
112
112
  });
113
113
  }));
114
114
  };
@@ -117,23 +117,27 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
117
117
  var _this = this;
118
118
 
119
119
  var _this$topo$dataModel$2 = this.topo.dataModel.getData(),
120
- nodes = _this$topo$dataModel$2.nodes;
120
+ nodes = _this$topo$dataModel$2.nodes; // console.log("getNodesTagTipConfig", nodes);
121
121
 
122
- return nodes.filter(function (node) {
123
- return !!node.ciType;
124
- }).map(function (node) {
125
- var ciType = node.ciType;
126
122
 
127
- var ciTypeConfig = _this.getNodeCiTypeConfig(ciType);
123
+ var nodeArr = [];
124
+ nodes.map(function (node) {
125
+ if (!!node.ciType) {
126
+ var ciType = node.ciType;
128
127
 
129
- return {
130
- type: 'node',
131
- id: node.id,
132
- ciType: ciType,
133
- tags: _this.filterCiFiledConfigItems(node, ciTypeConfig.tags),
134
- tips: _this.filterCiFiledConfigItems(node, ciTypeConfig.tips)
135
- };
136
- });
128
+ var ciTypeConfig = _this.getNodeCiTypeConfig(ciType);
129
+
130
+ nodeArr.push({
131
+ type: "node",
132
+ id: node.id,
133
+ ciType: ciType,
134
+ tags: _this.filterCiFiledConfigItems(node, ciTypeConfig.tags),
135
+ tips: _this.filterCiFiledConfigItems(node, ciTypeConfig.tips)
136
+ });
137
+ }
138
+ }); // console.log("nodeArr", nodeArr);
139
+
140
+ return nodeArr;
137
141
  } // eslint-disable-next-line class-methods-use-this
138
142
  ;
139
143
 
@@ -147,7 +151,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
147
151
 
148
152
  if (!isMonitoring(data)) {
149
153
  list = list.filter(function (item) {
150
- return item.type !== 'metric';
154
+ return item.type !== "metric";
151
155
  });
152
156
  }
153
157
 
@@ -156,7 +160,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
156
160
  ;
157
161
 
158
162
  _proto.getModelType = function getModelType(ci) {
159
- if (ci.ciType === 'network_link') {
163
+ if (ci.ciType === "network_link") {
160
164
  return ci.attributes.support_templates;
161
165
  }
162
166
 
@@ -164,8 +168,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
164
168
  }
165
169
  /**
166
170
  * 按链路类型获取对应的属性、指标配置
167
- * @param {*} link
168
- * @returns
171
+ * @param {*} link
172
+ * @returns
169
173
  */
170
174
  ;
171
175
 
@@ -196,9 +200,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
196
200
  return {
197
201
  tags: getItems(linkTagConfig),
198
202
  tagLinkArrow: {
199
- 1: 'both',
200
- 2: 'from',
201
- 3: 'to'
203
+ 1: "both",
204
+ 2: "from",
205
+ 3: "to"
202
206
  }[linkTagConfig === null || linkTagConfig === void 0 ? void 0 : linkTagConfig.type] || undefined,
203
207
  tips: getItems(linkTip || defaultLinkTipConfig)
204
208
  };
@@ -224,10 +228,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
224
228
  }
225
229
  /**
226
230
  * 获取资源的标注、悬浮框配置,只包含属性和指标字段。无权限的资源无配置
227
- *
231
+ *
228
232
  * @param {?*} data 可选参数
229
233
  * @param {?*} config 可选参数
230
- * @returns
234
+ * @returns
231
235
  */
232
236
  ;
233
237
 
@@ -240,6 +244,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
240
244
  var _this3 = this;
241
245
 
242
246
  return this.getResourceTagTipConfig().map(function (ciConfig) {
247
+ // console.log("ciConfig-----------", ciConfig);
243
248
  var fields = {
244
249
  ciType: ciConfig.ciType,
245
250
  type: ciConfig.type,
@@ -257,7 +262,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
257
262
  }
258
263
  }); // 增加概览需要的指标字段
259
264
 
260
- var overviewState = _this3.topo.store.getModelState('topoBaseInfoOverview');
265
+ var overviewState = _this3.topo.store.getModelState("topoBaseInfoOverview");
261
266
 
262
267
  if (overviewState.id === fields.id) {
263
268
  overviewState.metricCodes.forEach(function (code) {
@@ -278,7 +283,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
278
283
 
279
284
  _proto.getResourceMetricCodes = function getResourceMetricCodes() {
280
285
  var metricCodes = [];
281
- var resourceFields = this.getResourceFields();
286
+ var resourceFields = this.getResourceFields(); // console.log("getResourceMetricCodes", resourceFields);
287
+
282
288
  resourceFields.forEach(function (resource) {
283
289
  resource.metrics.forEach(function (metric) {
284
290
  if (metricCodes.indexOf(metric) === -1) {
@@ -290,8 +296,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
290
296
  }
291
297
  /**
292
298
  * 从配置获得节点名称是否显示
293
- * @param {*} node
294
- * @returns
299
+ * @param {*} node
300
+ * @returns
295
301
  */
296
302
  ;
297
303
 
@@ -306,12 +312,22 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
306
312
  var visible = true;
307
313
 
308
314
  if (nodeTag) {
315
+ var _nodeTag$data;
316
+
309
317
  var isCustom = nodeTag.isCustom,
310
318
  data = nodeTag.data;
311
319
  var items = (isCustom ? data[node.ciType] : data) || [];
312
320
  visible = !!items.filter(function (item) {
313
- return item.type === 'graph';
321
+ return item.type === "graph";
314
322
  }).length;
323
+ console.log("getNodeNameVisible--xxx", nodeTag);
324
+ var hasIpv4 = Array.isArray(nodeTag.data) && (nodeTag === null || nodeTag === void 0 ? void 0 : (_nodeTag$data = nodeTag.data) === null || _nodeTag$data === void 0 ? void 0 : _nodeTag$data.find(function (item) {
325
+ return item.code === "ipv4_address";
326
+ }));
327
+
328
+ if (node.bindType === "ip" && !hasIpv4) {
329
+ return true;
330
+ }
315
331
  }
316
332
 
317
333
  return visible;
@@ -322,6 +338,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
322
338
 
323
339
  var nodes = this.topo.dataModel.getNodes();
324
340
  return nodes.map(function (node) {
341
+ // console.log("getNodesNameVisible", node);
325
342
  return {
326
343
  id: node.id,
327
344
  visible: _this4.getNodeNameVisible(node)
@@ -338,16 +355,16 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
338
355
  this.getNodesNameVisible().forEach(function (_ref) {
339
356
  var id = _ref.id,
340
357
  visible = _ref.visible;
341
- var ele = dm.getDataByTag(id); //
358
+ var ele = dm.getDataByTag(id); //
342
359
 
343
360
  if (ele) {
344
- ele.a('isShowName', visible);
361
+ ele.a("isShowName", visible);
345
362
  }
346
363
  });
347
364
  }
348
365
  /**
349
366
  * 加载标注、悬浮框数据
350
- *
367
+ *
351
368
  * @param {array<{id, attributeMap: {}, metricMap: {}}>} data
352
369
  */
353
370
  ;
@@ -378,7 +395,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
378
395
 
379
396
  case 4:
380
397
  ciDatas = _context.sent;
381
- bizDispatchers = topo.store.getModelDispatchers('topoBizMod');
398
+ bizDispatchers = topo.store.getModelDispatchers("topoBizMod");
382
399
  _context.next = 8;
383
400
  return bizDispatchers.setAttrsAndMetrics(ciDatas);
384
401
 
@@ -406,7 +423,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
406
423
  /**
407
424
  * 加载标注、悬浮框数据
408
425
  * 业务拓扑使用
409
- *
426
+ *
410
427
  * @param {array<{id, attributes: [], attributeMap: {}, metrics: [], metricMap: {}}>} data
411
428
  */
412
429
  ;
@@ -438,8 +455,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
438
455
  }()
439
456
  /**
440
457
  * 临时由前端翻译引用属性名称
441
- * @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
442
- * @returns
458
+ * @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
459
+ * @returns
443
460
  */
444
461
  ;
445
462
 
@@ -499,12 +516,6 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
499
516
 
500
517
  case 8:
501
518
  refCiMap = _context3.sent;
502
- rlog.debug('translateRefAttribute', {
503
- ciRefAttributeMap: ciRefAttributeMap,
504
- refIds: refIds,
505
- refCiMap: refCiMap
506
- }); // 引用对象设置到数据
507
-
508
519
  return _context3.abrupt("return", ciDatas.map(function (ciData) {
509
520
  var id = ciData.id;
510
521
 
@@ -524,7 +535,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
524
535
  });
525
536
  }));
526
537
 
527
- case 11:
538
+ case 10:
528
539
  case "end":
529
540
  return _context3.stop();
530
541
  }
@@ -540,7 +551,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
540
551
  }()
541
552
  /**
542
553
  * 推送标注、悬浮框数据 => ht
543
- * @returns
554
+ * @returns
544
555
  */
545
556
  ;
546
557
 
@@ -553,7 +564,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
553
564
 
554
565
  var elementTagsAndTips = this.buildTagsTips() // 开锁状态下禁用悬停展示悬浮框
555
566
  .map(function (item) {
556
- var _topo$store$getModelS = topo.store.getModelState('lock'),
567
+ var _topo$store$getModelS = topo.store.getModelState("lock"),
557
568
  lock = _topo$store$getModelS.lock;
558
569
 
559
570
  return lock ? item : _extends({}, item, {
@@ -563,9 +574,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
563
574
  .map(function (item) {
564
575
  var tags = item.tags;
565
576
 
566
- if (item.type === 'edge') {
577
+ if (item.type === "edge") {
567
578
  var allNoValue = tags.data.filter(function (tItem) {
568
- return tItem.value === '- ';
579
+ return tItem.value === "- ";
569
580
  }).length === tags.data.length;
570
581
 
571
582
  if (allNoValue) {
@@ -576,30 +587,30 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
576
587
  return _extends({}, item, {
577
588
  tags: tags
578
589
  });
579
- });
580
- rlog.debug("AttributeMetricDisplay.updateTagsTips " + new Date().toLocaleString(), elementTagsAndTips);
590
+ }); // rlog.debug(`AttributeMetricDisplay.updateTagsTips ${new Date().toLocaleString()}`, elementTagsAndTips);
591
+
581
592
  var htTopo = topo.getHtTopo();
582
593
 
583
594
  if (htTopo) {
584
595
  var _topo$historyManager, _topo$historyManager2;
585
596
 
586
- (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '加载标注');
597
+ (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, "加载标注");
587
598
  htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
588
- (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '加载标注');
599
+ (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, "加载标注");
589
600
  }
590
601
  }
591
602
  /**
592
603
  * 从store获取属性、指标数据
593
- * @returns
604
+ * @returns
594
605
  */
595
606
  ;
596
607
 
597
608
  _proto.getData = function getData() {
598
- return this.topo.store.getModelState('topoBizMod').attrsAndMetrics;
609
+ return this.topo.store.getModelState("topoBizMod").attrsAndMetrics;
599
610
  }
600
611
  /**
601
612
  * 构造标注、悬浮框数据
602
- * @returns
613
+ * @returns
603
614
  */
604
615
  ;
605
616
 
@@ -608,9 +619,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
608
619
 
609
620
  var data = this.getData(); // 获取标注、悬浮框配置
610
621
 
611
- var ciConfigs = this.getResourceTagTipConfig();
622
+ var ciConfigs = this.getResourceTagTipConfig(); // console.log("buildTagsTips---ciConfigs", ciConfigs);
623
+
612
624
  var ciTagsAndTips = ciConfigs.map(function (ciConfig) {
613
- var ciDataItem = findItem(data, 'id', ciConfig.id);
625
+ var ciDataItem = findItem(data, "id", ciConfig.id); // console.log("buildTagsTips-ciDataItem", ciDataItem);
614
626
 
615
627
  if (!ciDataItem) {
616
628
  return {
@@ -621,14 +633,15 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
621
633
  } // 获取ci数据
622
634
 
623
635
 
624
- var ciData = _extends({}, findItem(data, 'id', ciConfig.id), {
636
+ var ciData = _extends({}, findItem(data, "id", ciConfig.id), {
625
637
  ciType: ciConfig.ciType
626
638
  });
627
639
 
628
- var formatter = new AttributeFormatter(_this6.topo);
640
+ var formatter = new AttributeFormatter(_this6.topo); // console.log("AttributeFormatter-----", ciData, ciConfig);
641
+
629
642
  var tags = formatter.formatAttrs(ciConfig.tags, ciData); // 链路标注箭头
630
643
 
631
- if (ciConfig.type === 'edge') {
644
+ if (ciConfig.type === "edge") {
632
645
  tags = {
633
646
  data: tags,
634
647
  linkArrow: ciConfig.tagLinkArrow
@@ -641,8 +654,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
641
654
  tags: tags,
642
655
  tips: formatter.formatAttrs(ciConfig.tips, ciData)
643
656
  };
644
- });
645
- var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []); // 刷新标注、浮层
657
+ }); // console.log("ciTagsAndTips", ciTagsAndTips);
658
+
659
+ var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []);
660
+ console.log("ciTagsAndTips", elementTagsAndTips); // 刷新标注、浮层
646
661
  // rlog.debug('AttributeMetricDisplay.buildTagsTips', {tagsAndTips: elementTagsAndTips, ciConfigs});
647
662
 
648
663
  return elementTagsAndTips;
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
26
26
 
27
- var version = typeof "9.0.0-a.8" === 'string' ? "9.0.0-a.8" : null;
27
+ var version = typeof "9.0.1" === 'string' ? "9.0.1" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -1,12 +1,12 @@
1
- import rlog from '@riil-frontend/component-topology-utils/es/rlog';
2
- import { metricValueFormat } from '@riil-frontend/utils';
1
+ import rlog from "@riil-frontend/component-topology-utils/es/rlog";
2
+ import { metricValueFormat } from "@riil-frontend/utils";
3
3
  import DictCache from "../cache/DictCache";
4
4
  /**
5
- * 格式化指标
6
- * @param {*} val
7
- * @param {*} metricInfo
8
- * @returns
9
- */
5
+ * 格式化指标
6
+ * @param {*} val
7
+ * @param {*} metricInfo
8
+ * @returns
9
+ */
10
10
 
11
11
  export function formatMetric(val, metricInfo) {
12
12
  // rlog.debug('formatMetric', item, metricInfo);
@@ -18,7 +18,7 @@ export function formatMetric(val, metricInfo) {
18
18
  unit: metricInfo.unit,
19
19
  code: metricInfo.code
20
20
  });
21
- return result.value + " " + (result.value === '-' ? '' : result.unit);
21
+ return result.value + " " + (result.value === "-" ? "" : result.unit);
22
22
  } else {
23
23
  return "" + val;
24
24
  }
@@ -57,7 +57,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
57
57
  var fieldMeta = this.topo.ciTyeCache.getCiType(ciData.ciType)[attrType + "Map"][fieldCode];
58
58
  var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
59
59
 
60
- if (attrType === 'attribute') {
60
+ if (attrType === "attribute") {
61
61
  if (ciData[attrType + "Map"][fieldCode + "_object"]) {
62
62
  fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
63
63
  }
@@ -67,7 +67,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
67
67
  type: item.type,
68
68
  code: item.code,
69
69
  // 属性code
70
- name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || '',
70
+ name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || "",
71
71
  // 属性名称
72
72
  value: formatMetric(fieldValue, fieldMeta),
73
73
  // 属性值
@@ -76,11 +76,11 @@ var AttributeFormatter = /*#__PURE__*/function () {
76
76
  };
77
77
 
78
78
  _proto.attributeTransform = function attributeTransform(item, ciData) {
79
- return this.commonTransform(item, ciData, 'attribute');
79
+ return this.commonTransform(item, ciData, "attribute");
80
80
  };
81
81
 
82
82
  _proto.metricTransform = function metricTransform(item, ciData) {
83
- return this.commonTransform(item, ciData, 'metric');
83
+ return this.commonTransform(item, ciData, "metric");
84
84
  };
85
85
 
86
86
  _proto.ciTypeAttrTransform = function ciTypeAttrTransform(item, ciData) {
@@ -89,7 +89,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
89
89
  type: item.type,
90
90
  code: item.code,
91
91
  // 属性code
92
- name: '资源类型',
92
+ name: "资源类型",
93
93
  // 属性名称
94
94
  value: ciTypeMeta.name // 属性数值
95
95
 
@@ -97,11 +97,11 @@ var AttributeFormatter = /*#__PURE__*/function () {
97
97
  };
98
98
 
99
99
  _proto.graphTransform = function graphTransform(item, ciData) {
100
- var value = '-';
100
+ var value = "-";
101
101
 
102
102
  try {
103
103
  var node = this.topo.getDataModel().getDataByTag(ciData.id);
104
- value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
104
+ value = (node === null || node === void 0 ? void 0 : node.a("customName")) || (node === null || node === void 0 ? void 0 : node.a("name")) || "-";
105
105
  } catch (error) {
106
106
  rlog.error(error);
107
107
  }
@@ -110,7 +110,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
110
110
  type: item.type,
111
111
  code: item.code,
112
112
  // 属性code
113
- name: '图片名称',
113
+ name: "图片名称",
114
114
  // 属性名称
115
115
  value: value // 属性值
116
116
 
@@ -11,8 +11,8 @@ export function getLayoutId(layout) {
11
11
 
12
12
  if (typeof layout === "string") {
13
13
  return {
14
- v: 'towardeast',
15
- h: 'towardsouth'
14
+ v: "towardeast",
15
+ h: "towardsouth"
16
16
  }[layout] || layout;
17
17
  }
18
18
 
@@ -41,7 +41,7 @@ export function saveTopo(_x) {
41
41
 
42
42
  function _saveTopo() {
43
43
  _saveTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
44
- var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources;
44
+ var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources, linkIps;
45
45
  return _regeneratorRuntime.wrap(function _callee$(_context) {
46
46
  while (1) {
47
47
  switch (_context.prev = _context.next) {
@@ -73,7 +73,7 @@ function _saveTopo() {
73
73
 
74
74
  case 8:
75
75
  if (!(resources || groups)) {
76
- _context.next = 15;
76
+ _context.next = 16;
77
77
  break;
78
78
  }
79
79
 
@@ -95,24 +95,31 @@ function _saveTopo() {
95
95
  });
96
96
  }
97
97
 
98
+ linkIps = []; // resources?.static.map((nodeId) => {
99
+ // if (nodeId.startsWith("ip_")) {
100
+ // linkIps.push(nodeId.replace("ip_", ""));
101
+ // }
102
+ // });
103
+
98
104
  rlog.debug("saveTopo-groupInfo", groupInfo);
99
- _context.next = 15;
105
+ _context.next = 16;
100
106
  return topoService.bindResourceToTopo(topoId, {
101
107
  groups: groupInfo,
108
+ linkIps: linkIps,
102
109
  exportLinkIdList: exportLinkIdList,
103
110
  relateTopoIdList: relateTopoIdList
104
111
  });
105
112
 
106
- case 15:
113
+ case 16:
107
114
  if (!serialize) {
108
- _context.next = 18;
115
+ _context.next = 19;
109
116
  break;
110
117
  }
111
118
 
112
- _context.next = 18;
119
+ _context.next = 19;
113
120
  return topoService.saveSerializeData(topoId, serialize);
114
121
 
115
- case 18:
122
+ case 19:
116
123
  case "end":
117
124
  return _context.stop();
118
125
  }