@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.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +18 -18
- package/es/core/components/TopoView/GraphViewPanel.js +17 -4
- package/es/core/components/TopoView/TopoView.module.scss +17 -3
- package/es/core/editor/components/BackgroundView/index.module.scss +2 -0
- package/es/core/editor/components/EditorPlugin.js +4 -1
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +20 -5
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
- package/es/core/editor/components/settings/core/getPropertyViewType.js +3 -0
- package/es/core/editor/components/settings/core/updateElementProperty.js +6 -1
- package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -3
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +3 -2
- package/es/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +95 -0
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +46 -14
- package/es/core/editor/config/themes.js +53 -2
- package/es/core/editor/utils/edgeTypeStyleUtil.js +38 -0
- package/es/core/hooks/useCanvasTheme.js +12 -4
- package/es/core/hooks/useResourceConfig.js +2 -1
- package/es/core/hooks/useTopoEdit.js +120 -19
- package/es/core/hooks/useTopoFullscreen.js +32 -0
- package/es/core/models/AttributeMetricDisplay.js +91 -79
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/attributeFormatter/index.js +16 -16
- package/es/core/models/topoData.js +16 -9
- package/es/core/models/utils/linkUtils.js +52 -27
- package/es/core/store/models/topoConfig.js +51 -20
- package/es/core/test/Test.js +52 -0
- package/es/core/utils/graphLinkUtil.js +11 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +16 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +8 -78
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +27 -37
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +57 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +6 -0
- package/es/networkTopo/getTopoData.js +2 -1
- package/es/networkTopo/models/IpNodeTagsTipsBuilder.js +164 -0
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +8 -8
- package/es/networkTopo/models/TopoCenter.js +4 -3
- package/es/networkTopo/services/link.js +1 -1
- package/es/networkTopo/services/topo/basic.js +27 -26
- package/es/networkTopo/services/topo/networkLink.js +45 -3
- package/es/networkTopo/utils/exitLinkUtil.js +257 -0
- package/es/style.js +1 -0
- package/es/utils/ResourceConfigUtil.js +5 -4
- package/es/utils/htElementDataUtil.js +1 -7
- package/es/utils/htElementUtils.js +21 -21
- package/lib/core/components/TopoView/GraphViewPanel.js +18 -3
- package/lib/core/components/TopoView/TopoView.module.scss +17 -3
- package/lib/core/editor/components/BackgroundView/index.module.scss +2 -0
- package/lib/core/editor/components/EditorPlugin.js +7 -1
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +19 -3
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
- package/lib/core/editor/components/settings/core/getPropertyViewType.js +3 -0
- package/lib/core/editor/components/settings/core/updateElementProperty.js +6 -1
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +3 -3
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +3 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +111 -0
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +48 -14
- package/lib/core/editor/config/themes.js +53 -2
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +39 -0
- package/lib/core/hooks/useCanvasTheme.js +12 -4
- package/lib/core/hooks/useResourceConfig.js +2 -1
- package/lib/core/hooks/useTopoEdit.js +121 -18
- package/lib/core/hooks/useTopoFullscreen.js +42 -0
- package/lib/core/models/AttributeMetricDisplay.js +87 -79
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/attributeFormatter/index.js +14 -14
- package/lib/core/models/topoData.js +16 -9
- package/lib/core/models/utils/linkUtils.js +53 -26
- package/lib/core/store/models/topoConfig.js +56 -19
- package/lib/core/test/Test.js +52 -0
- package/lib/core/utils/graphLinkUtil.js +10 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +15 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +7 -78
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +27 -36
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +58 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +6 -0
- package/lib/networkTopo/getTopoData.js +2 -1
- package/lib/networkTopo/models/IpNodeTagsTipsBuilder.js +174 -0
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +8 -8
- package/lib/networkTopo/models/TopoCenter.js +4 -3
- package/lib/networkTopo/services/topo/basic.js +28 -28
- package/lib/networkTopo/services/topo/networkLink.js +45 -3
- package/lib/networkTopo/utils/exitLinkUtil.js +269 -0
- package/lib/style.js +1 -0
- package/lib/utils/ResourceConfigUtil.js +4 -4
- package/lib/utils/htElementDataUtil.js +0 -10
- package/lib/utils/htElementUtils.js +21 -21
- 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
|
5
|
-
import rlog from
|
6
|
-
import { keyBy } from
|
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 ===
|
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 ===
|
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(
|
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:
|
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
|
-
|
123
|
+
var nodeArr = [];
|
124
|
+
nodes.map(function (node) {
|
125
|
+
if (!!node.ciType) {
|
126
|
+
var ciType = node.ciType;
|
128
127
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
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 !==
|
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 ===
|
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:
|
200
|
-
2:
|
201
|
-
3:
|
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(
|
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,16 +296,15 @@ 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
|
|
298
304
|
_proto.getNodeNameVisible = function getNodeNameVisible(node) {
|
299
|
-
if (!this.topo.isViewMode()) {
|
300
|
-
|
301
|
-
}
|
302
|
-
|
305
|
+
// if (!this.topo.isViewMode()) {
|
306
|
+
// return true;
|
307
|
+
// }
|
303
308
|
var _this$getConfig3 = this.getConfig(),
|
304
309
|
nodeTag = _this$getConfig3.nodeTag;
|
305
310
|
|
@@ -310,8 +315,16 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
310
315
|
data = nodeTag.data;
|
311
316
|
var items = (isCustom ? data[node.ciType] : data) || [];
|
312
317
|
visible = !!items.filter(function (item) {
|
313
|
-
return item.type ===
|
314
|
-
}).length;
|
318
|
+
return item.type === "graph";
|
319
|
+
}).length; // ipNode逻辑
|
320
|
+
|
321
|
+
if (isCustom) {
|
322
|
+
return true;
|
323
|
+
} else {
|
324
|
+
return !!(data || []).filter(function (item) {
|
325
|
+
return item.type === "graph";
|
326
|
+
}).length;
|
327
|
+
}
|
315
328
|
}
|
316
329
|
|
317
330
|
return visible;
|
@@ -322,6 +335,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
322
335
|
|
323
336
|
var nodes = this.topo.dataModel.getNodes();
|
324
337
|
return nodes.map(function (node) {
|
338
|
+
// console.log("getNodesNameVisible", node);
|
325
339
|
return {
|
326
340
|
id: node.id,
|
327
341
|
visible: _this4.getNodeNameVisible(node)
|
@@ -338,16 +352,16 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
338
352
|
this.getNodesNameVisible().forEach(function (_ref) {
|
339
353
|
var id = _ref.id,
|
340
354
|
visible = _ref.visible;
|
341
|
-
var ele = dm.getDataByTag(id); //
|
355
|
+
var ele = dm.getDataByTag(id); //
|
342
356
|
|
343
357
|
if (ele) {
|
344
|
-
ele.a(
|
358
|
+
ele.a("isShowName", visible);
|
345
359
|
}
|
346
360
|
});
|
347
361
|
}
|
348
362
|
/**
|
349
363
|
* 加载标注、悬浮框数据
|
350
|
-
*
|
364
|
+
*
|
351
365
|
* @param {array<{id, attributeMap: {}, metricMap: {}}>} data
|
352
366
|
*/
|
353
367
|
;
|
@@ -378,7 +392,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
378
392
|
|
379
393
|
case 4:
|
380
394
|
ciDatas = _context.sent;
|
381
|
-
bizDispatchers = topo.store.getModelDispatchers(
|
395
|
+
bizDispatchers = topo.store.getModelDispatchers("topoBizMod");
|
382
396
|
_context.next = 8;
|
383
397
|
return bizDispatchers.setAttrsAndMetrics(ciDatas);
|
384
398
|
|
@@ -406,7 +420,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
406
420
|
/**
|
407
421
|
* 加载标注、悬浮框数据
|
408
422
|
* 业务拓扑使用
|
409
|
-
*
|
423
|
+
*
|
410
424
|
* @param {array<{id, attributes: [], attributeMap: {}, metrics: [], metricMap: {}}>} data
|
411
425
|
*/
|
412
426
|
;
|
@@ -438,8 +452,8 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
438
452
|
}()
|
439
453
|
/**
|
440
454
|
* 临时由前端翻译引用属性名称
|
441
|
-
* @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
|
442
|
-
* @returns
|
455
|
+
* @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
|
456
|
+
* @returns
|
443
457
|
*/
|
444
458
|
;
|
445
459
|
|
@@ -499,12 +513,6 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
499
513
|
|
500
514
|
case 8:
|
501
515
|
refCiMap = _context3.sent;
|
502
|
-
rlog.debug('translateRefAttribute', {
|
503
|
-
ciRefAttributeMap: ciRefAttributeMap,
|
504
|
-
refIds: refIds,
|
505
|
-
refCiMap: refCiMap
|
506
|
-
}); // 引用对象设置到数据
|
507
|
-
|
508
516
|
return _context3.abrupt("return", ciDatas.map(function (ciData) {
|
509
517
|
var id = ciData.id;
|
510
518
|
|
@@ -524,7 +532,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
524
532
|
});
|
525
533
|
}));
|
526
534
|
|
527
|
-
case
|
535
|
+
case 10:
|
528
536
|
case "end":
|
529
537
|
return _context3.stop();
|
530
538
|
}
|
@@ -540,7 +548,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
540
548
|
}()
|
541
549
|
/**
|
542
550
|
* 推送标注、悬浮框数据 => ht
|
543
|
-
* @returns
|
551
|
+
* @returns
|
544
552
|
*/
|
545
553
|
;
|
546
554
|
|
@@ -553,7 +561,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
553
561
|
|
554
562
|
var elementTagsAndTips = this.buildTagsTips() // 开锁状态下禁用悬停展示悬浮框
|
555
563
|
.map(function (item) {
|
556
|
-
var _topo$store$getModelS = topo.store.getModelState(
|
564
|
+
var _topo$store$getModelS = topo.store.getModelState("lock"),
|
557
565
|
lock = _topo$store$getModelS.lock;
|
558
566
|
|
559
567
|
return lock ? item : _extends({}, item, {
|
@@ -563,9 +571,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
563
571
|
.map(function (item) {
|
564
572
|
var tags = item.tags;
|
565
573
|
|
566
|
-
if (item.type ===
|
574
|
+
if (item.type === "edge") {
|
567
575
|
var allNoValue = tags.data.filter(function (tItem) {
|
568
|
-
return tItem.value ===
|
576
|
+
return tItem.value === "- ";
|
569
577
|
}).length === tags.data.length;
|
570
578
|
|
571
579
|
if (allNoValue) {
|
@@ -576,30 +584,30 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
576
584
|
return _extends({}, item, {
|
577
585
|
tags: tags
|
578
586
|
});
|
579
|
-
});
|
580
|
-
|
587
|
+
}); // rlog.debug(`AttributeMetricDisplay.updateTagsTips ${new Date().toLocaleString()}`, elementTagsAndTips);
|
588
|
+
|
581
589
|
var htTopo = topo.getHtTopo();
|
582
590
|
|
583
591
|
if (htTopo) {
|
584
592
|
var _topo$historyManager, _topo$historyManager2;
|
585
593
|
|
586
|
-
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true,
|
594
|
+
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, "加载标注");
|
587
595
|
htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
|
588
|
-
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false,
|
596
|
+
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, "加载标注");
|
589
597
|
}
|
590
598
|
}
|
591
599
|
/**
|
592
600
|
* 从store获取属性、指标数据
|
593
|
-
* @returns
|
601
|
+
* @returns
|
594
602
|
*/
|
595
603
|
;
|
596
604
|
|
597
605
|
_proto.getData = function getData() {
|
598
|
-
return this.topo.store.getModelState(
|
606
|
+
return this.topo.store.getModelState("topoBizMod").attrsAndMetrics;
|
599
607
|
}
|
600
608
|
/**
|
601
609
|
* 构造标注、悬浮框数据
|
602
|
-
* @returns
|
610
|
+
* @returns
|
603
611
|
*/
|
604
612
|
;
|
605
613
|
|
@@ -608,9 +616,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
608
616
|
|
609
617
|
var data = this.getData(); // 获取标注、悬浮框配置
|
610
618
|
|
611
|
-
var ciConfigs = this.getResourceTagTipConfig();
|
619
|
+
var ciConfigs = this.getResourceTagTipConfig(); // console.log("buildTagsTips---ciConfigs", ciConfigs);
|
620
|
+
|
612
621
|
var ciTagsAndTips = ciConfigs.map(function (ciConfig) {
|
613
|
-
var ciDataItem = findItem(data,
|
622
|
+
var ciDataItem = findItem(data, "id", ciConfig.id); // console.log("buildTagsTips-ciDataItem", ciDataItem);
|
614
623
|
|
615
624
|
if (!ciDataItem) {
|
616
625
|
return {
|
@@ -621,14 +630,15 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
621
630
|
} // 获取ci数据
|
622
631
|
|
623
632
|
|
624
|
-
var ciData = _extends({}, findItem(data,
|
633
|
+
var ciData = _extends({}, findItem(data, "id", ciConfig.id), {
|
625
634
|
ciType: ciConfig.ciType
|
626
635
|
});
|
627
636
|
|
628
|
-
var formatter = new AttributeFormatter(_this6.topo);
|
637
|
+
var formatter = new AttributeFormatter(_this6.topo); // console.log("AttributeFormatter-----", ciData, ciConfig);
|
638
|
+
|
629
639
|
var tags = formatter.formatAttrs(ciConfig.tags, ciData); // 链路标注箭头
|
630
640
|
|
631
|
-
if (ciConfig.type ===
|
641
|
+
if (ciConfig.type === "edge") {
|
632
642
|
tags = {
|
633
643
|
data: tags,
|
634
644
|
linkArrow: ciConfig.tagLinkArrow
|
@@ -641,8 +651,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
641
651
|
tags: tags,
|
642
652
|
tips: formatter.formatAttrs(ciConfig.tips, ciData)
|
643
653
|
};
|
644
|
-
});
|
645
|
-
|
654
|
+
}); // console.log("ciTagsAndTips", ciTagsAndTips);
|
655
|
+
|
656
|
+
var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []);
|
657
|
+
console.log("ciTagsAndTips", elementTagsAndTips); // 刷新标注、浮层
|
646
658
|
// rlog.debug('AttributeMetricDisplay.buildTagsTips', {tagsAndTips: elementTagsAndTips, ciConfigs});
|
647
659
|
|
648
660
|
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.
|
27
|
+
var version = typeof "9.0.2" === 'string' ? "9.0.2" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import rlog from
|
2
|
-
import { metricValueFormat } from
|
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
|
-
|
7
|
-
|
8
|
-
|
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 ===
|
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 ===
|
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,
|
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,
|
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(
|
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:
|
15
|
-
h:
|
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 =
|
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 =
|
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
|
113
|
+
case 16:
|
107
114
|
if (!serialize) {
|
108
|
-
_context.next =
|
115
|
+
_context.next = 19;
|
109
116
|
break;
|
110
117
|
}
|
111
118
|
|
112
|
-
_context.next =
|
119
|
+
_context.next = 19;
|
113
120
|
return topoService.saveSerializeData(topoId, serialize);
|
114
121
|
|
115
|
-
case
|
122
|
+
case 19:
|
116
123
|
case "end":
|
117
124
|
return _context.stop();
|
118
125
|
}
|