@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
@@ -8,7 +8,7 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Sy
8
8
 
9
9
  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); }
10
10
 
11
- 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; }
11
+ 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; }
12
12
 
13
13
  import _regeneratorRuntime from "@babel/runtime/regenerator";
14
14
  import moment from 'moment';
@@ -48,7 +48,7 @@ function formatUrl(url) {
48
48
 
49
49
 
50
50
  export default function ResourceOverview(props) {
51
- var _data$attributes;
51
+ var _data$attributes, _ref, _getAddressFormat, _alarmRiskOperation, _baseInfoColChange, _getAttribute, _metricColChange;
52
52
 
53
53
  var topo = props.topo,
54
54
  id = props.id,
@@ -159,39 +159,33 @@ export default function ResourceOverview(props) {
159
159
  isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
160
160
  }
161
161
 
162
- var jump = /*#__PURE__*/function () {
163
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(roomLink, id) {
162
+ var jump = function jump(_x, _x2) {
163
+ return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(roomLink, id) {
164
164
  var power;
165
165
  return _regeneratorRuntime.wrap(function _callee$(_context) {
166
- while (1) {
167
- switch (_context.prev = _context.next) {
168
- case 0:
169
- onClose();
170
- _context.next = 3;
171
- return commonQueryCiData(id);
172
-
173
- case 3:
174
- power = _context.sent;
175
-
176
- // console.log(power)
177
- if (power.data.length) {
178
- window.open("" + window.location.origin + roomLink);
179
- } else {
180
- _Message.error('无访问权限,请联系管理员');
181
- }
166
+ while (1) switch (_context.prev = _context.next) {
167
+ case 0:
168
+ onClose();
169
+ _context.next = 3;
170
+ return commonQueryCiData(id);
171
+
172
+ case 3:
173
+ power = _context.sent;
174
+
175
+ // console.log(power)
176
+ if (power.data.length) {
177
+ window.open("" + window.location.origin + roomLink);
178
+ } else {
179
+ _Message.error('无访问权限,请联系管理员');
180
+ }
182
181
 
183
- case 5:
184
- case "end":
185
- return _context.stop();
186
- }
182
+ case 5:
183
+ case "end":
184
+ return _context.stop();
187
185
  }
188
186
  }, _callee);
189
- }));
190
-
191
- return function jump(_x, _x2) {
192
- return _ref.apply(this, arguments);
193
- };
194
- }(); // 基本信息可选项
187
+ }))).apply(this, arguments);
188
+ }; // 基本信息可选项
195
189
 
196
190
 
197
191
  var baseInfoCol = useMemo(function () {
@@ -245,90 +239,78 @@ export default function ResourceOverview(props) {
245
239
  })) || [];
246
240
  }, [id, monitorMetricModels, initFlag]);
247
241
  useEffect(function () {
242
+ var _getDevice;
243
+
248
244
  // 获取上架设备类型,判断资源是否是上架设备
249
245
  function getDevice() {
250
- return _getDevice.apply(this, arguments);
251
- }
252
-
253
- function _getDevice() {
254
- _getDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
246
+ return (_getDevice = _getDevice || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
255
247
  var list;
256
248
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
257
- while (1) {
258
- switch (_context2.prev = _context2.next) {
259
- case 0:
260
- _context2.next = 2;
261
- return service.getDeviceTypeList();
262
-
263
- case 2:
264
- list = _context2.sent;
265
- setIsDevice(list.some(function (item) {
266
- return item.code === ciType;
267
- })); // console.log('getDevice', ciType, list);
268
-
269
- case 4:
270
- case "end":
271
- return _context2.stop();
272
- }
249
+ while (1) switch (_context2.prev = _context2.next) {
250
+ case 0:
251
+ _context2.next = 2;
252
+ return service.getDeviceTypeList();
253
+
254
+ case 2:
255
+ list = _context2.sent;
256
+ setIsDevice(list.some(function (item) {
257
+ return item.code === ciType;
258
+ })); // console.log('getDevice', ciType, list);
259
+
260
+ case 4:
261
+ case "end":
262
+ return _context2.stop();
273
263
  }
274
264
  }, _callee2);
275
- }));
276
- return _getDevice.apply(this, arguments);
265
+ }))).apply(this, arguments);
277
266
  }
278
267
 
279
268
  getDevice();
280
269
  }, [ciType]); // 获取地址信息:机房 机柜 起始U-结束U
281
270
 
282
271
  function getAddressFormat(_x3) {
283
- return _getAddressFormat.apply(this, arguments);
284
- } // 告警table列配置
285
-
286
-
287
- function _getAddressFormat() {
288
- _getAddressFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
272
+ return (_getAddressFormat = _getAddressFormat || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
289
273
  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;
290
274
 
291
275
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
292
- while (1) {
293
- switch (_context3.prev = _context3.next) {
294
- case 0:
295
- 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;
296
- address = '';
276
+ while (1) switch (_context3.prev = _context3.next) {
277
+ case 0:
278
+ 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;
279
+ address = '';
297
280
 
298
- if (!(owned_computer_room && owned_cabinet)) {
299
- _context3.next = 7;
300
- break;
301
- }
281
+ if (!(owned_computer_room && owned_cabinet)) {
282
+ _context3.next = 7;
283
+ break;
284
+ }
302
285
 
303
- _context3.next = 5;
304
- return queryCisByIds([owned_computer_room, owned_cabinet]);
286
+ _context3.next = 5;
287
+ return queryCisByIds([owned_computer_room, owned_cabinet]);
305
288
 
306
- case 5:
307
- res = _context3.sent;
308
- address = (((_res$find = res.find(function (item) {
309
- return item.id === owned_computer_room;
310
- })) === 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) {
311
- return item.id === owned_cabinet;
312
- })) === 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) || '');
289
+ case 5:
290
+ res = _context3.sent;
291
+ address = (((_res$find = res.find(function (item) {
292
+ return item.id === owned_computer_room;
293
+ })) === 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) {
294
+ return item.id === owned_cabinet;
295
+ })) === 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) || '');
313
296
 
314
- case 7:
315
- u = '';
297
+ case 7:
298
+ u = '';
316
299
 
317
- if (start_u_location || end_u_location) {
318
- u = (start_u_location || '') + "-" + (end_u_location || '');
319
- }
300
+ if (start_u_location || end_u_location) {
301
+ u = (start_u_location || '') + "-" + (end_u_location || '');
302
+ }
320
303
 
321
- return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
304
+ return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
322
305
 
323
- case 10:
324
- case "end":
325
- return _context3.stop();
326
- }
306
+ case 10:
307
+ case "end":
308
+ return _context3.stop();
327
309
  }
328
310
  }, _callee3);
329
- }));
330
- return _getAddressFormat.apply(this, arguments);
331
- }
311
+ }))).apply(this, arguments);
312
+ } // 告警table列配置
313
+
332
314
 
333
315
  var columns = [{
334
316
  title: '描述',
@@ -384,48 +366,41 @@ export default function ResourceOverview(props) {
384
366
  }]; // 告警/风险 操作 (受理)
385
367
 
386
368
  function alarmRiskOperation(_x4, _x5) {
387
- return _alarmRiskOperation.apply(this, arguments);
388
- }
389
-
390
- function _alarmRiskOperation() {
391
- _alarmRiskOperation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(type, params) {
369
+ return (_alarmRiskOperation = _alarmRiskOperation || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(type, params) {
392
370
  var res;
393
371
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
394
- while (1) {
395
- switch (_context4.prev = _context4.next) {
396
- case 0:
397
- if (!(type === 'alarm')) {
398
- _context4.next = 6;
399
- break;
400
- }
372
+ while (1) switch (_context4.prev = _context4.next) {
373
+ case 0:
374
+ if (!(type === 'alarm')) {
375
+ _context4.next = 6;
376
+ break;
377
+ }
401
378
 
402
- _context4.next = 3;
403
- return service.handleAlarm(params);
379
+ _context4.next = 3;
380
+ return service.handleAlarm(params);
404
381
 
405
- case 3:
406
- res = _context4.sent;
382
+ case 3:
383
+ res = _context4.sent;
407
384
 
408
- _Message.success('受理成功');
385
+ _Message.success('受理成功');
409
386
 
410
- refreshAlarmData(id); // if (isAppTopo) {
411
- // const {
412
- // displayName: ciName,
413
- // attributeMap: modelAttributeMap,
414
- // domain,
415
- // } = topo.ciTyeCache.getCiType(ciType);
416
- // initAppTopo(monitorMetricModels, modelAttributeMap, ciName, domain);
417
- // } else {
418
- // getAlarmRiskData(id);
419
- // }
387
+ refreshAlarmData(id); // if (isAppTopo) {
388
+ // const {
389
+ // displayName: ciName,
390
+ // attributeMap: modelAttributeMap,
391
+ // domain,
392
+ // } = topo.ciTyeCache.getCiType(ciType);
393
+ // initAppTopo(monitorMetricModels, modelAttributeMap, ciName, domain);
394
+ // } else {
395
+ // getAlarmRiskData(id);
396
+ // }
420
397
 
421
- case 6:
422
- case "end":
423
- return _context4.stop();
424
- }
398
+ case 6:
399
+ case "end":
400
+ return _context4.stop();
425
401
  }
426
402
  }, _callee4);
427
- }));
428
- return _alarmRiskOperation.apply(this, arguments);
403
+ }))).apply(this, arguments);
429
404
  }
430
405
 
431
406
  var elementData = {
@@ -436,343 +411,322 @@ export default function ResourceOverview(props) {
436
411
  }; // 基本信息设置改变
437
412
 
438
413
  function baseInfoColChange(_x6) {
439
- return _baseInfoColChange.apply(this, arguments);
440
- } // 获取属性信息
414
+ return (_baseInfoColChange = _baseInfoColChange || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(col) {
415
+ var _col;
441
416
 
417
+ var infoData, attributeMap, _loop, _iterator, _step;
442
418
 
443
- function _baseInfoColChange() {
444
- _baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(col) {
445
- var _col;
419
+ return _regeneratorRuntime.wrap(function _callee5$(_context6) {
420
+ while (1) switch (_context6.prev = _context6.next) {
421
+ case 0:
422
+ if ((_col = col) !== null && _col !== void 0 && _col.length) {
423
+ _context6.next = 3;
424
+ break;
425
+ }
446
426
 
447
- var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref3, _ref3$, _item, _attributeMap, object, _object, displayName, attr;
427
+ setBaseInfo([]);
428
+ return _context6.abrupt("return");
448
429
 
449
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
450
- while (1) {
451
- switch (_context6.prev = _context6.next) {
452
- case 0:
453
- if ((_col = col) !== null && _col !== void 0 && _col.length) {
454
- _context6.next = 3;
455
- break;
456
- }
430
+ case 3:
431
+ settBaseInfoInitLoading(true);
432
+ infoData = [];
433
+ _context6.next = 7;
434
+ return getAttribute(id);
457
435
 
458
- setBaseInfo([]);
459
- return _context6.abrupt("return");
436
+ case 7:
437
+ attributeMap = _context6.sent;
438
+ // console.log('getAttribute', attributeMap);
439
+ col = col.filter(function (item) {
440
+ return !item.hidden;
441
+ });
442
+ _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
443
+ var item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, roomLink, node, data, _ref3, _ref3$, _item, _attributeMap, object, _object2, displayName, attr;
444
+
445
+ return _regeneratorRuntime.wrap(function _loop$(_context5) {
446
+ while (1) switch (_context5.prev = _context5.next) {
447
+ case 0:
448
+ item = _step.value;
449
+ value = formatMetric(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
450
+ contentTitle = value;
451
+ _context5.t0 = item.dataIndex;
452
+ _context5.next = _context5.t0 === 'display_name' ? 6 : _context5.t0 === 'ciName' ? 9 : _context5.t0 === 'res_address' ? 12 : _context5.t0 === 'imageName' ? 19 : 23;
453
+ break;
454
+
455
+ case 6:
456
+ // 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
457
+ if (attributeMap.support_templates) {
458
+ link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
459
+
460
+ value = /*#__PURE__*/React.createElement("span", {
461
+ onClick: onClose
462
+ }, /*#__PURE__*/React.createElement(Link, {
463
+ className: styles.link,
464
+ disabled: true,
465
+ title: attributeMap.display_name || '',
466
+ to: formatUrl(link)
467
+ }, attributeMap.display_name || '-'));
468
+ } else {
469
+ value = attributeMap.display_name || '-';
470
+ }
460
471
 
461
- case 3:
462
- settBaseInfoInitLoading(true);
463
- infoData = [];
464
- _context6.next = 7;
465
- return getAttribute(id);
472
+ contentTitle = attributeMap.display_name || '-';
473
+ return _context5.abrupt("break", 24);
466
474
 
467
- case 7:
468
- attributeMap = _context6.sent;
469
- // console.log('getAttribute', attributeMap);
470
- col = col.filter(function (item) {
471
- return !item.hidden;
472
- });
473
- _iterator = _createForOfIteratorHelperLoose(col);
475
+ case 9:
476
+ value = ciTypeMeta.displayName;
477
+ contentTitle = value;
478
+ return _context5.abrupt("break", 24);
474
479
 
475
- case 10:
476
- if ((_step = _iterator()).done) {
477
- _context6.next = 26;
478
- break;
479
- }
480
+ case 12:
481
+ _context5.next = 14;
482
+ return getAddressFormat(attributeMap);
480
483
 
481
- item = _step.value;
482
- value = formatMetric(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
483
- contentTitle = value;
484
- return _context6.delegateYield( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
485
- var link, address, owned_computer_room, owned_cabinet, roomLink, node;
486
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
487
- while (1) {
488
- switch (_context5.prev = _context5.next) {
489
- case 0:
490
- _context5.t0 = item.dataIndex;
491
- _context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
492
- break;
493
-
494
- case 3:
495
- // 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
496
- if (attributeMap.support_templates) {
497
- link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
498
-
499
- value = /*#__PURE__*/React.createElement("span", {
500
- onClick: onClose
501
- }, /*#__PURE__*/React.createElement(Link, {
502
- className: styles.link,
503
- disabled: true,
504
- title: attributeMap.display_name || '',
505
- to: formatUrl(link)
506
- }, attributeMap.display_name || '-'));
507
- } else {
508
- value = attributeMap.display_name || '-';
509
- }
484
+ case 14:
485
+ address = _context5.sent;
486
+ owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
510
487
 
511
- contentTitle = attributeMap.display_name || '-';
512
- return _context5.abrupt("break", 21);
513
-
514
- case 6:
515
- value = ciTypeMeta.displayName;
516
- contentTitle = value;
517
- return _context5.abrupt("break", 21);
518
-
519
- case 9:
520
- _context5.next = 11;
521
- return getAddressFormat(attributeMap);
522
-
523
- case 11:
524
- address = _context5.sent;
525
- owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
526
-
527
- if (owned_computer_room && owned_cabinet) {
528
- // /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
529
- roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
530
- value = /*#__PURE__*/React.createElement("span", {
531
- onClick: function onClick() {
532
- jump(roomLink, owned_computer_room);
533
- }
534
- }, /*#__PURE__*/React.createElement("span", {
535
- className: styles.link,
536
- title: address
537
- }, address));
538
- } else {
539
- value = address;
488
+ if (owned_computer_room && owned_cabinet) {
489
+ // /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
490
+ roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
491
+ value = /*#__PURE__*/React.createElement("span", {
492
+ onClick: function onClick() {
493
+ jump(roomLink, owned_computer_room);
540
494
  }
495
+ }, /*#__PURE__*/React.createElement("span", {
496
+ className: styles.link,
497
+ title: address
498
+ }, address));
499
+ } else {
500
+ value = address;
501
+ }
541
502
 
542
- contentTitle = address;
543
- return _context5.abrupt("break", 21);
503
+ contentTitle = address;
504
+ return _context5.abrupt("break", 24);
544
505
 
545
- case 16:
546
- node = topo.getDataModel().getDataByTag(id);
547
- value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
548
- contentTitle = value;
549
- return _context5.abrupt("break", 21);
506
+ case 19:
507
+ node = topo.getDataModel().getDataByTag(id);
508
+ value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
509
+ contentTitle = value;
510
+ return _context5.abrupt("break", 24);
550
511
 
551
- case 20:
552
- return _context5.abrupt("break", 21);
512
+ case 23:
513
+ return _context5.abrupt("break", 24);
553
514
 
554
- case 21:
555
- case "end":
556
- return _context5.stop();
515
+ case 24:
516
+ // 拿翻译字段属性数据
517
+ if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
518
+ value = attributeMap[item.dataIndex + ".name"];
519
+ contentTitle = value;
557
520
  }
558
- }
559
- }, _callee5);
560
- })(), "t0", 15);
561
-
562
- case 15:
563
- // 拿翻译字段属性数据
564
- if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
565
- value = attributeMap[item.dataIndex + ".name"];
566
- contentTitle = value;
567
- }
568
521
 
569
- _data = topo.attributeMetricDisplay.getData() || [];
570
- _ref3 = [].concat(_data.filter(function (m) {
571
- return m.id === id;
572
- })), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
573
- _attributeMap = _item.attributeMap || {};
574
- object = _attributeMap[item.dataIndex + "_object"] || {};
575
-
576
- if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
577
- _object = _extends({}, object), displayName = _object.displayName;
578
- value = displayName || _attributeMap["" + item.dataIndex];
579
- contentTitle = value;
580
- }
522
+ data = topo.attributeMetricDisplay.getData() || [];
523
+ _ref3 = [].concat(data.filter(function (m) {
524
+ return m.id === id;
525
+ })), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
526
+ _attributeMap = _item.attributeMap || {};
527
+ object = _attributeMap[item.dataIndex + "_object"] || {};
528
+
529
+ if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
530
+ _object2 = _extends({}, object), displayName = _object2.displayName;
531
+ value = displayName || _attributeMap["" + item.dataIndex];
532
+ contentTitle = value;
533
+ }
581
534
 
582
- if (item.dataIndex === 'ipv6_address') {
583
- value = _attributeMap["" + item.dataIndex];
584
- contentTitle = value;
585
- }
535
+ if (item.dataIndex === 'ipv6_address') {
536
+ value = _attributeMap["" + item.dataIndex];
537
+ contentTitle = value;
538
+ }
586
539
 
587
- if (isAppTopo && (item.dataIndex === 'source_type' || item.dataIndex === 'destination_type')) {
588
- attr = topo.ciTyeCache.getCiType(attributeMap["" + item.dataIndex]) || {};
589
- value = attr.displayName || attributeMap["" + item.dataIndex];
590
- contentTitle = value;
591
- }
540
+ if (isAppTopo && (item.dataIndex === 'source_type' || item.dataIndex === 'destination_type')) {
541
+ attr = topo.ciTyeCache.getCiType(attributeMap["" + item.dataIndex]) || {};
542
+ value = attr.displayName || attributeMap["" + item.dataIndex];
543
+ contentTitle = value;
544
+ }
592
545
 
593
- infoData.push(_extends({}, item, {
594
- value: value,
595
- contentTitle: contentTitle
596
- }));
546
+ infoData.push(_extends({}, item, {
547
+ value: value,
548
+ contentTitle: contentTitle
549
+ }));
597
550
 
598
- case 24:
599
- _context6.next = 10;
551
+ case 33:
552
+ case "end":
553
+ return _context5.stop();
554
+ }
555
+ }, _loop);
556
+ });
557
+ _iterator = _createForOfIteratorHelperLoose(col);
558
+
559
+ case 11:
560
+ if ((_step = _iterator()).done) {
561
+ _context6.next = 15;
600
562
  break;
563
+ }
601
564
 
602
- case 26:
603
- settBaseInfoInitLoading(false);
604
- setBaseInfo(infoData);
565
+ return _context6.delegateYield(_loop(), "t0", 13);
605
566
 
606
- case 28:
607
- case "end":
608
- return _context6.stop();
609
- }
610
- }
611
- }, _callee6);
612
- }));
613
- return _baseInfoColChange.apply(this, arguments);
614
- }
567
+ case 13:
568
+ _context6.next = 11;
569
+ break;
615
570
 
616
- function getAttribute(_x7) {
617
- return _getAttribute.apply(this, arguments);
618
- } // 指标设置改变
571
+ case 15:
572
+ settBaseInfoInitLoading(false);
573
+ setBaseInfo(infoData);
619
574
 
575
+ case 17:
576
+ case "end":
577
+ return _context6.stop();
578
+ }
579
+ }, _callee5);
580
+ }))).apply(this, arguments);
581
+ } // 获取属性信息
620
582
 
621
- function _getAttribute() {
622
- _getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
623
- var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
624
583
 
625
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
626
- while (1) {
627
- switch (_context7.prev = _context7.next) {
628
- case 0:
629
- if (id) {
630
- _context7.next = 2;
631
- break;
632
- }
584
+ function getAttribute(_x7) {
585
+ return (_getAttribute = _getAttribute || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
586
+ var _yield$resourceOvervi2, baseInfos, res, _ref4, attributes;
587
+
588
+ return _regeneratorRuntime.wrap(function _callee6$(_context7) {
589
+ while (1) switch (_context7.prev = _context7.next) {
590
+ case 0:
591
+ if (id) {
592
+ _context7.next = 2;
593
+ break;
594
+ }
633
595
 
634
- return _context7.abrupt("return");
596
+ return _context7.abrupt("return");
635
597
 
636
- case 2:
637
- if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
638
- _context7.next = 9;
639
- break;
640
- }
598
+ case 2:
599
+ if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
600
+ _context7.next = 9;
601
+ break;
602
+ }
641
603
 
642
- _context7.next = 5;
643
- return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
644
- id: id
645
- });
604
+ _context7.next = 5;
605
+ return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
606
+ id: id
607
+ });
646
608
 
647
- case 5:
648
- _yield$resourceOvervi = _context7.sent;
649
- baseInfos = _yield$resourceOvervi.baseInfos;
609
+ case 5:
610
+ _yield$resourceOvervi2 = _context7.sent;
611
+ baseInfos = _yield$resourceOvervi2.baseInfos;
650
612
 
651
- if (!baseInfos) {
652
- _context7.next = 9;
653
- break;
654
- }
613
+ if (!baseInfos) {
614
+ _context7.next = 9;
615
+ break;
616
+ }
655
617
 
656
- return _context7.abrupt("return", baseInfos);
657
-
658
- case 9:
659
- _context7.next = 11;
660
- return service.commonQueryCiData({
661
- condition: "id('" + id + "')",
662
- refAttribute: true,
663
- orders: [{
664
- name: 'CREATED_TIME',
665
- type: 'asc'
666
- }],
667
- pageIndex: 1,
668
- pageSize: 10
669
- });
618
+ return _context7.abrupt("return", baseInfos);
619
+
620
+ case 9:
621
+ _context7.next = 11;
622
+ return service.commonQueryCiData({
623
+ condition: "id('" + id + "')",
624
+ refAttribute: true,
625
+ orders: [{
626
+ name: 'CREATED_TIME',
627
+ type: 'asc'
628
+ }],
629
+ pageIndex: 1,
630
+ pageSize: 10
631
+ });
670
632
 
671
- case 11:
672
- res = _context7.sent;
673
- _ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
674
- return _context7.abrupt("return", attributes || {});
633
+ case 11:
634
+ res = _context7.sent;
635
+ _ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
636
+ return _context7.abrupt("return", attributes || {});
675
637
 
676
- case 14:
677
- case "end":
678
- return _context7.stop();
679
- }
638
+ case 14:
639
+ case "end":
640
+ return _context7.stop();
680
641
  }
681
- }, _callee7);
682
- }));
683
- return _getAttribute.apply(this, arguments);
684
- }
642
+ }, _callee6);
643
+ }))).apply(this, arguments);
644
+ } // 指标设置改变
685
645
 
686
- function metricColChange(_x8) {
687
- return _metricColChange.apply(this, arguments);
688
- }
689
646
 
690
- function _metricColChange() {
691
- _metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(col) {
647
+ function metricColChange(_x8) {
648
+ return (_metricColChange = _metricColChange || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(col) {
692
649
  var _col2, _col3;
693
650
 
694
- var codes, endTime, params, _ref5, times, metricList, metricLists;
651
+ var codes, endTime, params, _ref6, times, metricList, metricLists;
695
652
 
696
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
697
- while (1) {
698
- switch (_context8.prev = _context8.next) {
699
- case 0:
700
- // console.log('metricColChange col', col);
701
- col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
702
- return !item.hidden;
703
- });
653
+ return _regeneratorRuntime.wrap(function _callee7$(_context8) {
654
+ while (1) switch (_context8.prev = _context8.next) {
655
+ case 0:
656
+ // console.log('metricColChange col', col);
657
+ col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
658
+ return !item.hidden;
659
+ });
704
660
 
705
- if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
706
- _context8.next = 4;
707
- break;
708
- }
661
+ if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
662
+ _context8.next = 4;
663
+ break;
664
+ }
709
665
 
710
- setMetric([]); // Message.error('指标未设置')
666
+ setMetric([]); // Message.error('指标未设置')
711
667
 
712
- return _context8.abrupt("return");
668
+ return _context8.abrupt("return");
713
669
 
714
- case 4:
715
- codes = col.map(function (item) {
716
- return item.dataIndex;
717
- });
718
- endTime = Math.floor(new Date().getTime() / 1000);
719
- params = {
720
- ciIds: [id],
721
- subIds: [id],
670
+ case 4:
671
+ codes = col.map(function (item) {
672
+ return item.dataIndex;
673
+ });
674
+ endTime = Math.floor(new Date().getTime() / 1000);
675
+ params = {
676
+ ciIds: [id],
677
+ subIds: [id],
678
+ startTime: endTime - 60 * 60,
679
+ endTime: endTime,
680
+ codes: codes
681
+ };
682
+
683
+ if (isAppTopo) {
684
+ _ref6 = resourceOverviewProps.metricProps || {}, times = _ref6.times;
685
+
686
+ if (times !== null && times !== void 0 && times.length) {
687
+ params.startTime = times[0];
688
+ params.endTime = times[1];
689
+ }
690
+ }
691
+
692
+ setMetricInitLoading(true);
693
+ _context8.next = 11;
694
+ return service.getMetricList(params);
695
+
696
+ case 11:
697
+ metricList = _context8.sent;
698
+ metricLists = metricList.concat(getNewMetricList());
699
+ rlog.debug('metricColChange', metricLists, monitorMetricModels);
700
+ setMetric(col.map(function (item, key) {
701
+ return {
702
+ code: item.dataIndex,
703
+ chartIndex: key,
722
704
  startTime: endTime - 60 * 60,
723
705
  endTime: endTime,
724
- codes: codes
706
+ metricItem: monitorMetricModels.find(function (m_item) {
707
+ return m_item.code === item.dataIndex;
708
+ }),
709
+ list: metricLists.filter(function (m_item) {
710
+ return m_item.metricCode === item.dataIndex;
711
+ })
725
712
  };
713
+ }));
714
+ setMetricInitLoading(false);
715
+
716
+ if (!isAppTopo) {
717
+ // 一分钟更新一次指标信息 metricTimer
718
+ window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
719
+ window.topo_overview_metric_timer = setInterval(function () {
720
+ metricColChange(col);
721
+ }, 60000);
722
+ }
726
723
 
727
- if (isAppTopo) {
728
- _ref5 = resourceOverviewProps.metricProps || {}, times = _ref5.times;
729
-
730
- if (times !== null && times !== void 0 && times.length) {
731
- params.startTime = times[0];
732
- params.endTime = times[1];
733
- }
734
- }
735
-
736
- setMetricInitLoading(true);
737
- _context8.next = 11;
738
- return service.getMetricList(params);
739
-
740
- case 11:
741
- metricList = _context8.sent;
742
- metricLists = metricList.concat(getNewMetricList());
743
- rlog.debug('metricColChange', metricLists, monitorMetricModels);
744
- setMetric(col.map(function (item, key) {
745
- return {
746
- code: item.dataIndex,
747
- chartIndex: key,
748
- startTime: endTime - 60 * 60,
749
- endTime: endTime,
750
- metricItem: monitorMetricModels.find(function (m_item) {
751
- return m_item.code === item.dataIndex;
752
- }),
753
- list: metricLists.filter(function (m_item) {
754
- return m_item.metricCode === item.dataIndex;
755
- })
756
- };
757
- }));
758
- setMetricInitLoading(false);
759
-
760
- if (!isAppTopo) {
761
- // 一分钟更新一次指标信息 metricTimer
762
- window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
763
- window.topo_overview_metric_timer = setInterval(function () {
764
- metricColChange(col);
765
- }, 60000);
766
- }
767
-
768
- case 17:
769
- case "end":
770
- return _context8.stop();
771
- }
724
+ case 17:
725
+ case "end":
726
+ return _context8.stop();
772
727
  }
773
- }, _callee8);
774
- }));
775
- return _metricColChange.apply(this, arguments);
728
+ }, _callee7);
729
+ }))).apply(this, arguments);
776
730
  }
777
731
 
778
732
  var getNewMetricList = function getNewMetricList() {