@riil-frontend/component-topology 11.0.33 → 11.0.35

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 (217) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +4 -2
  4. package/build/index.js +52 -45
  5. package/es/components/MultiResourceDrawer/index.js +22 -26
  6. package/es/components/ResourceList/ResourceSelect.js +55 -58
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  13. package/es/core/editor/components/BackgroundView/index.js +149 -178
  14. package/es/core/editor/components/BackgroundView/index.module.scss +2 -1
  15. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
  16. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  17. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
  18. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
  19. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  20. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  21. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  22. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
  23. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
  24. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  25. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
  26. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
  27. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  28. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  29. package/es/core/editor/store/background.js +8 -10
  30. package/es/core/editor/store/topoEdit.js +4 -6
  31. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  32. package/es/core/hooks/usePolling.js +130 -142
  33. package/es/core/hooks/useResourceConfig.js +76 -100
  34. package/es/core/hooks/useTopoEdit.js +525 -623
  35. package/es/core/models/Alarm.js +319 -402
  36. package/es/core/models/AttributeMetricDisplay.js +115 -143
  37. package/es/core/models/PluginManager.js +4 -3
  38. package/es/core/models/SelectionModel.js +4 -5
  39. package/es/core/models/TopoApp.js +279 -436
  40. package/es/core/models/TopoGraphView.js +28 -41
  41. package/es/core/models/cache/CiCache.js +34 -39
  42. package/es/core/models/cache/CiTypeCache.js +47 -61
  43. package/es/core/models/cache/DictCache.js +36 -42
  44. package/es/core/models/graph/Background.js +21 -26
  45. package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
  46. package/es/core/models/tagstips/ElementTagTipConfig.js +44 -58
  47. package/es/core/models/topoData.js +73 -77
  48. package/es/core/models/utils/linkUtils.js +46 -51
  49. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  50. package/es/core/services/alarm.js +14 -16
  51. package/es/core/services/background.js +59 -67
  52. package/es/core/services/cmdb/metric.js +14 -18
  53. package/es/core/services/cmdb.js +23 -27
  54. package/es/core/services/index.js +48 -68
  55. package/es/core/services/overview.js +131 -151
  56. package/es/core/services/topo/basic.js +37 -41
  57. package/es/core/services/topo/tagtip.js +15 -19
  58. package/es/core/store/models/ciModel.js +58 -62
  59. package/es/core/store/models/customIcon.js +126 -145
  60. package/es/core/store/models/displayConfig.js +15 -19
  61. package/es/core/store/models/selection.js +4 -6
  62. package/es/core/store/models/topoAlarm.js +162 -145
  63. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  64. package/es/core/store/models/topoBizMod.js +9 -11
  65. package/es/core/store/models/topoConfig.js +215 -231
  66. package/es/core/store/models/topoGraphView.js +4 -6
  67. package/es/core/store/models/topoMod.js +373 -395
  68. package/es/core/utils/imageUtil.js +23 -27
  69. package/es/core/utils/saveSerialize.js +14 -18
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
  82. package/es/networkTopo/components/Link/hook.js +85 -96
  83. package/es/networkTopo/components/Link/index.js +104 -126
  84. package/es/networkTopo/components/Link/setting.js +48 -52
  85. package/es/networkTopo/getTopoData.js +73 -92
  86. package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
  87. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  88. package/es/networkTopo/models/TopoCenter.js +28 -46
  89. package/es/networkTopo/services/alert.js +18 -22
  90. package/es/networkTopo/services/authorization.js +45 -55
  91. package/es/networkTopo/services/cmdb.js +548 -696
  92. package/es/networkTopo/services/funcAuth.js +22 -24
  93. package/es/networkTopo/services/link.js +107 -117
  94. package/es/networkTopo/services/mdc.js +33 -48
  95. package/es/networkTopo/services/metric.js +38 -47
  96. package/es/networkTopo/services/model.js +616 -809
  97. package/es/networkTopo/services/risk.js +9 -11
  98. package/es/networkTopo/services/topo/auth.js +27 -33
  99. package/es/networkTopo/services/topo/basic.js +251 -289
  100. package/es/networkTopo/services/topo/blacklist.js +20 -24
  101. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  102. package/es/networkTopo/services/topo/icon.js +49 -59
  103. package/es/networkTopo/services/topo/networkLink.js +32 -36
  104. package/es/networkTopo/services/topo/relation.js +9 -11
  105. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  106. package/es/networkTopo/store/functionAuth.js +31 -37
  107. package/es/networkTopo/store/topoCenter.js +142 -152
  108. package/es/networkTopo/store/topoLinkMod.js +4 -6
  109. package/es/networkTopo/store/topoTreeMod.js +170 -182
  110. package/es/networkTopo/utils/exportData.js +57 -61
  111. package/lib/components/MultiResourceDrawer/index.js +22 -26
  112. package/lib/components/ResourceList/ResourceSelect.js +54 -58
  113. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
  114. package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  115. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
  116. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  117. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
  118. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  119. package/lib/core/editor/components/BackgroundView/index.js +148 -177
  120. package/lib/core/editor/components/BackgroundView/index.module.scss +2 -1
  121. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
  122. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  123. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
  124. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
  125. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  126. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  127. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  128. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
  129. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
  130. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  131. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
  132. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
  133. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  134. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  135. package/lib/core/editor/store/background.js +8 -10
  136. package/lib/core/editor/store/topoEdit.js +4 -6
  137. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  138. package/lib/core/hooks/usePolling.js +129 -141
  139. package/lib/core/hooks/useResourceConfig.js +76 -100
  140. package/lib/core/hooks/useTopoEdit.js +517 -615
  141. package/lib/core/models/Alarm.js +313 -396
  142. package/lib/core/models/AttributeMetricDisplay.js +118 -146
  143. package/lib/core/models/PluginManager.js +4 -3
  144. package/lib/core/models/SelectionModel.js +4 -5
  145. package/lib/core/models/TopoApp.js +279 -436
  146. package/lib/core/models/TopoGraphView.js +28 -41
  147. package/lib/core/models/cache/CiCache.js +39 -44
  148. package/lib/core/models/cache/CiTypeCache.js +48 -62
  149. package/lib/core/models/cache/DictCache.js +39 -45
  150. package/lib/core/models/graph/Background.js +22 -27
  151. package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
  152. package/lib/core/models/tagstips/ElementTagTipConfig.js +44 -58
  153. package/lib/core/models/topoData.js +73 -78
  154. package/lib/core/models/utils/linkUtils.js +45 -51
  155. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  156. package/lib/core/services/alarm.js +18 -20
  157. package/lib/core/services/background.js +70 -78
  158. package/lib/core/services/cmdb/metric.js +14 -19
  159. package/lib/core/services/cmdb.js +24 -29
  160. package/lib/core/services/index.js +53 -72
  161. package/lib/core/services/overview.js +131 -151
  162. package/lib/core/services/topo/basic.js +37 -41
  163. package/lib/core/services/topo/tagtip.js +16 -21
  164. package/lib/core/store/models/ciModel.js +66 -70
  165. package/lib/core/store/models/customIcon.js +126 -145
  166. package/lib/core/store/models/displayConfig.js +15 -19
  167. package/lib/core/store/models/selection.js +4 -6
  168. package/lib/core/store/models/topoAlarm.js +163 -145
  169. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  170. package/lib/core/store/models/topoBizMod.js +9 -11
  171. package/lib/core/store/models/topoConfig.js +222 -238
  172. package/lib/core/store/models/topoGraphView.js +4 -6
  173. package/lib/core/store/models/topoMod.js +375 -397
  174. package/lib/core/utils/imageUtil.js +26 -31
  175. package/lib/core/utils/saveSerialize.js +13 -18
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
  185. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
  186. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  187. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
  188. package/lib/networkTopo/components/Link/hook.js +86 -98
  189. package/lib/networkTopo/components/Link/index.js +105 -127
  190. package/lib/networkTopo/components/Link/setting.js +48 -52
  191. package/lib/networkTopo/getTopoData.js +73 -92
  192. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
  193. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  194. package/lib/networkTopo/models/TopoCenter.js +28 -46
  195. package/lib/networkTopo/services/alert.js +18 -22
  196. package/lib/networkTopo/services/authorization.js +55 -65
  197. package/lib/networkTopo/services/cmdb.js +551 -700
  198. package/lib/networkTopo/services/funcAuth.js +24 -26
  199. package/lib/networkTopo/services/link.js +108 -118
  200. package/lib/networkTopo/services/mdc.js +35 -51
  201. package/lib/networkTopo/services/metric.js +37 -47
  202. package/lib/networkTopo/services/model.js +615 -809
  203. package/lib/networkTopo/services/risk.js +11 -13
  204. package/lib/networkTopo/services/topo/auth.js +27 -33
  205. package/lib/networkTopo/services/topo/basic.js +252 -290
  206. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  207. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  208. package/lib/networkTopo/services/topo/icon.js +59 -69
  209. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  210. package/lib/networkTopo/services/topo/relation.js +11 -13
  211. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  212. package/lib/networkTopo/store/functionAuth.js +31 -37
  213. package/lib/networkTopo/store/topoCenter.js +142 -152
  214. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  215. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  216. package/lib/networkTopo/utils/exportData.js +63 -68
  217. package/package.json +4 -3
@@ -61,7 +61,7 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Sy
61
61
 
62
62
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
63
63
 
64
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
64
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
65
65
 
66
66
  // url 处理,UICBB 的地址需截取前缀
67
67
  function formatUrl(url) {
@@ -82,7 +82,7 @@ function formatUrl(url) {
82
82
 
83
83
 
84
84
  function ResourceOverview(props) {
85
- var _data$attributes;
85
+ var _data$attributes, _ref, _getAddressFormat, _alarmRiskOperation, _baseInfoColChange, _getAttribute, _metricColChange;
86
86
 
87
87
  var topo = props.topo,
88
88
  id = props.id,
@@ -193,39 +193,33 @@ function ResourceOverview(props) {
193
193
  isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
194
194
  }
195
195
 
196
- var jump = /*#__PURE__*/function () {
197
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(roomLink, id) {
196
+ var jump = function jump(_x, _x2) {
197
+ return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(roomLink, id) {
198
198
  var power;
199
199
  return _regenerator["default"].wrap(function _callee$(_context) {
200
- while (1) {
201
- switch (_context.prev = _context.next) {
202
- case 0:
203
- onClose();
204
- _context.next = 3;
205
- return (0, _services.commonQueryCiData)(id);
206
-
207
- case 3:
208
- power = _context.sent;
209
-
210
- // console.log(power)
211
- if (power.data.length) {
212
- window.open("" + window.location.origin + roomLink);
213
- } else {
214
- _message["default"].error('无访问权限,请联系管理员');
215
- }
200
+ while (1) switch (_context.prev = _context.next) {
201
+ case 0:
202
+ onClose();
203
+ _context.next = 3;
204
+ return (0, _services.commonQueryCiData)(id);
205
+
206
+ case 3:
207
+ power = _context.sent;
208
+
209
+ // console.log(power)
210
+ if (power.data.length) {
211
+ window.open("" + window.location.origin + roomLink);
212
+ } else {
213
+ _message["default"].error('无访问权限,请联系管理员');
214
+ }
216
215
 
217
- case 5:
218
- case "end":
219
- return _context.stop();
220
- }
216
+ case 5:
217
+ case "end":
218
+ return _context.stop();
221
219
  }
222
220
  }, _callee);
223
- }));
224
-
225
- return function jump(_x, _x2) {
226
- return _ref.apply(this, arguments);
227
- };
228
- }(); // 基本信息可选项
221
+ }))).apply(this, arguments);
222
+ }; // 基本信息可选项
229
223
 
230
224
 
231
225
  var baseInfoCol = (0, _react.useMemo)(function () {
@@ -279,90 +273,78 @@ function ResourceOverview(props) {
279
273
  })) || [];
280
274
  }, [id, monitorMetricModels, initFlag]);
281
275
  (0, _react.useEffect)(function () {
276
+ var _getDevice;
277
+
282
278
  // 获取上架设备类型,判断资源是否是上架设备
283
279
  function getDevice() {
284
- return _getDevice.apply(this, arguments);
285
- }
286
-
287
- function _getDevice() {
288
- _getDevice = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
280
+ return (_getDevice = _getDevice || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
289
281
  var list;
290
282
  return _regenerator["default"].wrap(function _callee2$(_context2) {
291
- while (1) {
292
- switch (_context2.prev = _context2.next) {
293
- case 0:
294
- _context2.next = 2;
295
- return _overview["default"].getDeviceTypeList();
296
-
297
- case 2:
298
- list = _context2.sent;
299
- setIsDevice(list.some(function (item) {
300
- return item.code === ciType;
301
- })); // console.log('getDevice', ciType, list);
302
-
303
- case 4:
304
- case "end":
305
- return _context2.stop();
306
- }
283
+ while (1) switch (_context2.prev = _context2.next) {
284
+ case 0:
285
+ _context2.next = 2;
286
+ return _overview["default"].getDeviceTypeList();
287
+
288
+ case 2:
289
+ list = _context2.sent;
290
+ setIsDevice(list.some(function (item) {
291
+ return item.code === ciType;
292
+ })); // console.log('getDevice', ciType, list);
293
+
294
+ case 4:
295
+ case "end":
296
+ return _context2.stop();
307
297
  }
308
298
  }, _callee2);
309
- }));
310
- return _getDevice.apply(this, arguments);
299
+ }))).apply(this, arguments);
311
300
  }
312
301
 
313
302
  getDevice();
314
303
  }, [ciType]); // 获取地址信息:机房 机柜 起始U-结束U
315
304
 
316
305
  function getAddressFormat(_x3) {
317
- return _getAddressFormat.apply(this, arguments);
318
- } // 告警table列配置
319
-
320
-
321
- function _getAddressFormat() {
322
- _getAddressFormat = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref2) {
306
+ return (_getAddressFormat = _getAddressFormat || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref2) {
323
307
  var owned_computer_room, owned_cabinet, start_u_location, end_u_location, address, _res$find, _res$find$attributes, _res$find2, _res$find2$attributes, res, u;
324
308
 
325
309
  return _regenerator["default"].wrap(function _callee3$(_context3) {
326
- while (1) {
327
- switch (_context3.prev = _context3.next) {
328
- case 0:
329
- owned_computer_room = _ref2.owned_computer_room, owned_cabinet = _ref2.owned_cabinet, start_u_location = _ref2.start_u_location, end_u_location = _ref2.end_u_location;
330
- address = '';
310
+ while (1) switch (_context3.prev = _context3.next) {
311
+ case 0:
312
+ owned_computer_room = _ref2.owned_computer_room, owned_cabinet = _ref2.owned_cabinet, start_u_location = _ref2.start_u_location, end_u_location = _ref2.end_u_location;
313
+ address = '';
331
314
 
332
- if (!(owned_computer_room && owned_cabinet)) {
333
- _context3.next = 7;
334
- break;
335
- }
315
+ if (!(owned_computer_room && owned_cabinet)) {
316
+ _context3.next = 7;
317
+ break;
318
+ }
336
319
 
337
- _context3.next = 5;
338
- return (0, _services.queryCisByIds)([owned_computer_room, owned_cabinet]);
320
+ _context3.next = 5;
321
+ return (0, _services.queryCisByIds)([owned_computer_room, owned_cabinet]);
339
322
 
340
- case 5:
341
- res = _context3.sent;
342
- address = (((_res$find = res.find(function (item) {
343
- return item.id === owned_computer_room;
344
- })) === null || _res$find === void 0 ? void 0 : (_res$find$attributes = _res$find.attributes) === null || _res$find$attributes === void 0 ? void 0 : _res$find$attributes.display_name) || '') + " " + (((_res$find2 = res.find(function (item) {
345
- return item.id === owned_cabinet;
346
- })) === null || _res$find2 === void 0 ? void 0 : (_res$find2$attributes = _res$find2.attributes) === null || _res$find2$attributes === void 0 ? void 0 : _res$find2$attributes.display_name) || '');
323
+ case 5:
324
+ res = _context3.sent;
325
+ address = (((_res$find = res.find(function (item) {
326
+ return item.id === owned_computer_room;
327
+ })) === null || _res$find === void 0 ? void 0 : (_res$find$attributes = _res$find.attributes) === null || _res$find$attributes === void 0 ? void 0 : _res$find$attributes.display_name) || '') + " " + (((_res$find2 = res.find(function (item) {
328
+ return item.id === owned_cabinet;
329
+ })) === null || _res$find2 === void 0 ? void 0 : (_res$find2$attributes = _res$find2.attributes) === null || _res$find2$attributes === void 0 ? void 0 : _res$find2$attributes.display_name) || '');
347
330
 
348
- case 7:
349
- u = '';
331
+ case 7:
332
+ u = '';
350
333
 
351
- if (start_u_location || end_u_location) {
352
- u = (start_u_location || '') + "-" + (end_u_location || '');
353
- }
334
+ if (start_u_location || end_u_location) {
335
+ u = (start_u_location || '') + "-" + (end_u_location || '');
336
+ }
354
337
 
355
- return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
338
+ return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
356
339
 
357
- case 10:
358
- case "end":
359
- return _context3.stop();
360
- }
340
+ case 10:
341
+ case "end":
342
+ return _context3.stop();
361
343
  }
362
344
  }, _callee3);
363
- }));
364
- return _getAddressFormat.apply(this, arguments);
365
- }
345
+ }))).apply(this, arguments);
346
+ } // 告警table列配置
347
+
366
348
 
367
349
  var columns = [{
368
350
  title: '描述',
@@ -418,48 +400,41 @@ function ResourceOverview(props) {
418
400
  }]; // 告警/风险 操作 (受理)
419
401
 
420
402
  function alarmRiskOperation(_x4, _x5) {
421
- return _alarmRiskOperation.apply(this, arguments);
422
- }
423
-
424
- function _alarmRiskOperation() {
425
- _alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(type, params) {
403
+ return (_alarmRiskOperation = _alarmRiskOperation || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(type, params) {
426
404
  var res;
427
405
  return _regenerator["default"].wrap(function _callee4$(_context4) {
428
- while (1) {
429
- switch (_context4.prev = _context4.next) {
430
- case 0:
431
- if (!(type === 'alarm')) {
432
- _context4.next = 6;
433
- break;
434
- }
406
+ while (1) switch (_context4.prev = _context4.next) {
407
+ case 0:
408
+ if (!(type === 'alarm')) {
409
+ _context4.next = 6;
410
+ break;
411
+ }
435
412
 
436
- _context4.next = 3;
437
- return _overview["default"].handleAlarm(params);
413
+ _context4.next = 3;
414
+ return _overview["default"].handleAlarm(params);
438
415
 
439
- case 3:
440
- res = _context4.sent;
416
+ case 3:
417
+ res = _context4.sent;
441
418
 
442
- _message["default"].success('受理成功');
419
+ _message["default"].success('受理成功');
443
420
 
444
- refreshAlarmData(id); // if (isAppTopo) {
445
- // const {
446
- // displayName: ciName,
447
- // attributeMap: modelAttributeMap,
448
- // domain,
449
- // } = topo.ciTyeCache.getCiType(ciType);
450
- // initAppTopo(monitorMetricModels, modelAttributeMap, ciName, domain);
451
- // } else {
452
- // getAlarmRiskData(id);
453
- // }
421
+ refreshAlarmData(id); // if (isAppTopo) {
422
+ // const {
423
+ // displayName: ciName,
424
+ // attributeMap: modelAttributeMap,
425
+ // domain,
426
+ // } = topo.ciTyeCache.getCiType(ciType);
427
+ // initAppTopo(monitorMetricModels, modelAttributeMap, ciName, domain);
428
+ // } else {
429
+ // getAlarmRiskData(id);
430
+ // }
454
431
 
455
- case 6:
456
- case "end":
457
- return _context4.stop();
458
- }
432
+ case 6:
433
+ case "end":
434
+ return _context4.stop();
459
435
  }
460
436
  }, _callee4);
461
- }));
462
- return _alarmRiskOperation.apply(this, arguments);
437
+ }))).apply(this, arguments);
463
438
  }
464
439
 
465
440
  var elementData = {
@@ -470,345 +445,324 @@ function ResourceOverview(props) {
470
445
  }; // 基本信息设置改变
471
446
 
472
447
  function baseInfoColChange(_x6) {
473
- return _baseInfoColChange.apply(this, arguments);
474
- } // 获取属性信息
448
+ return (_baseInfoColChange = _baseInfoColChange || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(col) {
449
+ var _col;
475
450
 
451
+ var infoData, attributeMap, _loop, _iterator, _step;
476
452
 
477
- function _baseInfoColChange() {
478
- _baseInfoColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(col) {
479
- var _col;
453
+ return _regenerator["default"].wrap(function _callee5$(_context6) {
454
+ while (1) switch (_context6.prev = _context6.next) {
455
+ case 0:
456
+ if ((_col = col) !== null && _col !== void 0 && _col.length) {
457
+ _context6.next = 3;
458
+ break;
459
+ }
480
460
 
481
- var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref3, _ref3$, _item, _attributeMap, object, _object, displayName, attr;
461
+ setBaseInfo([]);
462
+ return _context6.abrupt("return");
482
463
 
483
- return _regenerator["default"].wrap(function _callee6$(_context6) {
484
- while (1) {
485
- switch (_context6.prev = _context6.next) {
486
- case 0:
487
- if ((_col = col) !== null && _col !== void 0 && _col.length) {
488
- _context6.next = 3;
489
- break;
490
- }
464
+ case 3:
465
+ settBaseInfoInitLoading(true);
466
+ infoData = [];
467
+ _context6.next = 7;
468
+ return getAttribute(id);
491
469
 
492
- setBaseInfo([]);
493
- return _context6.abrupt("return");
470
+ case 7:
471
+ attributeMap = _context6.sent;
472
+ // console.log('getAttribute', attributeMap);
473
+ col = col.filter(function (item) {
474
+ return !item.hidden;
475
+ });
476
+ _loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
477
+ var item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, roomLink, node, data, _ref3, _ref3$, _item, _attributeMap, object, _object2, displayName, attr;
478
+
479
+ return _regenerator["default"].wrap(function _loop$(_context5) {
480
+ while (1) switch (_context5.prev = _context5.next) {
481
+ case 0:
482
+ item = _step.value;
483
+ value = (0, _metricUtil.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
484
+ contentTitle = value;
485
+ _context5.t0 = item.dataIndex;
486
+ _context5.next = _context5.t0 === 'display_name' ? 6 : _context5.t0 === 'ciName' ? 9 : _context5.t0 === 'res_address' ? 12 : _context5.t0 === 'imageName' ? 19 : 23;
487
+ break;
488
+
489
+ case 6:
490
+ // 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
491
+ if (attributeMap.support_templates) {
492
+ link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
493
+
494
+ value = /*#__PURE__*/_react["default"].createElement("span", {
495
+ onClick: onClose
496
+ }, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
497
+ className: _indexModule["default"].link,
498
+ disabled: true,
499
+ title: attributeMap.display_name || '',
500
+ to: formatUrl(link)
501
+ }, attributeMap.display_name || '-'));
502
+ } else {
503
+ value = attributeMap.display_name || '-';
504
+ }
494
505
 
495
- case 3:
496
- settBaseInfoInitLoading(true);
497
- infoData = [];
498
- _context6.next = 7;
499
- return getAttribute(id);
506
+ contentTitle = attributeMap.display_name || '-';
507
+ return _context5.abrupt("break", 24);
500
508
 
501
- case 7:
502
- attributeMap = _context6.sent;
503
- // console.log('getAttribute', attributeMap);
504
- col = col.filter(function (item) {
505
- return !item.hidden;
506
- });
507
- _iterator = _createForOfIteratorHelperLoose(col);
509
+ case 9:
510
+ value = ciTypeMeta.displayName;
511
+ contentTitle = value;
512
+ return _context5.abrupt("break", 24);
508
513
 
509
- case 10:
510
- if ((_step = _iterator()).done) {
511
- _context6.next = 26;
512
- break;
513
- }
514
+ case 12:
515
+ _context5.next = 14;
516
+ return getAddressFormat(attributeMap);
514
517
 
515
- item = _step.value;
516
- value = (0, _metricUtil.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
517
- contentTitle = value;
518
- return _context6.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
519
- var link, address, owned_computer_room, owned_cabinet, roomLink, node;
520
- return _regenerator["default"].wrap(function _callee5$(_context5) {
521
- while (1) {
522
- switch (_context5.prev = _context5.next) {
523
- case 0:
524
- _context5.t0 = item.dataIndex;
525
- _context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
526
- break;
527
-
528
- case 3:
529
- // 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
530
- if (attributeMap.support_templates) {
531
- link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
532
-
533
- value = /*#__PURE__*/_react["default"].createElement("span", {
534
- onClick: onClose
535
- }, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
536
- className: _indexModule["default"].link,
537
- disabled: true,
538
- title: attributeMap.display_name || '',
539
- to: formatUrl(link)
540
- }, attributeMap.display_name || '-'));
541
- } else {
542
- value = attributeMap.display_name || '-';
543
- }
518
+ case 14:
519
+ address = _context5.sent;
520
+ owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
544
521
 
545
- contentTitle = attributeMap.display_name || '-';
546
- return _context5.abrupt("break", 21);
547
-
548
- case 6:
549
- value = ciTypeMeta.displayName;
550
- contentTitle = value;
551
- return _context5.abrupt("break", 21);
552
-
553
- case 9:
554
- _context5.next = 11;
555
- return getAddressFormat(attributeMap);
556
-
557
- case 11:
558
- address = _context5.sent;
559
- owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
560
-
561
- if (owned_computer_room && owned_cabinet) {
562
- // /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
563
- roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
564
- value = /*#__PURE__*/_react["default"].createElement("span", {
565
- onClick: function onClick() {
566
- jump(roomLink, owned_computer_room);
567
- }
568
- }, /*#__PURE__*/_react["default"].createElement("span", {
569
- className: _indexModule["default"].link,
570
- title: address
571
- }, address));
572
- } else {
573
- value = address;
522
+ if (owned_computer_room && owned_cabinet) {
523
+ // /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
524
+ roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
525
+ value = /*#__PURE__*/_react["default"].createElement("span", {
526
+ onClick: function onClick() {
527
+ jump(roomLink, owned_computer_room);
574
528
  }
529
+ }, /*#__PURE__*/_react["default"].createElement("span", {
530
+ className: _indexModule["default"].link,
531
+ title: address
532
+ }, address));
533
+ } else {
534
+ value = address;
535
+ }
575
536
 
576
- contentTitle = address;
577
- return _context5.abrupt("break", 21);
537
+ contentTitle = address;
538
+ return _context5.abrupt("break", 24);
578
539
 
579
- case 16:
580
- node = topo.getDataModel().getDataByTag(id);
581
- value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
582
- contentTitle = value;
583
- return _context5.abrupt("break", 21);
540
+ case 19:
541
+ node = topo.getDataModel().getDataByTag(id);
542
+ value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
543
+ contentTitle = value;
544
+ return _context5.abrupt("break", 24);
584
545
 
585
- case 20:
586
- return _context5.abrupt("break", 21);
546
+ case 23:
547
+ return _context5.abrupt("break", 24);
587
548
 
588
- case 21:
589
- case "end":
590
- return _context5.stop();
549
+ case 24:
550
+ // 拿翻译字段属性数据
551
+ if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
552
+ value = attributeMap[item.dataIndex + ".name"];
553
+ contentTitle = value;
591
554
  }
592
- }
593
- }, _callee5);
594
- })(), "t0", 15);
595
-
596
- case 15:
597
- // 拿翻译字段属性数据
598
- if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
599
- value = attributeMap[item.dataIndex + ".name"];
600
- contentTitle = value;
601
- }
602
555
 
603
- _data = topo.attributeMetricDisplay.getData() || [];
604
- _ref3 = [].concat(_data.filter(function (m) {
605
- return m.id === id;
606
- })), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
607
- _attributeMap = _item.attributeMap || {};
608
- object = _attributeMap[item.dataIndex + "_object"] || {};
609
-
610
- if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
611
- _object = (0, _extends2["default"])({}, object), displayName = _object.displayName;
612
- value = displayName || _attributeMap["" + item.dataIndex];
613
- contentTitle = value;
614
- }
556
+ data = topo.attributeMetricDisplay.getData() || [];
557
+ _ref3 = [].concat(data.filter(function (m) {
558
+ return m.id === id;
559
+ })), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
560
+ _attributeMap = _item.attributeMap || {};
561
+ object = _attributeMap[item.dataIndex + "_object"] || {};
562
+
563
+ if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
564
+ _object2 = (0, _extends2["default"])({}, object), displayName = _object2.displayName;
565
+ value = displayName || _attributeMap["" + item.dataIndex];
566
+ contentTitle = value;
567
+ }
615
568
 
616
- if (item.dataIndex === 'ipv6_address') {
617
- value = _attributeMap["" + item.dataIndex];
618
- contentTitle = value;
619
- }
569
+ if (item.dataIndex === 'ipv6_address') {
570
+ value = _attributeMap["" + item.dataIndex];
571
+ contentTitle = value;
572
+ }
620
573
 
621
- if (isAppTopo && (item.dataIndex === 'source_type' || item.dataIndex === 'destination_type')) {
622
- attr = topo.ciTyeCache.getCiType(attributeMap["" + item.dataIndex]) || {};
623
- value = attr.displayName || attributeMap["" + item.dataIndex];
624
- contentTitle = value;
625
- }
574
+ if (isAppTopo && (item.dataIndex === 'source_type' || item.dataIndex === 'destination_type')) {
575
+ attr = topo.ciTyeCache.getCiType(attributeMap["" + item.dataIndex]) || {};
576
+ value = attr.displayName || attributeMap["" + item.dataIndex];
577
+ contentTitle = value;
578
+ }
626
579
 
627
- infoData.push((0, _extends2["default"])({}, item, {
628
- value: value,
629
- contentTitle: contentTitle
630
- }));
580
+ infoData.push((0, _extends2["default"])({}, item, {
581
+ value: value,
582
+ contentTitle: contentTitle
583
+ }));
631
584
 
632
- case 24:
633
- _context6.next = 10;
585
+ case 33:
586
+ case "end":
587
+ return _context5.stop();
588
+ }
589
+ }, _loop);
590
+ });
591
+ _iterator = _createForOfIteratorHelperLoose(col);
592
+
593
+ case 11:
594
+ if ((_step = _iterator()).done) {
595
+ _context6.next = 15;
634
596
  break;
597
+ }
635
598
 
636
- case 26:
637
- settBaseInfoInitLoading(false);
638
- setBaseInfo(infoData);
599
+ return _context6.delegateYield(_loop(), "t0", 13);
639
600
 
640
- case 28:
641
- case "end":
642
- return _context6.stop();
643
- }
644
- }
645
- }, _callee6);
646
- }));
647
- return _baseInfoColChange.apply(this, arguments);
648
- }
601
+ case 13:
602
+ _context6.next = 11;
603
+ break;
649
604
 
650
- function getAttribute(_x7) {
651
- return _getAttribute.apply(this, arguments);
652
- } // 指标设置改变
605
+ case 15:
606
+ settBaseInfoInitLoading(false);
607
+ setBaseInfo(infoData);
653
608
 
609
+ case 17:
610
+ case "end":
611
+ return _context6.stop();
612
+ }
613
+ }, _callee5);
614
+ }))).apply(this, arguments);
615
+ } // 获取属性信息
654
616
 
655
- function _getAttribute() {
656
- _getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
657
- var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
658
617
 
659
- return _regenerator["default"].wrap(function _callee7$(_context7) {
660
- while (1) {
661
- switch (_context7.prev = _context7.next) {
662
- case 0:
663
- if (id) {
664
- _context7.next = 2;
665
- break;
666
- }
618
+ function getAttribute(_x7) {
619
+ return (_getAttribute = _getAttribute || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
620
+ var _yield$resourceOvervi2, baseInfos, res, _ref4, attributes;
621
+
622
+ return _regenerator["default"].wrap(function _callee6$(_context7) {
623
+ while (1) switch (_context7.prev = _context7.next) {
624
+ case 0:
625
+ if (id) {
626
+ _context7.next = 2;
627
+ break;
628
+ }
667
629
 
668
- return _context7.abrupt("return");
630
+ return _context7.abrupt("return");
669
631
 
670
- case 2:
671
- if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
672
- _context7.next = 9;
673
- break;
674
- }
632
+ case 2:
633
+ if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
634
+ _context7.next = 9;
635
+ break;
636
+ }
675
637
 
676
- _context7.next = 5;
677
- return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
678
- id: id
679
- });
638
+ _context7.next = 5;
639
+ return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
640
+ id: id
641
+ });
680
642
 
681
- case 5:
682
- _yield$resourceOvervi = _context7.sent;
683
- baseInfos = _yield$resourceOvervi.baseInfos;
643
+ case 5:
644
+ _yield$resourceOvervi2 = _context7.sent;
645
+ baseInfos = _yield$resourceOvervi2.baseInfos;
684
646
 
685
- if (!baseInfos) {
686
- _context7.next = 9;
687
- break;
688
- }
647
+ if (!baseInfos) {
648
+ _context7.next = 9;
649
+ break;
650
+ }
689
651
 
690
- return _context7.abrupt("return", baseInfos);
691
-
692
- case 9:
693
- _context7.next = 11;
694
- return _overview["default"].commonQueryCiData({
695
- condition: "id('" + id + "')",
696
- refAttribute: true,
697
- orders: [{
698
- name: 'CREATED_TIME',
699
- type: 'asc'
700
- }],
701
- pageIndex: 1,
702
- pageSize: 10
703
- });
652
+ return _context7.abrupt("return", baseInfos);
653
+
654
+ case 9:
655
+ _context7.next = 11;
656
+ return _overview["default"].commonQueryCiData({
657
+ condition: "id('" + id + "')",
658
+ refAttribute: true,
659
+ orders: [{
660
+ name: 'CREATED_TIME',
661
+ type: 'asc'
662
+ }],
663
+ pageIndex: 1,
664
+ pageSize: 10
665
+ });
704
666
 
705
- case 11:
706
- res = _context7.sent;
707
- _ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
708
- return _context7.abrupt("return", attributes || {});
667
+ case 11:
668
+ res = _context7.sent;
669
+ _ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
670
+ return _context7.abrupt("return", attributes || {});
709
671
 
710
- case 14:
711
- case "end":
712
- return _context7.stop();
713
- }
672
+ case 14:
673
+ case "end":
674
+ return _context7.stop();
714
675
  }
715
- }, _callee7);
716
- }));
717
- return _getAttribute.apply(this, arguments);
718
- }
676
+ }, _callee6);
677
+ }))).apply(this, arguments);
678
+ } // 指标设置改变
719
679
 
720
- function metricColChange(_x8) {
721
- return _metricColChange.apply(this, arguments);
722
- }
723
680
 
724
- function _metricColChange() {
725
- _metricColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(col) {
681
+ function metricColChange(_x8) {
682
+ return (_metricColChange = _metricColChange || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(col) {
726
683
  var _col2, _col3;
727
684
 
728
- var codes, endTime, params, _ref5, times, metricList, metricLists;
685
+ var codes, endTime, params, _ref6, times, metricList, metricLists;
729
686
 
730
- return _regenerator["default"].wrap(function _callee8$(_context8) {
731
- while (1) {
732
- switch (_context8.prev = _context8.next) {
733
- case 0:
734
- // console.log('metricColChange col', col);
735
- col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
736
- return !item.hidden;
737
- });
687
+ return _regenerator["default"].wrap(function _callee7$(_context8) {
688
+ while (1) switch (_context8.prev = _context8.next) {
689
+ case 0:
690
+ // console.log('metricColChange col', col);
691
+ col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
692
+ return !item.hidden;
693
+ });
694
+
695
+ if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
696
+ _context8.next = 4;
697
+ break;
698
+ }
699
+
700
+ setMetric([]); // Message.error('指标未设置')
701
+
702
+ return _context8.abrupt("return");
738
703
 
739
- if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
740
- _context8.next = 4;
741
- break;
704
+ case 4:
705
+ codes = col.map(function (item) {
706
+ return item.dataIndex;
707
+ });
708
+ endTime = Math.floor(new Date().getTime() / 1000);
709
+ params = {
710
+ ciIds: [id],
711
+ subIds: [id],
712
+ startTime: endTime - 60 * 60,
713
+ endTime: endTime,
714
+ codes: codes
715
+ };
716
+
717
+ if (isAppTopo) {
718
+ _ref6 = resourceOverviewProps.metricProps || {}, times = _ref6.times;
719
+
720
+ if (times !== null && times !== void 0 && times.length) {
721
+ params.startTime = times[0];
722
+ params.endTime = times[1];
742
723
  }
724
+ }
743
725
 
744
- setMetric([]); // Message.error('指标未设置')
726
+ setMetricInitLoading(true);
727
+ _context8.next = 11;
728
+ return _overview["default"].getMetricList(params);
745
729
 
746
- return _context8.abrupt("return");
730
+ case 11:
731
+ metricList = _context8.sent;
732
+ metricLists = metricList.concat(getNewMetricList());
747
733
 
748
- case 4:
749
- codes = col.map(function (item) {
750
- return item.dataIndex;
751
- });
752
- endTime = Math.floor(new Date().getTime() / 1000);
753
- params = {
754
- ciIds: [id],
755
- subIds: [id],
734
+ _rlog.rlog.debug('metricColChange', metricLists, monitorMetricModels);
735
+
736
+ setMetric(col.map(function (item, key) {
737
+ return {
738
+ code: item.dataIndex,
739
+ chartIndex: key,
756
740
  startTime: endTime - 60 * 60,
757
741
  endTime: endTime,
758
- codes: codes
742
+ metricItem: monitorMetricModels.find(function (m_item) {
743
+ return m_item.code === item.dataIndex;
744
+ }),
745
+ list: metricLists.filter(function (m_item) {
746
+ return m_item.metricCode === item.dataIndex;
747
+ })
759
748
  };
749
+ }));
750
+ setMetricInitLoading(false);
751
+
752
+ if (!isAppTopo) {
753
+ // 一分钟更新一次指标信息 metricTimer
754
+ window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
755
+ window.topo_overview_metric_timer = setInterval(function () {
756
+ metricColChange(col);
757
+ }, 60000);
758
+ }
760
759
 
761
- if (isAppTopo) {
762
- _ref5 = resourceOverviewProps.metricProps || {}, times = _ref5.times;
763
-
764
- if (times !== null && times !== void 0 && times.length) {
765
- params.startTime = times[0];
766
- params.endTime = times[1];
767
- }
768
- }
769
-
770
- setMetricInitLoading(true);
771
- _context8.next = 11;
772
- return _overview["default"].getMetricList(params);
773
-
774
- case 11:
775
- metricList = _context8.sent;
776
- metricLists = metricList.concat(getNewMetricList());
777
-
778
- _rlog.rlog.debug('metricColChange', metricLists, monitorMetricModels);
779
-
780
- setMetric(col.map(function (item, key) {
781
- return {
782
- code: item.dataIndex,
783
- chartIndex: key,
784
- startTime: endTime - 60 * 60,
785
- endTime: endTime,
786
- metricItem: monitorMetricModels.find(function (m_item) {
787
- return m_item.code === item.dataIndex;
788
- }),
789
- list: metricLists.filter(function (m_item) {
790
- return m_item.metricCode === item.dataIndex;
791
- })
792
- };
793
- }));
794
- setMetricInitLoading(false);
795
-
796
- if (!isAppTopo) {
797
- // 一分钟更新一次指标信息 metricTimer
798
- window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
799
- window.topo_overview_metric_timer = setInterval(function () {
800
- metricColChange(col);
801
- }, 60000);
802
- }
803
-
804
- case 17:
805
- case "end":
806
- return _context8.stop();
807
- }
760
+ case 17:
761
+ case "end":
762
+ return _context8.stop();
808
763
  }
809
- }, _callee8);
810
- }));
811
- return _metricColChange.apply(this, arguments);
764
+ }, _callee7);
765
+ }))).apply(this, arguments);
812
766
  }
813
767
 
814
768
  var getNewMetricList = function getNewMetricList() {