@riil-frontend/component-topology 11.0.35 → 12.0.0-dev.1

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 (139) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.js +45 -29
  4. package/es/components/BatchAttrMetric/setting.js +1 -1
  5. package/es/components/MultiResourceDrawer/index.js +8 -6
  6. package/es/components/ResourceList/ResourceSelect.js +8 -7
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +8 -6
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
  11. package/es/core/editor/components/BackgroundView/index.js +73 -54
  12. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
  13. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -5
  14. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
  15. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
  16. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
  17. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
  18. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
  19. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
  20. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
  21. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
  22. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
  23. package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
  24. package/es/core/editor/utils/copyElementUtil.js +171 -0
  25. package/es/core/hooks/usePolling.js +21 -13
  26. package/es/core/hooks/useResourceConfig.js +37 -21
  27. package/es/core/hooks/useTopoEdit.js +202 -139
  28. package/es/core/models/Alarm.js +104 -38
  29. package/es/core/models/AttributeMetricDisplay.js +36 -14
  30. package/es/core/models/TopoApp.js +197 -75
  31. package/es/core/models/TopoGraphView.js +20 -10
  32. package/es/core/models/cache/CiCache.js +12 -6
  33. package/es/core/models/cache/CiTypeCache.js +20 -10
  34. package/es/core/models/cache/DictCache.js +10 -6
  35. package/es/core/models/graph/Background.js +9 -6
  36. package/es/core/models/plugins/resourceWebControllUrl.js +21 -8
  37. package/es/core/models/tagstips/ElementTagTipConfig.js +20 -10
  38. package/es/core/models/topoData.js +7 -5
  39. package/es/core/models/utils/linkUtils.js +8 -5
  40. package/es/core/services/cmdb/metric.js +7 -5
  41. package/es/core/services/cmdb.js +9 -5
  42. package/es/core/services/index.js +23 -9
  43. package/es/core/services/topo/tagtip.js +7 -5
  44. package/es/core/store/models/customIcon.js +11 -6
  45. package/es/core/utils/imageUtil.js +7 -5
  46. package/es/core/utils/metricUtil.js +5 -0
  47. package/es/core/utils/saveSerialize.js +7 -5
  48. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
  49. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +8 -5
  50. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
  51. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +47 -34
  52. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
  53. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +74 -34
  54. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
  55. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
  56. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -26
  57. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +15 -7
  58. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
  59. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
  60. package/es/networkTopo/components/Link/hook.js +21 -14
  61. package/es/networkTopo/components/Link/index.js +32 -18
  62. package/es/networkTopo/components/Link/setting.js +8 -6
  63. package/es/networkTopo/getTopoData.js +23 -10
  64. package/es/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
  65. package/es/networkTopo/models/TopoCenter.js +24 -10
  66. package/es/networkTopo/services/cmdb.js +333 -233
  67. package/es/networkTopo/services/mdc.js +24 -15
  68. package/es/networkTopo/services/metric.js +16 -11
  69. package/es/networkTopo/services/model.js +412 -283
  70. package/es/networkTopo/utils/exportData.js +7 -5
  71. package/lib/components/BatchAttrMetric/setting.js +1 -1
  72. package/lib/components/MultiResourceDrawer/index.js +8 -6
  73. package/lib/components/ResourceList/ResourceSelect.js +8 -6
  74. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
  75. package/lib/components/SingleResourceDrawer/SelectDrawer.js +8 -6
  76. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
  77. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
  78. package/lib/core/editor/components/BackgroundView/index.js +74 -55
  79. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
  80. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -4
  81. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
  82. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
  83. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
  84. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
  85. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
  86. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
  87. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
  88. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
  89. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
  90. package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
  91. package/lib/core/editor/utils/copyElementUtil.js +182 -0
  92. package/lib/core/hooks/usePolling.js +21 -13
  93. package/lib/core/hooks/useResourceConfig.js +37 -21
  94. package/lib/core/hooks/useTopoEdit.js +202 -139
  95. package/lib/core/models/Alarm.js +104 -38
  96. package/lib/core/models/AttributeMetricDisplay.js +36 -14
  97. package/lib/core/models/TopoApp.js +197 -75
  98. package/lib/core/models/TopoGraphView.js +20 -10
  99. package/lib/core/models/cache/CiCache.js +12 -6
  100. package/lib/core/models/cache/CiTypeCache.js +20 -10
  101. package/lib/core/models/cache/DictCache.js +10 -6
  102. package/lib/core/models/graph/Background.js +9 -6
  103. package/lib/core/models/plugins/resourceWebControllUrl.js +21 -8
  104. package/lib/core/models/tagstips/ElementTagTipConfig.js +20 -10
  105. package/lib/core/models/topoData.js +7 -4
  106. package/lib/core/models/utils/linkUtils.js +8 -4
  107. package/lib/core/services/cmdb/metric.js +7 -4
  108. package/lib/core/services/cmdb.js +9 -4
  109. package/lib/core/services/index.js +21 -8
  110. package/lib/core/services/topo/tagtip.js +7 -4
  111. package/lib/core/store/models/customIcon.js +11 -6
  112. package/lib/core/utils/imageUtil.js +7 -4
  113. package/lib/core/utils/metricUtil.js +5 -0
  114. package/lib/core/utils/saveSerialize.js +7 -4
  115. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
  116. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +9 -6
  117. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
  118. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +49 -36
  119. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
  120. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +73 -35
  121. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
  122. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
  123. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -25
  124. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +14 -6
  125. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
  126. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
  127. package/lib/networkTopo/components/Link/hook.js +23 -15
  128. package/lib/networkTopo/components/Link/index.js +32 -18
  129. package/lib/networkTopo/components/Link/setting.js +8 -6
  130. package/lib/networkTopo/getTopoData.js +23 -10
  131. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
  132. package/lib/networkTopo/models/TopoCenter.js +24 -10
  133. package/lib/networkTopo/services/cmdb.js +336 -235
  134. package/lib/networkTopo/services/mdc.js +24 -14
  135. package/lib/networkTopo/services/metric.js +16 -10
  136. package/lib/networkTopo/services/model.js +414 -284
  137. package/lib/networkTopo/utils/exportData.js +7 -4
  138. package/lib/utils/htElementDataUtil.js +4 -2
  139. package/package.json +3 -2
@@ -1,8 +1,5 @@
1
1
  import _Message from "@alifd/next/es/message";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
-
4
- var _queryWebConsoleUrlById;
5
-
6
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
4
  import { useRequest } from 'ahooks';
8
5
  import topoService from '@riil-frontend/component-topology-common/es/services/topo';
@@ -10,40 +7,43 @@ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
10
7
  import { useEffect, useState } from 'react';
11
8
 
12
9
  function queryWebConsoleUrlById(_x) {
13
- return (_queryWebConsoleUrlById = _queryWebConsoleUrlById || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
10
+ return _queryWebConsoleUrlById.apply(this, arguments);
11
+ }
12
+
13
+ function _queryWebConsoleUrlById() {
14
+ _queryWebConsoleUrlById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
14
15
  var _list, list;
15
16
 
16
- return _regeneratorRuntime.wrap(function _callee$(_context) {
17
- while (1) switch (_context.prev = _context.next) {
17
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
18
+ while (1) switch (_context2.prev = _context2.next) {
18
19
  case 0:
19
- _context.prev = 0;
20
- _context.next = 3;
20
+ _context2.prev = 0;
21
+ _context2.next = 3;
21
22
  return topoService.resourceWebUrl.list([id]);
22
23
 
23
24
  case 3:
24
- list = _context.sent;
25
+ list = _context2.sent;
25
26
  ;
26
- return _context.abrupt("return", (_list = list[list.length - 1]) === null || _list === void 0 ? void 0 : _list.webUrl);
27
+ return _context2.abrupt("return", (_list = list[list.length - 1]) === null || _list === void 0 ? void 0 : _list.webUrl);
27
28
 
28
29
  case 8:
29
- _context.prev = 8;
30
- _context.t0 = _context["catch"](0);
31
- rlog.error('资源web控制台.加载数据异常', _context.t0);
30
+ _context2.prev = 8;
31
+ _context2.t0 = _context2["catch"](0);
32
+ rlog.error('资源web控制台.加载数据异常', _context2.t0);
32
33
 
33
34
  case 11:
34
- return _context.abrupt("return", null);
35
+ return _context2.abrupt("return", null);
35
36
 
36
37
  case 12:
37
38
  case "end":
38
- return _context.stop();
39
+ return _context2.stop();
39
40
  }
40
- }, _callee, null, [[0, 8]]);
41
- }))).apply(this, arguments);
41
+ }, _callee2, null, [[0, 8]]);
42
+ }));
43
+ return _queryWebConsoleUrlById.apply(this, arguments);
42
44
  }
43
45
 
44
46
  export default function useWebConsole(props) {
45
- var _save;
46
-
47
47
  var ciId = props.ciId;
48
48
  var ipv4Address = props.ipv4Address;
49
49
 
@@ -70,11 +70,15 @@ export default function useWebConsole(props) {
70
70
  }, [ciId]); // 保存Web控制台url
71
71
 
72
72
  function save(_x2) {
73
- return (_save = _save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(newWebConsoleUrl) {
74
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
75
- while (1) switch (_context2.prev = _context2.next) {
73
+ return _save.apply(this, arguments);
74
+ }
75
+
76
+ function _save() {
77
+ _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(newWebConsoleUrl) {
78
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
79
+ while (1) switch (_context.prev = _context.next) {
76
80
  case 0:
77
- _context2.next = 2;
81
+ _context.next = 2;
78
82
  return topoService.resourceWebUrl.save(ciId, newWebConsoleUrl || null);
79
83
 
80
84
  case 2:
@@ -82,10 +86,11 @@ export default function useWebConsole(props) {
82
86
 
83
87
  case 3:
84
88
  case "end":
85
- return _context2.stop();
89
+ return _context.stop();
86
90
  }
87
- }, _callee2);
88
- }))).apply(this, arguments);
91
+ }, _callee);
92
+ }));
93
+ return _save.apply(this, arguments);
89
94
  }
90
95
 
91
96
  return {
@@ -1,11 +1,12 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
-
3
- var _queryCiMonitorMetricStrategys, _queryCiMonitorMetricCodes;
4
-
5
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
3
  import { request } from '@riil-frontend/component-topology-utils';
7
4
  export function queryCiMonitorMetricStrategys(_x) {
8
- return (_queryCiMonitorMetricStrategys = _queryCiMonitorMetricStrategys || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
5
+ return _queryCiMonitorMetricStrategys.apply(this, arguments);
6
+ }
7
+
8
+ function _queryCiMonitorMetricStrategys() {
9
+ _queryCiMonitorMetricStrategys = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
9
10
  var map, monitorMetrics;
10
11
  return _regeneratorRuntime.wrap(function _callee$(_context) {
11
12
  while (1) switch (_context.prev = _context.next) {
@@ -25,10 +26,16 @@ export function queryCiMonitorMetricStrategys(_x) {
25
26
  return _context.stop();
26
27
  }
27
28
  }, _callee);
28
- }))).apply(this, arguments);
29
+ }));
30
+ return _queryCiMonitorMetricStrategys.apply(this, arguments);
29
31
  }
32
+
30
33
  export function queryCiMonitorMetricCodes(_x2) {
31
- return (_queryCiMonitorMetricCodes = _queryCiMonitorMetricCodes || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
34
+ return _queryCiMonitorMetricCodes.apply(this, arguments);
35
+ }
36
+
37
+ function _queryCiMonitorMetricCodes() {
38
+ _queryCiMonitorMetricCodes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
32
39
  var arr;
33
40
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
34
41
  while (1) switch (_context2.prev = _context2.next) {
@@ -47,5 +54,6 @@ export function queryCiMonitorMetricCodes(_x2) {
47
54
  return _context2.stop();
48
55
  }
49
56
  }, _callee2);
50
- }))).apply(this, arguments);
57
+ }));
58
+ return _queryCiMonitorMetricCodes.apply(this, arguments);
51
59
  }
@@ -4,14 +4,16 @@ import React, { useState } from 'react';
4
4
  import service from "../../../../../services/overview";
5
5
 
6
6
  function useUserId(props) {
7
- var _fetchUserId;
8
-
9
7
  var _useState = useState(''),
10
8
  userId = _useState[0],
11
9
  setUserId = _useState[1];
12
10
 
13
11
  function fetchUserId() {
14
- return (_fetchUserId = _fetchUserId || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
12
+ return _fetchUserId.apply(this, arguments);
13
+ }
14
+
15
+ function _fetchUserId() {
16
+ _fetchUserId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
15
17
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
16
18
  while (1) switch (_context2.prev = _context2.next) {
17
19
  case 0:
@@ -47,7 +49,8 @@ function useUserId(props) {
47
49
  return _context2.stop();
48
50
  }
49
51
  }, _callee2);
50
- }))).apply(this, arguments);
52
+ }));
53
+ return _fetchUserId.apply(this, arguments);
51
54
  }
52
55
 
53
56
  return {
@@ -9,8 +9,6 @@ import React, { useEffect } from 'react';
9
9
  import styles from "./ResourceWebControllUrlSettingDialog.module.scss";
10
10
  var FormItem = _Form.Item;
11
11
  export default function ResourceWebControllUrlSettingDialog(props) {
12
- var _ref;
13
-
14
12
  var topo = props.topo;
15
13
  var store = topo.store;
16
14
  var resourceWebControllUrl = topo.pluginManager.pluginMap.resourceWebControllUrl;
@@ -35,8 +33,8 @@ export default function ResourceWebControllUrlSettingDialog(props) {
35
33
  });
36
34
  }, [url]);
37
35
 
38
- var submit = function submit() {
39
- return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
36
+ var submit = /*#__PURE__*/function () {
37
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
40
38
  var _yield$field$validate, errors, values;
41
39
 
42
40
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -63,8 +61,12 @@ export default function ResourceWebControllUrlSettingDialog(props) {
63
61
  return _context.stop();
64
62
  }
65
63
  }, _callee);
66
- }))).apply(this, arguments);
67
- };
64
+ }));
65
+
66
+ return function submit() {
67
+ return _ref.apply(this, arguments);
68
+ };
69
+ }();
68
70
 
69
71
  var renameIconForm = /*#__PURE__*/React.createElement(_Form, {
70
72
  field: field,
@@ -2,9 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
4
  var _excluded = ["run"];
5
-
6
- var _updateLink, _saveLink;
7
-
8
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
6
  import { useEffect, useState } from 'react';
10
7
  import { useRequest } from 'ahooks';
@@ -90,7 +87,11 @@ function buildCreateLinkParams(params, discoveryId) {
90
87
 
91
88
 
92
89
  function updateLink(_x, _x2) {
93
- return (_updateLink = _updateLink || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(oldLink, params) {
90
+ return _updateLink.apply(this, arguments);
91
+ }
92
+
93
+ function _updateLink() {
94
+ _updateLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(oldLink, params) {
94
95
  var result, src, dst, srcRelation, dstRelation, srcIsCurrentRelation, dstIsCurrentRelation, onlyChangeOneEnd, createResult;
95
96
  return _regeneratorRuntime.wrap(function _callee$(_context) {
96
97
  while (1) switch (_context.prev = _context.next) {
@@ -151,11 +152,23 @@ function updateLink(_x, _x2) {
151
152
  return _context.stop();
152
153
  }
153
154
  }, _callee);
154
- }))).apply(this, arguments);
155
+ }));
156
+ return _updateLink.apply(this, arguments);
155
157
  }
156
158
 
157
159
  function saveLink(_x3) {
158
- return (_saveLink = _saveLink || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
160
+ return _saveLink.apply(this, arguments);
161
+ }
162
+ /**
163
+ * 保存链路
164
+ * TODO 保存结构的解析未联调(全部保存成功、部分保存成功、全部保存失败回显效果)
165
+ * @param {*} cb 保存成功的回调
166
+ * @returns
167
+ */
168
+
169
+
170
+ function _saveLink() {
171
+ _saveLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
159
172
  var link, values, params, result, _params;
160
173
 
161
174
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -187,15 +200,9 @@ function saveLink(_x3) {
187
200
  return _context2.stop();
188
201
  }
189
202
  }, _callee2);
190
- }))).apply(this, arguments);
203
+ }));
204
+ return _saveLink.apply(this, arguments);
191
205
  }
192
- /**
193
- * 保存链路
194
- * TODO 保存结构的解析未联调(全部保存成功、部分保存成功、全部保存失败回显效果)
195
- * @param {*} cb 保存成功的回调
196
- * @returns
197
- */
198
-
199
206
 
200
207
  export var useSave = function useSave(_ref3) {
201
208
  var cb = _ref3.cb;
@@ -14,8 +14,6 @@ import LinkSetting from "./setting";
14
14
  */
15
15
 
16
16
  var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
17
- var _ref2, _ref3, _ref4, _ref5;
18
-
19
17
  var topoContext = props.topoContext,
20
18
  topo = props.topo;
21
19
  var store = topo.store;
@@ -83,8 +81,8 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
83
81
  }
84
82
  }, [urlParams.showAddLink]); // 链路更新,通过资源重新获取链路信息通知HT来更新
85
83
 
86
- var refreshLink = function refreshLink() {
87
- return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
84
+ var refreshLink = /*#__PURE__*/function () {
85
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
88
86
  var data;
89
87
  return _regeneratorRuntime.wrap(function _callee$(_context) {
90
88
  while (1) switch (_context.prev = _context.next) {
@@ -105,11 +103,15 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
105
103
  return _context.stop();
106
104
  }
107
105
  }, _callee);
108
- }))).apply(this, arguments);
109
- };
106
+ }));
107
+
108
+ return function refreshLink() {
109
+ return _ref2.apply(this, arguments);
110
+ };
111
+ }();
110
112
 
111
- var getLink = function getLink(_x) {
112
- return (_ref3 = _ref3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
113
+ var getLink = /*#__PURE__*/function () {
114
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
113
115
  var data;
114
116
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
115
117
  while (1) switch (_context2.prev = _context2.next) {
@@ -128,11 +130,15 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
128
130
  return _context2.stop();
129
131
  }
130
132
  }, _callee2);
131
- }))).apply(this, arguments);
132
- };
133
+ }));
133
134
 
134
- var updateTopo = useCallback(function (_x2) {
135
- return (_ref4 = _ref4 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data) {
135
+ return function getLink(_x) {
136
+ return _ref3.apply(this, arguments);
137
+ };
138
+ }();
139
+
140
+ var updateTopo = useCallback( /*#__PURE__*/function () {
141
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data) {
136
142
  var changed, isAdd, _data$result$2, oldId, id, linkData;
137
143
 
138
144
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
@@ -177,10 +183,14 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
177
183
  return _context3.stop();
178
184
  }
179
185
  }, _callee3);
180
- }))).apply(this, arguments);
181
- }, []);
182
- var handleSaved = useCallback(function (_x3) {
183
- return (_ref5 = _ref5 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
186
+ }));
187
+
188
+ return function (_x2) {
189
+ return _ref4.apply(this, arguments);
190
+ };
191
+ }(), []);
192
+ var handleSaved = useCallback( /*#__PURE__*/function () {
193
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
184
194
  var errorItems;
185
195
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
186
196
  while (1) switch (_context4.prev = _context4.next) {
@@ -205,8 +215,12 @@ var LinkDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
205
215
  return _context4.stop();
206
216
  }
207
217
  }, _callee4);
208
- }))).apply(this, arguments);
209
- }, []);
218
+ }));
219
+
220
+ return function (_x3) {
221
+ return _ref5.apply(this, arguments);
222
+ };
223
+ }(), []);
210
224
  return /*#__PURE__*/React.createElement(_Drawer, {
211
225
  closeMode: ['close', 'esc'],
212
226
  visible: visible,
@@ -38,8 +38,6 @@ var Title = function Title(_ref) {
38
38
 
39
39
 
40
40
  var LinkSetting = function LinkSetting(_ref2) {
41
- var _ref3;
42
-
43
41
  var link = _ref2.link,
44
42
  topoElements = _ref2.topoElements,
45
43
  topo = _ref2.topo,
@@ -108,8 +106,8 @@ var LinkSetting = function LinkSetting(_ref2) {
108
106
  return validatorErrors;
109
107
  };
110
108
 
111
- var onSave = function onSave() {
112
- return (_ref3 = _ref3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
109
+ var onSave = /*#__PURE__*/function () {
110
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
113
111
  var values, _values$2, src, dst;
114
112
 
115
113
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -156,8 +154,12 @@ var LinkSetting = function LinkSetting(_ref2) {
156
154
  return _context.stop();
157
155
  }
158
156
  }, _callee);
159
- }))).apply(this, arguments);
160
- };
157
+ }));
158
+
159
+ return function onSave() {
160
+ return _ref3.apply(this, arguments);
161
+ };
162
+ }();
161
163
 
162
164
  var formProp = {
163
165
  link: link,
@@ -1,8 +1,5 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
-
4
- var _addLinkData, _buildData, _getTopoData;
5
-
6
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
4
  import { getLinksDetail } from "../core/models/utils/linkUtils";
8
5
  import { addTopoDataResourcePermission } from "./utils/resourcePermissionUtil"; // import "./utils/__tests__/resourcePermissionUtil.test";
@@ -64,7 +61,11 @@ function isNetworkLink(link) {
64
61
  }
65
62
 
66
63
  export function addLinkData(_x) {
67
- return (_addLinkData = _addLinkData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
64
+ return _addLinkData.apply(this, arguments);
65
+ } // FIXME 业务拓扑不需要链路相关逻辑
66
+
67
+ function _addLinkData() {
68
+ _addLinkData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
68
69
  var links, nodes, prevNetworkLinks, networkLinks, otherLinks;
69
70
  return _regeneratorRuntime.wrap(function _callee$(_context) {
70
71
  while (1) switch (_context.prev = _context.next) {
@@ -93,11 +94,16 @@ export function addLinkData(_x) {
93
94
  return _context.stop();
94
95
  }
95
96
  }, _callee);
96
- }))).apply(this, arguments);
97
- } // FIXME 业务拓扑不需要链路相关逻辑
97
+ }));
98
+ return _addLinkData.apply(this, arguments);
99
+ }
98
100
 
99
101
  export function buildData(_x2) {
100
- return (_buildData = _buildData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(oldData) {
102
+ return _buildData.apply(this, arguments);
103
+ }
104
+
105
+ function _buildData() {
106
+ _buildData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(oldData) {
101
107
  var data;
102
108
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
103
109
  while (1) switch (_context2.prev = _context2.next) {
@@ -114,10 +120,16 @@ export function buildData(_x2) {
114
120
  return _context2.stop();
115
121
  }
116
122
  }, _callee2);
117
- }))).apply(this, arguments);
123
+ }));
124
+ return _buildData.apply(this, arguments);
118
125
  }
126
+
119
127
  export default function getTopoData(_x3, _x4) {
120
- return (_getTopoData = _getTopoData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, topoService) {
128
+ return _getTopoData.apply(this, arguments);
129
+ }
130
+
131
+ function _getTopoData() {
132
+ _getTopoData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, topoService) {
121
133
  var data;
122
134
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
123
135
  while (1) switch (_context3.prev = _context3.next) {
@@ -149,5 +161,6 @@ export default function getTopoData(_x3, _x4) {
149
161
  return _context3.stop();
150
162
  }
151
163
  }, _callee3);
152
- }))).apply(this, arguments);
164
+ }));
165
+ return _getTopoData.apply(this, arguments);
153
166
  }
@@ -12,8 +12,6 @@ import { loopTreeFun } from "../../../utils/tree";
12
12
  */
13
13
 
14
14
  export default function useRelateTopo(params) {
15
- var _openLinkedTopo;
16
-
17
15
  var topo = params.topo;
18
16
  var store = topo.store;
19
17
  var topoState = store.useModelState('topoMod');
@@ -56,7 +54,11 @@ export default function useRelateTopo(params) {
56
54
 
57
55
 
58
56
  function openLinkedTopo(_x) {
59
- return (_openLinkedTopo = _openLinkedTopo || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topoId) {
57
+ return _openLinkedTopo.apply(this, arguments);
58
+ }
59
+
60
+ function _openLinkedTopo() {
61
+ _openLinkedTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topoId) {
60
62
  var thumbnailImg;
61
63
  return _regeneratorRuntime.wrap(function _callee$(_context) {
62
64
  while (1) switch (_context.prev = _context.next) {
@@ -93,7 +95,8 @@ export default function useRelateTopo(params) {
93
95
  return _context.stop();
94
96
  }
95
97
  }, _callee);
96
- }))).apply(this, arguments);
98
+ }));
99
+ return _openLinkedTopo.apply(this, arguments);
97
100
  }
98
101
 
99
102
  function returnSourceTopo(data) {
@@ -12,8 +12,6 @@ import { DEFAULT_LINK_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../..
12
12
  import ExtElementTagTipBuilder from "./ExtElementTagTipBuilder";
13
13
 
14
14
  var TopoCenter = /*#__PURE__*/function (_TopoApp) {
15
- var _initData, _exit;
16
-
17
15
  _inheritsLoose(TopoCenter, _TopoApp);
18
16
 
19
17
  function TopoCenter(options) {
@@ -51,8 +49,10 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
51
49
 
52
50
  var _proto = TopoCenter.prototype;
53
51
 
54
- _proto.initData = function initData(_x) {
55
- return (_initData = _initData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
52
+ _proto.initData =
53
+ /*#__PURE__*/
54
+ function () {
55
+ var _initData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
56
56
  var topoDispatchers;
57
57
  return _regeneratorRuntime.wrap(function _callee$(_context) {
58
58
  while (1) switch (_context.prev = _context.next) {
@@ -66,8 +66,14 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
66
66
  return _context.stop();
67
67
  }
68
68
  }, _callee, this);
69
- }))).apply(this, arguments);
70
- };
69
+ }));
70
+
71
+ function initData(_x) {
72
+ return _initData.apply(this, arguments);
73
+ }
74
+
75
+ return initData;
76
+ }();
71
77
 
72
78
  _proto.openTopo = function openTopo(params) {
73
79
  var topoDispatchers = this.store.getModelDispatchers('topoCenter');
@@ -78,8 +84,10 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
78
84
  */
79
85
  ;
80
86
 
81
- _proto.exit = function exit() {
82
- return (_exit = _exit || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
87
+ _proto.exit =
88
+ /*#__PURE__*/
89
+ function () {
90
+ var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
83
91
  var topoDispatchers;
84
92
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
85
93
  while (1) switch (_context2.prev = _context2.next) {
@@ -93,8 +101,14 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
93
101
  return _context2.stop();
94
102
  }
95
103
  }, _callee2, this);
96
- }))).apply(this, arguments);
97
- };
104
+ }));
105
+
106
+ function exit() {
107
+ return _exit.apply(this, arguments);
108
+ }
109
+
110
+ return exit;
111
+ }();
98
112
 
99
113
  _proto.getResourceConfigManager = function getResourceConfigManager() {
100
114
  return this.resourceConfig;