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

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.
@@ -134,27 +134,6 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
134
134
  tags: _this.filterCiFiledConfigItems(node, ciTypeConfig.tags),
135
135
  tips: _this.filterCiFiledConfigItems(node, ciTypeConfig.tips)
136
136
  });
137
- } else if (node.bindType === "ip") {
138
- var _this$getConfig2 = _this.getConfig(),
139
- nodeTag = _this$getConfig2.nodeTag,
140
- nodeTip = _this$getConfig2.nodeTip;
141
-
142
- console.log("nodeTag------------------------", nodeTag, nodeTip);
143
-
144
- if (!nodeTag.isCustom) {
145
- var hasIpv4 = Array.isArray(nodeTag.data) && (nodeTag === null || nodeTag === void 0 ? void 0 : nodeTag.data.find(function (item) {
146
- return item.code === "ipv4_address";
147
- }));
148
- if (hasIpv4) nodeArr.push({
149
- type: "node",
150
- id: node.id,
151
- tags: [{
152
- type: "attribute",
153
- code: "ipv4_address"
154
- }],
155
- tips: []
156
- });
157
- }
158
137
  }
159
138
  }); // console.log("nodeArr", nodeArr);
160
139
 
@@ -195,9 +174,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
195
174
  ;
196
175
 
197
176
  _proto.getLinkTagTipConfig = function getLinkTagTipConfig(link) {
198
- var _this$getConfig3 = this.getConfig(),
199
- linkTag = _this$getConfig3.linkTag,
200
- linkTip = _this$getConfig3.linkTip;
177
+ var _this$getConfig2 = this.getConfig(),
178
+ linkTag = _this$getConfig2.linkTag,
179
+ linkTip = _this$getConfig2.linkTip;
201
180
 
202
181
  var ciTypeMeta = this.topo.ciTyeCache.getCiTypeByCi(link);
203
182
  var modelType = this.getModelType(link);
@@ -323,33 +302,32 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
323
302
  ;
324
303
 
325
304
  _proto.getNodeNameVisible = function getNodeNameVisible(node) {
326
- var _nodeTag$data;
327
-
328
305
  if (!this.topo.isViewMode()) {
329
- return trueipv4_address;
306
+ return true;
330
307
  }
331
308
 
332
- var _this$getConfig4 = this.getConfig(),
333
- nodeTag = _this$getConfig4.nodeTag;
309
+ var _this$getConfig3 = this.getConfig(),
310
+ nodeTag = _this$getConfig3.nodeTag;
334
311
 
335
312
  var visible = true;
336
313
 
337
314
  if (nodeTag) {
315
+ var _nodeTag$data;
316
+
338
317
  var isCustom = nodeTag.isCustom,
339
318
  data = nodeTag.data;
340
319
  var items = (isCustom ? data[node.ciType] : data) || [];
341
320
  visible = !!items.filter(function (item) {
342
321
  return item.type === "graph";
343
322
  }).length;
344
- } // console.log("getNodeNameVisible--xxx", nodeTag);
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
+ }));
345
327
 
346
-
347
- 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) {
348
- return item.code === "ipv4_address";
349
- }));
350
-
351
- if (node.bindType === "ip" && !hasIpv4) {
352
- return true;
328
+ if (node.bindType === "ip" && !hasIpv4) {
329
+ return true;
330
+ }
353
331
  }
354
332
 
355
333
  return visible;
@@ -678,7 +656,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
678
656
  };
679
657
  }); // console.log("ciTagsAndTips", ciTagsAndTips);
680
658
 
681
- var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []); // 刷新标注、浮层
659
+ var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []);
660
+ console.log("ciTagsAndTips", elementTagsAndTips); // 刷新标注、浮层
682
661
  // rlog.debug('AttributeMetricDisplay.buildTagsTips', {tagsAndTips: elementTagsAndTips, ciConfigs});
683
662
 
684
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.38" === 'string' ? "9.0.0-a.38" : null;
27
+ var version = typeof "9.0.0-a.39" === 'string' ? "9.0.0-a.39" : 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
  }
@@ -54,64 +54,33 @@ var AttributeFormatter = /*#__PURE__*/function () {
54
54
 
55
55
  _proto.commonTransform = function commonTransform(item, ciData, attrType) {
56
56
  var fieldCode = item.code;
57
- console.log("commonTransform-item, ciData, attrType", item, ciData, attrType);
58
-
59
- if (ciData.ciType) {
60
- var fieldMeta = this.topo.ciTyeCache.getCiType(ciData.ciType)[attrType + "Map"][fieldCode];
61
- var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
62
-
63
- if (attrType === "attribute") {
64
- if (ciData[attrType + "Map"][fieldCode + "_object"]) {
65
- fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
66
- }
67
- }
57
+ var fieldMeta = this.topo.ciTyeCache.getCiType(ciData.ciType)[attrType + "Map"][fieldCode];
58
+ var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
68
59
 
69
- var obj = {
70
- type: item.type,
71
- code: item.code,
72
- // 属性code
73
- name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || "",
74
- // 属性名称
75
- value: formatMetric(fieldValue, fieldMeta),
76
- // 属性值
77
- originValue: fieldValue
78
- };
79
- return obj;
80
- } else {
81
- if (item.code === "ipv4_address" && ciData.bindType === "ip") {
82
- return {
83
- type: item.type,
84
- code: item.code,
85
- // 属性code
86
- name: "IPv4地址",
87
- // 属性名称
88
- value: ciData.bindIp,
89
- // 属性值
90
- originValue: ciData.bindIp
91
- };
92
- } else {
93
- var _ciData$attributes$di, _ciData$attributes, _ciData$attributes$di2, _ciData$attributes2;
94
-
95
- return {
96
- type: item.type,
97
- code: item.code,
98
- // 属性code
99
- name: "显示名称",
100
- // 属性名称
101
- 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 : "",
102
- // 属性值
103
- 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 : ""
104
- };
60
+ if (attrType === "attribute") {
61
+ if (ciData[attrType + "Map"][fieldCode + "_object"]) {
62
+ fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
105
63
  }
106
64
  }
65
+
66
+ return {
67
+ type: item.type,
68
+ code: item.code,
69
+ // 属性code
70
+ name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || "",
71
+ // 属性名称
72
+ value: formatMetric(fieldValue, fieldMeta),
73
+ // 属性值
74
+ originValue: fieldValue
75
+ };
107
76
  };
108
77
 
109
78
  _proto.attributeTransform = function attributeTransform(item, ciData) {
110
- return this.commonTransform(item, ciData, 'attribute');
79
+ return this.commonTransform(item, ciData, "attribute");
111
80
  };
112
81
 
113
82
  _proto.metricTransform = function metricTransform(item, ciData) {
114
- return this.commonTransform(item, ciData, 'metric');
83
+ return this.commonTransform(item, ciData, "metric");
115
84
  };
116
85
 
117
86
  _proto.ciTypeAttrTransform = function ciTypeAttrTransform(item, ciData) {
@@ -120,7 +89,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
120
89
  type: item.type,
121
90
  code: item.code,
122
91
  // 属性code
123
- name: '资源类型',
92
+ name: "资源类型",
124
93
  // 属性名称
125
94
  value: ciTypeMeta.name // 属性数值
126
95
 
@@ -128,11 +97,11 @@ var AttributeFormatter = /*#__PURE__*/function () {
128
97
  };
129
98
 
130
99
  _proto.graphTransform = function graphTransform(item, ciData) {
131
- var value = '-';
100
+ var value = "-";
132
101
 
133
102
  try {
134
103
  var node = this.topo.getDataModel().getDataByTag(ciData.id);
135
- 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")) || "-";
136
105
  } catch (error) {
137
106
  rlog.error(error);
138
107
  }
@@ -141,7 +110,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
141
110
  type: item.type,
142
111
  code: item.code,
143
112
  // 属性code
144
- name: '图片名称',
113
+ name: "图片名称",
145
114
  // 属性名称
146
115
  value: value // 属性值
147
116
 
@@ -1,37 +1,35 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
-
3
1
  /**
4
2
  * 连线组标注、悬浮框数据构建
5
3
  */
6
- import rlog from '@riil-frontend/component-topology-utils/es/rlog';
4
+ import rlog from "@riil-frontend/component-topology-utils/es/rlog";
7
5
  import { getEdgeGroups } from "../../utils/htElementUtils";
8
6
  import AttributeFormatter from "../../core/models/attributeFormatter"; // 参与计算的链路指标
9
7
 
10
8
  var metrics = [// 总流速
11
9
  {
12
- code: 'interface_totalbps',
13
- calcType: 'sum'
10
+ code: "interface_totalbps",
11
+ calcType: "sum"
14
12
  }, // 带宽利用率
15
13
  {
16
- code: 'bandwidth_utilization',
17
- calcType: 'avg'
14
+ code: "bandwidth_utilization",
15
+ calcType: "avg"
18
16
  }, // 发送带宽利用率
19
17
  {
20
- code: 'out_bandwidth_utilization',
21
- calcType: 'avg',
18
+ code: "out_bandwidth_utilization",
19
+ calcType: "avg",
22
20
  showWhenSameSource: true
23
21
  }, // 接收带宽利用率
24
22
  {
25
- code: 'in_bandwidth_utilization',
26
- calcType: 'avg',
23
+ code: "in_bandwidth_utilization",
24
+ calcType: "avg",
27
25
  showWhenSameSource: true
28
26
  }, {
29
- code: 'out_rate',
30
- calcType: 'sum',
27
+ code: "out_rate",
28
+ calcType: "sum",
31
29
  showWhenSameSource: true
32
30
  }, {
33
- code: 'in_rate',
34
- calcType: 'sum',
31
+ code: "in_rate",
32
+ calcType: "sum",
35
33
  showWhenSameSource: true
36
34
  }];
37
35
  var calcFnMap = {
@@ -58,178 +56,58 @@ var IpNodeTagsTipsBuilder = /*#__PURE__*/function () {
58
56
  var _proto = IpNodeTagsTipsBuilder.prototype;
59
57
 
60
58
  _proto.getExtElementTagsAndTips = function getExtElementTagsAndTips() {
61
- return this.getEdgeGroupTagsAndTips();
62
- }
63
- /**
64
- * 获得未关联聚合链路的连线组标注和悬浮框数据
65
- * @param {*} ciTagsAndTips
66
- * @returns
67
- */
68
- ;
69
-
70
- _proto.getEdgeGroupTagsAndTips = function getEdgeGroupTagsAndTips() {
71
- var _this = this;
72
-
73
- var ciConfigs = this.amDisplay.getResourceTagTipConfig();
74
- var data = this.amDisplay.getData();
75
- var topo = this.topo;
76
- var dm = this.topo.getDataModel(); // 获取所有连线组,排除关联聚合链路,排除无子链路
77
-
78
- var groups = getEdgeGroups(dm).map(getGroupInfo).filter(function (item) {
79
- return !!item;
80
- }); // 计算标注和指标
81
-
82
- var edgeGroupsTagsTips = groups.map(function (_ref) {
83
- var groupId = _ref.groupId,
84
- linkChildren = _ref.children;
85
- var config = ciConfigs.find(function (item) {
86
- return item.id === linkChildren[0].id;
87
- });
88
- return _this.buildEdgeGroupTagTagsAndTips({
89
- groupId: groupId,
90
- config: config,
91
- linkChildren: linkChildren,
92
- data: data
93
- });
94
- }); // 获得连线组及子链路
95
- // 关联聚合链路、无子链路 时返回null
96
-
97
- function getGroupInfo(group) {
98
- var edges = group.getEdges().toArray();
99
- var edge = edges[0];
100
- var edgeGroupData = topo.getHtTopo().getEdgeGroupData(edge.getSource(), edge.getTarget()); // eslint-disable-next-line no-underscore-dangle
101
-
102
- var linkId = edgeGroupData.data._attrObject.id;
103
-
104
- if (linkId) {
105
- return null;
106
- }
107
-
108
- var linkChildren = getLinkChildren(edges);
109
-
110
- if (!linkChildren.length) {
111
- return null;
112
- }
113
-
114
- return {
115
- groupId: [edge.getSource().getId(), edge.getTarget().getId()].sort().join('-'),
116
- children: linkChildren
117
- };
118
- }
119
-
120
- function getLinkChildren(edges) {
121
- return edges.map(function (edge) {
122
- var edgeData = topo.getHtTopo().getEdgeData(edge); // eslint-disable-next-line no-underscore-dangle
123
-
124
- var childLinkId = edgeData._tag;
125
-
126
- if (childLinkId) {
127
- return topo.dataModel.getDataById(childLinkId);
128
- }
129
-
130
- return null;
131
- }).filter(function (item) {
132
- return !!item;
133
- }).filter(function (link) {
134
- return link.ciType === 'network_link';
135
- });
136
- }
137
-
138
- return edgeGroupsTagsTips;
59
+ return this.getIpNodeTagsAndTips();
139
60
  };
140
61
 
141
- _proto.buildEdgeGroupTagTagsAndTips = function buildEdgeGroupTagTagsAndTips(_ref2) {
142
- var _this2 = this;
143
-
144
- var groupId = _ref2.groupId,
145
- config = _ref2.config,
146
- linkChildren = _ref2.linkChildren,
147
- data = _ref2.data;
148
-
149
- // 查询配置,过滤不在范围内的属性
150
- var finalConfig = _extends({}, config, {
151
- tags: config.tags.filter(function (item) {
152
- return _this2.filterField(item, linkChildren);
153
- }),
154
- tips: config.tips.filter(function (item) {
155
- return _this2.filterField(item, linkChildren);
156
- })
157
- }); // 构造数据,计算指标值
158
-
159
-
160
- var mergeData = this.buildData(data, linkChildren);
161
- rlog.debug('buildEdgeGroupTagTagsAndTips', {
162
- groupId: groupId,
163
- config: config,
164
- linkChildren: linkChildren,
165
- data: data,
166
- finalConfig: finalConfig,
167
- mergeData: mergeData
168
- }); // 构造标注、悬浮框数据
169
-
170
- var formatter = new AttributeFormatter(this.topo);
171
- return {
172
- type: 'edgeGroup',
173
- edgeGroupId: groupId,
174
- tags: formatter.formatAttrs(finalConfig.tags, mergeData),
175
- tips: formatter.formatAttrs(finalConfig.tips, mergeData)
176
- };
177
- } // eslint-disable-next-line class-methods-use-this
178
- ;
179
-
180
- _proto.filterField = function filterField(item, linkChildren) {
181
- var fieldConfig = metrics.find(function (m) {
182
- return item.code === m.code;
62
+ _proto.getIpNodeTagsAndTips = function getIpNodeTagsAndTips() {
63
+ // const ciConfigs = this.amDisplay.getResourceTagTipConfig();
64
+ var tts = [];
65
+ var data = this.amDisplay.getData();
66
+ var ipNodes = data.filter(function (item) {
67
+ return item.bindType === "ip";
183
68
  });
184
-
185
- if (item.type !== 'metric' || !fieldConfig) {
186
- return false;
187
- } // 如果需要校验取值接口,如果取值接口为不同设备的接口,则不显示这四个指标
188
-
189
-
190
- if (fieldConfig.showWhenSameSource) {
191
- var sources = [];
192
- linkChildren.forEach(function (link) {
193
- if (sources.indexOf(link.source) === -1) {
194
- sources.push(link.source);
69
+ var topo = this.topo;
70
+ var dm = this.topo.getDataModel();
71
+ var config = topo.attributeMetricDisplay.getConfig();
72
+ console.log("getIpNodeTagsAndTips", config, ipNodes);
73
+
74
+ if (config.nodeTag && !config.nodeTag.isCustom) {
75
+ var tagDatas = config.nodeTag.data;
76
+ var hasIpv4 = tagDatas.filter(function (item) {
77
+ return item.code === "ipv4_address";
78
+ }).length > 0;
79
+ ipNodes.map(function (node) {
80
+ if (hasIpv4) {
81
+ tts.push({
82
+ type: node,
83
+ id: node.id,
84
+ tags: [{
85
+ type: "attribute",
86
+ code: "ipv4_address",
87
+ // 属性code
88
+ name: "IPv4地址",
89
+ // 属性名称
90
+ value: node.bindIp,
91
+ // 属性值
92
+ originValue: node.bindIp
93
+ }],
94
+ tips: []
95
+ });
96
+ } else {
97
+ tts.push({
98
+ type: node,
99
+ id: node.id,
100
+ tags: [],
101
+ tips: []
102
+ });
195
103
  }
196
104
  });
197
-
198
- if (sources.length > 1) {
199
- return false;
200
- }
201
105
  }
202
106
 
203
- return true;
204
- } // eslint-disable-next-line class-methods-use-this
205
- ;
206
-
207
- _proto.buildData = function buildData(data, linkChildren) {
208
- var linkChildrenData = linkChildren.map(function (link) {
209
- return data.find(function (item) {
210
- return item.id === link.id;
211
- });
212
- });
213
- var mergeData = {
214
- ciType: 'network_link',
215
- metricMap: {}
216
- };
217
- metrics.forEach(function (m) {
218
- try {
219
- var values = linkChildrenData.map(function (linkData) {
220
- return linkData.metricMap[m.code];
221
- });
222
- mergeData.metricMap[m.code] = calcFnMap[m.calcType](values);
223
- } catch (error) {
224
- rlog.warn('连线组指标计算异常', error);
225
- }
226
- }); // console.error(groupId, {config, linkChildrenData, mergeData})
227
-
228
- return mergeData;
107
+ return tts;
229
108
  };
230
109
 
231
110
  return IpNodeTagsTipsBuilder;
232
111
  }();
233
112
 
234
- export { IpNodeTagsTipsBuilder as default };
235
- ;
113
+ export { IpNodeTagsTipsBuilder as default };
@@ -8,7 +8,8 @@ import TopoApp from "../../core/models/TopoApp";
8
8
  import createMenuCommands from "../../contextmenu/createMenuCommands";
9
9
  import getTopoData from "../getTopoData";
10
10
  import customStoreModels from "../store";
11
- import { DEFAULT_LINK_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../../constants/ResourceInfoDisplay"; // import LinkTagsTipsBuilder from './LinkTagsTipsBuilder';
11
+ import { DEFAULT_LINK_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../../constants/ResourceInfoDisplay";
12
+ import IpNodeTagsTipsBuilder from "./IpNodeTagsTipsBuilder";
12
13
 
13
14
  var TopoCenter = /*#__PURE__*/function (_TopoApp) {
14
15
  _inheritsLoose(TopoCenter, _TopoApp);
@@ -28,8 +29,8 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
28
29
  },
29
30
  getDefaultLinkTipConfig: function getDefaultLinkTipConfig() {
30
31
  return DEFAULT_TIP_COMMON_CONFIG;
31
- } // ExtElementTagTipBuilder: LinkTagsTipsBuilder,
32
-
32
+ },
33
+ ExtElementTagTipBuilder: IpNodeTagsTipsBuilder
33
34
  }
34
35
  })) || this;
35
36
  _this.resourceConfig = null;
@@ -152,27 +152,6 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
152
152
  tags: _this.filterCiFiledConfigItems(node, ciTypeConfig.tags),
153
153
  tips: _this.filterCiFiledConfigItems(node, ciTypeConfig.tips)
154
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
155
  }
177
156
  }); // console.log("nodeArr", nodeArr);
178
157
 
@@ -213,9 +192,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
213
192
  ;
214
193
 
215
194
  _proto.getLinkTagTipConfig = function getLinkTagTipConfig(link) {
216
- var _this$getConfig3 = this.getConfig(),
217
- linkTag = _this$getConfig3.linkTag,
218
- linkTip = _this$getConfig3.linkTip;
195
+ var _this$getConfig2 = this.getConfig(),
196
+ linkTag = _this$getConfig2.linkTag,
197
+ linkTip = _this$getConfig2.linkTip;
219
198
 
220
199
  var ciTypeMeta = this.topo.ciTyeCache.getCiTypeByCi(link);
221
200
  var modelType = this.getModelType(link);
@@ -341,33 +320,32 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
341
320
  ;
342
321
 
343
322
  _proto.getNodeNameVisible = function getNodeNameVisible(node) {
344
- var _nodeTag$data;
345
-
346
323
  if (!this.topo.isViewMode()) {
347
- return trueipv4_address;
324
+ return true;
348
325
  }
349
326
 
350
- var _this$getConfig4 = this.getConfig(),
351
- nodeTag = _this$getConfig4.nodeTag;
327
+ var _this$getConfig3 = this.getConfig(),
328
+ nodeTag = _this$getConfig3.nodeTag;
352
329
 
353
330
  var visible = true;
354
331
 
355
332
  if (nodeTag) {
333
+ var _nodeTag$data;
334
+
356
335
  var isCustom = nodeTag.isCustom,
357
336
  data = nodeTag.data;
358
337
  var items = (isCustom ? data[node.ciType] : data) || [];
359
338
  visible = !!items.filter(function (item) {
360
339
  return item.type === "graph";
361
340
  }).length;
362
- } // console.log("getNodeNameVisible--xxx", nodeTag);
341
+ console.log("getNodeNameVisible--xxx", nodeTag);
342
+ 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) {
343
+ return item.code === "ipv4_address";
344
+ }));
363
345
 
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;
346
+ if (node.bindType === "ip" && !hasIpv4) {
347
+ return true;
348
+ }
371
349
  }
372
350
 
373
351
  return visible;
@@ -693,7 +671,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
693
671
  };
694
672
  }); // console.log("ciTagsAndTips", ciTagsAndTips);
695
673
 
696
- var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []); // 刷新标注、浮层
674
+ var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []);
675
+ console.log("ciTagsAndTips", elementTagsAndTips); // 刷新标注、浮层
697
676
  // rlog.debug('AttributeMetricDisplay.buildTagsTips', {tagsAndTips: elementTagsAndTips, ciConfigs});
698
677
 
699
678
  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.38" === 'string' ? "9.0.0-a.38" : null;
59
+ var version = typeof "9.0.0-a.39" === 'string' ? "9.0.0-a.39" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑