@riil-frontend/component-topology 11.0.33 → 11.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +4 -2
  4. package/build/index.js +52 -45
  5. package/es/components/MultiResourceDrawer/index.js +22 -26
  6. package/es/components/ResourceList/ResourceSelect.js +55 -58
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  13. package/es/core/editor/components/BackgroundView/index.js +149 -178
  14. package/es/core/editor/components/BackgroundView/index.module.scss +2 -1
  15. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
  16. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  17. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
  18. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
  19. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  20. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  21. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  22. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
  23. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
  24. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  25. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
  26. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
  27. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  28. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  29. package/es/core/editor/store/background.js +8 -10
  30. package/es/core/editor/store/topoEdit.js +4 -6
  31. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  32. package/es/core/hooks/usePolling.js +130 -142
  33. package/es/core/hooks/useResourceConfig.js +76 -100
  34. package/es/core/hooks/useTopoEdit.js +525 -623
  35. package/es/core/models/Alarm.js +319 -402
  36. package/es/core/models/AttributeMetricDisplay.js +115 -143
  37. package/es/core/models/PluginManager.js +4 -3
  38. package/es/core/models/SelectionModel.js +4 -5
  39. package/es/core/models/TopoApp.js +279 -436
  40. package/es/core/models/TopoGraphView.js +28 -41
  41. package/es/core/models/cache/CiCache.js +34 -39
  42. package/es/core/models/cache/CiTypeCache.js +47 -61
  43. package/es/core/models/cache/DictCache.js +36 -42
  44. package/es/core/models/graph/Background.js +21 -26
  45. package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
  46. package/es/core/models/tagstips/ElementTagTipConfig.js +44 -58
  47. package/es/core/models/topoData.js +73 -77
  48. package/es/core/models/utils/linkUtils.js +46 -51
  49. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  50. package/es/core/services/alarm.js +14 -16
  51. package/es/core/services/background.js +59 -67
  52. package/es/core/services/cmdb/metric.js +14 -18
  53. package/es/core/services/cmdb.js +23 -27
  54. package/es/core/services/index.js +48 -68
  55. package/es/core/services/overview.js +131 -151
  56. package/es/core/services/topo/basic.js +37 -41
  57. package/es/core/services/topo/tagtip.js +15 -19
  58. package/es/core/store/models/ciModel.js +58 -62
  59. package/es/core/store/models/customIcon.js +126 -145
  60. package/es/core/store/models/displayConfig.js +15 -19
  61. package/es/core/store/models/selection.js +4 -6
  62. package/es/core/store/models/topoAlarm.js +162 -145
  63. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  64. package/es/core/store/models/topoBizMod.js +9 -11
  65. package/es/core/store/models/topoConfig.js +215 -231
  66. package/es/core/store/models/topoGraphView.js +4 -6
  67. package/es/core/store/models/topoMod.js +373 -395
  68. package/es/core/utils/imageUtil.js +23 -27
  69. package/es/core/utils/saveSerialize.js +14 -18
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
  82. package/es/networkTopo/components/Link/hook.js +85 -96
  83. package/es/networkTopo/components/Link/index.js +104 -126
  84. package/es/networkTopo/components/Link/setting.js +48 -52
  85. package/es/networkTopo/getTopoData.js +73 -92
  86. package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
  87. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  88. package/es/networkTopo/models/TopoCenter.js +28 -46
  89. package/es/networkTopo/services/alert.js +18 -22
  90. package/es/networkTopo/services/authorization.js +45 -55
  91. package/es/networkTopo/services/cmdb.js +548 -696
  92. package/es/networkTopo/services/funcAuth.js +22 -24
  93. package/es/networkTopo/services/link.js +107 -117
  94. package/es/networkTopo/services/mdc.js +33 -48
  95. package/es/networkTopo/services/metric.js +38 -47
  96. package/es/networkTopo/services/model.js +616 -809
  97. package/es/networkTopo/services/risk.js +9 -11
  98. package/es/networkTopo/services/topo/auth.js +27 -33
  99. package/es/networkTopo/services/topo/basic.js +251 -289
  100. package/es/networkTopo/services/topo/blacklist.js +20 -24
  101. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  102. package/es/networkTopo/services/topo/icon.js +49 -59
  103. package/es/networkTopo/services/topo/networkLink.js +32 -36
  104. package/es/networkTopo/services/topo/relation.js +9 -11
  105. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  106. package/es/networkTopo/store/functionAuth.js +31 -37
  107. package/es/networkTopo/store/topoCenter.js +142 -152
  108. package/es/networkTopo/store/topoLinkMod.js +4 -6
  109. package/es/networkTopo/store/topoTreeMod.js +170 -182
  110. package/es/networkTopo/utils/exportData.js +57 -61
  111. package/lib/components/MultiResourceDrawer/index.js +22 -26
  112. package/lib/components/ResourceList/ResourceSelect.js +54 -58
  113. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
  114. package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  115. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
  116. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  117. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
  118. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  119. package/lib/core/editor/components/BackgroundView/index.js +148 -177
  120. package/lib/core/editor/components/BackgroundView/index.module.scss +2 -1
  121. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
  122. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  123. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
  124. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
  125. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  126. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  127. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  128. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
  129. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
  130. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  131. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
  132. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
  133. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  134. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  135. package/lib/core/editor/store/background.js +8 -10
  136. package/lib/core/editor/store/topoEdit.js +4 -6
  137. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  138. package/lib/core/hooks/usePolling.js +129 -141
  139. package/lib/core/hooks/useResourceConfig.js +76 -100
  140. package/lib/core/hooks/useTopoEdit.js +517 -615
  141. package/lib/core/models/Alarm.js +313 -396
  142. package/lib/core/models/AttributeMetricDisplay.js +118 -146
  143. package/lib/core/models/PluginManager.js +4 -3
  144. package/lib/core/models/SelectionModel.js +4 -5
  145. package/lib/core/models/TopoApp.js +279 -436
  146. package/lib/core/models/TopoGraphView.js +28 -41
  147. package/lib/core/models/cache/CiCache.js +39 -44
  148. package/lib/core/models/cache/CiTypeCache.js +48 -62
  149. package/lib/core/models/cache/DictCache.js +39 -45
  150. package/lib/core/models/graph/Background.js +22 -27
  151. package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
  152. package/lib/core/models/tagstips/ElementTagTipConfig.js +44 -58
  153. package/lib/core/models/topoData.js +73 -78
  154. package/lib/core/models/utils/linkUtils.js +45 -51
  155. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  156. package/lib/core/services/alarm.js +18 -20
  157. package/lib/core/services/background.js +70 -78
  158. package/lib/core/services/cmdb/metric.js +14 -19
  159. package/lib/core/services/cmdb.js +24 -29
  160. package/lib/core/services/index.js +53 -72
  161. package/lib/core/services/overview.js +131 -151
  162. package/lib/core/services/topo/basic.js +37 -41
  163. package/lib/core/services/topo/tagtip.js +16 -21
  164. package/lib/core/store/models/ciModel.js +66 -70
  165. package/lib/core/store/models/customIcon.js +126 -145
  166. package/lib/core/store/models/displayConfig.js +15 -19
  167. package/lib/core/store/models/selection.js +4 -6
  168. package/lib/core/store/models/topoAlarm.js +163 -145
  169. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  170. package/lib/core/store/models/topoBizMod.js +9 -11
  171. package/lib/core/store/models/topoConfig.js +222 -238
  172. package/lib/core/store/models/topoGraphView.js +4 -6
  173. package/lib/core/store/models/topoMod.js +375 -397
  174. package/lib/core/utils/imageUtil.js +26 -31
  175. package/lib/core/utils/saveSerialize.js +13 -18
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
  185. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
  186. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  187. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
  188. package/lib/networkTopo/components/Link/hook.js +86 -98
  189. package/lib/networkTopo/components/Link/index.js +105 -127
  190. package/lib/networkTopo/components/Link/setting.js +48 -52
  191. package/lib/networkTopo/getTopoData.js +73 -92
  192. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
  193. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  194. package/lib/networkTopo/models/TopoCenter.js +28 -46
  195. package/lib/networkTopo/services/alert.js +18 -22
  196. package/lib/networkTopo/services/authorization.js +55 -65
  197. package/lib/networkTopo/services/cmdb.js +551 -700
  198. package/lib/networkTopo/services/funcAuth.js +24 -26
  199. package/lib/networkTopo/services/link.js +108 -118
  200. package/lib/networkTopo/services/mdc.js +35 -51
  201. package/lib/networkTopo/services/metric.js +37 -47
  202. package/lib/networkTopo/services/model.js +615 -809
  203. package/lib/networkTopo/services/risk.js +11 -13
  204. package/lib/networkTopo/services/topo/auth.js +27 -33
  205. package/lib/networkTopo/services/topo/basic.js +252 -290
  206. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  207. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  208. package/lib/networkTopo/services/topo/icon.js +59 -69
  209. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  210. package/lib/networkTopo/services/topo/relation.js +11 -13
  211. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  212. package/lib/networkTopo/store/functionAuth.js +31 -37
  213. package/lib/networkTopo/store/topoCenter.js +142 -152
  214. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  215. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  216. package/lib/networkTopo/utils/exportData.js +63 -68
  217. package/package.json +4 -3
@@ -3,6 +3,9 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
3
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
4
  var _excluded = ["checkAuth"],
5
5
  _excluded2 = ["totalPage", "pageIndex", "data"];
6
+
7
+ var _ref, _ref2, _ref3, _ref4, _commonQuery, _ref7, _ref8, _changeManageStatus, _batchChangeManageStatus, _commonCount, _queryCiWithComponents, _queryPageIgnoreRelations, _deleteIgnoreRelations, _ref9, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20;
8
+
6
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
10
  import { request } from '@riil-frontend/component-topology-utils';
8
11
  /**
@@ -11,32 +14,26 @@ import { request } from '@riil-frontend/component-topology-utils';
11
14
  * @param {string} id 实例id
12
15
  */
13
16
 
14
- export var queryById = /*#__PURE__*/function () {
15
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
17
+ export var queryById = function queryById(_x) {
18
+ return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
16
19
  return _regeneratorRuntime.wrap(function _callee$(_context) {
17
- while (1) {
18
- switch (_context.prev = _context.next) {
19
- case 0:
20
- _context.next = 2;
21
- return request.post('/mdc/v1/api/cmdb/queryCiById', {
22
- id: id
23
- });
24
-
25
- case 2:
26
- return _context.abrupt("return", _context.sent);
27
-
28
- case 3:
29
- case "end":
30
- return _context.stop();
31
- }
20
+ while (1) switch (_context.prev = _context.next) {
21
+ case 0:
22
+ _context.next = 2;
23
+ return request.post('/mdc/v1/api/cmdb/queryCiById', {
24
+ id: id
25
+ });
26
+
27
+ case 2:
28
+ return _context.abrupt("return", _context.sent);
29
+
30
+ case 3:
31
+ case "end":
32
+ return _context.stop();
32
33
  }
33
34
  }, _callee);
34
- }));
35
-
36
- return function queryById(_x) {
37
- return _ref.apply(this, arguments);
38
- };
39
- }();
35
+ }))).apply(this, arguments);
36
+ };
40
37
  /**
41
38
  * ci删除
42
39
  * @param {string} id 实例id
@@ -47,32 +44,26 @@ export var queryById = /*#__PURE__*/function () {
47
44
  }
48
45
  */
49
46
 
50
- export var deleteById = /*#__PURE__*/function () {
51
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
47
+ export var deleteById = function deleteById(_x2) {
48
+ return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
52
49
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
53
- while (1) {
54
- switch (_context2.prev = _context2.next) {
55
- case 0:
56
- _context2.next = 2;
57
- return request.post('/cmdb/v1/api/ci/deleteById', {
58
- id: id
59
- });
60
-
61
- case 2:
62
- return _context2.abrupt("return", _context2.sent);
63
-
64
- case 3:
65
- case "end":
66
- return _context2.stop();
67
- }
50
+ while (1) switch (_context2.prev = _context2.next) {
51
+ case 0:
52
+ _context2.next = 2;
53
+ return request.post('/cmdb/v1/api/ci/deleteById', {
54
+ id: id
55
+ });
56
+
57
+ case 2:
58
+ return _context2.abrupt("return", _context2.sent);
59
+
60
+ case 3:
61
+ case "end":
62
+ return _context2.stop();
68
63
  }
69
64
  }, _callee2);
70
- }));
71
-
72
- return function deleteById(_x2) {
73
- return _ref2.apply(this, arguments);
74
- };
75
- }();
65
+ }))).apply(this, arguments);
66
+ };
76
67
  /**
77
68
  * ci删除(批量)
78
69
  * @param {array} keys [ "1513569" ,...]
@@ -83,41 +74,35 @@ export var deleteById = /*#__PURE__*/function () {
83
74
  }
84
75
  */
85
76
 
86
- export var batchDeleteById = /*#__PURE__*/function () {
87
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(keys) {
77
+ export var batchDeleteById = function batchDeleteById(_x3) {
78
+ return (_ref3 = _ref3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(keys) {
88
79
  var ids;
89
80
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
90
- while (1) {
91
- switch (_context3.prev = _context3.next) {
92
- case 0:
93
- if (keys === void 0) {
94
- keys = [];
95
- }
81
+ while (1) switch (_context3.prev = _context3.next) {
82
+ case 0:
83
+ if (keys === void 0) {
84
+ keys = [];
85
+ }
86
+
87
+ // TODO 替换为map
88
+ ids = keys.map(function (key) {
89
+ return {
90
+ id: key
91
+ };
92
+ });
93
+ _context3.next = 4;
94
+ return request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
95
+
96
+ case 4:
97
+ return _context3.abrupt("return", _context3.sent);
96
98
 
97
- // TODO 替换为map
98
- ids = keys.map(function (key) {
99
- return {
100
- id: key
101
- };
102
- });
103
- _context3.next = 4;
104
- return request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
105
-
106
- case 4:
107
- return _context3.abrupt("return", _context3.sent);
108
-
109
- case 5:
110
- case "end":
111
- return _context3.stop();
112
- }
99
+ case 5:
100
+ case "end":
101
+ return _context3.stop();
113
102
  }
114
103
  }, _callee3);
115
- }));
116
-
117
- return function batchDeleteById(_x3) {
118
- return _ref3.apply(this, arguments);
119
- };
120
- }();
104
+ }))).apply(this, arguments);
105
+ };
121
106
  /**
122
107
  * cmdm 通用查询接口
123
108
  * @param {Object | string } condition 查询条件对象 或 接口原生查询字符串
@@ -135,96 +120,90 @@ export var batchDeleteById = /*#__PURE__*/function () {
135
120
  * @param {boolean} authOption.checkAuth 默认为true,是否只查看有权限的资源
136
121
  */
137
122
 
138
- export var fetchCommonQuery = /*#__PURE__*/function () {
139
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(condition, sortIndex, sortMethod, currentPage, pageSize, sort, authOption) {
123
+ export var fetchCommonQuery = function fetchCommonQuery(_x4, _x5, _x6, _x7, _x8, _x9, _x10) {
124
+ return (_ref4 = _ref4 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(condition, sortIndex, sortMethod, currentPage, pageSize, sort, authOption) {
140
125
  var newCondition, _ref5, _ref5$checkAuth, checkAuth, otherOption, url, sorts, params, response, _ref6, totalPage, pageIndex, data, result;
141
126
 
142
127
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
143
- while (1) {
144
- switch (_context4.prev = _context4.next) {
145
- case 0:
146
- newCondition = condition;
147
-
148
- if (typeof newCondition !== 'string') {
149
- newCondition = Object.keys(newCondition).reduce(function (param, current) {
150
- if (current === 'ciType') {
151
- param.push("type(" + (Array.isArray(newCondition[current]) ? newCondition[current].map(function (item) {
152
- return "'" + item + "'";
153
- }).toString() : "'" + newCondition[current] + "'") + ")");
154
- } else if (current === 'principal') {
155
- param.push(newCondition[current]);
156
- } else if (current === 'searchValue' && newCondition.searchValue && newCondition.searchIndexArray) {
157
- param.push("contain('" + newCondition.searchValue + "'," + newCondition.searchIndexArray.toString() + ")");
158
- } else if (current === 'alert') {
159
- var alert = Object.keys(newCondition[current]).map(function (item) {
160
- return item + " = " + newCondition[current][item];
161
- }).join(' && ');
162
- param.push("alert(" + alert + ")");
163
- }
164
-
165
- return param;
166
- }, []).join(' && ');
167
- }
168
-
169
- _ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = _objectWithoutPropertiesLoose(_ref5, _excluded); // const url = checkAuth
170
- // ? '/appserver/api/v1/cmdb/ci/commonQuery'
171
- // : '/api/v1/cmdb/ci/commonQuery';
172
- // const url ='/api/v1/cmdb/ci/commonQuery';
173
- // let params = {
174
- // condition: condition.conditions
175
- // ? `${newCondition} && ${condition.conditions}`
176
- // : newCondition,
177
- // sort: sort || `${sortIndex} ${sortMethod}`,
178
- // currentPage,
179
- // pageSize,
180
- // };
181
- // APPBIR MVP
182
- // ------------------------------------------------
183
- // TODO important 带确认权限接口是否可通 ---
184
-
185
- url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
186
- sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
187
- params = {
188
- condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
189
- // APPBIR MVP 临时去掉排序 等接口OK
190
- // orders: [{
191
- // name: sorts[0],
192
- // type: sorts[1]
193
- // }],
194
- pageIndex: currentPage,
195
- pageSize: pageSize
196
- };
197
-
198
- if (checkAuth && otherOption) {
199
- params = _extends({}, params, otherOption);
200
- } // 处理 返回结果
201
-
202
-
203
- _context4.next = 9;
204
- return request.post(url, params);
205
-
206
- case 9:
207
- response = _context4.sent;
208
- // TODO ---
209
- _ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = _objectWithoutPropertiesLoose(_ref6, _excluded2);
210
- return _context4.abrupt("return", _extends({}, result, {
211
- total: totalPage,
212
- page: pageIndex,
213
- content: data
214
- }));
128
+ while (1) switch (_context4.prev = _context4.next) {
129
+ case 0:
130
+ newCondition = condition;
131
+
132
+ if (typeof newCondition !== 'string') {
133
+ newCondition = Object.keys(newCondition).reduce(function (param, current) {
134
+ if (current === 'ciType') {
135
+ param.push("type(" + (Array.isArray(newCondition[current]) ? newCondition[current].map(function (item) {
136
+ return "'" + item + "'";
137
+ }).toString() : "'" + newCondition[current] + "'") + ")");
138
+ } else if (current === 'principal') {
139
+ param.push(newCondition[current]);
140
+ } else if (current === 'searchValue' && newCondition.searchValue && newCondition.searchIndexArray) {
141
+ param.push("contain('" + newCondition.searchValue + "'," + newCondition.searchIndexArray.toString() + ")");
142
+ } else if (current === 'alert') {
143
+ var alert = Object.keys(newCondition[current]).map(function (item) {
144
+ return item + " = " + newCondition[current][item];
145
+ }).join(' && ');
146
+ param.push("alert(" + alert + ")");
147
+ }
215
148
 
216
- case 12:
217
- case "end":
218
- return _context4.stop();
219
- }
149
+ return param;
150
+ }, []).join(' && ');
151
+ }
152
+
153
+ _ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = _objectWithoutPropertiesLoose(_ref5, _excluded); // const url = checkAuth
154
+ // ? '/appserver/api/v1/cmdb/ci/commonQuery'
155
+ // : '/api/v1/cmdb/ci/commonQuery';
156
+ // const url ='/api/v1/cmdb/ci/commonQuery';
157
+ // let params = {
158
+ // condition: condition.conditions
159
+ // ? `${newCondition} && ${condition.conditions}`
160
+ // : newCondition,
161
+ // sort: sort || `${sortIndex} ${sortMethod}`,
162
+ // currentPage,
163
+ // pageSize,
164
+ // };
165
+ // APPBIR MVP
166
+ // ------------------------------------------------
167
+ // TODO important 带确认权限接口是否可通 ---
168
+
169
+ url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
170
+ sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
171
+ params = {
172
+ condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
173
+ // APPBIR MVP 临时去掉排序 等接口OK
174
+ // orders: [{
175
+ // name: sorts[0],
176
+ // type: sorts[1]
177
+ // }],
178
+ pageIndex: currentPage,
179
+ pageSize: pageSize
180
+ };
181
+
182
+ if (checkAuth && otherOption) {
183
+ params = _extends({}, params, otherOption);
184
+ } // 处理 返回结果
185
+
186
+
187
+ _context4.next = 9;
188
+ return request.post(url, params);
189
+
190
+ case 9:
191
+ response = _context4.sent;
192
+ // TODO ---
193
+ _ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = _objectWithoutPropertiesLoose(_ref6, _excluded2);
194
+ return _context4.abrupt("return", _extends({}, result, {
195
+ total: totalPage,
196
+ page: pageIndex,
197
+ content: data
198
+ }));
199
+
200
+ case 12:
201
+ case "end":
202
+ return _context4.stop();
220
203
  }
221
204
  }, _callee4);
222
- }));
223
-
224
- return function fetchCommonQuery(_x4, _x5, _x6, _x7, _x8, _x9, _x10) {
225
- return _ref4.apply(this, arguments);
226
- };
227
- }();
205
+ }))).apply(this, arguments);
206
+ };
228
207
  /**
229
208
  * cmdb实例查询接口(不涉及权限)
230
209
  * @param {Object} param
@@ -232,117 +211,98 @@ export var fetchCommonQuery = /*#__PURE__*/function () {
232
211
  */
233
212
 
234
213
  export function commonQuery(_x11) {
235
- return _commonQuery.apply(this, arguments);
236
- } // 批量属性更新
237
-
238
- function _commonQuery() {
239
- _commonQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(param) {
240
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
241
- while (1) {
242
- switch (_context18.prev = _context18.next) {
243
- case 0:
244
- _context18.next = 2;
245
- return request.post('/cmdb/v1/api/ci/commonQuery', param);
246
-
247
- case 2:
248
- return _context18.abrupt("return", _context18.sent);
249
-
250
- case 3:
251
- case "end":
252
- return _context18.stop();
253
- }
254
- }
255
- }, _callee18);
256
- }));
257
- return _commonQuery.apply(this, arguments);
258
- }
259
-
260
- export var batchUpdateAttributes = /*#__PURE__*/function () {
261
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(values, fieldName) {
262
- var aa, _aa;
263
-
214
+ return (_commonQuery = _commonQuery || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(param) {
264
215
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
265
- while (1) {
266
- switch (_context5.prev = _context5.next) {
267
- case 0:
268
- if (!fieldName) {
269
- _context5.next = 8;
270
- break;
271
- }
216
+ while (1) switch (_context5.prev = _context5.next) {
217
+ case 0:
218
+ _context5.next = 2;
219
+ return request.post('/cmdb/v1/api/ci/commonQuery', param);
272
220
 
273
- // 传了要更新的属性名,更新某一个属性
274
- aa = {};
275
- aa[fieldName] = values[fieldName];
276
- _context5.next = 5;
277
- return request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
278
- id: values.id,
279
- attributes: aa
280
- }]);
281
-
282
- case 5:
283
- return _context5.abrupt("return", _context5.sent);
284
-
285
- case 8:
286
- if (!Array.isArray(values)) {
287
- _context5.next = 12;
288
- break;
289
- }
290
-
291
- _context5.next = 11;
292
- return request.post('/cmdb/v1/api/ci/batchUpdateAttributes', values);
293
-
294
- case 11:
295
- return _context5.abrupt("return", _context5.sent);
221
+ case 2:
222
+ return _context5.abrupt("return", _context5.sent);
296
223
 
297
- case 12:
298
- _aa = values.id;
299
- delete values.id;
300
- _context5.next = 16;
301
- return request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
302
- id: _aa,
303
- attributes: values
304
- }]);
305
-
306
- case 16:
307
- return _context5.abrupt("return", _context5.sent);
308
-
309
- case 17:
310
- case "end":
311
- return _context5.stop();
312
- }
224
+ case 3:
225
+ case "end":
226
+ return _context5.stop();
313
227
  }
314
228
  }, _callee5);
315
- }));
229
+ }))).apply(this, arguments);
230
+ } // 批量属性更新
316
231
 
317
- return function batchUpdateAttributes(_x12, _x13) {
318
- return _ref7.apply(this, arguments);
319
- };
320
- }(); // 创建单个ci实例
232
+ export var batchUpdateAttributes = function batchUpdateAttributes(_x12, _x13) {
233
+ return (_ref7 = _ref7 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(values, fieldName) {
234
+ var aa, _aa;
321
235
 
322
- export var createInstance = /*#__PURE__*/function () {
323
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(values) {
324
236
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
325
- while (1) {
326
- switch (_context6.prev = _context6.next) {
327
- case 0:
328
- _context6.next = 2;
329
- return request.post('/cmdb/v1/api/ci/create', values);
330
-
331
- case 2:
332
- return _context6.abrupt("return", _context6.sent);
333
-
334
- case 3:
335
- case "end":
336
- return _context6.stop();
337
- }
237
+ while (1) switch (_context6.prev = _context6.next) {
238
+ case 0:
239
+ if (!fieldName) {
240
+ _context6.next = 8;
241
+ break;
242
+ }
243
+
244
+ // 传了要更新的属性名,更新某一个属性
245
+ aa = {};
246
+ aa[fieldName] = values[fieldName];
247
+ _context6.next = 5;
248
+ return request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
249
+ id: values.id,
250
+ attributes: aa
251
+ }]);
252
+
253
+ case 5:
254
+ return _context6.abrupt("return", _context6.sent);
255
+
256
+ case 8:
257
+ if (!Array.isArray(values)) {
258
+ _context6.next = 12;
259
+ break;
260
+ }
261
+
262
+ _context6.next = 11;
263
+ return request.post('/cmdb/v1/api/ci/batchUpdateAttributes', values);
264
+
265
+ case 11:
266
+ return _context6.abrupt("return", _context6.sent);
267
+
268
+ case 12:
269
+ _aa = values.id;
270
+ delete values.id;
271
+ _context6.next = 16;
272
+ return request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
273
+ id: _aa,
274
+ attributes: values
275
+ }]);
276
+
277
+ case 16:
278
+ return _context6.abrupt("return", _context6.sent);
279
+
280
+ case 17:
281
+ case "end":
282
+ return _context6.stop();
338
283
  }
339
284
  }, _callee6);
340
- }));
285
+ }))).apply(this, arguments);
286
+ }; // 创建单个ci实例
287
+
288
+ export var createInstance = function createInstance(_x14) {
289
+ return (_ref8 = _ref8 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(values) {
290
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
291
+ while (1) switch (_context7.prev = _context7.next) {
292
+ case 0:
293
+ _context7.next = 2;
294
+ return request.post('/cmdb/v1/api/ci/create', values);
341
295
 
342
- return function createInstance(_x14) {
343
- return _ref8.apply(this, arguments);
344
- };
345
- }();
296
+ case 2:
297
+ return _context7.abrupt("return", _context7.sent);
298
+
299
+ case 3:
300
+ case "end":
301
+ return _context7.stop();
302
+ }
303
+ }, _callee7);
304
+ }))).apply(this, arguments);
305
+ };
346
306
  /**
347
307
  * 改变监控状态
348
308
  * @param {object} param 查询传参{"id":"xxxx","manageStatus": 3,//已监控:3,加入监控中:2,取消监控中:1,未监控:0}
@@ -350,7 +310,22 @@ export var createInstance = /*#__PURE__*/function () {
350
310
  */
351
311
 
352
312
  export function changeManageStatus(_x15) {
353
- return _changeManageStatus.apply(this, arguments);
313
+ return (_changeManageStatus = _changeManageStatus || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(param) {
314
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
315
+ while (1) switch (_context8.prev = _context8.next) {
316
+ case 0:
317
+ _context8.next = 2;
318
+ return request.post('/cmdb/v1/api/ci/changeManageStatus', param);
319
+
320
+ case 2:
321
+ return _context8.abrupt("return", _context8.sent);
322
+
323
+ case 3:
324
+ case "end":
325
+ return _context8.stop();
326
+ }
327
+ }, _callee8);
328
+ }))).apply(this, arguments);
354
329
  }
355
330
  /**
356
331
  * 批量改变监控状态
@@ -358,30 +333,23 @@ export function changeManageStatus(_x15) {
358
333
  * @returns {object}
359
334
  */
360
335
 
361
- function _changeManageStatus() {
362
- _changeManageStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(param) {
363
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
364
- while (1) {
365
- switch (_context19.prev = _context19.next) {
366
- case 0:
367
- _context19.next = 2;
368
- return request.post('/cmdb/v1/api/ci/changeManageStatus', param);
369
-
370
- case 2:
371
- return _context19.abrupt("return", _context19.sent);
372
-
373
- case 3:
374
- case "end":
375
- return _context19.stop();
376
- }
377
- }
378
- }, _callee19);
379
- }));
380
- return _changeManageStatus.apply(this, arguments);
381
- }
382
-
383
336
  export function batchChangeManageStatus(_x16) {
384
- return _batchChangeManageStatus.apply(this, arguments);
337
+ return (_batchChangeManageStatus = _batchChangeManageStatus || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(param) {
338
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
339
+ while (1) switch (_context9.prev = _context9.next) {
340
+ case 0:
341
+ _context9.next = 2;
342
+ return request.post('/cmdb/v1/api/ci/batchChangeManageStatus', param);
343
+
344
+ case 2:
345
+ return _context9.abrupt("return", _context9.sent);
346
+
347
+ case 3:
348
+ case "end":
349
+ return _context9.stop();
350
+ }
351
+ }, _callee9);
352
+ }))).apply(this, arguments);
385
353
  }
386
354
  /**
387
355
  * 计数函数
@@ -393,30 +361,23 @@ export function batchChangeManageStatus(_x16) {
393
361
  ]
394
362
  */
395
363
 
396
- function _batchChangeManageStatus() {
397
- _batchChangeManageStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(param) {
398
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
399
- while (1) {
400
- switch (_context20.prev = _context20.next) {
401
- case 0:
402
- _context20.next = 2;
403
- return request.post('/cmdb/v1/api/ci/batchChangeManageStatus', param);
404
-
405
- case 2:
406
- return _context20.abrupt("return", _context20.sent);
407
-
408
- case 3:
409
- case "end":
410
- return _context20.stop();
411
- }
412
- }
413
- }, _callee20);
414
- }));
415
- return _batchChangeManageStatus.apply(this, arguments);
416
- }
417
-
418
364
  export function commonCount(_x17) {
419
- return _commonCount.apply(this, arguments);
365
+ return (_commonCount = _commonCount || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(param) {
366
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
367
+ while (1) switch (_context10.prev = _context10.next) {
368
+ case 0:
369
+ _context10.next = 2;
370
+ return request.post('/cmdb/v1/api/ci/commonCount', param);
371
+
372
+ case 2:
373
+ return _context10.abrupt("return", _context10.sent);
374
+
375
+ case 3:
376
+ case "end":
377
+ return _context10.stop();
378
+ }
379
+ }, _callee10);
380
+ }))).apply(this, arguments);
420
381
  }
421
382
  /**
422
383
  * 批量改变监控状态
@@ -424,30 +385,23 @@ export function commonCount(_x17) {
424
385
  * @returns {object}
425
386
  */
426
387
 
427
- function _commonCount() {
428
- _commonCount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(param) {
429
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
430
- while (1) {
431
- switch (_context21.prev = _context21.next) {
432
- case 0:
433
- _context21.next = 2;
434
- return request.post('/cmdb/v1/api/ci/commonCount', param);
435
-
436
- case 2:
437
- return _context21.abrupt("return", _context21.sent);
438
-
439
- case 3:
440
- case "end":
441
- return _context21.stop();
442
- }
443
- }
444
- }, _callee21);
445
- }));
446
- return _commonCount.apply(this, arguments);
447
- }
448
-
449
388
  export function queryCiWithComponents(_x18) {
450
- return _queryCiWithComponents.apply(this, arguments);
389
+ return (_queryCiWithComponents = _queryCiWithComponents || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(mainCiIds) {
390
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
391
+ while (1) switch (_context11.prev = _context11.next) {
392
+ case 0:
393
+ _context11.next = 2;
394
+ return request.post('/cmdb/v1/api/ci/queryCiWithComponents', mainCiIds);
395
+
396
+ case 2:
397
+ return _context11.abrupt("return", _context11.sent);
398
+
399
+ case 3:
400
+ case "end":
401
+ return _context11.stop();
402
+ }
403
+ }, _callee11);
404
+ }))).apply(this, arguments);
451
405
  }
452
406
  /**
453
407
  * 连接关系忽略列表查询
@@ -458,440 +412,338 @@ export function queryCiWithComponents(_x18) {
458
412
  * @param {*} sort 排序对象
459
413
  */
460
414
 
461
- function _queryCiWithComponents() {
462
- _queryCiWithComponents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(mainCiIds) {
463
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
464
- while (1) {
465
- switch (_context22.prev = _context22.next) {
466
- case 0:
467
- _context22.next = 2;
468
- return request.post('/cmdb/v1/api/ci/queryCiWithComponents', mainCiIds);
469
-
470
- case 2:
471
- return _context22.abrupt("return", _context22.sent);
472
-
473
- case 3:
474
- case "end":
475
- return _context22.stop();
476
- }
477
- }
478
- }, _callee22);
479
- }));
480
- return _queryCiWithComponents.apply(this, arguments);
481
- }
482
-
483
415
  export function queryPageIgnoreRelations(_x19, _x20, _x21, _x22, _x23) {
484
- return _queryPageIgnoreRelations.apply(this, arguments);
416
+ return (_queryPageIgnoreRelations = _queryPageIgnoreRelations || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(relationType, currentPage, pageSize, condition, sort) {
417
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
418
+ while (1) switch (_context12.prev = _context12.next) {
419
+ case 0:
420
+ _context12.next = 2;
421
+ return request.post('/cmdb/v1/api/relation/ignore/list', _extends({
422
+ relationType: relationType,
423
+ currentPage: currentPage,
424
+ pageSize: pageSize
425
+ }, condition ? {
426
+ condition: condition
427
+ } : {}, sort ? {
428
+ sort: sort
429
+ } : {}));
430
+
431
+ case 2:
432
+ return _context12.abrupt("return", _context12.sent);
433
+
434
+ case 3:
435
+ case "end":
436
+ return _context12.stop();
437
+ }
438
+ }, _callee12);
439
+ }))).apply(this, arguments);
485
440
  }
486
441
  /**
487
442
  * 忽略的连接关系批量删除
488
443
  * @param {*} ids id集合
489
444
  */
490
445
 
491
- function _queryPageIgnoreRelations() {
492
- _queryPageIgnoreRelations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(relationType, currentPage, pageSize, condition, sort) {
493
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
494
- while (1) {
495
- switch (_context23.prev = _context23.next) {
496
- case 0:
497
- _context23.next = 2;
498
- return request.post('/cmdb/v1/api/relation/ignore/list', _extends({
499
- relationType: relationType,
500
- currentPage: currentPage,
501
- pageSize: pageSize
502
- }, condition ? {
503
- condition: condition
504
- } : {}, sort ? {
505
- sort: sort
506
- } : {}));
507
-
508
- case 2:
509
- return _context23.abrupt("return", _context23.sent);
510
-
511
- case 3:
512
- case "end":
513
- return _context23.stop();
514
- }
515
- }
516
- }, _callee23);
517
- }));
518
- return _queryPageIgnoreRelations.apply(this, arguments);
519
- }
520
-
521
446
  export function deleteIgnoreRelations(_x24) {
522
- return _deleteIgnoreRelations.apply(this, arguments);
523
- } // 上传文件
447
+ return (_deleteIgnoreRelations = _deleteIgnoreRelations || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(ids) {
448
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
449
+ while (1) switch (_context13.prev = _context13.next) {
450
+ case 0:
451
+ _context13.next = 2;
452
+ return request.post('/cmdb/v1/api/relation/ignore/batchDeleteById', ids.map(function (id) {
453
+ return {
454
+ id: id
455
+ };
456
+ }));
524
457
 
525
- function _deleteIgnoreRelations() {
526
- _deleteIgnoreRelations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(ids) {
527
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
528
- while (1) {
529
- switch (_context24.prev = _context24.next) {
530
- case 0:
531
- _context24.next = 2;
532
- return request.post('/cmdb/v1/api/relation/ignore/batchDeleteById', ids.map(function (id) {
533
- return {
534
- id: id
535
- };
536
- }));
537
-
538
- case 2:
539
- return _context24.abrupt("return", _context24.sent);
540
-
541
- case 3:
542
- case "end":
543
- return _context24.stop();
544
- }
458
+ case 2:
459
+ return _context13.abrupt("return", _context13.sent);
460
+
461
+ case 3:
462
+ case "end":
463
+ return _context13.stop();
545
464
  }
546
- }, _callee24);
547
- }));
548
- return _deleteIgnoreRelations.apply(this, arguments);
549
- }
465
+ }, _callee13);
466
+ }))).apply(this, arguments);
467
+ } // 上传文件
550
468
 
551
- export var uploadFile = /*#__PURE__*/function () {
552
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(files, userId, modelType) {
469
+ export var uploadFile = function uploadFile(_x25, _x26, _x27) {
470
+ return (_ref9 = _ref9 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(files, userId, modelType) {
553
471
  var formData, names, originFiles, config, result;
554
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
555
- while (1) {
556
- switch (_context7.prev = _context7.next) {
557
- case 0:
558
- formData = new FormData(); // 用户id
559
-
560
- formData.append('userId', userId);
561
- modelType && formData.append('modelType', modelType);
562
- names = [];
563
- originFiles = [];
564
- files.forEach(function (_ref10) {
565
- var name = _ref10.name,
566
- originFileObj = _ref10.originFileObj;
567
- names.push(name);
568
- originFiles.push(originFileObj);
569
- formData.append('files', originFileObj, name);
570
- });
571
- config = {
572
- headers: {
573
- 'Content-Type': "multipart/form-data;boundary=" + new Date().getTime()
574
- }
575
- };
576
- _context7.next = 9;
577
- return request.post('/cmdb/v1/api/import', formData, config);
472
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
473
+ while (1) switch (_context14.prev = _context14.next) {
474
+ case 0:
475
+ formData = new FormData(); // 用户id
476
+
477
+ formData.append('userId', userId);
478
+ modelType && formData.append('modelType', modelType);
479
+ names = [];
480
+ originFiles = [];
481
+ files.forEach(function (_ref10) {
482
+ var name = _ref10.name,
483
+ originFileObj = _ref10.originFileObj;
484
+ names.push(name);
485
+ originFiles.push(originFileObj);
486
+ formData.append('files', originFileObj, name);
487
+ });
488
+ config = {
489
+ headers: {
490
+ 'Content-Type': "multipart/form-data;boundary=" + new Date().getTime()
491
+ }
492
+ };
493
+ _context14.next = 9;
494
+ return request.post('/cmdb/v1/api/import', formData, config);
578
495
 
579
- case 9:
580
- result = _context7.sent;
581
- return _context7.abrupt("return", result);
496
+ case 9:
497
+ result = _context14.sent;
498
+ return _context14.abrupt("return", result);
582
499
 
583
- case 11:
584
- case "end":
585
- return _context7.stop();
586
- }
500
+ case 11:
501
+ case "end":
502
+ return _context14.stop();
587
503
  }
588
- }, _callee7);
589
- }));
590
-
591
- return function uploadFile(_x25, _x26, _x27) {
592
- return _ref9.apply(this, arguments);
593
- };
594
- }(); // 关闭提示
504
+ }, _callee14);
505
+ }))).apply(this, arguments);
506
+ }; // 关闭提示
595
507
 
596
- export var closeRecord = /*#__PURE__*/function () {
597
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(userId, modelType) {
508
+ export var closeRecord = function closeRecord(_x28, _x29) {
509
+ return (_ref11 = _ref11 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(userId, modelType) {
598
510
  var result;
599
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
600
- while (1) {
601
- switch (_context8.prev = _context8.next) {
602
- case 0:
603
- _context8.next = 2;
604
- return request.post('/cmdb/v1/api/delete/import/record', {
605
- userId: userId,
606
- modelType: modelType
607
- });
608
-
609
- case 2:
610
- result = _context8.sent;
611
- return _context8.abrupt("return", result);
612
-
613
- case 4:
614
- case "end":
615
- return _context8.stop();
616
- }
511
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
512
+ while (1) switch (_context15.prev = _context15.next) {
513
+ case 0:
514
+ _context15.next = 2;
515
+ return request.post('/cmdb/v1/api/delete/import/record', {
516
+ userId: userId,
517
+ modelType: modelType
518
+ });
519
+
520
+ case 2:
521
+ result = _context15.sent;
522
+ return _context15.abrupt("return", result);
523
+
524
+ case 4:
525
+ case "end":
526
+ return _context15.stop();
617
527
  }
618
- }, _callee8);
619
- }));
620
-
621
- return function closeRecord(_x28, _x29) {
622
- return _ref11.apply(this, arguments);
623
- };
624
- }(); // 获取提示信息
528
+ }, _callee15);
529
+ }))).apply(this, arguments);
530
+ }; // 获取提示信息
625
531
 
626
- export var getRecord = /*#__PURE__*/function () {
627
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(userId, modelType) {
628
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
629
- while (1) {
630
- switch (_context9.prev = _context9.next) {
631
- case 0:
632
- _context9.next = 2;
633
- return request.post('/cmdb/v1/api/get/import/record', {
634
- userId: userId,
635
- modelType: modelType
636
- });
637
-
638
- case 2:
639
- return _context9.abrupt("return", _context9.sent);
640
-
641
- case 3:
642
- case "end":
643
- return _context9.stop();
644
- }
532
+ export var getRecord = function getRecord(_x30, _x31) {
533
+ return (_ref12 = _ref12 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(userId, modelType) {
534
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
535
+ while (1) switch (_context16.prev = _context16.next) {
536
+ case 0:
537
+ _context16.next = 2;
538
+ return request.post('/cmdb/v1/api/get/import/record', {
539
+ userId: userId,
540
+ modelType: modelType
541
+ });
542
+
543
+ case 2:
544
+ return _context16.abrupt("return", _context16.sent);
545
+
546
+ case 3:
547
+ case "end":
548
+ return _context16.stop();
645
549
  }
646
- }, _callee9);
647
- }));
648
-
649
- return function getRecord(_x30, _x31) {
650
- return _ref12.apply(this, arguments);
651
- };
652
- }();
550
+ }, _callee16);
551
+ }))).apply(this, arguments);
552
+ };
653
553
  /**
654
554
  * 批量创建关系
655
555
  * @param {*} params
656
556
  * @returns
657
557
  */
658
558
 
659
- export var batchCreateRelation = /*#__PURE__*/function () {
660
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(params) {
661
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
662
- while (1) {
663
- switch (_context10.prev = _context10.next) {
664
- case 0:
665
- _context10.next = 2;
666
- return request.post('/cmdb/v1/api/relation/batchCreate', params);
667
-
668
- case 2:
669
- return _context10.abrupt("return", _context10.sent);
670
-
671
- case 3:
672
- case "end":
673
- return _context10.stop();
674
- }
675
- }
676
- }, _callee10);
677
- }));
678
-
679
- return function batchCreateRelation(_x32) {
680
- return _ref13.apply(this, arguments);
681
- };
682
- }();
683
- export var queryRelationByEndpoint = /*#__PURE__*/function () {
684
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(id) {
685
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
686
- while (1) {
687
- switch (_context11.prev = _context11.next) {
688
- case 0:
689
- _context11.next = 2;
690
- return request.post('/cmdb/v1/api/relation/queryByEndpoint', {
691
- id: id
692
- });
559
+ export var batchCreateRelation = function batchCreateRelation(_x32) {
560
+ return (_ref13 = _ref13 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(params) {
561
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
562
+ while (1) switch (_context17.prev = _context17.next) {
563
+ case 0:
564
+ _context17.next = 2;
565
+ return request.post('/cmdb/v1/api/relation/batchCreate', params);
693
566
 
694
- case 2:
695
- return _context11.abrupt("return", _context11.sent);
567
+ case 2:
568
+ return _context17.abrupt("return", _context17.sent);
696
569
 
697
- case 3:
698
- case "end":
699
- return _context11.stop();
700
- }
570
+ case 3:
571
+ case "end":
572
+ return _context17.stop();
701
573
  }
702
- }, _callee11);
703
- }));
704
-
705
- return function queryRelationByEndpoint(_x33) {
706
- return _ref14.apply(this, arguments);
707
- };
708
- }();
574
+ }, _callee17);
575
+ }))).apply(this, arguments);
576
+ };
577
+ export var queryRelationByEndpoint = function queryRelationByEndpoint(_x33) {
578
+ return (_ref14 = _ref14 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(id) {
579
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
580
+ while (1) switch (_context18.prev = _context18.next) {
581
+ case 0:
582
+ _context18.next = 2;
583
+ return request.post('/cmdb/v1/api/relation/queryByEndpoint', {
584
+ id: id
585
+ });
586
+
587
+ case 2:
588
+ return _context18.abrupt("return", _context18.sent);
589
+
590
+ case 3:
591
+ case "end":
592
+ return _context18.stop();
593
+ }
594
+ }, _callee18);
595
+ }))).apply(this, arguments);
596
+ };
709
597
  /**
710
598
  * 批量更新关系
711
599
  * @param {*} params
712
600
  * @returns
713
601
  */
714
602
 
715
- export var batchUpdateRelation = /*#__PURE__*/function () {
716
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(params) {
717
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
718
- while (1) {
719
- switch (_context12.prev = _context12.next) {
720
- case 0:
721
- _context12.next = 2;
722
- return request.post('/cmdb/v1/api/relation/batchUpdateAttributes', params);
723
-
724
- case 2:
725
- return _context12.abrupt("return", _context12.sent);
726
-
727
- case 3:
728
- case "end":
729
- return _context12.stop();
730
- }
731
- }
732
- }, _callee12);
733
- }));
603
+ export var batchUpdateRelation = function batchUpdateRelation(_x34) {
604
+ return (_ref15 = _ref15 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(params) {
605
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
606
+ while (1) switch (_context19.prev = _context19.next) {
607
+ case 0:
608
+ _context19.next = 2;
609
+ return request.post('/cmdb/v1/api/relation/batchUpdateAttributes', params);
610
+
611
+ case 2:
612
+ return _context19.abrupt("return", _context19.sent);
734
613
 
735
- return function batchUpdateRelation(_x34) {
736
- return _ref15.apply(this, arguments);
737
- };
738
- }();
614
+ case 3:
615
+ case "end":
616
+ return _context19.stop();
617
+ }
618
+ }, _callee19);
619
+ }))).apply(this, arguments);
620
+ };
739
621
  /**
740
622
  * 删除关系,添加到忽略
741
623
  * @param {*} id 关系id
742
624
  * @returns
743
625
  */
744
626
 
745
- export var deleteRelation = /*#__PURE__*/function () {
746
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(id) {
747
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
748
- while (1) {
749
- switch (_context13.prev = _context13.next) {
750
- case 0:
751
- _context13.next = 2;
752
- return request.post('/cmdb/v1/api/relation/delete', {
753
- id: id
754
- });
755
-
756
- case 2:
757
- return _context13.abrupt("return", _context13.sent);
758
-
759
- case 3:
760
- case "end":
761
- return _context13.stop();
762
- }
627
+ export var deleteRelation = function deleteRelation(_x35) {
628
+ return (_ref16 = _ref16 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(id) {
629
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
630
+ while (1) switch (_context20.prev = _context20.next) {
631
+ case 0:
632
+ _context20.next = 2;
633
+ return request.post('/cmdb/v1/api/relation/delete', {
634
+ id: id
635
+ });
636
+
637
+ case 2:
638
+ return _context20.abrupt("return", _context20.sent);
639
+
640
+ case 3:
641
+ case "end":
642
+ return _context20.stop();
763
643
  }
764
- }, _callee13);
765
- }));
766
-
767
- return function deleteRelation(_x35) {
768
- return _ref16.apply(this, arguments);
769
- };
770
- }();
644
+ }, _callee20);
645
+ }))).apply(this, arguments);
646
+ };
771
647
  /**
772
648
  * 批量删除关系
773
649
  * @param {[{id: string}]} params
774
650
  * @returns
775
651
  */
776
652
 
777
- export var batchDeleteRelation = /*#__PURE__*/function () {
778
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(params) {
779
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
780
- while (1) {
781
- switch (_context14.prev = _context14.next) {
782
- case 0:
783
- _context14.next = 2;
784
- return request.post('/cmdb/v1/api/relation/batchDelete', params);
785
-
786
- case 2:
787
- return _context14.abrupt("return", _context14.sent);
788
-
789
- case 3:
790
- case "end":
791
- return _context14.stop();
792
- }
793
- }
794
- }, _callee14);
795
- }));
653
+ export var batchDeleteRelation = function batchDeleteRelation(_x36) {
654
+ return (_ref17 = _ref17 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(params) {
655
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
656
+ while (1) switch (_context21.prev = _context21.next) {
657
+ case 0:
658
+ _context21.next = 2;
659
+ return request.post('/cmdb/v1/api/relation/batchDelete', params);
796
660
 
797
- return function batchDeleteRelation(_x36) {
798
- return _ref17.apply(this, arguments);
799
- };
800
- }();
661
+ case 2:
662
+ return _context21.abrupt("return", _context21.sent);
663
+
664
+ case 3:
665
+ case "end":
666
+ return _context21.stop();
667
+ }
668
+ }, _callee21);
669
+ }))).apply(this, arguments);
670
+ };
801
671
  /**
802
672
  * 强制删除关系
803
673
  * @param {*} id 关系id
804
674
  * @returns
805
675
  */
806
676
 
807
- export var forceDeleteRelation = /*#__PURE__*/function () {
808
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(id) {
809
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
810
- while (1) {
811
- switch (_context15.prev = _context15.next) {
812
- case 0:
813
- _context15.next = 2;
814
- return batchDeleteRelation([{
815
- id: id,
816
- force: true
817
- }]);
818
-
819
- case 2:
820
- return _context15.abrupt("return", _context15.sent);
821
-
822
- case 3:
823
- case "end":
824
- return _context15.stop();
825
- }
677
+ export var forceDeleteRelation = function forceDeleteRelation(_x37) {
678
+ return (_ref18 = _ref18 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(id) {
679
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
680
+ while (1) switch (_context22.prev = _context22.next) {
681
+ case 0:
682
+ _context22.next = 2;
683
+ return batchDeleteRelation([{
684
+ id: id,
685
+ force: true
686
+ }]);
687
+
688
+ case 2:
689
+ return _context22.abrupt("return", _context22.sent);
690
+
691
+ case 3:
692
+ case "end":
693
+ return _context22.stop();
826
694
  }
827
- }, _callee15);
828
- }));
829
-
830
- return function forceDeleteRelation(_x37) {
831
- return _ref18.apply(this, arguments);
832
- };
833
- }();
695
+ }, _callee22);
696
+ }))).apply(this, arguments);
697
+ };
834
698
  /**
835
699
  * 查询关系
836
700
  * @param {[{id: string}]} params
837
701
  * @returns
838
702
  */
839
703
 
840
- export var batchQueryRelationById = /*#__PURE__*/function () {
841
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(params) {
842
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
843
- while (1) {
844
- switch (_context16.prev = _context16.next) {
845
- case 0:
846
- _context16.next = 2;
847
- return request.post('/cmdb/v1/api/relation/batchQueryById', params);
848
-
849
- case 2:
850
- return _context16.abrupt("return", _context16.sent);
851
-
852
- case 3:
853
- case "end":
854
- return _context16.stop();
855
- }
856
- }
857
- }, _callee16);
858
- }));
704
+ export var batchQueryRelationById = function batchQueryRelationById(_x38) {
705
+ return (_ref19 = _ref19 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(params) {
706
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
707
+ while (1) switch (_context23.prev = _context23.next) {
708
+ case 0:
709
+ _context23.next = 2;
710
+ return request.post('/cmdb/v1/api/relation/batchQueryById', params);
711
+
712
+ case 2:
713
+ return _context23.abrupt("return", _context23.sent);
859
714
 
860
- return function batchQueryRelationById(_x38) {
861
- return _ref19.apply(this, arguments);
862
- };
863
- }();
715
+ case 3:
716
+ case "end":
717
+ return _context23.stop();
718
+ }
719
+ }, _callee23);
720
+ }))).apply(this, arguments);
721
+ };
864
722
  /**
865
723
  * 查询关系
866
724
  * @param {*} ids 关系ids
867
725
  * @returns
868
726
  */
869
727
 
870
- export var queryRelationByIds = /*#__PURE__*/function () {
871
- var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(ids) {
872
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
873
- while (1) {
874
- switch (_context17.prev = _context17.next) {
875
- case 0:
876
- _context17.next = 2;
877
- return batchQueryRelationById(ids.map(function (id) {
878
- return {
879
- id: id
880
- };
881
- }));
882
-
883
- case 2:
884
- return _context17.abrupt("return", _context17.sent);
885
-
886
- case 3:
887
- case "end":
888
- return _context17.stop();
889
- }
890
- }
891
- }, _callee17);
892
- }));
728
+ export var queryRelationByIds = function queryRelationByIds(_x39) {
729
+ return (_ref20 = _ref20 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(ids) {
730
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
731
+ while (1) switch (_context24.prev = _context24.next) {
732
+ case 0:
733
+ _context24.next = 2;
734
+ return batchQueryRelationById(ids.map(function (id) {
735
+ return {
736
+ id: id
737
+ };
738
+ }));
739
+
740
+ case 2:
741
+ return _context24.abrupt("return", _context24.sent);
893
742
 
894
- return function queryRelationByIds(_x39) {
895
- return _ref20.apply(this, arguments);
896
- };
897
- }();
743
+ case 3:
744
+ case "end":
745
+ return _context24.stop();
746
+ }
747
+ }, _callee24);
748
+ }))).apply(this, arguments);
749
+ };