@riil-frontend/component-topology 12.0.0-dev.1 → 12.0.0-dev.10
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 +1 -1
- package/build/index.js +14 -14
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +1 -1
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -1
- package/es/core/components/AlarmListPanel/index.js +1 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +1 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +1 -1
- package/es/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +1 -1
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +1 -1
- package/es/core/components/TopoView/topoView.js +6 -2
- package/es/core/editor/components/BackgroundView/index.js +1 -1
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +1 -1
- package/es/core/editor/components/EditorPlugin.js +1 -1
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +1 -1
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
- package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +1 -1
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +1 -1
- package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
- package/es/core/editor/store/background.js +1 -1
- package/es/core/editor/store/historyManager.js +1 -1
- package/es/core/editor/store/topoEdit.js +1 -1
- package/es/core/editor/utils/copyElementUtil.js +24 -9
- package/es/core/hooks/__tests__/useCiAttributeChange.test.js +0 -0
- package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -1
- package/es/core/hooks/useCiAttributeChange.js +35 -16
- package/es/core/hooks/useManageStatus.js +1 -1
- package/es/core/hooks/usePolling.js +1 -1
- package/es/core/hooks/useResourceConfig.js +1 -3
- package/es/core/hooks/useTopoEdit.js +48 -52
- package/es/core/models/Alarm.js +1 -1
- package/es/core/models/AttributeMetricDisplay.js +6 -3
- package/es/core/models/HistoryManager.js +1 -1
- package/es/core/models/SelectionModel.js +1 -1
- package/es/core/models/TopoApp.js +2 -2
- package/es/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
- package/es/core/models/attributeFormatter/formatter/graphTransform.js +1 -1
- package/es/core/models/attributeFormatter/index.js +1 -1
- package/es/core/models/cache/CiTypeCache.js +5 -1
- package/es/core/models/cache/DictCache.js +1 -1
- package/es/core/models/plugins/resourceWebControllUrl.js +1 -1
- package/es/core/models/tagstips/ElementTagTipConfig.js +1 -1
- package/es/core/models/topoData.js +0 -1
- package/es/core/services/alarm.js +1 -1
- package/es/core/services/index.js +1 -1
- package/es/core/services/topo/basic.js +2 -2
- package/es/core/store/models/customIcon.js +1 -1
- package/es/core/store/models/displayConfig.js +1 -1
- package/es/core/store/models/selection.js +1 -1
- package/es/core/store/models/topoBaseInfoOverview.js +1 -1
- package/es/core/store/models/topoBizMod.js +1 -1
- package/es/core/store/models/topoConfig.js +7 -10
- package/es/core/store/models/topoGraphView.js +1 -1
- package/es/core/store/models/topoMod.js +1 -1
- package/es/core/store/models/viewer/lock.js +1 -1
- package/es/core/store/models/viewer/resourceDetail.js +1 -1
- package/es/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
- package/es/core/utils/edgeUtil.js +2 -1
- package/es/core/utils/metricUtil.js +8 -1
- package/es/core/utils/showMessage.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +1 -1
- package/es/networkTopo/components/Link/index.js +1 -1
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +1 -1
- package/es/networkTopo/models/LinkTagsTipsBuilder.js +1 -1
- package/es/networkTopo/models/TopoCenter.js +1 -1
- package/es/networkTopo/services/model.js +1 -1
- package/es/networkTopo/services/topo/basic.js +4 -4
- package/es/networkTopo/services/topo/ciInfo.js +1 -1
- package/es/networkTopo/store/functionAuth.js +1 -1
- package/es/networkTopo/store/topoCenter.js +1 -1
- package/es/networkTopo/store/topoTreeMod.js +1 -1
- package/es/networkTopo/utils/exportData.js +1 -1
- package/es/style.js +1 -1
- package/es/utils/ResourceConfigUtil.js +4 -37
- package/es/utils/ciRefAttributeTranslateUtil.d.ts +12 -0
- package/es/utils/ciRefAttributeTranslateUtil.js +156 -0
- package/es/utils/clipboardUtil.d.ts +7 -0
- package/es/utils/clipboardUtil.js +104 -0
- package/es/utils/format.js +1 -1
- package/es/utils/topoData.js +4 -2
- package/lib/components/BatchAttrMetric/setting.js +2 -2
- package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +2 -2
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -2
- package/lib/core/components/AlarmListPanel/index.js +1 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -3
- package/lib/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +2 -2
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +2 -2
- package/lib/core/components/TopoView/topoView.js +14 -10
- package/lib/core/editor/components/BackgroundView/index.js +3 -3
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +2 -2
- package/lib/core/editor/components/EditorPlugin.js +3 -3
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +2 -4
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +2 -4
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +2 -4
- package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +5 -5
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +3 -3
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +2 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
- package/lib/core/editor/store/background.js +1 -1
- package/lib/core/editor/store/historyManager.js +1 -1
- package/lib/core/editor/store/topoEdit.js +1 -1
- package/lib/core/editor/utils/copyElementUtil.js +29 -9
- package/lib/core/hooks/__tests__/useCiAttributeChange.test.js +1 -0
- package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -3
- package/lib/core/hooks/useCiAttributeChange.js +34 -15
- package/lib/core/hooks/useManageStatus.js +1 -1
- package/lib/core/hooks/usePolling.js +3 -3
- package/lib/core/hooks/useResourceConfig.js +1 -3
- package/lib/core/hooks/useTopoEdit.js +47 -51
- package/lib/core/models/Alarm.js +10 -10
- package/lib/core/models/AttributeMetricDisplay.js +8 -4
- package/lib/core/models/HistoryManager.js +8 -8
- package/lib/core/models/SelectionModel.js +5 -5
- package/lib/core/models/TopoApp.js +4 -6
- package/lib/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
- package/lib/core/models/attributeFormatter/formatter/graphTransform.js +2 -4
- package/lib/core/models/attributeFormatter/index.js +1 -1
- package/lib/core/models/cache/CiTypeCache.js +6 -2
- package/lib/core/models/cache/DictCache.js +2 -2
- package/lib/core/models/plugins/resourceWebControllUrl.js +2 -2
- package/lib/core/models/tagstips/ElementTagTipConfig.js +2 -2
- package/lib/core/models/topoData.js +0 -1
- package/lib/core/services/alarm.js +2 -2
- package/lib/core/services/index.js +1 -1
- package/lib/core/services/topo/basic.js +2 -2
- package/lib/core/store/models/customIcon.js +3 -3
- package/lib/core/store/models/displayConfig.js +1 -1
- package/lib/core/store/models/selection.js +1 -1
- package/lib/core/store/models/topoBaseInfoOverview.js +1 -1
- package/lib/core/store/models/topoBizMod.js +1 -1
- package/lib/core/store/models/topoConfig.js +7 -10
- package/lib/core/store/models/topoGraphView.js +1 -1
- package/lib/core/store/models/topoMod.js +9 -9
- package/lib/core/store/models/viewer/lock.js +1 -1
- package/lib/core/store/models/viewer/resourceDetail.js +1 -1
- package/lib/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
- package/lib/core/utils/edgeUtil.js +2 -1
- package/lib/core/utils/metricUtil.js +8 -1
- package/lib/core/utils/showMessage.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +6 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +3 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +2 -2
- package/lib/networkTopo/components/Link/index.js +2 -2
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +4 -4
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +3 -5
- package/lib/networkTopo/models/LinkTagsTipsBuilder.js +3 -3
- package/lib/networkTopo/models/TopoCenter.js +1 -1
- package/lib/networkTopo/services/model.js +1 -3
- package/lib/networkTopo/services/topo/basic.js +4 -6
- package/lib/networkTopo/services/topo/ciInfo.js +0 -2
- package/lib/networkTopo/store/functionAuth.js +1 -1
- package/lib/networkTopo/store/topoCenter.js +1 -1
- package/lib/networkTopo/store/topoTreeMod.js +5 -5
- package/lib/networkTopo/utils/exportData.js +1 -3
- package/lib/style.js +1 -1
- package/lib/utils/ResourceConfigUtil.js +4 -39
- package/lib/utils/ciRefAttributeTranslateUtil.d.ts +12 -0
- package/lib/utils/ciRefAttributeTranslateUtil.js +169 -0
- package/lib/utils/clipboardUtil.d.ts +7 -0
- package/lib/utils/clipboardUtil.js +113 -0
- package/lib/utils/format.js +1 -1
- package/lib/utils/topoData.js +4 -2
- package/package.json +4 -4
@@ -11,8 +11,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
11
11
|
|
12
12
|
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
13
13
|
|
14
|
-
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
15
|
-
|
16
14
|
var _clusterUtil = require("../../utils/clusterUtil");
|
17
15
|
|
18
16
|
function _default(_x) {
|
@@ -57,7 +55,7 @@ function _ref() {
|
|
57
55
|
})
|
58
56
|
};
|
59
57
|
|
60
|
-
|
58
|
+
_componentTopologyUtils.rlog.error('导出数据', params);
|
61
59
|
|
62
60
|
_context.next = 6;
|
63
61
|
return _componentTopologyUtils.request.post('/topo/v1/api/structure/excel', params, {
|
package/lib/style.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require('@riil-frontend/component-topology-graph/lib/style');
|
2
2
|
require('@alifd/next/lib/box/style');
|
3
|
-
require('@alifd/next/lib/message/style');
|
4
3
|
require('@riil-frontend/component-topology-utils/lib/style');
|
4
|
+
require('@alifd/next/lib/message/style');
|
5
5
|
require('@riil-frontend/component-riil-event-emitter/lib/style');
|
6
6
|
require('@riil-frontend/utils/lib/style');
|
7
7
|
require('@alifd/next/lib/menu-button/style');
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
exports.__esModule = true;
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
9
9
|
|
10
10
|
var _sortBy = _interopRequireDefault(require("lodash/sortBy"));
|
11
11
|
|
@@ -53,12 +53,6 @@ function getResourceConfigFromHt(topo) {
|
|
53
53
|
layers: (0, _sortBy["default"])(layers, 'order'),
|
54
54
|
groups: groups,
|
55
55
|
resources: resources,
|
56
|
-
exportLinkIdList: getExportLinkIdList({
|
57
|
-
topo: topo,
|
58
|
-
htTopo: htTopo,
|
59
|
-
dataModel: dataModel
|
60
|
-
}),
|
61
|
-
// 出口链路id列表
|
62
56
|
relateTopoIdList: getRelateTopoIdList(dataModel)
|
63
57
|
};
|
64
58
|
} // 查询关联拓扑id列表
|
@@ -75,35 +69,6 @@ function getRelateTopoIdList(dataModel) {
|
|
75
69
|
|
76
70
|
return topoIds;
|
77
71
|
}, []);
|
78
|
-
} // 查询出口链路列表
|
79
|
-
|
80
|
-
|
81
|
-
function getExportLinkIdList(_ref) {
|
82
|
-
var topo = _ref.topo,
|
83
|
-
htTopo = _ref.htTopo,
|
84
|
-
dataModel = _ref.dataModel;
|
85
|
-
var exportLinkIdList = [];
|
86
|
-
var edges = (0, _htElementUtils.getEdges)(dataModel);
|
87
|
-
|
88
|
-
_rlog["default"].debug(' 查询出口链路列表-edges', edges, dataModel);
|
89
|
-
|
90
|
-
edges.forEach(function (edge) {
|
91
|
-
var edgeData = htTopo.getEdgeData(edge); // 有组无子连线返回null
|
92
|
-
|
93
|
-
if (edgeData) {
|
94
|
-
// eslint-disable-next-line no-underscore-dangle
|
95
|
-
var id = edgeData._attrObject.id;
|
96
|
-
|
97
|
-
if (id) {
|
98
|
-
var linkData = topo.dataModel.getDataById(id);
|
99
|
-
|
100
|
-
if ((0, _linkUtils.isExitLink)(linkData) && !exportLinkIdList.includes(id)) {
|
101
|
-
exportLinkIdList.push(id);
|
102
|
-
}
|
103
|
-
}
|
104
|
-
}
|
105
|
-
});
|
106
|
-
return exportLinkIdList;
|
107
72
|
}
|
108
73
|
|
109
74
|
function getLayerDatas(dataModel) {
|
@@ -127,9 +92,9 @@ function getLayerDatas(dataModel) {
|
|
127
92
|
return layers;
|
128
93
|
}
|
129
94
|
|
130
|
-
function getGroupDatas(
|
131
|
-
var groupElements =
|
132
|
-
layers =
|
95
|
+
function getGroupDatas(_ref) {
|
96
|
+
var groupElements = _ref.groupElements,
|
97
|
+
layers = _ref.layers;
|
133
98
|
// 获得视图上的区域配置
|
134
99
|
var groups = groupElements.filter(function (node) {
|
135
100
|
return !node.getParent();
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/**
|
2
|
+
* 翻译ci列表引用属性名称
|
3
|
+
* @param ciDatas
|
4
|
+
* @returns
|
5
|
+
*/
|
6
|
+
export declare function translateCisRefAttributeName(ciDatas: Array<any>): Promise<Array<any>>;
|
7
|
+
/**
|
8
|
+
* 翻译ci引用属性名称
|
9
|
+
* @param ciData
|
10
|
+
* @returns
|
11
|
+
*/
|
12
|
+
export declare function translateCiRefAttributeName(ciData: any): Promise<any>;
|
@@ -0,0 +1,169 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.translateCiRefAttributeName = translateCiRefAttributeName;
|
7
|
+
exports.translateCisRefAttributeName = translateCisRefAttributeName;
|
8
|
+
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
10
|
+
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
12
|
+
|
13
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
14
|
+
|
15
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
16
|
+
|
17
|
+
var _CiTypeCache = _interopRequireDefault(require("../core/models/cache/CiTypeCache"));
|
18
|
+
|
19
|
+
var _CiCache = _interopRequireDefault(require("../core/models/cache/CiCache"));
|
20
|
+
|
21
|
+
var _topoData = require("./topoData");
|
22
|
+
|
23
|
+
/**
|
24
|
+
* 获取ci列表的引用字段列表
|
25
|
+
*/
|
26
|
+
function getCiRefAttributesMap(ciDatas, ciTypeMap) {
|
27
|
+
// ci引用字段列表
|
28
|
+
var ciRefAttributeMap = {};
|
29
|
+
ciDatas.forEach(function (ciData) {
|
30
|
+
var id = ciData.id;
|
31
|
+
var attributeMap = ciData.attributeMap || ciData.attributes;
|
32
|
+
ciRefAttributeMap[id] = [];
|
33
|
+
var typeCode = ciData.typeCode || ciData.ciType;
|
34
|
+
var ciTypeMeta = ciTypeMap[typeCode];
|
35
|
+
|
36
|
+
if (ciTypeMeta) {
|
37
|
+
ciTypeMeta.attributes.filter(function (attributeMeta) {
|
38
|
+
return !!attributeMeta.refCi;
|
39
|
+
}).forEach(function (attributeMeta) {
|
40
|
+
var refId = attributeMap[attributeMeta.code];
|
41
|
+
|
42
|
+
if (refId) {
|
43
|
+
var ciRefAttributeData = {
|
44
|
+
attrCode: attributeMeta.code,
|
45
|
+
id: refId
|
46
|
+
};
|
47
|
+
ciRefAttributeMap[ciData.id].push(ciRefAttributeData);
|
48
|
+
}
|
49
|
+
});
|
50
|
+
} else {
|
51
|
+
_componentTopologyUtils.rlog.warn("\u7FFB\u8BD1\u5F15\u7528\u5B57\u6BB5\u540D\u79F0\uFF1A\u672A\u67E5\u8BE2\u5230ciType " + typeCode, ciData);
|
52
|
+
}
|
53
|
+
});
|
54
|
+
return ciRefAttributeMap;
|
55
|
+
}
|
56
|
+
|
57
|
+
function getRefIds(ciRefAttributesMap) {
|
58
|
+
var refIds = [];
|
59
|
+
Object.keys(ciRefAttributesMap).forEach(function (ciId) {
|
60
|
+
var ciRefAttributeDatas = ciRefAttributesMap[ciId];
|
61
|
+
ciRefAttributeDatas.forEach(function (ciRefAttributeData) {
|
62
|
+
var refId = ciRefAttributeData.id;
|
63
|
+
|
64
|
+
if (!refIds.includes(refId)) {
|
65
|
+
refIds.push(refId);
|
66
|
+
}
|
67
|
+
});
|
68
|
+
});
|
69
|
+
return refIds;
|
70
|
+
}
|
71
|
+
|
72
|
+
function addRefCiNameToCiDatas(ciDatas, ciRefAttributesMap, refCiMap) {
|
73
|
+
return ciDatas.map(function (ciData) {
|
74
|
+
var id = ciData.id;
|
75
|
+
var attributeMap = (0, _extends2["default"])({}, ciData.attributeMap || ciData.attributes);
|
76
|
+
ciRefAttributesMap[id].forEach(function (refAttrs) {
|
77
|
+
var refCi = refCiMap[refAttrs.id];
|
78
|
+
|
79
|
+
if (refCi) {
|
80
|
+
// 引用ci名称获取规则:如果ci是树形结构(例如区域),取 tree_name_path;非树形,取display_name
|
81
|
+
var displayName = refCi.attributes.tree_name_path || refCi.attributes.display_name;
|
82
|
+
attributeMap[refAttrs.attrCode + "_object"] = {
|
83
|
+
displayName: displayName
|
84
|
+
};
|
85
|
+
}
|
86
|
+
});
|
87
|
+
return (0, _extends2["default"])({}, ciData, {
|
88
|
+
attributeMap: attributeMap
|
89
|
+
});
|
90
|
+
});
|
91
|
+
}
|
92
|
+
/**
|
93
|
+
* 翻译ci列表引用属性名称
|
94
|
+
* @param ciDatas
|
95
|
+
* @returns
|
96
|
+
*/
|
97
|
+
|
98
|
+
|
99
|
+
function translateCisRefAttributeName(_x) {
|
100
|
+
return _translateCisRefAttributeName.apply(this, arguments);
|
101
|
+
}
|
102
|
+
/**
|
103
|
+
* 翻译ci引用属性名称
|
104
|
+
* @param ciData
|
105
|
+
* @returns
|
106
|
+
*/
|
107
|
+
|
108
|
+
|
109
|
+
function _translateCisRefAttributeName() {
|
110
|
+
_translateCisRefAttributeName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ciDatas) {
|
111
|
+
var ciTypeMap, ciRefAttributesMap, refIds, refCiMap;
|
112
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
113
|
+
while (1) switch (_context.prev = _context.next) {
|
114
|
+
case 0:
|
115
|
+
_context.next = 2;
|
116
|
+
return _CiTypeCache["default"].load((0, _topoData.getCiTypesFromCiElements)(ciDatas));
|
117
|
+
|
118
|
+
case 2:
|
119
|
+
ciTypeMap = _context.sent;
|
120
|
+
// 2. 查找引用字段及值
|
121
|
+
ciRefAttributesMap = getCiRefAttributesMap(ciDatas, ciTypeMap); // 3. 引用id列表
|
122
|
+
|
123
|
+
refIds = getRefIds(ciRefAttributesMap);
|
124
|
+
|
125
|
+
if (refIds.length) {
|
126
|
+
_context.next = 7;
|
127
|
+
break;
|
128
|
+
}
|
129
|
+
|
130
|
+
return _context.abrupt("return", ciDatas);
|
131
|
+
|
132
|
+
case 7:
|
133
|
+
_context.next = 9;
|
134
|
+
return _CiCache["default"].load(refIds);
|
135
|
+
|
136
|
+
case 9:
|
137
|
+
refCiMap = _context.sent;
|
138
|
+
return _context.abrupt("return", addRefCiNameToCiDatas(ciDatas, ciRefAttributesMap, refCiMap));
|
139
|
+
|
140
|
+
case 11:
|
141
|
+
case "end":
|
142
|
+
return _context.stop();
|
143
|
+
}
|
144
|
+
}, _callee);
|
145
|
+
}));
|
146
|
+
return _translateCisRefAttributeName.apply(this, arguments);
|
147
|
+
}
|
148
|
+
|
149
|
+
function translateCiRefAttributeName(_x2) {
|
150
|
+
return _translateCiRefAttributeName.apply(this, arguments);
|
151
|
+
}
|
152
|
+
|
153
|
+
function _translateCiRefAttributeName() {
|
154
|
+
_translateCiRefAttributeName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(ciData) {
|
155
|
+
var result;
|
156
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
157
|
+
while (1) switch (_context2.prev = _context2.next) {
|
158
|
+
case 0:
|
159
|
+
result = translateCisRefAttributeName([]);
|
160
|
+
return _context2.abrupt("return", result[0]);
|
161
|
+
|
162
|
+
case 2:
|
163
|
+
case "end":
|
164
|
+
return _context2.stop();
|
165
|
+
}
|
166
|
+
}, _callee2);
|
167
|
+
}));
|
168
|
+
return _translateCiRefAttributeName.apply(this, arguments);
|
169
|
+
}
|
@@ -0,0 +1,113 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.clipboard = void 0;
|
7
|
+
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
11
|
+
|
12
|
+
function writeText(_x) {
|
13
|
+
return _writeText.apply(this, arguments);
|
14
|
+
}
|
15
|
+
|
16
|
+
function _writeText() {
|
17
|
+
_writeText = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(text) {
|
18
|
+
var success, textArea;
|
19
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
20
|
+
while (1) switch (_context.prev = _context.next) {
|
21
|
+
case 0:
|
22
|
+
success = false;
|
23
|
+
_context.prev = 1;
|
24
|
+
|
25
|
+
if (!navigator.clipboard) {
|
26
|
+
_context.next = 5;
|
27
|
+
break;
|
28
|
+
}
|
29
|
+
|
30
|
+
_context.next = 5;
|
31
|
+
return navigator.clipboard.writeText(text);
|
32
|
+
|
33
|
+
case 5:
|
34
|
+
success = true;
|
35
|
+
_context.next = 10;
|
36
|
+
break;
|
37
|
+
|
38
|
+
case 8:
|
39
|
+
_context.prev = 8;
|
40
|
+
_context.t0 = _context["catch"](1);
|
41
|
+
|
42
|
+
case 10:
|
43
|
+
if (!success) {
|
44
|
+
// 创建text area
|
45
|
+
textArea = document.createElement('textarea');
|
46
|
+
textArea.value = text; // 使text area不在viewport,同时设置不可见
|
47
|
+
|
48
|
+
document.body.appendChild(textArea);
|
49
|
+
textArea.focus();
|
50
|
+
textArea.select();
|
51
|
+
document.execCommand('copy');
|
52
|
+
textArea.remove();
|
53
|
+
}
|
54
|
+
|
55
|
+
case 11:
|
56
|
+
case "end":
|
57
|
+
return _context.stop();
|
58
|
+
}
|
59
|
+
}, _callee, null, [[1, 8]]);
|
60
|
+
}));
|
61
|
+
return _writeText.apply(this, arguments);
|
62
|
+
}
|
63
|
+
|
64
|
+
function readText() {
|
65
|
+
return _readText.apply(this, arguments);
|
66
|
+
}
|
67
|
+
|
68
|
+
function _readText() {
|
69
|
+
_readText = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
70
|
+
var text, textareaElement, _text;
|
71
|
+
|
72
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
73
|
+
while (1) switch (_context2.prev = _context2.next) {
|
74
|
+
case 0:
|
75
|
+
if (!navigator.clipboard) {
|
76
|
+
_context2.next = 7;
|
77
|
+
break;
|
78
|
+
}
|
79
|
+
|
80
|
+
_context2.next = 3;
|
81
|
+
return navigator.clipboard.readText();
|
82
|
+
|
83
|
+
case 3:
|
84
|
+
text = _context2.sent;
|
85
|
+
return _context2.abrupt("return", text);
|
86
|
+
|
87
|
+
case 7:
|
88
|
+
textareaElement = document.createElement('textarea');
|
89
|
+
document.body.appendChild(textareaElement);
|
90
|
+
textareaElement.innerText = '';
|
91
|
+
textareaElement.focus();
|
92
|
+
textareaElement.select();
|
93
|
+
document.execCommand('paste');
|
94
|
+
_text = textareaElement.innerText; // 从该元素中读取内容
|
95
|
+
|
96
|
+
document.body.removeChild(textareaElement); // 移除元素
|
97
|
+
|
98
|
+
return _context2.abrupt("return", _text);
|
99
|
+
|
100
|
+
case 16:
|
101
|
+
case "end":
|
102
|
+
return _context2.stop();
|
103
|
+
}
|
104
|
+
}, _callee2);
|
105
|
+
}));
|
106
|
+
return _readText.apply(this, arguments);
|
107
|
+
}
|
108
|
+
|
109
|
+
var clipboard = {
|
110
|
+
readText: readText,
|
111
|
+
writeText: writeText
|
112
|
+
};
|
113
|
+
exports.clipboard = clipboard;
|
package/lib/utils/format.js
CHANGED
@@ -15,7 +15,7 @@ exports.sortData = sortData;
|
|
15
15
|
|
16
16
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
17
17
|
|
18
|
-
var
|
18
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
19
19
|
|
20
20
|
var _utils = require("@riil-frontend/utils");
|
21
21
|
|
package/lib/utils/topoData.js
CHANGED
@@ -135,8 +135,10 @@ var tfLink = function tfLink(engine, link) {
|
|
135
135
|
function getCiTypesFromCiElements(allCi) {
|
136
136
|
var ciTypes = [];
|
137
137
|
allCi.forEach(function (element) {
|
138
|
-
|
139
|
-
|
138
|
+
var typeCode = element.typeCode || element.ciType;
|
139
|
+
|
140
|
+
if (typeCode && ciTypes.indexOf(typeCode) < 0) {
|
141
|
+
ciTypes.push(typeCode);
|
140
142
|
}
|
141
143
|
});
|
142
144
|
return ciTypes;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "12.0.0-dev.
|
3
|
+
"version": "12.0.0-dev.10",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"@riil-frontend/component-action-tree": "^1.0.13",
|
65
65
|
"@riil-frontend/component-common-res-list": "^1.0.26",
|
66
66
|
"@riil-frontend/component-condition-res-list": "^1.0.18",
|
67
|
-
"@riil-frontend/component-crucial-link-topo": "
|
67
|
+
"@riil-frontend/component-crucial-link-topo": "*",
|
68
68
|
"@riil-frontend/component-extra-title": "^1.0.3",
|
69
69
|
"@riil-frontend/component-more-buttons-menu": "^2.0.1",
|
70
70
|
"@riil-frontend/component-no-data-page": "^3.0.4",
|
@@ -80,7 +80,7 @@
|
|
80
80
|
"@riil-frontend/css": "^2.0.2",
|
81
81
|
"@riil-frontend/hooks": "latest",
|
82
82
|
"@riil-frontend/next-collapse": "^1.0.1-a.0",
|
83
|
-
"@riil-frontend/utils": "^1.0.
|
83
|
+
"@riil-frontend/utils": "^1.0.45",
|
84
84
|
"@types/jest": "^29.5.4",
|
85
85
|
"axios": "^0.21.1",
|
86
86
|
"build-plugin-component": "^1.12.1",
|
@@ -123,6 +123,6 @@
|
|
123
123
|
"access": "public"
|
124
124
|
},
|
125
125
|
"license": "MIT",
|
126
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@12.0.0-dev.
|
126
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@12.0.0-dev.10/build/index.html",
|
127
127
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
128
128
|
}
|