@riil-frontend/component-topology 11.0.34 → 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 (222) 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 +57 -34
  5. package/es/components/BatchAttrMetric/setting.js +1 -1
  6. package/es/components/MultiResourceDrawer/index.js +16 -18
  7. package/es/components/ResourceList/ResourceSelect.js +48 -50
  8. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +24 -26
  9. package/es/components/SingleResourceDrawer/SelectDrawer.js +18 -20
  10. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -25
  11. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
  12. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
  13. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  14. package/es/core/editor/components/BackgroundView/index.js +119 -129
  15. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +20 -22
  16. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  17. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +15 -17
  18. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +7 -9
  19. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
  20. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
  21. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
  22. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +11 -13
  23. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +21 -23
  24. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
  25. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -12
  26. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +21 -27
  27. package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
  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/copyElementUtil.js +171 -0
  32. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  33. package/es/core/hooks/usePolling.js +117 -121
  34. package/es/core/hooks/useResourceConfig.js +58 -66
  35. package/es/core/hooks/useTopoEdit.js +473 -503
  36. package/es/core/models/Alarm.js +281 -298
  37. package/es/core/models/AttributeMetricDisplay.js +101 -107
  38. package/es/core/models/PluginManager.js +4 -3
  39. package/es/core/models/SelectionModel.js +4 -5
  40. package/es/core/models/TopoApp.js +205 -240
  41. package/es/core/models/TopoGraphView.js +18 -21
  42. package/es/core/models/cache/CiCache.js +28 -27
  43. package/es/core/models/cache/CiTypeCache.js +37 -41
  44. package/es/core/models/cache/DictCache.js +33 -35
  45. package/es/core/models/graph/Background.js +15 -17
  46. package/es/core/models/plugins/resourceWebControllUrl.js +76 -82
  47. package/es/core/models/tagstips/ElementTagTipConfig.js +34 -38
  48. package/es/core/models/topoData.js +68 -70
  49. package/es/core/models/utils/linkUtils.js +41 -43
  50. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  51. package/es/core/services/alarm.js +14 -16
  52. package/es/core/services/background.js +59 -67
  53. package/es/core/services/cmdb/metric.js +9 -11
  54. package/es/core/services/cmdb.js +20 -20
  55. package/es/core/services/index.js +39 -45
  56. package/es/core/services/overview.js +131 -151
  57. package/es/core/services/topo/basic.js +37 -41
  58. package/es/core/services/topo/tagtip.js +10 -12
  59. package/es/core/store/models/ciModel.js +58 -62
  60. package/es/core/store/models/customIcon.js +120 -134
  61. package/es/core/store/models/displayConfig.js +15 -19
  62. package/es/core/store/models/selection.js +4 -6
  63. package/es/core/store/models/topoAlarm.js +162 -145
  64. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  65. package/es/core/store/models/topoBizMod.js +9 -11
  66. package/es/core/store/models/topoConfig.js +215 -231
  67. package/es/core/store/models/topoGraphView.js +4 -6
  68. package/es/core/store/models/topoMod.js +373 -395
  69. package/es/core/utils/imageUtil.js +18 -20
  70. package/es/core/utils/metricUtil.js +5 -0
  71. package/es/core/utils/saveSerialize.js +9 -11
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +343 -357
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +189 -205
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
  79. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
  80. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -37
  81. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
  82. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
  83. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +17 -19
  84. package/es/networkTopo/components/Link/hook.js +73 -77
  85. package/es/networkTopo/components/Link/index.js +86 -94
  86. package/es/networkTopo/components/Link/setting.js +42 -44
  87. package/es/networkTopo/getTopoData.js +63 -69
  88. package/es/networkTopo/hooks/viewer/useRelateTopo.js +30 -32
  89. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  90. package/es/networkTopo/models/TopoCenter.js +18 -22
  91. package/es/networkTopo/services/alert.js +18 -22
  92. package/es/networkTopo/services/authorization.js +45 -55
  93. package/es/networkTopo/services/cmdb.js +422 -470
  94. package/es/networkTopo/services/funcAuth.js +22 -24
  95. package/es/networkTopo/services/link.js +107 -117
  96. package/es/networkTopo/services/mdc.js +18 -24
  97. package/es/networkTopo/services/metric.js +23 -27
  98. package/es/networkTopo/services/model.js +445 -509
  99. package/es/networkTopo/services/risk.js +9 -11
  100. package/es/networkTopo/services/topo/auth.js +27 -33
  101. package/es/networkTopo/services/topo/basic.js +251 -289
  102. package/es/networkTopo/services/topo/blacklist.js +20 -24
  103. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  104. package/es/networkTopo/services/topo/icon.js +49 -59
  105. package/es/networkTopo/services/topo/networkLink.js +32 -36
  106. package/es/networkTopo/services/topo/relation.js +9 -11
  107. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  108. package/es/networkTopo/store/functionAuth.js +31 -37
  109. package/es/networkTopo/store/topoCenter.js +142 -152
  110. package/es/networkTopo/store/topoLinkMod.js +4 -6
  111. package/es/networkTopo/store/topoTreeMod.js +170 -182
  112. package/es/networkTopo/utils/exportData.js +52 -54
  113. package/lib/components/BatchAttrMetric/setting.js +1 -1
  114. package/lib/components/MultiResourceDrawer/index.js +16 -18
  115. package/lib/components/ResourceList/ResourceSelect.js +48 -50
  116. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -29
  117. package/lib/components/SingleResourceDrawer/SelectDrawer.js +18 -20
  118. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +30 -32
  119. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
  120. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
  121. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  122. package/lib/core/editor/components/BackgroundView/index.js +118 -128
  123. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -24
  124. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  125. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +19 -21
  126. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -10
  127. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
  128. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
  129. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
  130. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +12 -14
  131. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +26 -28
  132. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
  133. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -14
  134. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +25 -31
  135. package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
  136. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  137. package/lib/core/editor/store/background.js +8 -10
  138. package/lib/core/editor/store/topoEdit.js +4 -6
  139. package/lib/core/editor/utils/copyElementUtil.js +182 -0
  140. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  141. package/lib/core/hooks/usePolling.js +116 -120
  142. package/lib/core/hooks/useResourceConfig.js +58 -66
  143. package/lib/core/hooks/useTopoEdit.js +465 -495
  144. package/lib/core/models/Alarm.js +275 -292
  145. package/lib/core/models/AttributeMetricDisplay.js +104 -110
  146. package/lib/core/models/PluginManager.js +4 -3
  147. package/lib/core/models/SelectionModel.js +4 -5
  148. package/lib/core/models/TopoApp.js +205 -240
  149. package/lib/core/models/TopoGraphView.js +18 -21
  150. package/lib/core/models/cache/CiCache.js +33 -32
  151. package/lib/core/models/cache/CiTypeCache.js +38 -42
  152. package/lib/core/models/cache/DictCache.js +33 -35
  153. package/lib/core/models/graph/Background.js +16 -18
  154. package/lib/core/models/plugins/resourceWebControllUrl.js +74 -80
  155. package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -38
  156. package/lib/core/models/topoData.js +69 -71
  157. package/lib/core/models/utils/linkUtils.js +41 -43
  158. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  159. package/lib/core/services/alarm.js +18 -20
  160. package/lib/core/services/background.js +70 -78
  161. package/lib/core/services/cmdb/metric.js +10 -12
  162. package/lib/core/services/cmdb.js +22 -22
  163. package/lib/core/services/index.js +45 -51
  164. package/lib/core/services/overview.js +131 -151
  165. package/lib/core/services/topo/basic.js +37 -41
  166. package/lib/core/services/topo/tagtip.js +12 -14
  167. package/lib/core/store/models/ciModel.js +66 -70
  168. package/lib/core/store/models/customIcon.js +120 -134
  169. package/lib/core/store/models/displayConfig.js +15 -19
  170. package/lib/core/store/models/selection.js +4 -6
  171. package/lib/core/store/models/topoAlarm.js +163 -145
  172. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  173. package/lib/core/store/models/topoBizMod.js +9 -11
  174. package/lib/core/store/models/topoConfig.js +222 -238
  175. package/lib/core/store/models/topoGraphView.js +4 -6
  176. package/lib/core/store/models/topoMod.js +375 -397
  177. package/lib/core/utils/imageUtil.js +22 -24
  178. package/lib/core/utils/metricUtil.js +5 -0
  179. package/lib/core/utils/saveSerialize.js +9 -11
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +344 -358
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
  185. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +190 -206
  186. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
  187. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
  188. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +29 -33
  189. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
  190. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
  191. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -20
  192. package/lib/networkTopo/components/Link/hook.js +73 -77
  193. package/lib/networkTopo/components/Link/index.js +87 -95
  194. package/lib/networkTopo/components/Link/setting.js +42 -44
  195. package/lib/networkTopo/getTopoData.js +63 -69
  196. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -33
  197. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  198. package/lib/networkTopo/models/TopoCenter.js +18 -22
  199. package/lib/networkTopo/services/alert.js +18 -22
  200. package/lib/networkTopo/services/authorization.js +55 -65
  201. package/lib/networkTopo/services/cmdb.js +422 -470
  202. package/lib/networkTopo/services/funcAuth.js +24 -26
  203. package/lib/networkTopo/services/link.js +108 -118
  204. package/lib/networkTopo/services/mdc.js +21 -27
  205. package/lib/networkTopo/services/metric.js +27 -31
  206. package/lib/networkTopo/services/model.js +445 -509
  207. package/lib/networkTopo/services/risk.js +11 -13
  208. package/lib/networkTopo/services/topo/auth.js +27 -33
  209. package/lib/networkTopo/services/topo/basic.js +252 -290
  210. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  211. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  212. package/lib/networkTopo/services/topo/icon.js +59 -69
  213. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  214. package/lib/networkTopo/services/topo/relation.js +11 -13
  215. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  216. package/lib/networkTopo/store/functionAuth.js +31 -37
  217. package/lib/networkTopo/store/topoCenter.js +142 -152
  218. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  219. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  220. package/lib/networkTopo/utils/exportData.js +59 -61
  221. package/lib/utils/htElementDataUtil.js +4 -2
  222. package/package.json +5 -3
@@ -37,21 +37,19 @@ var _excluded = ["checkAuth"],
37
37
  var queryById = /*#__PURE__*/function () {
38
38
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(id) {
39
39
  return _regenerator["default"].wrap(function _callee$(_context) {
40
- while (1) {
41
- switch (_context.prev = _context.next) {
42
- case 0:
43
- _context.next = 2;
44
- return _componentTopologyUtils.request.post('/mdc/v1/api/cmdb/queryCiById', {
45
- id: id
46
- });
47
-
48
- case 2:
49
- return _context.abrupt("return", _context.sent);
50
-
51
- case 3:
52
- case "end":
53
- return _context.stop();
54
- }
40
+ while (1) switch (_context.prev = _context.next) {
41
+ case 0:
42
+ _context.next = 2;
43
+ return _componentTopologyUtils.request.post('/mdc/v1/api/cmdb/queryCiById', {
44
+ id: id
45
+ });
46
+
47
+ case 2:
48
+ return _context.abrupt("return", _context.sent);
49
+
50
+ case 3:
51
+ case "end":
52
+ return _context.stop();
55
53
  }
56
54
  }, _callee);
57
55
  }));
@@ -76,21 +74,19 @@ exports.queryById = queryById;
76
74
  var deleteById = /*#__PURE__*/function () {
77
75
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
78
76
  return _regenerator["default"].wrap(function _callee2$(_context2) {
79
- while (1) {
80
- switch (_context2.prev = _context2.next) {
81
- case 0:
82
- _context2.next = 2;
83
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/deleteById', {
84
- id: id
85
- });
86
-
87
- case 2:
88
- return _context2.abrupt("return", _context2.sent);
89
-
90
- case 3:
91
- case "end":
92
- return _context2.stop();
93
- }
77
+ while (1) switch (_context2.prev = _context2.next) {
78
+ case 0:
79
+ _context2.next = 2;
80
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/deleteById', {
81
+ id: id
82
+ });
83
+
84
+ case 2:
85
+ return _context2.abrupt("return", _context2.sent);
86
+
87
+ case 3:
88
+ case "end":
89
+ return _context2.stop();
94
90
  }
95
91
  }, _callee2);
96
92
  }));
@@ -116,29 +112,27 @@ var batchDeleteById = /*#__PURE__*/function () {
116
112
  var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(keys) {
117
113
  var ids;
118
114
  return _regenerator["default"].wrap(function _callee3$(_context3) {
119
- while (1) {
120
- switch (_context3.prev = _context3.next) {
121
- case 0:
122
- if (keys === void 0) {
123
- keys = [];
124
- }
115
+ while (1) switch (_context3.prev = _context3.next) {
116
+ case 0:
117
+ if (keys === void 0) {
118
+ keys = [];
119
+ }
120
+
121
+ // TODO 替换为map
122
+ ids = keys.map(function (key) {
123
+ return {
124
+ id: key
125
+ };
126
+ });
127
+ _context3.next = 4;
128
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
125
129
 
126
- // TODO 替换为map
127
- ids = keys.map(function (key) {
128
- return {
129
- id: key
130
- };
131
- });
132
- _context3.next = 4;
133
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
134
-
135
- case 4:
136
- return _context3.abrupt("return", _context3.sent);
137
-
138
- case 5:
139
- case "end":
140
- return _context3.stop();
141
- }
130
+ case 4:
131
+ return _context3.abrupt("return", _context3.sent);
132
+
133
+ case 5:
134
+ case "end":
135
+ return _context3.stop();
142
136
  }
143
137
  }, _callee3);
144
138
  }));
@@ -172,83 +166,81 @@ var fetchCommonQuery = /*#__PURE__*/function () {
172
166
  var newCondition, _ref5, _ref5$checkAuth, checkAuth, otherOption, url, sorts, params, response, _ref6, totalPage, pageIndex, data, result;
173
167
 
174
168
  return _regenerator["default"].wrap(function _callee4$(_context4) {
175
- while (1) {
176
- switch (_context4.prev = _context4.next) {
177
- case 0:
178
- newCondition = condition;
179
-
180
- if (typeof newCondition !== 'string') {
181
- newCondition = Object.keys(newCondition).reduce(function (param, current) {
182
- if (current === 'ciType') {
183
- param.push("type(" + (Array.isArray(newCondition[current]) ? newCondition[current].map(function (item) {
184
- return "'" + item + "'";
185
- }).toString() : "'" + newCondition[current] + "'") + ")");
186
- } else if (current === 'principal') {
187
- param.push(newCondition[current]);
188
- } else if (current === 'searchValue' && newCondition.searchValue && newCondition.searchIndexArray) {
189
- param.push("contain('" + newCondition.searchValue + "'," + newCondition.searchIndexArray.toString() + ")");
190
- } else if (current === 'alert') {
191
- var alert = Object.keys(newCondition[current]).map(function (item) {
192
- return item + " = " + newCondition[current][item];
193
- }).join(' && ');
194
- param.push("alert(" + alert + ")");
195
- }
196
-
197
- return param;
198
- }, []).join(' && ');
199
- }
200
-
201
- _ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = (0, _objectWithoutPropertiesLoose2["default"])(_ref5, _excluded); // const url = checkAuth
202
- // ? '/appserver/api/v1/cmdb/ci/commonQuery'
203
- // : '/api/v1/cmdb/ci/commonQuery';
204
- // const url ='/api/v1/cmdb/ci/commonQuery';
205
- // let params = {
206
- // condition: condition.conditions
207
- // ? `${newCondition} && ${condition.conditions}`
208
- // : newCondition,
209
- // sort: sort || `${sortIndex} ${sortMethod}`,
210
- // currentPage,
211
- // pageSize,
212
- // };
213
- // APPBIR MVP
214
- // ------------------------------------------------
215
- // TODO important 带确认权限接口是否可通 ---
216
-
217
- url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
218
- sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
219
- params = {
220
- condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
221
- // APPBIR MVP 临时去掉排序 等接口OK
222
- // orders: [{
223
- // name: sorts[0],
224
- // type: sorts[1]
225
- // }],
226
- pageIndex: currentPage,
227
- pageSize: pageSize
228
- };
229
-
230
- if (checkAuth && otherOption) {
231
- params = (0, _extends2["default"])({}, params, otherOption);
232
- } // 处理 返回结果
233
-
234
-
235
- _context4.next = 9;
236
- return _componentTopologyUtils.request.post(url, params);
237
-
238
- case 9:
239
- response = _context4.sent;
240
- // TODO ---
241
- _ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = (0, _objectWithoutPropertiesLoose2["default"])(_ref6, _excluded2);
242
- return _context4.abrupt("return", (0, _extends2["default"])({}, result, {
243
- total: totalPage,
244
- page: pageIndex,
245
- content: data
246
- }));
169
+ while (1) switch (_context4.prev = _context4.next) {
170
+ case 0:
171
+ newCondition = condition;
172
+
173
+ if (typeof newCondition !== 'string') {
174
+ newCondition = Object.keys(newCondition).reduce(function (param, current) {
175
+ if (current === 'ciType') {
176
+ param.push("type(" + (Array.isArray(newCondition[current]) ? newCondition[current].map(function (item) {
177
+ return "'" + item + "'";
178
+ }).toString() : "'" + newCondition[current] + "'") + ")");
179
+ } else if (current === 'principal') {
180
+ param.push(newCondition[current]);
181
+ } else if (current === 'searchValue' && newCondition.searchValue && newCondition.searchIndexArray) {
182
+ param.push("contain('" + newCondition.searchValue + "'," + newCondition.searchIndexArray.toString() + ")");
183
+ } else if (current === 'alert') {
184
+ var alert = Object.keys(newCondition[current]).map(function (item) {
185
+ return item + " = " + newCondition[current][item];
186
+ }).join(' && ');
187
+ param.push("alert(" + alert + ")");
188
+ }
247
189
 
248
- case 12:
249
- case "end":
250
- return _context4.stop();
251
- }
190
+ return param;
191
+ }, []).join(' && ');
192
+ }
193
+
194
+ _ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = (0, _objectWithoutPropertiesLoose2["default"])(_ref5, _excluded); // const url = checkAuth
195
+ // ? '/appserver/api/v1/cmdb/ci/commonQuery'
196
+ // : '/api/v1/cmdb/ci/commonQuery';
197
+ // const url ='/api/v1/cmdb/ci/commonQuery';
198
+ // let params = {
199
+ // condition: condition.conditions
200
+ // ? `${newCondition} && ${condition.conditions}`
201
+ // : newCondition,
202
+ // sort: sort || `${sortIndex} ${sortMethod}`,
203
+ // currentPage,
204
+ // pageSize,
205
+ // };
206
+ // APPBIR MVP
207
+ // ------------------------------------------------
208
+ // TODO important 带确认权限接口是否可通 ---
209
+
210
+ url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
211
+ sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
212
+ params = {
213
+ condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
214
+ // APPBIR MVP 临时去掉排序 等接口OK
215
+ // orders: [{
216
+ // name: sorts[0],
217
+ // type: sorts[1]
218
+ // }],
219
+ pageIndex: currentPage,
220
+ pageSize: pageSize
221
+ };
222
+
223
+ if (checkAuth && otherOption) {
224
+ params = (0, _extends2["default"])({}, params, otherOption);
225
+ } // 处理 返回结果
226
+
227
+
228
+ _context4.next = 9;
229
+ return _componentTopologyUtils.request.post(url, params);
230
+
231
+ case 9:
232
+ response = _context4.sent;
233
+ // TODO ---
234
+ _ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = (0, _objectWithoutPropertiesLoose2["default"])(_ref6, _excluded2);
235
+ return _context4.abrupt("return", (0, _extends2["default"])({}, result, {
236
+ total: totalPage,
237
+ page: pageIndex,
238
+ content: data
239
+ }));
240
+
241
+ case 12:
242
+ case "end":
243
+ return _context4.stop();
252
244
  }
253
245
  }, _callee4);
254
246
  }));
@@ -274,19 +266,17 @@ function commonQuery(_x11) {
274
266
  function _commonQuery() {
275
267
  _commonQuery = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18(param) {
276
268
  return _regenerator["default"].wrap(function _callee18$(_context18) {
277
- while (1) {
278
- switch (_context18.prev = _context18.next) {
279
- case 0:
280
- _context18.next = 2;
281
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonQuery', param);
282
-
283
- case 2:
284
- return _context18.abrupt("return", _context18.sent);
285
-
286
- case 3:
287
- case "end":
288
- return _context18.stop();
289
- }
269
+ while (1) switch (_context18.prev = _context18.next) {
270
+ case 0:
271
+ _context18.next = 2;
272
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonQuery', param);
273
+
274
+ case 2:
275
+ return _context18.abrupt("return", _context18.sent);
276
+
277
+ case 3:
278
+ case "end":
279
+ return _context18.stop();
290
280
  }
291
281
  }, _callee18);
292
282
  }));
@@ -298,54 +288,52 @@ var batchUpdateAttributes = /*#__PURE__*/function () {
298
288
  var aa, _aa;
299
289
 
300
290
  return _regenerator["default"].wrap(function _callee5$(_context5) {
301
- while (1) {
302
- switch (_context5.prev = _context5.next) {
303
- case 0:
304
- if (!fieldName) {
305
- _context5.next = 8;
306
- break;
307
- }
308
-
309
- // 传了要更新的属性名,更新某一个属性
310
- aa = {};
311
- aa[fieldName] = values[fieldName];
312
- _context5.next = 5;
313
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
314
- id: values.id,
315
- attributes: aa
316
- }]);
317
-
318
- case 5:
319
- return _context5.abrupt("return", _context5.sent);
320
-
321
- case 8:
322
- if (!Array.isArray(values)) {
323
- _context5.next = 12;
324
- break;
325
- }
326
-
327
- _context5.next = 11;
328
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', values);
329
-
330
- case 11:
331
- return _context5.abrupt("return", _context5.sent);
332
-
333
- case 12:
334
- _aa = values.id;
335
- delete values.id;
336
- _context5.next = 16;
337
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
338
- id: _aa,
339
- attributes: values
340
- }]);
341
-
342
- case 16:
343
- return _context5.abrupt("return", _context5.sent);
344
-
345
- case 17:
346
- case "end":
347
- return _context5.stop();
348
- }
291
+ while (1) switch (_context5.prev = _context5.next) {
292
+ case 0:
293
+ if (!fieldName) {
294
+ _context5.next = 8;
295
+ break;
296
+ }
297
+
298
+ // 传了要更新的属性名,更新某一个属性
299
+ aa = {};
300
+ aa[fieldName] = values[fieldName];
301
+ _context5.next = 5;
302
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
303
+ id: values.id,
304
+ attributes: aa
305
+ }]);
306
+
307
+ case 5:
308
+ return _context5.abrupt("return", _context5.sent);
309
+
310
+ case 8:
311
+ if (!Array.isArray(values)) {
312
+ _context5.next = 12;
313
+ break;
314
+ }
315
+
316
+ _context5.next = 11;
317
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', values);
318
+
319
+ case 11:
320
+ return _context5.abrupt("return", _context5.sent);
321
+
322
+ case 12:
323
+ _aa = values.id;
324
+ delete values.id;
325
+ _context5.next = 16;
326
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
327
+ id: _aa,
328
+ attributes: values
329
+ }]);
330
+
331
+ case 16:
332
+ return _context5.abrupt("return", _context5.sent);
333
+
334
+ case 17:
335
+ case "end":
336
+ return _context5.stop();
349
337
  }
350
338
  }, _callee5);
351
339
  }));
@@ -361,19 +349,17 @@ exports.batchUpdateAttributes = batchUpdateAttributes;
361
349
  var createInstance = /*#__PURE__*/function () {
362
350
  var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(values) {
363
351
  return _regenerator["default"].wrap(function _callee6$(_context6) {
364
- while (1) {
365
- switch (_context6.prev = _context6.next) {
366
- case 0:
367
- _context6.next = 2;
368
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/create', values);
369
-
370
- case 2:
371
- return _context6.abrupt("return", _context6.sent);
372
-
373
- case 3:
374
- case "end":
375
- return _context6.stop();
376
- }
352
+ while (1) switch (_context6.prev = _context6.next) {
353
+ case 0:
354
+ _context6.next = 2;
355
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/create', values);
356
+
357
+ case 2:
358
+ return _context6.abrupt("return", _context6.sent);
359
+
360
+ case 3:
361
+ case "end":
362
+ return _context6.stop();
377
363
  }
378
364
  }, _callee6);
379
365
  }));
@@ -404,19 +390,17 @@ function changeManageStatus(_x15) {
404
390
  function _changeManageStatus() {
405
391
  _changeManageStatus = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee19(param) {
406
392
  return _regenerator["default"].wrap(function _callee19$(_context19) {
407
- while (1) {
408
- switch (_context19.prev = _context19.next) {
409
- case 0:
410
- _context19.next = 2;
411
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/changeManageStatus', param);
412
-
413
- case 2:
414
- return _context19.abrupt("return", _context19.sent);
415
-
416
- case 3:
417
- case "end":
418
- return _context19.stop();
419
- }
393
+ while (1) switch (_context19.prev = _context19.next) {
394
+ case 0:
395
+ _context19.next = 2;
396
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/changeManageStatus', param);
397
+
398
+ case 2:
399
+ return _context19.abrupt("return", _context19.sent);
400
+
401
+ case 3:
402
+ case "end":
403
+ return _context19.stop();
420
404
  }
421
405
  }, _callee19);
422
406
  }));
@@ -440,19 +424,17 @@ function batchChangeManageStatus(_x16) {
440
424
  function _batchChangeManageStatus() {
441
425
  _batchChangeManageStatus = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee20(param) {
442
426
  return _regenerator["default"].wrap(function _callee20$(_context20) {
443
- while (1) {
444
- switch (_context20.prev = _context20.next) {
445
- case 0:
446
- _context20.next = 2;
447
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchChangeManageStatus', param);
448
-
449
- case 2:
450
- return _context20.abrupt("return", _context20.sent);
451
-
452
- case 3:
453
- case "end":
454
- return _context20.stop();
455
- }
427
+ while (1) switch (_context20.prev = _context20.next) {
428
+ case 0:
429
+ _context20.next = 2;
430
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchChangeManageStatus', param);
431
+
432
+ case 2:
433
+ return _context20.abrupt("return", _context20.sent);
434
+
435
+ case 3:
436
+ case "end":
437
+ return _context20.stop();
456
438
  }
457
439
  }, _callee20);
458
440
  }));
@@ -472,19 +454,17 @@ function commonCount(_x17) {
472
454
  function _commonCount() {
473
455
  _commonCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee21(param) {
474
456
  return _regenerator["default"].wrap(function _callee21$(_context21) {
475
- while (1) {
476
- switch (_context21.prev = _context21.next) {
477
- case 0:
478
- _context21.next = 2;
479
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonCount', param);
480
-
481
- case 2:
482
- return _context21.abrupt("return", _context21.sent);
483
-
484
- case 3:
485
- case "end":
486
- return _context21.stop();
487
- }
457
+ while (1) switch (_context21.prev = _context21.next) {
458
+ case 0:
459
+ _context21.next = 2;
460
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonCount', param);
461
+
462
+ case 2:
463
+ return _context21.abrupt("return", _context21.sent);
464
+
465
+ case 3:
466
+ case "end":
467
+ return _context21.stop();
488
468
  }
489
469
  }, _callee21);
490
470
  }));
@@ -507,19 +487,17 @@ function queryCiWithComponents(_x18) {
507
487
  function _queryCiWithComponents() {
508
488
  _queryCiWithComponents = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee22(mainCiIds) {
509
489
  return _regenerator["default"].wrap(function _callee22$(_context22) {
510
- while (1) {
511
- switch (_context22.prev = _context22.next) {
512
- case 0:
513
- _context22.next = 2;
514
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/queryCiWithComponents', mainCiIds);
515
-
516
- case 2:
517
- return _context22.abrupt("return", _context22.sent);
518
-
519
- case 3:
520
- case "end":
521
- return _context22.stop();
522
- }
490
+ while (1) switch (_context22.prev = _context22.next) {
491
+ case 0:
492
+ _context22.next = 2;
493
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/queryCiWithComponents', mainCiIds);
494
+
495
+ case 2:
496
+ return _context22.abrupt("return", _context22.sent);
497
+
498
+ case 3:
499
+ case "end":
500
+ return _context22.stop();
523
501
  }
524
502
  }, _callee22);
525
503
  }));
@@ -538,27 +516,25 @@ function queryPageIgnoreRelations(_x19, _x20, _x21, _x22, _x23) {
538
516
  function _queryPageIgnoreRelations() {
539
517
  _queryPageIgnoreRelations = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee23(relationType, currentPage, pageSize, condition, sort) {
540
518
  return _regenerator["default"].wrap(function _callee23$(_context23) {
541
- while (1) {
542
- switch (_context23.prev = _context23.next) {
543
- case 0:
544
- _context23.next = 2;
545
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/list', (0, _extends2["default"])({
546
- relationType: relationType,
547
- currentPage: currentPage,
548
- pageSize: pageSize
549
- }, condition ? {
550
- condition: condition
551
- } : {}, sort ? {
552
- sort: sort
553
- } : {}));
554
-
555
- case 2:
556
- return _context23.abrupt("return", _context23.sent);
557
-
558
- case 3:
559
- case "end":
560
- return _context23.stop();
561
- }
519
+ while (1) switch (_context23.prev = _context23.next) {
520
+ case 0:
521
+ _context23.next = 2;
522
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/list', (0, _extends2["default"])({
523
+ relationType: relationType,
524
+ currentPage: currentPage,
525
+ pageSize: pageSize
526
+ }, condition ? {
527
+ condition: condition
528
+ } : {}, sort ? {
529
+ sort: sort
530
+ } : {}));
531
+
532
+ case 2:
533
+ return _context23.abrupt("return", _context23.sent);
534
+
535
+ case 3:
536
+ case "end":
537
+ return _context23.stop();
562
538
  }
563
539
  }, _callee23);
564
540
  }));
@@ -573,23 +549,21 @@ function deleteIgnoreRelations(_x24) {
573
549
  function _deleteIgnoreRelations() {
574
550
  _deleteIgnoreRelations = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee24(ids) {
575
551
  return _regenerator["default"].wrap(function _callee24$(_context24) {
576
- while (1) {
577
- switch (_context24.prev = _context24.next) {
578
- case 0:
579
- _context24.next = 2;
580
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/batchDeleteById', ids.map(function (id) {
581
- return {
582
- id: id
583
- };
584
- }));
585
-
586
- case 2:
587
- return _context24.abrupt("return", _context24.sent);
588
-
589
- case 3:
590
- case "end":
591
- return _context24.stop();
592
- }
552
+ while (1) switch (_context24.prev = _context24.next) {
553
+ case 0:
554
+ _context24.next = 2;
555
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/batchDeleteById', ids.map(function (id) {
556
+ return {
557
+ id: id
558
+ };
559
+ }));
560
+
561
+ case 2:
562
+ return _context24.abrupt("return", _context24.sent);
563
+
564
+ case 3:
565
+ case "end":
566
+ return _context24.stop();
593
567
  }
594
568
  }, _callee24);
595
569
  }));
@@ -600,38 +574,36 @@ var uploadFile = /*#__PURE__*/function () {
600
574
  var _ref9 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(files, userId, modelType) {
601
575
  var formData, names, originFiles, config, result;
602
576
  return _regenerator["default"].wrap(function _callee7$(_context7) {
603
- while (1) {
604
- switch (_context7.prev = _context7.next) {
605
- case 0:
606
- formData = new FormData(); // 用户id
607
-
608
- formData.append('userId', userId);
609
- modelType && formData.append('modelType', modelType);
610
- names = [];
611
- originFiles = [];
612
- files.forEach(function (_ref10) {
613
- var name = _ref10.name,
614
- originFileObj = _ref10.originFileObj;
615
- names.push(name);
616
- originFiles.push(originFileObj);
617
- formData.append('files', originFileObj, name);
618
- });
619
- config = {
620
- headers: {
621
- 'Content-Type': "multipart/form-data;boundary=" + new Date().getTime()
622
- }
623
- };
624
- _context7.next = 9;
625
- return _componentTopologyUtils.request.post('/cmdb/v1/api/import', formData, config);
577
+ while (1) switch (_context7.prev = _context7.next) {
578
+ case 0:
579
+ formData = new FormData(); // 用户id
580
+
581
+ formData.append('userId', userId);
582
+ modelType && formData.append('modelType', modelType);
583
+ names = [];
584
+ originFiles = [];
585
+ files.forEach(function (_ref10) {
586
+ var name = _ref10.name,
587
+ originFileObj = _ref10.originFileObj;
588
+ names.push(name);
589
+ originFiles.push(originFileObj);
590
+ formData.append('files', originFileObj, name);
591
+ });
592
+ config = {
593
+ headers: {
594
+ 'Content-Type': "multipart/form-data;boundary=" + new Date().getTime()
595
+ }
596
+ };
597
+ _context7.next = 9;
598
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/import', formData, config);
626
599
 
627
- case 9:
628
- result = _context7.sent;
629
- return _context7.abrupt("return", result);
600
+ case 9:
601
+ result = _context7.sent;
602
+ return _context7.abrupt("return", result);
630
603
 
631
- case 11:
632
- case "end":
633
- return _context7.stop();
634
- }
604
+ case 11:
605
+ case "end":
606
+ return _context7.stop();
635
607
  }
636
608
  }, _callee7);
637
609
  }));
@@ -648,23 +620,21 @@ var closeRecord = /*#__PURE__*/function () {
648
620
  var _ref11 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(userId, modelType) {
649
621
  var result;
650
622
  return _regenerator["default"].wrap(function _callee8$(_context8) {
651
- while (1) {
652
- switch (_context8.prev = _context8.next) {
653
- case 0:
654
- _context8.next = 2;
655
- return _componentTopologyUtils.request.post('/cmdb/v1/api/delete/import/record', {
656
- userId: userId,
657
- modelType: modelType
658
- });
659
-
660
- case 2:
661
- result = _context8.sent;
662
- return _context8.abrupt("return", result);
663
-
664
- case 4:
665
- case "end":
666
- return _context8.stop();
667
- }
623
+ while (1) switch (_context8.prev = _context8.next) {
624
+ case 0:
625
+ _context8.next = 2;
626
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/delete/import/record', {
627
+ userId: userId,
628
+ modelType: modelType
629
+ });
630
+
631
+ case 2:
632
+ result = _context8.sent;
633
+ return _context8.abrupt("return", result);
634
+
635
+ case 4:
636
+ case "end":
637
+ return _context8.stop();
668
638
  }
669
639
  }, _callee8);
670
640
  }));
@@ -680,22 +650,20 @@ exports.closeRecord = closeRecord;
680
650
  var getRecord = /*#__PURE__*/function () {
681
651
  var _ref12 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(userId, modelType) {
682
652
  return _regenerator["default"].wrap(function _callee9$(_context9) {
683
- while (1) {
684
- switch (_context9.prev = _context9.next) {
685
- case 0:
686
- _context9.next = 2;
687
- return _componentTopologyUtils.request.post('/cmdb/v1/api/get/import/record', {
688
- userId: userId,
689
- modelType: modelType
690
- });
691
-
692
- case 2:
693
- return _context9.abrupt("return", _context9.sent);
694
-
695
- case 3:
696
- case "end":
697
- return _context9.stop();
698
- }
653
+ while (1) switch (_context9.prev = _context9.next) {
654
+ case 0:
655
+ _context9.next = 2;
656
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/get/import/record', {
657
+ userId: userId,
658
+ modelType: modelType
659
+ });
660
+
661
+ case 2:
662
+ return _context9.abrupt("return", _context9.sent);
663
+
664
+ case 3:
665
+ case "end":
666
+ return _context9.stop();
699
667
  }
700
668
  }, _callee9);
701
669
  }));
@@ -716,19 +684,17 @@ exports.getRecord = getRecord;
716
684
  var batchCreateRelation = /*#__PURE__*/function () {
717
685
  var _ref13 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(params) {
718
686
  return _regenerator["default"].wrap(function _callee10$(_context10) {
719
- while (1) {
720
- switch (_context10.prev = _context10.next) {
721
- case 0:
722
- _context10.next = 2;
723
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchCreate', params);
724
-
725
- case 2:
726
- return _context10.abrupt("return", _context10.sent);
727
-
728
- case 3:
729
- case "end":
730
- return _context10.stop();
731
- }
687
+ while (1) switch (_context10.prev = _context10.next) {
688
+ case 0:
689
+ _context10.next = 2;
690
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchCreate', params);
691
+
692
+ case 2:
693
+ return _context10.abrupt("return", _context10.sent);
694
+
695
+ case 3:
696
+ case "end":
697
+ return _context10.stop();
732
698
  }
733
699
  }, _callee10);
734
700
  }));
@@ -743,21 +709,19 @@ exports.batchCreateRelation = batchCreateRelation;
743
709
  var queryRelationByEndpoint = /*#__PURE__*/function () {
744
710
  var _ref14 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(id) {
745
711
  return _regenerator["default"].wrap(function _callee11$(_context11) {
746
- while (1) {
747
- switch (_context11.prev = _context11.next) {
748
- case 0:
749
- _context11.next = 2;
750
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/queryByEndpoint', {
751
- id: id
752
- });
753
-
754
- case 2:
755
- return _context11.abrupt("return", _context11.sent);
756
-
757
- case 3:
758
- case "end":
759
- return _context11.stop();
760
- }
712
+ while (1) switch (_context11.prev = _context11.next) {
713
+ case 0:
714
+ _context11.next = 2;
715
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/queryByEndpoint', {
716
+ id: id
717
+ });
718
+
719
+ case 2:
720
+ return _context11.abrupt("return", _context11.sent);
721
+
722
+ case 3:
723
+ case "end":
724
+ return _context11.stop();
761
725
  }
762
726
  }, _callee11);
763
727
  }));
@@ -778,19 +742,17 @@ exports.queryRelationByEndpoint = queryRelationByEndpoint;
778
742
  var batchUpdateRelation = /*#__PURE__*/function () {
779
743
  var _ref15 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(params) {
780
744
  return _regenerator["default"].wrap(function _callee12$(_context12) {
781
- while (1) {
782
- switch (_context12.prev = _context12.next) {
783
- case 0:
784
- _context12.next = 2;
785
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchUpdateAttributes', params);
786
-
787
- case 2:
788
- return _context12.abrupt("return", _context12.sent);
789
-
790
- case 3:
791
- case "end":
792
- return _context12.stop();
793
- }
745
+ while (1) switch (_context12.prev = _context12.next) {
746
+ case 0:
747
+ _context12.next = 2;
748
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchUpdateAttributes', params);
749
+
750
+ case 2:
751
+ return _context12.abrupt("return", _context12.sent);
752
+
753
+ case 3:
754
+ case "end":
755
+ return _context12.stop();
794
756
  }
795
757
  }, _callee12);
796
758
  }));
@@ -811,21 +773,19 @@ exports.batchUpdateRelation = batchUpdateRelation;
811
773
  var deleteRelation = /*#__PURE__*/function () {
812
774
  var _ref16 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(id) {
813
775
  return _regenerator["default"].wrap(function _callee13$(_context13) {
814
- while (1) {
815
- switch (_context13.prev = _context13.next) {
816
- case 0:
817
- _context13.next = 2;
818
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/delete', {
819
- id: id
820
- });
821
-
822
- case 2:
823
- return _context13.abrupt("return", _context13.sent);
824
-
825
- case 3:
826
- case "end":
827
- return _context13.stop();
828
- }
776
+ while (1) switch (_context13.prev = _context13.next) {
777
+ case 0:
778
+ _context13.next = 2;
779
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/delete', {
780
+ id: id
781
+ });
782
+
783
+ case 2:
784
+ return _context13.abrupt("return", _context13.sent);
785
+
786
+ case 3:
787
+ case "end":
788
+ return _context13.stop();
829
789
  }
830
790
  }, _callee13);
831
791
  }));
@@ -846,19 +806,17 @@ exports.deleteRelation = deleteRelation;
846
806
  var batchDeleteRelation = /*#__PURE__*/function () {
847
807
  var _ref17 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(params) {
848
808
  return _regenerator["default"].wrap(function _callee14$(_context14) {
849
- while (1) {
850
- switch (_context14.prev = _context14.next) {
851
- case 0:
852
- _context14.next = 2;
853
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchDelete', params);
854
-
855
- case 2:
856
- return _context14.abrupt("return", _context14.sent);
857
-
858
- case 3:
859
- case "end":
860
- return _context14.stop();
861
- }
809
+ while (1) switch (_context14.prev = _context14.next) {
810
+ case 0:
811
+ _context14.next = 2;
812
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchDelete', params);
813
+
814
+ case 2:
815
+ return _context14.abrupt("return", _context14.sent);
816
+
817
+ case 3:
818
+ case "end":
819
+ return _context14.stop();
862
820
  }
863
821
  }, _callee14);
864
822
  }));
@@ -879,22 +837,20 @@ exports.batchDeleteRelation = batchDeleteRelation;
879
837
  var forceDeleteRelation = /*#__PURE__*/function () {
880
838
  var _ref18 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(id) {
881
839
  return _regenerator["default"].wrap(function _callee15$(_context15) {
882
- while (1) {
883
- switch (_context15.prev = _context15.next) {
884
- case 0:
885
- _context15.next = 2;
886
- return batchDeleteRelation([{
887
- id: id,
888
- force: true
889
- }]);
890
-
891
- case 2:
892
- return _context15.abrupt("return", _context15.sent);
893
-
894
- case 3:
895
- case "end":
896
- return _context15.stop();
897
- }
840
+ while (1) switch (_context15.prev = _context15.next) {
841
+ case 0:
842
+ _context15.next = 2;
843
+ return batchDeleteRelation([{
844
+ id: id,
845
+ force: true
846
+ }]);
847
+
848
+ case 2:
849
+ return _context15.abrupt("return", _context15.sent);
850
+
851
+ case 3:
852
+ case "end":
853
+ return _context15.stop();
898
854
  }
899
855
  }, _callee15);
900
856
  }));
@@ -915,19 +871,17 @@ exports.forceDeleteRelation = forceDeleteRelation;
915
871
  var batchQueryRelationById = /*#__PURE__*/function () {
916
872
  var _ref19 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(params) {
917
873
  return _regenerator["default"].wrap(function _callee16$(_context16) {
918
- while (1) {
919
- switch (_context16.prev = _context16.next) {
920
- case 0:
921
- _context16.next = 2;
922
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchQueryById', params);
923
-
924
- case 2:
925
- return _context16.abrupt("return", _context16.sent);
926
-
927
- case 3:
928
- case "end":
929
- return _context16.stop();
930
- }
874
+ while (1) switch (_context16.prev = _context16.next) {
875
+ case 0:
876
+ _context16.next = 2;
877
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchQueryById', params);
878
+
879
+ case 2:
880
+ return _context16.abrupt("return", _context16.sent);
881
+
882
+ case 3:
883
+ case "end":
884
+ return _context16.stop();
931
885
  }
932
886
  }, _callee16);
933
887
  }));
@@ -948,23 +902,21 @@ exports.batchQueryRelationById = batchQueryRelationById;
948
902
  var queryRelationByIds = /*#__PURE__*/function () {
949
903
  var _ref20 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17(ids) {
950
904
  return _regenerator["default"].wrap(function _callee17$(_context17) {
951
- while (1) {
952
- switch (_context17.prev = _context17.next) {
953
- case 0:
954
- _context17.next = 2;
955
- return batchQueryRelationById(ids.map(function (id) {
956
- return {
957
- id: id
958
- };
959
- }));
960
-
961
- case 2:
962
- return _context17.abrupt("return", _context17.sent);
963
-
964
- case 3:
965
- case "end":
966
- return _context17.stop();
967
- }
905
+ while (1) switch (_context17.prev = _context17.next) {
906
+ case 0:
907
+ _context17.next = 2;
908
+ return batchQueryRelationById(ids.map(function (id) {
909
+ return {
910
+ id: id
911
+ };
912
+ }));
913
+
914
+ case 2:
915
+ return _context17.abrupt("return", _context17.sent);
916
+
917
+ case 3:
918
+ case "end":
919
+ return _context17.stop();
968
920
  }
969
921
  }, _callee17);
970
922
  }));