@riil-frontend/component-topology 9.0.0-a.36 → 9.0.0-a.38

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.
@@ -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,48 @@ 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
+ } else if (node.bindType === "ip") {
156
+ var _this$getConfig2 = _this.getConfig(),
157
+ nodeTag = _this$getConfig2.nodeTag,
158
+ nodeTip = _this$getConfig2.nodeTip;
159
+
160
+ console.log("nodeTag------------------------", nodeTag, nodeTip);
161
+
162
+ if (!nodeTag.isCustom) {
163
+ var hasIpv4 = Array.isArray(nodeTag.data) && (nodeTag === null || nodeTag === void 0 ? void 0 : nodeTag.data.find(function (item) {
164
+ return item.code === "ipv4_address";
165
+ }));
166
+ if (hasIpv4) nodeArr.push({
167
+ type: "node",
168
+ id: node.id,
169
+ tags: [{
170
+ type: "attribute",
171
+ code: "ipv4_address"
172
+ }],
173
+ tips: []
174
+ });
175
+ }
176
+ }
177
+ }); // console.log("nodeArr", nodeArr);
178
+
179
+ return nodeArr;
155
180
  } // eslint-disable-next-line class-methods-use-this
156
181
  ;
157
182
 
@@ -165,7 +190,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
165
190
 
166
191
  if (!(0, _manageStatusUtil.isMonitoring)(data)) {
167
192
  list = list.filter(function (item) {
168
- return item.type !== 'metric';
193
+ return item.type !== "metric";
169
194
  });
170
195
  }
171
196
 
@@ -174,7 +199,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
174
199
  ;
175
200
 
176
201
  _proto.getModelType = function getModelType(ci) {
177
- if (ci.ciType === 'network_link') {
202
+ if (ci.ciType === "network_link") {
178
203
  return ci.attributes.support_templates;
179
204
  }
180
205
 
@@ -182,15 +207,15 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
182
207
  }
183
208
  /**
184
209
  * 按链路类型获取对应的属性、指标配置
185
- * @param {*} link
186
- * @returns
210
+ * @param {*} link
211
+ * @returns
187
212
  */
188
213
  ;
189
214
 
190
215
  _proto.getLinkTagTipConfig = function getLinkTagTipConfig(link) {
191
- var _this$getConfig2 = this.getConfig(),
192
- linkTag = _this$getConfig2.linkTag,
193
- linkTip = _this$getConfig2.linkTip;
216
+ var _this$getConfig3 = this.getConfig(),
217
+ linkTag = _this$getConfig3.linkTag,
218
+ linkTip = _this$getConfig3.linkTip;
194
219
 
195
220
  var ciTypeMeta = this.topo.ciTyeCache.getCiTypeByCi(link);
196
221
  var modelType = this.getModelType(link);
@@ -214,9 +239,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
214
239
  return {
215
240
  tags: getItems(linkTagConfig),
216
241
  tagLinkArrow: {
217
- 1: 'both',
218
- 2: 'from',
219
- 3: 'to'
242
+ 1: "both",
243
+ 2: "from",
244
+ 3: "to"
220
245
  }[linkTagConfig === null || linkTagConfig === void 0 ? void 0 : linkTagConfig.type] || undefined,
221
246
  tips: getItems(linkTip || defaultLinkTipConfig)
222
247
  };
@@ -242,10 +267,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
242
267
  }
243
268
  /**
244
269
  * 获取资源的标注、悬浮框配置,只包含属性和指标字段。无权限的资源无配置
245
- *
270
+ *
246
271
  * @param {?*} data 可选参数
247
272
  * @param {?*} config 可选参数
248
- * @returns
273
+ * @returns
249
274
  */
250
275
  ;
251
276
 
@@ -258,6 +283,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
258
283
  var _this3 = this;
259
284
 
260
285
  return this.getResourceTagTipConfig().map(function (ciConfig) {
286
+ // console.log("ciConfig-----------", ciConfig);
261
287
  var fields = {
262
288
  ciType: ciConfig.ciType,
263
289
  type: ciConfig.type,
@@ -275,7 +301,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
275
301
  }
276
302
  }); // 增加概览需要的指标字段
277
303
 
278
- var overviewState = _this3.topo.store.getModelState('topoBaseInfoOverview');
304
+ var overviewState = _this3.topo.store.getModelState("topoBaseInfoOverview");
279
305
 
280
306
  if (overviewState.id === fields.id) {
281
307
  overviewState.metricCodes.forEach(function (code) {
@@ -296,7 +322,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
296
322
 
297
323
  _proto.getResourceMetricCodes = function getResourceMetricCodes() {
298
324
  var metricCodes = [];
299
- var resourceFields = this.getResourceFields();
325
+ var resourceFields = this.getResourceFields(); // console.log("getResourceMetricCodes", resourceFields);
326
+
300
327
  resourceFields.forEach(function (resource) {
301
328
  resource.metrics.forEach(function (metric) {
302
329
  if (metricCodes.indexOf(metric) === -1) {
@@ -308,18 +335,20 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
308
335
  }
309
336
  /**
310
337
  * 从配置获得节点名称是否显示
311
- * @param {*} node
312
- * @returns
338
+ * @param {*} node
339
+ * @returns
313
340
  */
314
341
  ;
315
342
 
316
343
  _proto.getNodeNameVisible = function getNodeNameVisible(node) {
344
+ var _nodeTag$data;
345
+
317
346
  if (!this.topo.isViewMode()) {
318
- return true;
347
+ return trueipv4_address;
319
348
  }
320
349
 
321
- var _this$getConfig3 = this.getConfig(),
322
- nodeTag = _this$getConfig3.nodeTag;
350
+ var _this$getConfig4 = this.getConfig(),
351
+ nodeTag = _this$getConfig4.nodeTag;
323
352
 
324
353
  var visible = true;
325
354
 
@@ -328,8 +357,17 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
328
357
  data = nodeTag.data;
329
358
  var items = (isCustom ? data[node.ciType] : data) || [];
330
359
  visible = !!items.filter(function (item) {
331
- return item.type === 'graph';
360
+ return item.type === "graph";
332
361
  }).length;
362
+ } // console.log("getNodeNameVisible--xxx", nodeTag);
363
+
364
+
365
+ 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) {
366
+ return item.code === "ipv4_address";
367
+ }));
368
+
369
+ if (node.bindType === "ip" && !hasIpv4) {
370
+ return true;
333
371
  }
334
372
 
335
373
  return visible;
@@ -340,6 +378,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
340
378
 
341
379
  var nodes = this.topo.dataModel.getNodes();
342
380
  return nodes.map(function (node) {
381
+ // console.log("getNodesNameVisible", node);
343
382
  return {
344
383
  id: node.id,
345
384
  visible: _this4.getNodeNameVisible(node)
@@ -356,16 +395,16 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
356
395
  this.getNodesNameVisible().forEach(function (_ref) {
357
396
  var id = _ref.id,
358
397
  visible = _ref.visible;
359
- var ele = dm.getDataByTag(id); //
398
+ var ele = dm.getDataByTag(id); //
360
399
 
361
400
  if (ele) {
362
- ele.a('isShowName', visible);
401
+ ele.a("isShowName", visible);
363
402
  }
364
403
  });
365
404
  }
366
405
  /**
367
406
  * 加载标注、悬浮框数据
368
- *
407
+ *
369
408
  * @param {array<{id, attributeMap: {}, metricMap: {}}>} data
370
409
  */
371
410
  ;
@@ -396,7 +435,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
396
435
 
397
436
  case 4:
398
437
  ciDatas = _context.sent;
399
- bizDispatchers = topo.store.getModelDispatchers('topoBizMod');
438
+ bizDispatchers = topo.store.getModelDispatchers("topoBizMod");
400
439
  _context.next = 8;
401
440
  return bizDispatchers.setAttrsAndMetrics(ciDatas);
402
441
 
@@ -424,7 +463,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
424
463
  /**
425
464
  * 加载标注、悬浮框数据
426
465
  * 业务拓扑使用
427
- *
466
+ *
428
467
  * @param {array<{id, attributes: [], attributeMap: {}, metrics: [], metricMap: {}}>} data
429
468
  */
430
469
  ;
@@ -456,8 +495,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
456
495
  }()
457
496
  /**
458
497
  * 临时由前端翻译引用属性名称
459
- * @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
460
- * @returns
498
+ * @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
499
+ * @returns
461
500
  */
462
501
  ;
463
502
 
@@ -517,14 +556,6 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
517
556
 
518
557
  case 8:
519
558
  refCiMap = _context3.sent;
520
-
521
- _rlog["default"].debug('translateRefAttribute', {
522
- ciRefAttributeMap: ciRefAttributeMap,
523
- refIds: refIds,
524
- refCiMap: refCiMap
525
- }); // 引用对象设置到数据
526
-
527
-
528
559
  return _context3.abrupt("return", ciDatas.map(function (ciData) {
529
560
  var id = ciData.id;
530
561
  var attributeMap = (0, _extends2["default"])({}, ciData.attributeMap);
@@ -542,7 +573,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
542
573
  });
543
574
  }));
544
575
 
545
- case 11:
576
+ case 10:
546
577
  case "end":
547
578
  return _context3.stop();
548
579
  }
@@ -558,7 +589,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
558
589
  }()
559
590
  /**
560
591
  * 推送标注、悬浮框数据 => ht
561
- * @returns
592
+ * @returns
562
593
  */
563
594
  ;
564
595
 
@@ -571,7 +602,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
571
602
 
572
603
  var elementTagsAndTips = this.buildTagsTips() // 开锁状态下禁用悬停展示悬浮框
573
604
  .map(function (item) {
574
- var _topo$store$getModelS = topo.store.getModelState('lock'),
605
+ var _topo$store$getModelS = topo.store.getModelState("lock"),
575
606
  lock = _topo$store$getModelS.lock;
576
607
 
577
608
  return lock ? item : (0, _extends2["default"])({}, item, {
@@ -581,9 +612,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
581
612
  .map(function (item) {
582
613
  var tags = item.tags;
583
614
 
584
- if (item.type === 'edge') {
615
+ if (item.type === "edge") {
585
616
  var allNoValue = tags.data.filter(function (tItem) {
586
- return tItem.value === '- ';
617
+ return tItem.value === "- ";
587
618
  }).length === tags.data.length;
588
619
 
589
620
  if (allNoValue) {
@@ -594,32 +625,30 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
594
625
  return (0, _extends2["default"])({}, item, {
595
626
  tags: tags
596
627
  });
597
- });
598
-
599
- _rlog["default"].debug("AttributeMetricDisplay.updateTagsTips " + new Date().toLocaleString(), elementTagsAndTips);
628
+ }); // rlog.debug(`AttributeMetricDisplay.updateTagsTips ${new Date().toLocaleString()}`, elementTagsAndTips);
600
629
 
601
630
  var htTopo = topo.getHtTopo();
602
631
 
603
632
  if (htTopo) {
604
633
  var _topo$historyManager, _topo$historyManager2;
605
634
 
606
- (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '加载标注');
635
+ (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, "加载标注");
607
636
  htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
608
- (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '加载标注');
637
+ (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, "加载标注");
609
638
  }
610
639
  }
611
640
  /**
612
641
  * 从store获取属性、指标数据
613
- * @returns
642
+ * @returns
614
643
  */
615
644
  ;
616
645
 
617
646
  _proto.getData = function getData() {
618
- return this.topo.store.getModelState('topoBizMod').attrsAndMetrics;
647
+ return this.topo.store.getModelState("topoBizMod").attrsAndMetrics;
619
648
  }
620
649
  /**
621
650
  * 构造标注、悬浮框数据
622
- * @returns
651
+ * @returns
623
652
  */
624
653
  ;
625
654
 
@@ -628,9 +657,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
628
657
 
629
658
  var data = this.getData(); // 获取标注、悬浮框配置
630
659
 
631
- var ciConfigs = this.getResourceTagTipConfig();
660
+ var ciConfigs = this.getResourceTagTipConfig(); // console.log("buildTagsTips---ciConfigs", ciConfigs);
661
+
632
662
  var ciTagsAndTips = ciConfigs.map(function (ciConfig) {
633
- var ciDataItem = (0, _topoData.findItem)(data, 'id', ciConfig.id);
663
+ var ciDataItem = (0, _topoData.findItem)(data, "id", ciConfig.id); // console.log("buildTagsTips-ciDataItem", ciDataItem);
634
664
 
635
665
  if (!ciDataItem) {
636
666
  return {
@@ -641,13 +671,14 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
641
671
  } // 获取ci数据
642
672
 
643
673
 
644
- var ciData = (0, _extends2["default"])({}, (0, _topoData.findItem)(data, 'id', ciConfig.id), {
674
+ var ciData = (0, _extends2["default"])({}, (0, _topoData.findItem)(data, "id", ciConfig.id), {
645
675
  ciType: ciConfig.ciType
646
676
  });
647
- var formatter = new _attributeFormatter["default"](_this6.topo);
677
+ var formatter = new _attributeFormatter["default"](_this6.topo); // console.log("AttributeFormatter-----", ciData, ciConfig);
678
+
648
679
  var tags = formatter.formatAttrs(ciConfig.tags, ciData); // 链路标注箭头
649
680
 
650
- if (ciConfig.type === 'edge') {
681
+ if (ciConfig.type === "edge") {
651
682
  tags = {
652
683
  data: tags,
653
684
  linkArrow: ciConfig.tagLinkArrow
@@ -660,7 +691,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
660
691
  tags: tags,
661
692
  tips: formatter.formatAttrs(ciConfig.tips, ciData)
662
693
  };
663
- });
694
+ }); // console.log("ciTagsAndTips", ciTagsAndTips);
695
+
664
696
  var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []); // 刷新标注、浮层
665
697
  // rlog.debug('AttributeMetricDisplay.buildTagsTips', {tagsAndTips: elementTagsAndTips, ciConfigs});
666
698
 
@@ -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.36" === 'string' ? "9.0.0-a.36" : null;
59
+ var version = typeof "9.0.0-a.38" === 'string' ? "9.0.0-a.38" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑
@@ -65,25 +65,56 @@ var AttributeFormatter = /*#__PURE__*/function () {
65
65
 
66
66
  _proto.commonTransform = function commonTransform(item, ciData, attrType) {
67
67
  var fieldCode = item.code;
68
- var fieldMeta = this.topo.ciTyeCache.getCiType(ciData.ciType)[attrType + "Map"][fieldCode];
69
- var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
68
+ console.log("commonTransform-item, ciData, attrType", item, ciData, attrType);
70
69
 
71
- if (attrType === 'attribute') {
72
- if (ciData[attrType + "Map"][fieldCode + "_object"]) {
73
- fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
70
+ if (ciData.ciType) {
71
+ var fieldMeta = this.topo.ciTyeCache.getCiType(ciData.ciType)[attrType + "Map"][fieldCode];
72
+ var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
73
+
74
+ if (attrType === "attribute") {
75
+ if (ciData[attrType + "Map"][fieldCode + "_object"]) {
76
+ fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
77
+ }
74
78
  }
75
- }
76
79
 
77
- return {
78
- type: item.type,
79
- code: item.code,
80
- // 属性code
81
- name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || '',
82
- // 属性名称
83
- value: formatMetric(fieldValue, fieldMeta),
84
- // 属性值
85
- originValue: fieldValue
86
- };
80
+ var obj = {
81
+ type: item.type,
82
+ code: item.code,
83
+ // 属性code
84
+ name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || "",
85
+ // 属性名称
86
+ value: formatMetric(fieldValue, fieldMeta),
87
+ // 属性值
88
+ originValue: fieldValue
89
+ };
90
+ return obj;
91
+ } else {
92
+ if (item.code === "ipv4_address" && ciData.bindType === "ip") {
93
+ return {
94
+ type: item.type,
95
+ code: item.code,
96
+ // 属性code
97
+ name: "IPv4地址",
98
+ // 属性名称
99
+ value: ciData.bindIp,
100
+ // 属性值
101
+ originValue: ciData.bindIp
102
+ };
103
+ } else {
104
+ var _ciData$attributes$di, _ciData$attributes, _ciData$attributes$di2, _ciData$attributes2;
105
+
106
+ return {
107
+ type: item.type,
108
+ code: item.code,
109
+ // 属性code
110
+ name: "显示名称",
111
+ // 属性名称
112
+ value: (_ciData$attributes$di = ciData === null || ciData === void 0 ? void 0 : (_ciData$attributes = ciData.attributes) === null || _ciData$attributes === void 0 ? void 0 : _ciData$attributes.display_name) !== null && _ciData$attributes$di !== void 0 ? _ciData$attributes$di : "",
113
+ // 属性值
114
+ originValue: (_ciData$attributes$di2 = ciData === null || ciData === void 0 ? void 0 : (_ciData$attributes2 = ciData.attributes) === null || _ciData$attributes2 === void 0 ? void 0 : _ciData$attributes2.display_name) !== null && _ciData$attributes$di2 !== void 0 ? _ciData$attributes$di2 : ""
115
+ };
116
+ }
117
+ }
87
118
  };
88
119
 
89
120
  _proto.attributeTransform = function attributeTransform(item, ciData) {
@@ -12,7 +12,7 @@ var _htElementUtils = require("../../utils/htElementUtils");
12
12
  function fixLink(topo) {
13
13
  var linkDatas = topo.dataModel.getEdges();
14
14
  var dm = topo.getHtTopo().getGraphView().dm();
15
- var edges = (0, _htElementUtils.getEdges)(dm);
15
+ var edges = (0, _htElementUtils.getElements)(dm).filter(_htElementUtils.isEdge);
16
16
  edges.forEach(function (edge) {
17
17
  var source = edge.getSource();
18
18
  var target = edge.getTarget();
@@ -21,15 +21,20 @@ function fixLink(topo) {
21
21
  }); // TODO 判断两端互相切换
22
22
  // const isChange =
23
23
 
24
- if (linkData && source.getTag() !== linkData.source) {
24
+ if (linkData && (source === null || source === void 0 ? void 0 : source.getTag()) !== linkData.source) {
25
25
  var node = dm.getDataByTag(linkData.source);
26
- edge.setSource(node);
26
+
27
+ if (node) {
28
+ edge.setSource(node);
29
+ }
27
30
  }
28
31
 
29
- if (linkData && linkData.target && target.getTag() !== linkData.target) {
32
+ if (linkData && linkData.target && (target === null || target === void 0 ? void 0 : target.getTag()) !== linkData.target) {
30
33
  var _node = dm.getDataByTag(linkData.target);
31
34
 
32
- edge.setTarget(_node);
35
+ if (_node) {
36
+ edge.setTarget(_node);
37
+ }
33
38
  } // TODO 两端互相切换,交换两端样式
34
39
 
35
40
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "9.0.0-a.36",
3
+ "version": "9.0.0-a.38",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.36/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.38/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }