@riil-frontend/component-topology 12.0.0-dev.2 → 12.0.0-dev.21

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 (218) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.css +1 -1
  3. package/build/index.js +13 -13
  4. package/es/components/BatchAttrMetric/setting.js +1 -1
  5. package/es/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +1 -1
  6. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -1
  7. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +58 -3
  8. package/es/core/components/AlarmListPanel/index.js +1 -1
  9. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +1 -1
  10. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
  11. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +1 -1
  12. package/es/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +1 -1
  13. package/es/core/components/ResourceViewAttributeSetting/Setting.js +1 -1
  14. package/es/core/components/TopoView/topoView.js +6 -2
  15. package/es/core/editor/components/BackgroundView/index.js +1 -1
  16. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +1 -1
  17. package/es/core/editor/components/EditorPlugin.js +1 -1
  18. package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
  19. package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
  20. package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
  21. package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +1 -1
  22. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +1 -1
  23. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +1 -1
  24. package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
  25. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +5 -12
  26. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -10
  27. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
  28. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +9 -0
  29. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -2
  30. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
  31. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +1 -1
  32. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
  33. package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
  34. package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +1 -1
  35. package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +1 -1
  36. package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
  37. package/es/core/editor/store/background.js +1 -1
  38. package/es/core/editor/store/historyManager.js +1 -1
  39. package/es/core/editor/store/topoEdit.js +1 -1
  40. package/es/core/editor/utils/copyElementUtil.js +12 -0
  41. package/es/core/editor/utils/edgeTypeStyleUtil.js +8 -7
  42. package/es/core/hooks/__tests__/useCiAttributeChange.test.js +0 -0
  43. package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -1
  44. package/es/core/hooks/useCiAttributeChange.js +31 -15
  45. package/es/core/hooks/useGraphAlarmDisplay.js +62 -40
  46. package/es/core/hooks/useManageStatus.js +1 -1
  47. package/es/core/hooks/usePolling.js +1 -1
  48. package/es/core/hooks/useResourceConfig.js +1 -3
  49. package/es/core/hooks/useTopoEdit.js +51 -54
  50. package/es/core/models/Alarm.js +29 -17
  51. package/es/core/models/AttributeMetricDisplay.js +15 -6
  52. package/es/core/models/HistoryManager.js +1 -1
  53. package/es/core/models/SelectionModel.js +1 -1
  54. package/es/core/models/TopoApp.js +2 -2
  55. package/es/core/models/attributeFormatter/formatter/graphTransform.js +1 -1
  56. package/es/core/models/attributeFormatter/index.js +1 -1
  57. package/es/core/models/cache/CiCache.d.ts +1 -1
  58. package/es/core/models/cache/CiCache.js +3 -3
  59. package/es/core/models/cache/CiTypeCache.js +5 -1
  60. package/es/core/models/cache/DictCache.js +1 -1
  61. package/es/core/models/plugins/resourceWebControllUrl.js +1 -1
  62. package/es/core/models/tagstips/ElementTagTipConfig.js +1 -1
  63. package/es/core/models/topoData.js +0 -1
  64. package/es/core/services/alarm.js +1 -1
  65. package/es/core/services/index.js +1 -1
  66. package/es/core/services/topo/basic.js +2 -2
  67. package/es/core/store/models/customIcon.js +1 -1
  68. package/es/core/store/models/displayConfig.js +1 -1
  69. package/es/core/store/models/selection.js +1 -1
  70. package/es/core/store/models/topoBaseInfoOverview.js +1 -1
  71. package/es/core/store/models/topoBizMod.js +1 -1
  72. package/es/core/store/models/topoConfig.js +7 -10
  73. package/es/core/store/models/topoGraphView.js +1 -1
  74. package/es/core/store/models/topoMod.js +82 -135
  75. package/es/core/store/models/viewer/lock.js +1 -1
  76. package/es/core/store/models/viewer/resourceDetail.js +1 -1
  77. package/es/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
  78. package/es/core/utils/edgeUtil.js +10 -1
  79. package/es/core/utils/metricUtil.js +1 -1
  80. package/es/core/utils/showGraphManageStatusUtil.js +3 -2
  81. package/es/core/utils/showMessage.js +1 -1
  82. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
  83. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
  84. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
  85. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
  86. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +1 -1
  87. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +1 -1
  88. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
  89. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +1 -1
  90. package/es/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  91. package/es/networkTopo/components/Link/index.js +1 -1
  92. package/es/networkTopo/components/TopoView.js +6 -11
  93. package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
  94. package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
  95. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +1 -1
  96. package/es/networkTopo/models/LinkTagsTipsBuilder.js +1 -1
  97. package/es/networkTopo/models/TopoCenter.js +1 -1
  98. package/es/networkTopo/services/model.js +1 -1
  99. package/es/networkTopo/services/topo/basic.js +4 -4
  100. package/es/networkTopo/services/topo/ciInfo.js +1 -1
  101. package/es/networkTopo/store/functionAuth.js +1 -1
  102. package/es/networkTopo/store/topoCenter.js +1 -1
  103. package/es/networkTopo/store/topoTreeMod.js +1 -1
  104. package/es/networkTopo/utils/exportData.js +1 -1
  105. package/es/style.js +1 -1
  106. package/es/utils/ResourceConfigUtil.js +4 -37
  107. package/es/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
  108. package/es/utils/ciRefAttributeTranslateUtil.js +155 -0
  109. package/es/utils/format.js +1 -1
  110. package/es/utils/topoData.js +4 -2
  111. package/lib/components/BatchAttrMetric/setting.js +2 -2
  112. package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +2 -2
  113. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -2
  114. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +60 -3
  115. package/lib/core/components/AlarmListPanel/index.js +1 -1
  116. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -2
  117. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
  118. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -3
  119. package/lib/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +2 -2
  120. package/lib/core/components/ResourceViewAttributeSetting/Setting.js +2 -2
  121. package/lib/core/components/TopoView/topoView.js +14 -10
  122. package/lib/core/editor/components/BackgroundView/index.js +3 -3
  123. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +2 -2
  124. package/lib/core/editor/components/EditorPlugin.js +3 -3
  125. package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +2 -4
  126. package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
  127. package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
  128. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -2
  129. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +2 -2
  130. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +2 -4
  131. package/lib/core/editor/components/Sidebar/views/LinkPanel.js +2 -4
  132. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +6 -12
  133. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
  134. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
  135. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
  136. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
  137. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
  138. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +5 -5
  139. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
  140. package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
  141. package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +3 -3
  142. package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +2 -2
  143. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
  144. package/lib/core/editor/store/background.js +1 -1
  145. package/lib/core/editor/store/historyManager.js +1 -1
  146. package/lib/core/editor/store/topoEdit.js +1 -1
  147. package/lib/core/editor/utils/copyElementUtil.js +15 -0
  148. package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -6
  149. package/lib/core/hooks/__tests__/useCiAttributeChange.test.js +1 -0
  150. package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -3
  151. package/lib/core/hooks/useCiAttributeChange.js +30 -14
  152. package/lib/core/hooks/useGraphAlarmDisplay.js +62 -40
  153. package/lib/core/hooks/useManageStatus.js +1 -1
  154. package/lib/core/hooks/usePolling.js +3 -3
  155. package/lib/core/hooks/useResourceConfig.js +1 -3
  156. package/lib/core/hooks/useTopoEdit.js +50 -53
  157. package/lib/core/models/Alarm.js +38 -26
  158. package/lib/core/models/AttributeMetricDisplay.js +18 -6
  159. package/lib/core/models/HistoryManager.js +8 -8
  160. package/lib/core/models/SelectionModel.js +5 -5
  161. package/lib/core/models/TopoApp.js +4 -6
  162. package/lib/core/models/attributeFormatter/formatter/graphTransform.js +2 -4
  163. package/lib/core/models/attributeFormatter/index.js +1 -1
  164. package/lib/core/models/cache/CiCache.d.ts +1 -1
  165. package/lib/core/models/cache/CiCache.js +3 -3
  166. package/lib/core/models/cache/CiTypeCache.js +6 -2
  167. package/lib/core/models/cache/DictCache.js +2 -2
  168. package/lib/core/models/plugins/resourceWebControllUrl.js +2 -2
  169. package/lib/core/models/tagstips/ElementTagTipConfig.js +2 -2
  170. package/lib/core/models/topoData.js +0 -1
  171. package/lib/core/services/alarm.js +2 -2
  172. package/lib/core/services/index.js +1 -1
  173. package/lib/core/services/topo/basic.js +2 -2
  174. package/lib/core/store/models/customIcon.js +3 -3
  175. package/lib/core/store/models/displayConfig.js +1 -1
  176. package/lib/core/store/models/selection.js +1 -1
  177. package/lib/core/store/models/topoBaseInfoOverview.js +1 -1
  178. package/lib/core/store/models/topoBizMod.js +1 -1
  179. package/lib/core/store/models/topoConfig.js +7 -10
  180. package/lib/core/store/models/topoGraphView.js +1 -1
  181. package/lib/core/store/models/topoMod.js +89 -142
  182. package/lib/core/store/models/viewer/lock.js +1 -1
  183. package/lib/core/store/models/viewer/resourceDetail.js +1 -1
  184. package/lib/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
  185. package/lib/core/utils/edgeUtil.js +12 -1
  186. package/lib/core/utils/metricUtil.js +1 -1
  187. package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
  188. package/lib/core/utils/showMessage.js +2 -2
  189. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
  190. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
  191. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
  192. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
  193. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +6 -6
  194. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +3 -5
  195. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
  196. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +2 -2
  197. package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  198. package/lib/networkTopo/components/Link/index.js +2 -2
  199. package/lib/networkTopo/components/TopoView.js +5 -14
  200. package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
  201. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +4 -4
  202. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +3 -5
  203. package/lib/networkTopo/models/LinkTagsTipsBuilder.js +3 -3
  204. package/lib/networkTopo/models/TopoCenter.js +1 -1
  205. package/lib/networkTopo/services/model.js +1 -3
  206. package/lib/networkTopo/services/topo/basic.js +4 -6
  207. package/lib/networkTopo/services/topo/ciInfo.js +0 -2
  208. package/lib/networkTopo/store/functionAuth.js +1 -1
  209. package/lib/networkTopo/store/topoCenter.js +1 -1
  210. package/lib/networkTopo/store/topoTreeMod.js +5 -5
  211. package/lib/networkTopo/utils/exportData.js +1 -3
  212. package/lib/style.js +1 -1
  213. package/lib/utils/ResourceConfigUtil.js +4 -39
  214. package/lib/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
  215. package/lib/utils/ciRefAttributeTranslateUtil.js +168 -0
  216. package/lib/utils/format.js +1 -1
  217. package/lib/utils/topoData.js +4 -2
  218. 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,19 @@
1
+ interface Options {
2
+ /**
3
+ * 是否属性缓存重新请求数据
4
+ */
5
+ refreshCiCache: boolean;
6
+ }
7
+ /**
8
+ * 翻译ci列表引用属性名称
9
+ * @param ciDatas
10
+ * @returns
11
+ */
12
+ export declare function translateCisRefAttributeName(ciDatas: Array<any>, options?: Options): Promise<Array<any>>;
13
+ /**
14
+ * 翻译ci引用属性名称
15
+ * @param ciData
16
+ * @returns
17
+ */
18
+ export declare function translateCiRefAttributeName(ciData: any, options?: Options): Promise<any>;
19
+ export {};
@@ -0,0 +1,168 @@
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
+ /**
94
+ * 翻译ci列表引用属性名称
95
+ * @param ciDatas
96
+ * @returns
97
+ */
98
+ function translateCisRefAttributeName(_x, _x2) {
99
+ return _translateCisRefAttributeName.apply(this, arguments);
100
+ }
101
+ /**
102
+ * 翻译ci引用属性名称
103
+ * @param ciData
104
+ * @returns
105
+ */
106
+
107
+
108
+ function _translateCisRefAttributeName() {
109
+ _translateCisRefAttributeName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ciDatas, options) {
110
+ var ciTypeMap, ciRefAttributesMap, refIds, refCiMap;
111
+ return _regenerator["default"].wrap(function _callee$(_context) {
112
+ while (1) switch (_context.prev = _context.next) {
113
+ case 0:
114
+ _context.next = 2;
115
+ return _CiTypeCache["default"].load((0, _topoData.getCiTypesFromCiElements)(ciDatas));
116
+
117
+ case 2:
118
+ ciTypeMap = _context.sent;
119
+ // 2. 查找引用字段及值
120
+ ciRefAttributesMap = getCiRefAttributesMap(ciDatas, ciTypeMap); // 3. 引用id列表
121
+
122
+ refIds = getRefIds(ciRefAttributesMap);
123
+
124
+ if (refIds.length) {
125
+ _context.next = 7;
126
+ break;
127
+ }
128
+
129
+ return _context.abrupt("return", ciDatas);
130
+
131
+ case 7:
132
+ _context.next = 9;
133
+ return _CiCache["default"].load(refIds, options === null || options === void 0 ? void 0 : options.refreshCiCache);
134
+
135
+ case 9:
136
+ refCiMap = _context.sent;
137
+ return _context.abrupt("return", addRefCiNameToCiDatas(ciDatas, ciRefAttributesMap, refCiMap));
138
+
139
+ case 11:
140
+ case "end":
141
+ return _context.stop();
142
+ }
143
+ }, _callee);
144
+ }));
145
+ return _translateCisRefAttributeName.apply(this, arguments);
146
+ }
147
+
148
+ function translateCiRefAttributeName(_x3, _x4) {
149
+ return _translateCiRefAttributeName.apply(this, arguments);
150
+ }
151
+
152
+ function _translateCiRefAttributeName() {
153
+ _translateCiRefAttributeName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(ciData, options) {
154
+ var result;
155
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
156
+ while (1) switch (_context2.prev = _context2.next) {
157
+ case 0:
158
+ result = translateCisRefAttributeName([ciData], options);
159
+ return _context2.abrupt("return", result[0]);
160
+
161
+ case 2:
162
+ case "end":
163
+ return _context2.stop();
164
+ }
165
+ }, _callee2);
166
+ }));
167
+ return _translateCiRefAttributeName.apply(this, arguments);
168
+ }
@@ -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.ciType || element.typeCode;
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.2",
3
+ "version": "12.0.0-dev.21",
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.2/build/index.html",
126
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@12.0.0-dev.21/build/index.html",
127
127
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
128
128
  }