@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.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +4 -2
- package/build/index.js +52 -45
- package/es/components/MultiResourceDrawer/index.js +22 -26
- package/es/components/ResourceList/ResourceSelect.js +55 -58
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
- package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
- package/es/core/editor/components/BackgroundView/index.js +149 -178
- package/es/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
- package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/es/core/editor/hooks/useNewElementTheme.js +2 -2
- package/es/core/editor/store/background.js +8 -10
- package/es/core/editor/store/topoEdit.js +4 -6
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +130 -142
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +525 -623
- package/es/core/models/Alarm.js +319 -402
- package/es/core/models/AttributeMetricDisplay.js +115 -143
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +279 -436
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +47 -61
- package/es/core/models/cache/DictCache.js +36 -42
- package/es/core/models/graph/Background.js +21 -26
- package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
- package/es/core/models/tagstips/ElementTagTipConfig.js +44 -58
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +14 -16
- package/es/core/services/background.js +59 -67
- package/es/core/services/cmdb/metric.js +14 -18
- package/es/core/services/cmdb.js +23 -27
- package/es/core/services/index.js +48 -68
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +15 -19
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +126 -145
- package/es/core/store/models/displayConfig.js +15 -19
- package/es/core/store/models/selection.js +4 -6
- package/es/core/store/models/topoAlarm.js +162 -145
- package/es/core/store/models/topoBaseInfoOverview.js +4 -6
- package/es/core/store/models/topoBizMod.js +9 -11
- package/es/core/store/models/topoConfig.js +215 -231
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +373 -395
- package/es/core/utils/imageUtil.js +23 -27
- package/es/core/utils/saveSerialize.js +14 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
- package/es/networkTopo/components/Link/hook.js +85 -96
- package/es/networkTopo/components/Link/index.js +104 -126
- package/es/networkTopo/components/Link/setting.js +48 -52
- package/es/networkTopo/getTopoData.js +73 -92
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +28 -46
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +548 -696
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +33 -48
- package/es/networkTopo/services/metric.js +38 -47
- package/es/networkTopo/services/model.js +616 -809
- package/es/networkTopo/services/risk.js +9 -11
- package/es/networkTopo/services/topo/auth.js +27 -33
- package/es/networkTopo/services/topo/basic.js +251 -289
- package/es/networkTopo/services/topo/blacklist.js +20 -24
- package/es/networkTopo/services/topo/ciInfo.js +27 -31
- package/es/networkTopo/services/topo/icon.js +49 -59
- package/es/networkTopo/services/topo/networkLink.js +32 -36
- package/es/networkTopo/services/topo/relation.js +9 -11
- package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
- package/es/networkTopo/store/functionAuth.js +31 -37
- package/es/networkTopo/store/topoCenter.js +142 -152
- package/es/networkTopo/store/topoLinkMod.js +4 -6
- package/es/networkTopo/store/topoTreeMod.js +170 -182
- package/es/networkTopo/utils/exportData.js +57 -61
- package/lib/components/MultiResourceDrawer/index.js +22 -26
- package/lib/components/ResourceList/ResourceSelect.js +54 -58
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
- package/lib/core/editor/components/BackgroundView/index.js +148 -177
- package/lib/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
- package/lib/core/editor/store/background.js +8 -10
- package/lib/core/editor/store/topoEdit.js +4 -6
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +129 -141
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +517 -615
- package/lib/core/models/Alarm.js +313 -396
- package/lib/core/models/AttributeMetricDisplay.js +118 -146
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +279 -436
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +48 -62
- package/lib/core/models/cache/DictCache.js +39 -45
- package/lib/core/models/graph/Background.js +22 -27
- package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
- package/lib/core/models/tagstips/ElementTagTipConfig.js +44 -58
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +18 -20
- package/lib/core/services/background.js +70 -78
- package/lib/core/services/cmdb/metric.js +14 -19
- package/lib/core/services/cmdb.js +24 -29
- package/lib/core/services/index.js +53 -72
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +16 -21
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +126 -145
- package/lib/core/store/models/displayConfig.js +15 -19
- package/lib/core/store/models/selection.js +4 -6
- package/lib/core/store/models/topoAlarm.js +163 -145
- package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
- package/lib/core/store/models/topoBizMod.js +9 -11
- package/lib/core/store/models/topoConfig.js +222 -238
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +375 -397
- package/lib/core/utils/imageUtil.js +26 -31
- package/lib/core/utils/saveSerialize.js +13 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
- package/lib/networkTopo/components/Link/hook.js +86 -98
- package/lib/networkTopo/components/Link/index.js +105 -127
- package/lib/networkTopo/components/Link/setting.js +48 -52
- package/lib/networkTopo/getTopoData.js +73 -92
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +28 -46
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +551 -700
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +35 -51
- package/lib/networkTopo/services/metric.js +37 -47
- package/lib/networkTopo/services/model.js +615 -809
- package/lib/networkTopo/services/risk.js +11 -13
- package/lib/networkTopo/services/topo/auth.js +27 -33
- package/lib/networkTopo/services/topo/basic.js +252 -290
- package/lib/networkTopo/services/topo/blacklist.js +20 -24
- package/lib/networkTopo/services/topo/ciInfo.js +34 -38
- package/lib/networkTopo/services/topo/icon.js +59 -69
- package/lib/networkTopo/services/topo/networkLink.js +32 -36
- package/lib/networkTopo/services/topo/relation.js +11 -13
- package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
- package/lib/networkTopo/store/functionAuth.js +31 -37
- package/lib/networkTopo/store/topoCenter.js +142 -152
- package/lib/networkTopo/store/topoLinkMod.js +4 -6
- package/lib/networkTopo/store/topoTreeMod.js +166 -178
- package/lib/networkTopo/utils/exportData.js +63 -68
- 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 =
|
15
|
-
|
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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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 =
|
51
|
-
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
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 =
|
87
|
-
|
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
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
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
|
-
|
98
|
-
|
99
|
-
|
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 =
|
139
|
-
|
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
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
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
|
-
|
217
|
-
|
218
|
-
|
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.
|
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
|
-
|
267
|
-
|
268
|
-
|
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
|
-
|
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
|
-
|
298
|
-
|
299
|
-
|
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
|
-
|
318
|
-
|
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
|
-
|
327
|
-
|
328
|
-
_context6.next =
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
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
|
-
|
343
|
-
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
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
|
-
},
|
547
|
-
}));
|
548
|
-
|
549
|
-
}
|
465
|
+
}, _callee13);
|
466
|
+
}))).apply(this, arguments);
|
467
|
+
} // 上传文件
|
550
468
|
|
551
|
-
export var uploadFile =
|
552
|
-
|
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
|
555
|
-
while (1) {
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
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
|
-
|
580
|
-
|
581
|
-
|
496
|
+
case 9:
|
497
|
+
result = _context14.sent;
|
498
|
+
return _context14.abrupt("return", result);
|
582
499
|
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
}
|
500
|
+
case 11:
|
501
|
+
case "end":
|
502
|
+
return _context14.stop();
|
587
503
|
}
|
588
|
-
},
|
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 =
|
597
|
-
|
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
|
600
|
-
while (1) {
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
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
|
-
},
|
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 =
|
627
|
-
|
628
|
-
return _regeneratorRuntime.wrap(function
|
629
|
-
while (1) {
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
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
|
-
},
|
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 =
|
660
|
-
|
661
|
-
return _regeneratorRuntime.wrap(function
|
662
|
-
while (1) {
|
663
|
-
|
664
|
-
|
665
|
-
|
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
|
-
|
695
|
-
|
567
|
+
case 2:
|
568
|
+
return _context17.abrupt("return", _context17.sent);
|
696
569
|
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
}
|
570
|
+
case 3:
|
571
|
+
case "end":
|
572
|
+
return _context17.stop();
|
701
573
|
}
|
702
|
-
},
|
703
|
-
}));
|
704
|
-
|
705
|
-
|
706
|
-
|
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 =
|
716
|
-
|
717
|
-
return _regeneratorRuntime.wrap(function
|
718
|
-
while (1) {
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
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
|
-
|
736
|
-
|
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 =
|
746
|
-
|
747
|
-
return _regeneratorRuntime.wrap(function
|
748
|
-
while (1) {
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
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
|
-
},
|
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 =
|
778
|
-
|
779
|
-
return _regeneratorRuntime.wrap(function
|
780
|
-
while (1) {
|
781
|
-
|
782
|
-
|
783
|
-
|
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
|
-
|
798
|
-
|
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 =
|
808
|
-
|
809
|
-
return _regeneratorRuntime.wrap(function
|
810
|
-
while (1) {
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
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
|
-
},
|
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 =
|
841
|
-
|
842
|
-
return _regeneratorRuntime.wrap(function
|
843
|
-
while (1) {
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
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
|
-
|
861
|
-
|
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 =
|
871
|
-
|
872
|
-
return _regeneratorRuntime.wrap(function
|
873
|
-
while (1) {
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
return
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
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
|
-
|
895
|
-
|
896
|
-
|
897
|
-
}
|
743
|
+
case 3:
|
744
|
+
case "end":
|
745
|
+
return _context24.stop();
|
746
|
+
}
|
747
|
+
}, _callee24);
|
748
|
+
}))).apply(this, arguments);
|
749
|
+
};
|