@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.
Files changed (193) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.js +14 -14
  3. package/es/components/BatchAttrMetric/setting.js +1 -1
  4. package/es/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +1 -1
  5. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -1
  6. package/es/core/components/AlarmListPanel/index.js +1 -1
  7. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +1 -1
  8. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
  9. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +1 -1
  10. package/es/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +1 -1
  11. package/es/core/components/ResourceViewAttributeSetting/Setting.js +1 -1
  12. package/es/core/components/TopoView/topoView.js +6 -2
  13. package/es/core/editor/components/BackgroundView/index.js +1 -1
  14. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +1 -1
  15. package/es/core/editor/components/EditorPlugin.js +1 -1
  16. package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
  17. package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
  18. package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
  19. package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +1 -1
  20. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +1 -1
  21. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +1 -1
  22. package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
  23. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +1 -1
  24. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
  25. package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
  26. package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +1 -1
  27. package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +1 -1
  28. package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
  29. package/es/core/editor/store/background.js +1 -1
  30. package/es/core/editor/store/historyManager.js +1 -1
  31. package/es/core/editor/store/topoEdit.js +1 -1
  32. package/es/core/editor/utils/copyElementUtil.js +24 -9
  33. package/es/core/hooks/__tests__/useCiAttributeChange.test.js +0 -0
  34. package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -1
  35. package/es/core/hooks/useCiAttributeChange.js +35 -16
  36. package/es/core/hooks/useManageStatus.js +1 -1
  37. package/es/core/hooks/usePolling.js +1 -1
  38. package/es/core/hooks/useResourceConfig.js +1 -3
  39. package/es/core/hooks/useTopoEdit.js +48 -52
  40. package/es/core/models/Alarm.js +1 -1
  41. package/es/core/models/AttributeMetricDisplay.js +6 -3
  42. package/es/core/models/HistoryManager.js +1 -1
  43. package/es/core/models/SelectionModel.js +1 -1
  44. package/es/core/models/TopoApp.js +2 -2
  45. package/es/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
  46. package/es/core/models/attributeFormatter/formatter/graphTransform.js +1 -1
  47. package/es/core/models/attributeFormatter/index.js +1 -1
  48. package/es/core/models/cache/CiTypeCache.js +5 -1
  49. package/es/core/models/cache/DictCache.js +1 -1
  50. package/es/core/models/plugins/resourceWebControllUrl.js +1 -1
  51. package/es/core/models/tagstips/ElementTagTipConfig.js +1 -1
  52. package/es/core/models/topoData.js +0 -1
  53. package/es/core/services/alarm.js +1 -1
  54. package/es/core/services/index.js +1 -1
  55. package/es/core/services/topo/basic.js +2 -2
  56. package/es/core/store/models/customIcon.js +1 -1
  57. package/es/core/store/models/displayConfig.js +1 -1
  58. package/es/core/store/models/selection.js +1 -1
  59. package/es/core/store/models/topoBaseInfoOverview.js +1 -1
  60. package/es/core/store/models/topoBizMod.js +1 -1
  61. package/es/core/store/models/topoConfig.js +7 -10
  62. package/es/core/store/models/topoGraphView.js +1 -1
  63. package/es/core/store/models/topoMod.js +1 -1
  64. package/es/core/store/models/viewer/lock.js +1 -1
  65. package/es/core/store/models/viewer/resourceDetail.js +1 -1
  66. package/es/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
  67. package/es/core/utils/edgeUtil.js +2 -1
  68. package/es/core/utils/metricUtil.js +8 -1
  69. package/es/core/utils/showMessage.js +1 -1
  70. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +1 -1
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +1 -1
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +1 -1
  78. package/es/networkTopo/components/Link/index.js +1 -1
  79. package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
  80. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +1 -1
  81. package/es/networkTopo/models/LinkTagsTipsBuilder.js +1 -1
  82. package/es/networkTopo/models/TopoCenter.js +1 -1
  83. package/es/networkTopo/services/model.js +1 -1
  84. package/es/networkTopo/services/topo/basic.js +4 -4
  85. package/es/networkTopo/services/topo/ciInfo.js +1 -1
  86. package/es/networkTopo/store/functionAuth.js +1 -1
  87. package/es/networkTopo/store/topoCenter.js +1 -1
  88. package/es/networkTopo/store/topoTreeMod.js +1 -1
  89. package/es/networkTopo/utils/exportData.js +1 -1
  90. package/es/style.js +1 -1
  91. package/es/utils/ResourceConfigUtil.js +4 -37
  92. package/es/utils/ciRefAttributeTranslateUtil.d.ts +12 -0
  93. package/es/utils/ciRefAttributeTranslateUtil.js +156 -0
  94. package/es/utils/clipboardUtil.d.ts +7 -0
  95. package/es/utils/clipboardUtil.js +104 -0
  96. package/es/utils/format.js +1 -1
  97. package/es/utils/topoData.js +4 -2
  98. package/lib/components/BatchAttrMetric/setting.js +2 -2
  99. package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +2 -2
  100. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -2
  101. package/lib/core/components/AlarmListPanel/index.js +1 -1
  102. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -2
  103. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
  104. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -3
  105. package/lib/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +2 -2
  106. package/lib/core/components/ResourceViewAttributeSetting/Setting.js +2 -2
  107. package/lib/core/components/TopoView/topoView.js +14 -10
  108. package/lib/core/editor/components/BackgroundView/index.js +3 -3
  109. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +2 -2
  110. package/lib/core/editor/components/EditorPlugin.js +3 -3
  111. package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +2 -4
  112. package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
  113. package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
  114. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -2
  115. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +2 -2
  116. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +2 -4
  117. package/lib/core/editor/components/Sidebar/views/LinkPanel.js +2 -4
  118. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +5 -5
  119. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
  120. package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
  121. package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +3 -3
  122. package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +2 -2
  123. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
  124. package/lib/core/editor/store/background.js +1 -1
  125. package/lib/core/editor/store/historyManager.js +1 -1
  126. package/lib/core/editor/store/topoEdit.js +1 -1
  127. package/lib/core/editor/utils/copyElementUtil.js +29 -9
  128. package/lib/core/hooks/__tests__/useCiAttributeChange.test.js +1 -0
  129. package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -3
  130. package/lib/core/hooks/useCiAttributeChange.js +34 -15
  131. package/lib/core/hooks/useManageStatus.js +1 -1
  132. package/lib/core/hooks/usePolling.js +3 -3
  133. package/lib/core/hooks/useResourceConfig.js +1 -3
  134. package/lib/core/hooks/useTopoEdit.js +47 -51
  135. package/lib/core/models/Alarm.js +10 -10
  136. package/lib/core/models/AttributeMetricDisplay.js +8 -4
  137. package/lib/core/models/HistoryManager.js +8 -8
  138. package/lib/core/models/SelectionModel.js +5 -5
  139. package/lib/core/models/TopoApp.js +4 -6
  140. package/lib/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
  141. package/lib/core/models/attributeFormatter/formatter/graphTransform.js +2 -4
  142. package/lib/core/models/attributeFormatter/index.js +1 -1
  143. package/lib/core/models/cache/CiTypeCache.js +6 -2
  144. package/lib/core/models/cache/DictCache.js +2 -2
  145. package/lib/core/models/plugins/resourceWebControllUrl.js +2 -2
  146. package/lib/core/models/tagstips/ElementTagTipConfig.js +2 -2
  147. package/lib/core/models/topoData.js +0 -1
  148. package/lib/core/services/alarm.js +2 -2
  149. package/lib/core/services/index.js +1 -1
  150. package/lib/core/services/topo/basic.js +2 -2
  151. package/lib/core/store/models/customIcon.js +3 -3
  152. package/lib/core/store/models/displayConfig.js +1 -1
  153. package/lib/core/store/models/selection.js +1 -1
  154. package/lib/core/store/models/topoBaseInfoOverview.js +1 -1
  155. package/lib/core/store/models/topoBizMod.js +1 -1
  156. package/lib/core/store/models/topoConfig.js +7 -10
  157. package/lib/core/store/models/topoGraphView.js +1 -1
  158. package/lib/core/store/models/topoMod.js +9 -9
  159. package/lib/core/store/models/viewer/lock.js +1 -1
  160. package/lib/core/store/models/viewer/resourceDetail.js +1 -1
  161. package/lib/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
  162. package/lib/core/utils/edgeUtil.js +2 -1
  163. package/lib/core/utils/metricUtil.js +8 -1
  164. package/lib/core/utils/showMessage.js +2 -2
  165. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
  166. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
  167. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
  168. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
  169. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +6 -6
  170. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +3 -5
  171. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
  172. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +2 -2
  173. package/lib/networkTopo/components/Link/index.js +2 -2
  174. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +4 -4
  175. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +3 -5
  176. package/lib/networkTopo/models/LinkTagsTipsBuilder.js +3 -3
  177. package/lib/networkTopo/models/TopoCenter.js +1 -1
  178. package/lib/networkTopo/services/model.js +1 -3
  179. package/lib/networkTopo/services/topo/basic.js +4 -6
  180. package/lib/networkTopo/services/topo/ciInfo.js +0 -2
  181. package/lib/networkTopo/store/functionAuth.js +1 -1
  182. package/lib/networkTopo/store/topoCenter.js +1 -1
  183. package/lib/networkTopo/store/topoTreeMod.js +5 -5
  184. package/lib/networkTopo/utils/exportData.js +1 -3
  185. package/lib/style.js +1 -1
  186. package/lib/utils/ResourceConfigUtil.js +4 -39
  187. package/lib/utils/ciRefAttributeTranslateUtil.d.ts +12 -0
  188. package/lib/utils/ciRefAttributeTranslateUtil.js +169 -0
  189. package/lib/utils/clipboardUtil.d.ts +7 -0
  190. package/lib/utils/clipboardUtil.js +113 -0
  191. package/lib/utils/format.js +1 -1
  192. package/lib/utils/topoData.js +4 -2
  193. 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
- _rlog["default"].error('导出数据', params);
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 _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
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(_ref2) {
131
- var groupElements = _ref2.groupElements,
132
- layers = _ref2.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,7 @@
1
+ declare function writeText(text: string): Promise<void>;
2
+ declare function readText(): Promise<string>;
3
+ export declare const clipboard: {
4
+ readText: typeof readText;
5
+ writeText: typeof writeText;
6
+ };
7
+ export {};
@@ -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;
@@ -15,7 +15,7 @@ exports.sortData = sortData;
15
15
 
16
16
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
17
17
 
18
- var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
18
+ var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
19
19
 
20
20
  var _utils = require("@riil-frontend/utils");
21
21
 
@@ -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
- if (element.ciType && ciTypes.indexOf(element.ciType) < 0) {
139
- ciTypes.push(element.ciType);
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.1",
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": "0.1.0",
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.44",
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.1/build/index.html",
126
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@12.0.0-dev.10/build/index.html",
127
127
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
128
128
  }