@riil-frontend/component-topology 7.0.0-dev.9 → 7.0.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 (162) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +31 -31
  5. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -23
  6. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +3 -2
  7. package/es/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +1 -2
  8. package/es/core/components/TopoView/GraphViewPanel.js +18 -2
  9. package/es/core/editor/components/Toolbar/buttons.js +2 -2
  10. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +10 -3
  11. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +9 -2
  12. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +7 -1
  13. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +21 -6
  14. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  15. package/es/core/editor/components/settings/PropertyView.js +11 -10
  16. package/es/core/editor/components/settings/Settings.js +8 -1
  17. package/es/core/editor/components/settings/core/PropertyViewManager.js +4 -3
  18. package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -7
  19. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +4 -2
  20. package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +15 -0
  21. package/es/core/hooks/usePolling.js +1 -6
  22. package/es/core/hooks/useTopoEdit.js +3 -1
  23. package/es/core/models/Alarm.js +12 -24
  24. package/es/core/models/TopoApp.js +5 -3
  25. package/es/core/models/utils/linkUtils.js +0 -3
  26. package/es/core/store/models/topoMod.js +7 -6
  27. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
  28. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
  29. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
  30. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  31. package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -11
  32. package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +5 -3
  33. package/es/networkTopo/getTopoData.js +16 -27
  34. package/es/networkTopo/index.js +2 -2
  35. package/es/networkTopo/services/alert.js +55 -0
  36. package/es/networkTopo/services/authorization.js +135 -0
  37. package/es/networkTopo/services/cmdb.js +897 -0
  38. package/es/networkTopo/services/index.js +2 -26
  39. package/es/networkTopo/services/mdc.js +74 -0
  40. package/es/networkTopo/services/metric.js +68 -0
  41. package/es/networkTopo/services/model.js +1283 -0
  42. package/es/networkTopo/services/risk.js +29 -0
  43. package/es/networkTopo/services/topo/auth.js +67 -0
  44. package/es/networkTopo/services/topo/basic.js +727 -0
  45. package/es/networkTopo/services/topo/blacklist.js +60 -0
  46. package/es/networkTopo/services/topo/ciInfo.js +69 -0
  47. package/es/networkTopo/services/topo/constants.js +1 -0
  48. package/es/networkTopo/services/topo/icon.js +131 -0
  49. package/es/networkTopo/services/topo/index.js +18 -0
  50. package/es/networkTopo/services/topo/networkLink.js +33 -0
  51. package/es/networkTopo/services/topo/relation.js +27 -0
  52. package/es/networkTopo/services/topo/resourceWebUrl.js +84 -0
  53. package/es/networkTopo/store/topoTreeMod.js +5 -1
  54. package/es/networkTopo/utils/storage.js +38 -0
  55. package/es/utils/tree.js +1 -0
  56. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +3 -24
  57. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +3 -3
  58. package/lib/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +1 -2
  59. package/lib/core/components/TopoView/GraphViewPanel.js +22 -2
  60. package/lib/core/editor/components/Toolbar/buttons.js +2 -2
  61. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +10 -3
  62. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +9 -3
  63. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +8 -1
  64. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +21 -7
  65. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  66. package/lib/core/editor/components/settings/PropertyView.js +10 -10
  67. package/lib/core/editor/components/settings/Settings.js +9 -1
  68. package/lib/core/editor/components/settings/core/PropertyViewManager.js +4 -3
  69. package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -10
  70. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +5 -3
  71. package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +23 -0
  72. package/lib/core/hooks/usePolling.js +1 -6
  73. package/lib/core/hooks/useTopoEdit.js +3 -1
  74. package/lib/core/models/Alarm.js +12 -24
  75. package/lib/core/models/TopoApp.js +5 -3
  76. package/lib/core/models/utils/linkUtils.js +0 -5
  77. package/lib/core/store/models/topoMod.js +9 -6
  78. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
  79. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
  80. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
  81. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  82. package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -11
  83. package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +5 -3
  84. package/lib/networkTopo/getTopoData.js +16 -28
  85. package/lib/networkTopo/index.js +4 -4
  86. package/lib/networkTopo/services/alert.js +66 -0
  87. package/lib/networkTopo/services/authorization.js +145 -0
  88. package/lib/networkTopo/services/cmdb.js +977 -0
  89. package/lib/networkTopo/services/index.js +3 -29
  90. package/lib/networkTopo/services/mdc.js +91 -0
  91. package/lib/networkTopo/services/metric.js +82 -0
  92. package/lib/networkTopo/services/model.js +1387 -0
  93. package/lib/networkTopo/services/risk.js +40 -0
  94. package/lib/networkTopo/services/topo/auth.js +79 -0
  95. package/lib/networkTopo/services/topo/basic.js +753 -0
  96. package/lib/networkTopo/services/topo/blacklist.js +72 -0
  97. package/lib/networkTopo/services/topo/ciInfo.js +82 -0
  98. package/lib/networkTopo/services/topo/constants.js +6 -0
  99. package/lib/networkTopo/services/topo/icon.js +144 -0
  100. package/lib/networkTopo/{components/editor/plugins/LayerConfigPlugin.js → services/topo/index.js} +33 -23
  101. package/lib/networkTopo/services/topo/networkLink.js +45 -0
  102. package/lib/networkTopo/services/topo/relation.js +39 -0
  103. package/lib/networkTopo/services/topo/resourceWebUrl.js +95 -0
  104. package/lib/networkTopo/store/topoTreeMod.js +5 -1
  105. package/lib/networkTopo/utils/storage.js +46 -0
  106. package/lib/utils/tree.js +1 -0
  107. package/package.json +3 -3
  108. package/es/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +0 -122
  109. package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -10
  110. package/es/networkTopo/components/Topology.js +0 -28
  111. package/es/networkTopo/components/editor/plugins/LayerConfigPlugin.js +0 -22
  112. package/es/networkTopo/components/editor/propertyViews/LayerRelatedResourceList.js +0 -48
  113. package/es/networkTopo/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +0 -35
  114. package/es/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +0 -43
  115. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +0 -39
  116. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +0 -31
  117. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +0 -37
  118. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +0 -49
  119. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/index.js +0 -2
  120. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -630
  121. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -4
  122. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -458
  123. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
  124. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -104
  125. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
  126. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -55
  127. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -187
  128. package/es/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +0 -178
  129. package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +0 -103
  130. package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +0 -65
  131. package/es/networkTopo/components/editor/useEditorProps.js +0 -32
  132. package/es/networkTopo/event/index.js +0 -6
  133. package/es/networkTopo/hooks/editor/useDeleteEdges.js +0 -200
  134. package/es/networkTopo/hooks/editor/useGroupSortResources.js +0 -16
  135. package/es/networkTopo/hooks/useTopoEdit.js +0 -26
  136. package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +0 -147
  137. package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -19
  138. package/lib/networkTopo/components/Topology.js +0 -40
  139. package/lib/networkTopo/components/editor/propertyViews/LayerRelatedResourceList.js +0 -63
  140. package/lib/networkTopo/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +0 -51
  141. package/lib/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +0 -60
  142. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +0 -54
  143. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +0 -42
  144. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +0 -50
  145. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +0 -66
  146. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/index.js +0 -11
  147. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -661
  148. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -12
  149. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -486
  150. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
  151. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -120
  152. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
  153. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -60
  154. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -207
  155. package/lib/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +0 -205
  156. package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +0 -121
  157. package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +0 -65
  158. package/lib/networkTopo/components/editor/useEditorProps.js +0 -46
  159. package/lib/networkTopo/event/index.js +0 -11
  160. package/lib/networkTopo/hooks/editor/useDeleteEdges.js +0 -218
  161. package/lib/networkTopo/hooks/editor/useGroupSortResources.js +0 -21
  162. package/lib/networkTopo/hooks/useTopoEdit.js +0 -40
@@ -0,0 +1,977 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports.batchChangeManageStatus = batchChangeManageStatus;
7
+ exports.batchUpdateRelation = exports.batchUpdateAttributes = exports.batchQueryRelationById = exports.batchDeleteRelation = exports.batchDeleteById = exports.batchCreateRelation = void 0;
8
+ exports.changeManageStatus = changeManageStatus;
9
+ exports.closeRecord = void 0;
10
+ exports.commonCount = commonCount;
11
+ exports.commonQuery = commonQuery;
12
+ exports.deleteById = exports.createInstance = void 0;
13
+ exports.deleteIgnoreRelations = deleteIgnoreRelations;
14
+ exports.queryById = exports.getRecord = exports.forceDeleteRelation = exports.fetchCommonQuery = exports.deleteRelation = void 0;
15
+ exports.queryCiWithComponents = queryCiWithComponents;
16
+ exports.queryPageIgnoreRelations = queryPageIgnoreRelations;
17
+ exports.uploadFile = exports.queryRelationByIds = exports.queryRelationByEndpoint = void 0;
18
+
19
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
20
+
21
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
22
+
23
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
24
+
25
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
26
+
27
+ var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
28
+
29
+ var _excluded = ["checkAuth"],
30
+ _excluded2 = ["totalPage", "pageIndex", "data"];
31
+
32
+ /**
33
+ * 根据id获取实例数据
34
+ * TODO params参数名称可语义化
35
+ * @param {string} id 实例id
36
+ */
37
+ var queryById = /*#__PURE__*/function () {
38
+ var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(id) {
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
+ }
55
+ }
56
+ }, _callee);
57
+ }));
58
+
59
+ return function queryById(_x) {
60
+ return _ref.apply(this, arguments);
61
+ };
62
+ }();
63
+ /**
64
+ * ci删除
65
+ * @param {string} id 实例id
66
+ * @returns {object} {
67
+ "code": "OK",
68
+ "message": null,
69
+ "data": 0 //0:成功 -1:失败
70
+ }
71
+ */
72
+
73
+
74
+ exports.queryById = queryById;
75
+
76
+ var deleteById = /*#__PURE__*/function () {
77
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
78
+ 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
+ }
94
+ }
95
+ }, _callee2);
96
+ }));
97
+
98
+ return function deleteById(_x2) {
99
+ return _ref2.apply(this, arguments);
100
+ };
101
+ }();
102
+ /**
103
+ * ci删除(批量)
104
+ * @param {array} keys [ "1513569" ,...]
105
+ * @returns {object} {
106
+ "code": "OK",
107
+ "message": null,
108
+ "data": 0 //0:成功 -1:失败
109
+ }
110
+ */
111
+
112
+
113
+ exports.deleteById = deleteById;
114
+
115
+ var batchDeleteById = /*#__PURE__*/function () {
116
+ var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(keys) {
117
+ var ids;
118
+ 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
+ }
125
+
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
+ }
142
+ }
143
+ }, _callee3);
144
+ }));
145
+
146
+ return function batchDeleteById(_x3) {
147
+ return _ref3.apply(this, arguments);
148
+ };
149
+ }();
150
+ /**
151
+ * cmdm 通用查询接口
152
+ * @param {Object | string } condition 查询条件对象 或 接口原生查询字符串
153
+ * @param { string | Array } condition.ciType 单ci类型或ci类型数组
154
+ * @param { string } condition.searchValue 搜索的关键字
155
+ * @param { Array } condition.searchIndexArray 搜索的属性数组
156
+ * @param { Object } condition.alert 告警相关查询
157
+ * @param { Number } condition.alert.alert_type 告警类型
158
+ * @param { Number } condition.alert.alert_level 告警级别
159
+ * @param {string } sortIndex 排序索引
160
+ * @param { string } sortMethod 排序方法
161
+ * @param { string } currentPage 当前页
162
+ * @param { pageSize } pageSize 每页条数
163
+ * @param {Object} authOption 权限参数包装,透传给带权限的commonQuery接口
164
+ * @param {boolean} authOption.checkAuth 默认为true,是否只查看有权限的资源
165
+ */
166
+
167
+
168
+ exports.batchDeleteById = batchDeleteById;
169
+
170
+ var fetchCommonQuery = /*#__PURE__*/function () {
171
+ var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(condition, sortIndex, sortMethod, currentPage, pageSize, sort, authOption) {
172
+ var newCondition, _ref5, _ref5$checkAuth, checkAuth, otherOption, url, sorts, params, response, _ref6, totalPage, pageIndex, data, result;
173
+
174
+ 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
+ }));
247
+
248
+ case 12:
249
+ case "end":
250
+ return _context4.stop();
251
+ }
252
+ }
253
+ }, _callee4);
254
+ }));
255
+
256
+ return function fetchCommonQuery(_x4, _x5, _x6, _x7, _x8, _x9, _x10) {
257
+ return _ref4.apply(this, arguments);
258
+ };
259
+ }();
260
+ /**
261
+ * cmdb实例查询接口(不涉及权限)
262
+ * @param {Object} param
263
+ * @returns
264
+ */
265
+
266
+
267
+ exports.fetchCommonQuery = fetchCommonQuery;
268
+
269
+ function commonQuery(_x11) {
270
+ return _commonQuery.apply(this, arguments);
271
+ } // 批量属性更新
272
+
273
+
274
+ function _commonQuery() {
275
+ _commonQuery = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18(param) {
276
+ 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
+ }
290
+ }
291
+ }, _callee18);
292
+ }));
293
+ return _commonQuery.apply(this, arguments);
294
+ }
295
+
296
+ var batchUpdateAttributes = /*#__PURE__*/function () {
297
+ var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(values, fieldName) {
298
+ var aa, _aa;
299
+
300
+ 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
+ }
349
+ }
350
+ }, _callee5);
351
+ }));
352
+
353
+ return function batchUpdateAttributes(_x12, _x13) {
354
+ return _ref7.apply(this, arguments);
355
+ };
356
+ }(); // 创建单个ci实例
357
+
358
+
359
+ exports.batchUpdateAttributes = batchUpdateAttributes;
360
+
361
+ var createInstance = /*#__PURE__*/function () {
362
+ var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(values) {
363
+ 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
+ }
377
+ }
378
+ }, _callee6);
379
+ }));
380
+
381
+ return function createInstance(_x14) {
382
+ return _ref8.apply(this, arguments);
383
+ };
384
+ }();
385
+ /**
386
+ * 改变监控状态
387
+ * @param {object} param 查询传参{"id":"xxxx","manageStatus": 3,//已监控:3,加入监控中:2,取消监控中:1,未监控:0}
388
+ * @returns {object}
389
+ */
390
+
391
+
392
+ exports.createInstance = createInstance;
393
+
394
+ function changeManageStatus(_x15) {
395
+ return _changeManageStatus.apply(this, arguments);
396
+ }
397
+ /**
398
+ * 批量改变监控状态
399
+ * @param {Array} param 查询传参[{"id":"xxxx","manageStatus": 3,//已监控:3,加入监控中:2,取消监控中:1,未监控:0}]
400
+ * @returns {object}
401
+ */
402
+
403
+
404
+ function _changeManageStatus() {
405
+ _changeManageStatus = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee19(param) {
406
+ 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
+ }
420
+ }
421
+ }, _callee19);
422
+ }));
423
+ return _changeManageStatus.apply(this, arguments);
424
+ }
425
+
426
+ function batchChangeManageStatus(_x16) {
427
+ return _batchChangeManageStatus.apply(this, arguments);
428
+ }
429
+ /**
430
+ * 计数函数
431
+ * @param {object} param 复杂对象,具体看后端给的API说明
432
+ * @return eg:[
433
+ {
434
+ "count": 0
435
+ }
436
+ ]
437
+ */
438
+
439
+
440
+ function _batchChangeManageStatus() {
441
+ _batchChangeManageStatus = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee20(param) {
442
+ 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
+ }
456
+ }
457
+ }, _callee20);
458
+ }));
459
+ return _batchChangeManageStatus.apply(this, arguments);
460
+ }
461
+
462
+ function commonCount(_x17) {
463
+ return _commonCount.apply(this, arguments);
464
+ }
465
+ /**
466
+ * 批量改变监控状态
467
+ * @param {Array} param 传参['xx']
468
+ * @returns {object}
469
+ */
470
+
471
+
472
+ function _commonCount() {
473
+ _commonCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee21(param) {
474
+ 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
+ }
488
+ }
489
+ }, _callee21);
490
+ }));
491
+ return _commonCount.apply(this, arguments);
492
+ }
493
+
494
+ function queryCiWithComponents(_x18) {
495
+ return _queryCiWithComponents.apply(this, arguments);
496
+ }
497
+ /**
498
+ * 连接关系忽略列表查询
499
+ * @param {*} relationType 关系类型编码,为空不做限制
500
+ * @param {*} currentPage 当前页码
501
+ * @param {*} pageSize 单页数据量
502
+ * @param {*} condition 检索条件,可为空,每个检索项的语法类似common query接口
503
+ * @param {*} sort 排序对象
504
+ */
505
+
506
+
507
+ function _queryCiWithComponents() {
508
+ _queryCiWithComponents = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee22(mainCiIds) {
509
+ 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
+ }
523
+ }
524
+ }, _callee22);
525
+ }));
526
+ return _queryCiWithComponents.apply(this, arguments);
527
+ }
528
+
529
+ function queryPageIgnoreRelations(_x19, _x20, _x21, _x22, _x23) {
530
+ return _queryPageIgnoreRelations.apply(this, arguments);
531
+ }
532
+ /**
533
+ * 忽略的连接关系批量删除
534
+ * @param {*} ids id集合
535
+ */
536
+
537
+
538
+ function _queryPageIgnoreRelations() {
539
+ _queryPageIgnoreRelations = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee23(relationType, currentPage, pageSize, condition, sort) {
540
+ 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
+ }
562
+ }
563
+ }, _callee23);
564
+ }));
565
+ return _queryPageIgnoreRelations.apply(this, arguments);
566
+ }
567
+
568
+ function deleteIgnoreRelations(_x24) {
569
+ return _deleteIgnoreRelations.apply(this, arguments);
570
+ } // 上传文件
571
+
572
+
573
+ function _deleteIgnoreRelations() {
574
+ _deleteIgnoreRelations = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee24(ids) {
575
+ 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
+ }
593
+ }
594
+ }, _callee24);
595
+ }));
596
+ return _deleteIgnoreRelations.apply(this, arguments);
597
+ }
598
+
599
+ var uploadFile = /*#__PURE__*/function () {
600
+ var _ref9 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(files, userId, modelType) {
601
+ var formData, names, originFiles, config, result;
602
+ 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);
626
+
627
+ case 9:
628
+ result = _context7.sent;
629
+ return _context7.abrupt("return", result);
630
+
631
+ case 11:
632
+ case "end":
633
+ return _context7.stop();
634
+ }
635
+ }
636
+ }, _callee7);
637
+ }));
638
+
639
+ return function uploadFile(_x25, _x26, _x27) {
640
+ return _ref9.apply(this, arguments);
641
+ };
642
+ }(); // 关闭提示
643
+
644
+
645
+ exports.uploadFile = uploadFile;
646
+
647
+ var closeRecord = /*#__PURE__*/function () {
648
+ var _ref11 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(userId, modelType) {
649
+ var result;
650
+ 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
+ }
668
+ }
669
+ }, _callee8);
670
+ }));
671
+
672
+ return function closeRecord(_x28, _x29) {
673
+ return _ref11.apply(this, arguments);
674
+ };
675
+ }(); // 获取提示信息
676
+
677
+
678
+ exports.closeRecord = closeRecord;
679
+
680
+ var getRecord = /*#__PURE__*/function () {
681
+ var _ref12 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(userId, modelType) {
682
+ 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
+ }
699
+ }
700
+ }, _callee9);
701
+ }));
702
+
703
+ return function getRecord(_x30, _x31) {
704
+ return _ref12.apply(this, arguments);
705
+ };
706
+ }();
707
+ /**
708
+ * 批量创建关系
709
+ * @param {*} params
710
+ * @returns
711
+ */
712
+
713
+
714
+ exports.getRecord = getRecord;
715
+
716
+ var batchCreateRelation = /*#__PURE__*/function () {
717
+ var _ref13 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(params) {
718
+ 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
+ }
732
+ }
733
+ }, _callee10);
734
+ }));
735
+
736
+ return function batchCreateRelation(_x32) {
737
+ return _ref13.apply(this, arguments);
738
+ };
739
+ }();
740
+
741
+ exports.batchCreateRelation = batchCreateRelation;
742
+
743
+ var queryRelationByEndpoint = /*#__PURE__*/function () {
744
+ var _ref14 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(id) {
745
+ 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
+ }
761
+ }
762
+ }, _callee11);
763
+ }));
764
+
765
+ return function queryRelationByEndpoint(_x33) {
766
+ return _ref14.apply(this, arguments);
767
+ };
768
+ }();
769
+ /**
770
+ * 批量更新关系
771
+ * @param {*} params
772
+ * @returns
773
+ */
774
+
775
+
776
+ exports.queryRelationByEndpoint = queryRelationByEndpoint;
777
+
778
+ var batchUpdateRelation = /*#__PURE__*/function () {
779
+ var _ref15 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(params) {
780
+ 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
+ }
794
+ }
795
+ }, _callee12);
796
+ }));
797
+
798
+ return function batchUpdateRelation(_x34) {
799
+ return _ref15.apply(this, arguments);
800
+ };
801
+ }();
802
+ /**
803
+ * 删除关系,添加到忽略
804
+ * @param {*} id 关系id
805
+ * @returns
806
+ */
807
+
808
+
809
+ exports.batchUpdateRelation = batchUpdateRelation;
810
+
811
+ var deleteRelation = /*#__PURE__*/function () {
812
+ var _ref16 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(id) {
813
+ 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
+ }
829
+ }
830
+ }, _callee13);
831
+ }));
832
+
833
+ return function deleteRelation(_x35) {
834
+ return _ref16.apply(this, arguments);
835
+ };
836
+ }();
837
+ /**
838
+ * 批量删除关系
839
+ * @param {[{id: string}]} params
840
+ * @returns
841
+ */
842
+
843
+
844
+ exports.deleteRelation = deleteRelation;
845
+
846
+ var batchDeleteRelation = /*#__PURE__*/function () {
847
+ var _ref17 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(params) {
848
+ 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
+ }
862
+ }
863
+ }, _callee14);
864
+ }));
865
+
866
+ return function batchDeleteRelation(_x36) {
867
+ return _ref17.apply(this, arguments);
868
+ };
869
+ }();
870
+ /**
871
+ * 强制删除关系
872
+ * @param {*} id 关系id
873
+ * @returns
874
+ */
875
+
876
+
877
+ exports.batchDeleteRelation = batchDeleteRelation;
878
+
879
+ var forceDeleteRelation = /*#__PURE__*/function () {
880
+ var _ref18 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(id) {
881
+ 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
+ }
898
+ }
899
+ }, _callee15);
900
+ }));
901
+
902
+ return function forceDeleteRelation(_x37) {
903
+ return _ref18.apply(this, arguments);
904
+ };
905
+ }();
906
+ /**
907
+ * 查询关系
908
+ * @param {[{id: string}]} params
909
+ * @returns
910
+ */
911
+
912
+
913
+ exports.forceDeleteRelation = forceDeleteRelation;
914
+
915
+ var batchQueryRelationById = /*#__PURE__*/function () {
916
+ var _ref19 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(params) {
917
+ 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
+ }
931
+ }
932
+ }, _callee16);
933
+ }));
934
+
935
+ return function batchQueryRelationById(_x38) {
936
+ return _ref19.apply(this, arguments);
937
+ };
938
+ }();
939
+ /**
940
+ * 查询关系
941
+ * @param {*} ids 关系ids
942
+ * @returns
943
+ */
944
+
945
+
946
+ exports.batchQueryRelationById = batchQueryRelationById;
947
+
948
+ var queryRelationByIds = /*#__PURE__*/function () {
949
+ var _ref20 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17(ids) {
950
+ 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
+ }
968
+ }
969
+ }, _callee17);
970
+ }));
971
+
972
+ return function queryRelationByIds(_x39) {
973
+ return _ref20.apply(this, arguments);
974
+ };
975
+ }();
976
+
977
+ exports.queryRelationByIds = queryRelationByIds;