@riil-frontend/component-topology 11.0.13 → 11.0.15
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/index.css +1 -1
- package/build/index.js +1 -1
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +1 -2
- package/es/core/components/ResourceViewAttributeSetting/nodeCiTypeAttrUtil.js +1 -1
- package/es/core/components/TopoView/topoView.js +4 -1
- package/es/core/editor/components/BottomFloatTool/HelpIcon.module.scss +7 -0
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/attributeFormatter/formatter/attributeTransform.js +4 -0
- package/es/core/models/attributeFormatter/formatter/ciTypeAttrTransform.js +15 -0
- package/es/core/models/attributeFormatter/formatter/commonTransform.js +51 -0
- package/es/core/models/attributeFormatter/formatter/graphTransform.js +24 -0
- package/es/core/models/attributeFormatter/formatter/metricTransform.js +4 -0
- package/es/core/models/attributeFormatter/index.js +19 -92
- package/es/networkTopo/getTopoData.js +13 -9
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +1 -3
- package/lib/core/components/ResourceViewAttributeSetting/nodeCiTypeAttrUtil.js +1 -1
- package/lib/core/components/TopoView/topoView.js +4 -1
- package/lib/core/editor/components/BottomFloatTool/HelpIcon.module.scss +7 -0
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/attributeFormatter/formatter/attributeTransform.js +12 -0
- package/lib/core/models/attributeFormatter/formatter/ciTypeAttrTransform.js +20 -0
- package/lib/core/models/attributeFormatter/formatter/commonTransform.js +61 -0
- package/lib/core/models/attributeFormatter/formatter/graphTransform.js +32 -0
- package/lib/core/models/attributeFormatter/formatter/metricTransform.js +12 -0
- package/lib/core/models/attributeFormatter/index.js +20 -93
- package/lib/networkTopo/getTopoData.js +13 -9
- package/package.json +2 -2
@@ -1,7 +1,6 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
5
4
|
export default (function (props) {
|
6
5
|
var topo = props.topo,
|
7
6
|
displaySettingProps = props.displaySettingProps,
|
@@ -21,7 +20,7 @@ export default (function (props) {
|
|
21
20
|
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
22
21
|
displayConfig = _extends({}, prevDisplayConfig, values);
|
23
22
|
_context.next = 5;
|
24
|
-
return
|
23
|
+
return topo.serverApi.saveTopoSettings(topo.id, {
|
25
24
|
alarmSwitch: displayConfig.alarmSwitch,
|
26
25
|
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
27
26
|
extraConfig: JSON.stringify(_extends({}, displayConfig))
|
@@ -266,7 +266,10 @@ var Topology = function Topology(props) {
|
|
266
266
|
|
267
267
|
return /*#__PURE__*/React.createElement("div", {
|
268
268
|
className: styles.topoView,
|
269
|
-
"data-version": topo.version
|
269
|
+
"data-version": topo.version,
|
270
|
+
onFocus: function onFocus() {
|
271
|
+
window.topo = topo;
|
272
|
+
}
|
270
273
|
}, titleBar !== false && titleBar, isEditMode && /*#__PURE__*/React.createElement(EditorToolbar, {
|
271
274
|
topo: topo,
|
272
275
|
topoEdit: topoEdit,
|
@@ -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 "11.0.
|
27
|
+
var version = typeof "11.0.15" === 'string' ? "11.0.15" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export default function ciTypeAttrTransform(options) {
|
2
|
+
var item = options.item,
|
3
|
+
ciData = options.ciData,
|
4
|
+
topo = options.topo;
|
5
|
+
var ciTypeMeta = topo.ciTyeCache.getCiType(ciData.ciType);
|
6
|
+
return {
|
7
|
+
type: item.type,
|
8
|
+
code: item.code,
|
9
|
+
// 属性code
|
10
|
+
name: "资源类型",
|
11
|
+
// 属性名称
|
12
|
+
value: ciTypeMeta.name // 属性数值
|
13
|
+
|
14
|
+
};
|
15
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { metricValueFormat } from '@riil-frontend/utils';
|
2
|
+
import DictCache from "../../cache/DictCache";
|
3
|
+
/**
|
4
|
+
* 格式化指标
|
5
|
+
* @param {*} val
|
6
|
+
* @param {*} metricInfo
|
7
|
+
* @returns
|
8
|
+
*/
|
9
|
+
|
10
|
+
export function formatMetric(val, metricInfo) {
|
11
|
+
// rlog.debug('formatMetric', item, metricInfo);
|
12
|
+
if (metricInfo) {
|
13
|
+
var result = metricValueFormat({
|
14
|
+
value: val,
|
15
|
+
dataType: metricInfo.dataType,
|
16
|
+
dict: DictCache.getDictObject(),
|
17
|
+
unit: metricInfo.unit,
|
18
|
+
code: metricInfo.code
|
19
|
+
});
|
20
|
+
return result.value + " " + (result.value === '-' ? '' : result.unit);
|
21
|
+
} else {
|
22
|
+
return "" + val;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
export default function commonTransform(options) {
|
26
|
+
var item = options.item,
|
27
|
+
ciData = options.ciData,
|
28
|
+
topo = options.topo;
|
29
|
+
var fieldCode = item.code;
|
30
|
+
var attrType = item.type;
|
31
|
+
var ciTypeModel = topo.ciTyeCache.getCiType(ciData.ciType);
|
32
|
+
var fieldMeta = ciTypeModel[attrType + "Map"][fieldCode];
|
33
|
+
var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
|
34
|
+
|
35
|
+
if (attrType === 'attribute') {
|
36
|
+
if (ciData[attrType + "Map"][fieldCode + "_object"]) {
|
37
|
+
fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
return {
|
42
|
+
type: item.type,
|
43
|
+
code: item.code,
|
44
|
+
// 属性code
|
45
|
+
name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || '',
|
46
|
+
// 属性名称
|
47
|
+
value: formatMetric(fieldValue, fieldMeta),
|
48
|
+
// 属性值
|
49
|
+
originValue: fieldValue
|
50
|
+
};
|
51
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
2
|
+
export default function graphTransform(options) {
|
3
|
+
var item = options.item,
|
4
|
+
ciData = options.ciData,
|
5
|
+
topo = options.topo;
|
6
|
+
var value = '-';
|
7
|
+
|
8
|
+
try {
|
9
|
+
var node = topo.getDataModel().getDataByTag(ciData.id);
|
10
|
+
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
11
|
+
} catch (error) {
|
12
|
+
rlog.error(error);
|
13
|
+
}
|
14
|
+
|
15
|
+
return {
|
16
|
+
type: item.type,
|
17
|
+
code: item.code,
|
18
|
+
// 属性code
|
19
|
+
name: '图片名称',
|
20
|
+
// 属性名称
|
21
|
+
value: value // 属性值
|
22
|
+
|
23
|
+
};
|
24
|
+
}
|
@@ -1,28 +1,8 @@
|
|
1
|
-
import rlog from
|
2
|
-
import
|
3
|
-
import
|
4
|
-
|
5
|
-
|
6
|
-
* @param {*} val
|
7
|
-
* @param {*} metricInfo
|
8
|
-
* @returns
|
9
|
-
*/
|
10
|
-
|
11
|
-
export function formatMetric(val, metricInfo) {
|
12
|
-
// rlog.debug('formatMetric', item, metricInfo);
|
13
|
-
if (metricInfo) {
|
14
|
-
var result = metricValueFormat({
|
15
|
-
value: val,
|
16
|
-
dataType: metricInfo.dataType,
|
17
|
-
dict: DictCache.getDictObject(),
|
18
|
-
unit: metricInfo.unit,
|
19
|
-
code: metricInfo.code
|
20
|
-
});
|
21
|
-
return result.value + " " + (result.value === "-" ? "" : result.unit);
|
22
|
-
} else {
|
23
|
-
return "" + val;
|
24
|
-
}
|
25
|
-
}
|
1
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
2
|
+
import attributeTransform from "./formatter/attributeTransform";
|
3
|
+
import metricTransform from "./formatter/metricTransform";
|
4
|
+
import ciTypeAttrTransform from "./formatter/ciTypeAttrTransform";
|
5
|
+
import graphTransform from "./formatter/graphTransform";
|
26
6
|
/**
|
27
7
|
* 标注值格式化
|
28
8
|
*/
|
@@ -31,10 +11,10 @@ var AttributeFormatter = /*#__PURE__*/function () {
|
|
31
11
|
function AttributeFormatter(topo) {
|
32
12
|
this.topo = topo;
|
33
13
|
this.transformMap = {
|
34
|
-
attribute:
|
35
|
-
metric:
|
36
|
-
ciType:
|
37
|
-
graph:
|
14
|
+
attribute: attributeTransform,
|
15
|
+
metric: metricTransform,
|
16
|
+
ciType: ciTypeAttrTransform,
|
17
|
+
graph: graphTransform
|
38
18
|
};
|
39
19
|
}
|
40
20
|
|
@@ -45,76 +25,23 @@ var AttributeFormatter = /*#__PURE__*/function () {
|
|
45
25
|
|
46
26
|
return items.map(function (item) {
|
47
27
|
return _this.transformAttr(item, ciData);
|
28
|
+
}).filter(function (item) {
|
29
|
+
return !!item;
|
48
30
|
});
|
49
31
|
};
|
50
32
|
|
51
33
|
_proto.transformAttr = function transformAttr(item, ciData) {
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
var fieldCode = item.code;
|
57
|
-
var fieldMeta = this.topo.ciTyeCache.getCiType(ciData.ciType)[attrType + "Map"][fieldCode];
|
58
|
-
var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
|
59
|
-
|
60
|
-
if (attrType === "attribute") {
|
61
|
-
if (ciData[attrType + "Map"][fieldCode + "_object"]) {
|
62
|
-
fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
|
63
|
-
}
|
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
|
34
|
+
var options = {
|
35
|
+
item: item,
|
36
|
+
ciData: ciData,
|
37
|
+
topo: this.topo
|
75
38
|
};
|
39
|
+
var transform = this.transformMap[item.type];
|
40
|
+
return transform(options);
|
76
41
|
};
|
77
42
|
|
78
|
-
_proto.
|
79
|
-
|
80
|
-
};
|
81
|
-
|
82
|
-
_proto.metricTransform = function metricTransform(item, ciData) {
|
83
|
-
return this.commonTransform(item, ciData, "metric");
|
84
|
-
};
|
85
|
-
|
86
|
-
_proto.ciTypeAttrTransform = function ciTypeAttrTransform(item, ciData) {
|
87
|
-
var ciTypeMeta = this.topo.ciTyeCache.getCiType(ciData.ciType);
|
88
|
-
return {
|
89
|
-
type: item.type,
|
90
|
-
code: item.code,
|
91
|
-
// 属性code
|
92
|
-
name: "资源类型",
|
93
|
-
// 属性名称
|
94
|
-
value: ciTypeMeta.name // 属性数值
|
95
|
-
|
96
|
-
};
|
97
|
-
};
|
98
|
-
|
99
|
-
_proto.graphTransform = function graphTransform(item, ciData) {
|
100
|
-
var value = "-";
|
101
|
-
|
102
|
-
try {
|
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")) || "-";
|
105
|
-
} catch (error) {
|
106
|
-
rlog.error(error);
|
107
|
-
}
|
108
|
-
|
109
|
-
return {
|
110
|
-
type: item.type,
|
111
|
-
code: item.code,
|
112
|
-
// 属性code
|
113
|
-
name: "图片名称",
|
114
|
-
// 属性名称
|
115
|
-
value: value // 属性值
|
116
|
-
|
117
|
-
};
|
43
|
+
_proto.addTransform = function addTransform(name, transform) {
|
44
|
+
this.transformMap[name] = transform;
|
118
45
|
};
|
119
46
|
|
120
47
|
return AttributeFormatter;
|
@@ -56,13 +56,17 @@ function fixNodeGroupId(data) {
|
|
56
56
|
});
|
57
57
|
}
|
58
58
|
|
59
|
+
function isNetworkLink(link) {
|
60
|
+
return link.ciType === 'network_link' || link.typeCode === 'network_link';
|
61
|
+
}
|
62
|
+
|
59
63
|
export function addLinkData(_x) {
|
60
64
|
return _addLinkData.apply(this, arguments);
|
61
65
|
} // FIXME 业务拓扑不需要链路相关逻辑
|
62
66
|
|
63
67
|
function _addLinkData() {
|
64
68
|
_addLinkData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
65
|
-
var links, nodes, networkLinks, otherLinks;
|
69
|
+
var links, nodes, prevNetworkLinks, networkLinks, otherLinks;
|
66
70
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
67
71
|
while (1) {
|
68
72
|
switch (_context.prev = _context.next) {
|
@@ -70,23 +74,23 @@ function _addLinkData() {
|
|
70
74
|
links = data.links || [];
|
71
75
|
nodes = data.nodes || []; // 如果是网络链路,补充详情信息
|
72
76
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
+
prevNetworkLinks = links.filter(function (link) {
|
78
|
+
return isNetworkLink(link);
|
79
|
+
});
|
80
|
+
_context.next = 5;
|
81
|
+
return getLinksDetail(prevNetworkLinks, nodes);
|
77
82
|
|
78
|
-
case
|
83
|
+
case 5:
|
79
84
|
networkLinks = _context.sent;
|
80
|
-
// console.log("如果是网络链路,补充详情信息", networkLinks);
|
81
85
|
otherLinks = links.filter(function (link) {
|
82
|
-
return link
|
86
|
+
return !isNetworkLink(link);
|
83
87
|
});
|
84
88
|
return _context.abrupt("return", _extends({}, data, {
|
85
89
|
links: [].concat(networkLinks, otherLinks),
|
86
90
|
linkGroups: []
|
87
91
|
}));
|
88
92
|
|
89
|
-
case
|
93
|
+
case 8:
|
90
94
|
case "end":
|
91
95
|
return _context.stop();
|
92
96
|
}
|
@@ -11,8 +11,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
11
11
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
13
13
|
|
14
|
-
var _topo = _interopRequireDefault(require("@riil-frontend/component-topology-common/es/services/topo"));
|
15
|
-
|
16
14
|
var _default = function _default(props) {
|
17
15
|
var topo = props.topo,
|
18
16
|
displaySettingProps = props.displaySettingProps,
|
@@ -32,7 +30,7 @@ var _default = function _default(props) {
|
|
32
30
|
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
33
31
|
displayConfig = (0, _extends2["default"])({}, prevDisplayConfig, values);
|
34
32
|
_context.next = 5;
|
35
|
-
return
|
33
|
+
return topo.serverApi.saveTopoSettings(topo.id, {
|
36
34
|
alarmSwitch: displayConfig.alarmSwitch,
|
37
35
|
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
38
36
|
extraConfig: JSON.stringify((0, _extends2["default"])({}, displayConfig))
|
@@ -311,7 +311,10 @@ var Topology = function Topology(props) {
|
|
311
311
|
|
312
312
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
313
313
|
className: _TopoViewModule["default"].topoView,
|
314
|
-
"data-version": topo.version
|
314
|
+
"data-version": topo.version,
|
315
|
+
onFocus: function onFocus() {
|
316
|
+
window.topo = topo;
|
317
|
+
}
|
315
318
|
}, titleBar !== false && titleBar, isEditMode && /*#__PURE__*/_react["default"].createElement(_EditorToolbar["default"], {
|
316
319
|
topo: topo,
|
317
320
|
topoEdit: topoEdit,
|
@@ -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 "11.0.
|
59
|
+
var version = typeof "11.0.15" === 'string' ? "11.0.15" : null;
|
60
60
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
61
61
|
/**
|
62
62
|
* 拓扑显示和编辑
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = attributeTransform;
|
7
|
+
|
8
|
+
var _commonTransform = _interopRequireDefault(require("./commonTransform"));
|
9
|
+
|
10
|
+
function attributeTransform(options) {
|
11
|
+
return (0, _commonTransform["default"])(options);
|
12
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports["default"] = ciTypeAttrTransform;
|
5
|
+
|
6
|
+
function ciTypeAttrTransform(options) {
|
7
|
+
var item = options.item,
|
8
|
+
ciData = options.ciData,
|
9
|
+
topo = options.topo;
|
10
|
+
var ciTypeMeta = topo.ciTyeCache.getCiType(ciData.ciType);
|
11
|
+
return {
|
12
|
+
type: item.type,
|
13
|
+
code: item.code,
|
14
|
+
// 属性code
|
15
|
+
name: "资源类型",
|
16
|
+
// 属性名称
|
17
|
+
value: ciTypeMeta.name // 属性数值
|
18
|
+
|
19
|
+
};
|
20
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = commonTransform;
|
7
|
+
exports.formatMetric = formatMetric;
|
8
|
+
|
9
|
+
var _utils = require("@riil-frontend/utils");
|
10
|
+
|
11
|
+
var _DictCache = _interopRequireDefault(require("../../cache/DictCache"));
|
12
|
+
|
13
|
+
/**
|
14
|
+
* 格式化指标
|
15
|
+
* @param {*} val
|
16
|
+
* @param {*} metricInfo
|
17
|
+
* @returns
|
18
|
+
*/
|
19
|
+
function formatMetric(val, metricInfo) {
|
20
|
+
// rlog.debug('formatMetric', item, metricInfo);
|
21
|
+
if (metricInfo) {
|
22
|
+
var result = (0, _utils.metricValueFormat)({
|
23
|
+
value: val,
|
24
|
+
dataType: metricInfo.dataType,
|
25
|
+
dict: _DictCache["default"].getDictObject(),
|
26
|
+
unit: metricInfo.unit,
|
27
|
+
code: metricInfo.code
|
28
|
+
});
|
29
|
+
return result.value + " " + (result.value === '-' ? '' : result.unit);
|
30
|
+
} else {
|
31
|
+
return "" + val;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
function commonTransform(options) {
|
36
|
+
var item = options.item,
|
37
|
+
ciData = options.ciData,
|
38
|
+
topo = options.topo;
|
39
|
+
var fieldCode = item.code;
|
40
|
+
var attrType = item.type;
|
41
|
+
var ciTypeModel = topo.ciTyeCache.getCiType(ciData.ciType);
|
42
|
+
var fieldMeta = ciTypeModel[attrType + "Map"][fieldCode];
|
43
|
+
var fieldValue = (ciData[attrType + "Map"] || ciData[attrType + "s"])[fieldCode]; // 引用属性
|
44
|
+
|
45
|
+
if (attrType === 'attribute') {
|
46
|
+
if (ciData[attrType + "Map"][fieldCode + "_object"]) {
|
47
|
+
fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
return {
|
52
|
+
type: item.type,
|
53
|
+
code: item.code,
|
54
|
+
// 属性code
|
55
|
+
name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || '',
|
56
|
+
// 属性名称
|
57
|
+
value: formatMetric(fieldValue, fieldMeta),
|
58
|
+
// 属性值
|
59
|
+
originValue: fieldValue
|
60
|
+
};
|
61
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = graphTransform;
|
7
|
+
|
8
|
+
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
9
|
+
|
10
|
+
function graphTransform(options) {
|
11
|
+
var item = options.item,
|
12
|
+
ciData = options.ciData,
|
13
|
+
topo = options.topo;
|
14
|
+
var value = '-';
|
15
|
+
|
16
|
+
try {
|
17
|
+
var node = topo.getDataModel().getDataByTag(ciData.id);
|
18
|
+
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
19
|
+
} catch (error) {
|
20
|
+
_rlog["default"].error(error);
|
21
|
+
}
|
22
|
+
|
23
|
+
return {
|
24
|
+
type: item.type,
|
25
|
+
code: item.code,
|
26
|
+
// 属性code
|
27
|
+
name: '图片名称',
|
28
|
+
// 属性名称
|
29
|
+
value: value // 属性值
|
30
|
+
|
31
|
+
};
|
32
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = metricTransform;
|
7
|
+
|
8
|
+
var _commonTransform = _interopRequireDefault(require("./commonTransform"));
|
9
|
+
|
10
|
+
function metricTransform(options) {
|
11
|
+
return (0, _commonTransform["default"])(options);
|
12
|
+
}
|