@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
@@ -29,37 +29,33 @@ var _componentTopologyUtils = require("@riil-frontend/component-topology-utils")
|
|
29
29
|
var _excluded = ["checkAuth"],
|
30
30
|
_excluded2 = ["totalPage", "pageIndex", "data"];
|
31
31
|
|
32
|
+
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;
|
33
|
+
|
32
34
|
/**
|
33
35
|
* 根据id获取实例数据
|
34
36
|
* TODO params参数名称可语义化
|
35
37
|
* @param {string} id 实例id
|
36
38
|
*/
|
37
|
-
var queryById =
|
38
|
-
|
39
|
+
var queryById = function queryById(_x) {
|
40
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(id) {
|
39
41
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
40
|
-
while (1) {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
return _context.stop();
|
54
|
-
}
|
42
|
+
while (1) switch (_context.prev = _context.next) {
|
43
|
+
case 0:
|
44
|
+
_context.next = 2;
|
45
|
+
return _componentTopologyUtils.request.post('/mdc/v1/api/cmdb/queryCiById', {
|
46
|
+
id: id
|
47
|
+
});
|
48
|
+
|
49
|
+
case 2:
|
50
|
+
return _context.abrupt("return", _context.sent);
|
51
|
+
|
52
|
+
case 3:
|
53
|
+
case "end":
|
54
|
+
return _context.stop();
|
55
55
|
}
|
56
56
|
}, _callee);
|
57
|
-
}));
|
58
|
-
|
59
|
-
return function queryById(_x) {
|
60
|
-
return _ref.apply(this, arguments);
|
61
|
-
};
|
62
|
-
}();
|
57
|
+
}))).apply(this, arguments);
|
58
|
+
};
|
63
59
|
/**
|
64
60
|
* ci删除
|
65
61
|
* @param {string} id 实例id
|
@@ -73,32 +69,26 @@ var queryById = /*#__PURE__*/function () {
|
|
73
69
|
|
74
70
|
exports.queryById = queryById;
|
75
71
|
|
76
|
-
var deleteById =
|
77
|
-
|
72
|
+
var deleteById = function deleteById(_x2) {
|
73
|
+
return (_ref2 = _ref2 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
|
78
74
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
79
|
-
while (1) {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
return _context2.stop();
|
93
|
-
}
|
75
|
+
while (1) switch (_context2.prev = _context2.next) {
|
76
|
+
case 0:
|
77
|
+
_context2.next = 2;
|
78
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/deleteById', {
|
79
|
+
id: id
|
80
|
+
});
|
81
|
+
|
82
|
+
case 2:
|
83
|
+
return _context2.abrupt("return", _context2.sent);
|
84
|
+
|
85
|
+
case 3:
|
86
|
+
case "end":
|
87
|
+
return _context2.stop();
|
94
88
|
}
|
95
89
|
}, _callee2);
|
96
|
-
}));
|
97
|
-
|
98
|
-
return function deleteById(_x2) {
|
99
|
-
return _ref2.apply(this, arguments);
|
100
|
-
};
|
101
|
-
}();
|
90
|
+
}))).apply(this, arguments);
|
91
|
+
};
|
102
92
|
/**
|
103
93
|
* ci删除(批量)
|
104
94
|
* @param {array} keys [ "1513569" ,...]
|
@@ -112,41 +102,35 @@ var deleteById = /*#__PURE__*/function () {
|
|
112
102
|
|
113
103
|
exports.deleteById = deleteById;
|
114
104
|
|
115
|
-
var batchDeleteById =
|
116
|
-
|
105
|
+
var batchDeleteById = function batchDeleteById(_x3) {
|
106
|
+
return (_ref3 = _ref3 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(keys) {
|
117
107
|
var ids;
|
118
108
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
119
|
-
while (1) {
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
109
|
+
while (1) switch (_context3.prev = _context3.next) {
|
110
|
+
case 0:
|
111
|
+
if (keys === void 0) {
|
112
|
+
keys = [];
|
113
|
+
}
|
114
|
+
|
115
|
+
// TODO 替换为map
|
116
|
+
ids = keys.map(function (key) {
|
117
|
+
return {
|
118
|
+
id: key
|
119
|
+
};
|
120
|
+
});
|
121
|
+
_context3.next = 4;
|
122
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
|
123
|
+
|
124
|
+
case 4:
|
125
|
+
return _context3.abrupt("return", _context3.sent);
|
125
126
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
id: key
|
130
|
-
};
|
131
|
-
});
|
132
|
-
_context3.next = 4;
|
133
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
|
134
|
-
|
135
|
-
case 4:
|
136
|
-
return _context3.abrupt("return", _context3.sent);
|
137
|
-
|
138
|
-
case 5:
|
139
|
-
case "end":
|
140
|
-
return _context3.stop();
|
141
|
-
}
|
127
|
+
case 5:
|
128
|
+
case "end":
|
129
|
+
return _context3.stop();
|
142
130
|
}
|
143
131
|
}, _callee3);
|
144
|
-
}));
|
145
|
-
|
146
|
-
return function batchDeleteById(_x3) {
|
147
|
-
return _ref3.apply(this, arguments);
|
148
|
-
};
|
149
|
-
}();
|
132
|
+
}))).apply(this, arguments);
|
133
|
+
};
|
150
134
|
/**
|
151
135
|
* cmdm 通用查询接口
|
152
136
|
* @param {Object | string } condition 查询条件对象 或 接口原生查询字符串
|
@@ -167,96 +151,90 @@ var batchDeleteById = /*#__PURE__*/function () {
|
|
167
151
|
|
168
152
|
exports.batchDeleteById = batchDeleteById;
|
169
153
|
|
170
|
-
var fetchCommonQuery =
|
171
|
-
|
154
|
+
var fetchCommonQuery = function fetchCommonQuery(_x4, _x5, _x6, _x7, _x8, _x9, _x10) {
|
155
|
+
return (_ref4 = _ref4 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(condition, sortIndex, sortMethod, currentPage, pageSize, sort, authOption) {
|
172
156
|
var newCondition, _ref5, _ref5$checkAuth, checkAuth, otherOption, url, sorts, params, response, _ref6, totalPage, pageIndex, data, result;
|
173
157
|
|
174
158
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
175
|
-
while (1) {
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
}
|
196
|
-
|
197
|
-
return param;
|
198
|
-
}, []).join(' && ');
|
199
|
-
}
|
200
|
-
|
201
|
-
_ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = (0, _objectWithoutPropertiesLoose2["default"])(_ref5, _excluded); // const url = checkAuth
|
202
|
-
// ? '/appserver/api/v1/cmdb/ci/commonQuery'
|
203
|
-
// : '/api/v1/cmdb/ci/commonQuery';
|
204
|
-
// const url ='/api/v1/cmdb/ci/commonQuery';
|
205
|
-
// let params = {
|
206
|
-
// condition: condition.conditions
|
207
|
-
// ? `${newCondition} && ${condition.conditions}`
|
208
|
-
// : newCondition,
|
209
|
-
// sort: sort || `${sortIndex} ${sortMethod}`,
|
210
|
-
// currentPage,
|
211
|
-
// pageSize,
|
212
|
-
// };
|
213
|
-
// APPBIR MVP
|
214
|
-
// ------------------------------------------------
|
215
|
-
// TODO important 带确认权限接口是否可通 ---
|
216
|
-
|
217
|
-
url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
|
218
|
-
sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
|
219
|
-
params = {
|
220
|
-
condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
|
221
|
-
// APPBIR MVP 临时去掉排序 等接口OK
|
222
|
-
// orders: [{
|
223
|
-
// name: sorts[0],
|
224
|
-
// type: sorts[1]
|
225
|
-
// }],
|
226
|
-
pageIndex: currentPage,
|
227
|
-
pageSize: pageSize
|
228
|
-
};
|
229
|
-
|
230
|
-
if (checkAuth && otherOption) {
|
231
|
-
params = (0, _extends2["default"])({}, params, otherOption);
|
232
|
-
} // 处理 返回结果
|
233
|
-
|
234
|
-
|
235
|
-
_context4.next = 9;
|
236
|
-
return _componentTopologyUtils.request.post(url, params);
|
237
|
-
|
238
|
-
case 9:
|
239
|
-
response = _context4.sent;
|
240
|
-
// TODO ---
|
241
|
-
_ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = (0, _objectWithoutPropertiesLoose2["default"])(_ref6, _excluded2);
|
242
|
-
return _context4.abrupt("return", (0, _extends2["default"])({}, result, {
|
243
|
-
total: totalPage,
|
244
|
-
page: pageIndex,
|
245
|
-
content: data
|
246
|
-
}));
|
159
|
+
while (1) switch (_context4.prev = _context4.next) {
|
160
|
+
case 0:
|
161
|
+
newCondition = condition;
|
162
|
+
|
163
|
+
if (typeof newCondition !== 'string') {
|
164
|
+
newCondition = Object.keys(newCondition).reduce(function (param, current) {
|
165
|
+
if (current === 'ciType') {
|
166
|
+
param.push("type(" + (Array.isArray(newCondition[current]) ? newCondition[current].map(function (item) {
|
167
|
+
return "'" + item + "'";
|
168
|
+
}).toString() : "'" + newCondition[current] + "'") + ")");
|
169
|
+
} else if (current === 'principal') {
|
170
|
+
param.push(newCondition[current]);
|
171
|
+
} else if (current === 'searchValue' && newCondition.searchValue && newCondition.searchIndexArray) {
|
172
|
+
param.push("contain('" + newCondition.searchValue + "'," + newCondition.searchIndexArray.toString() + ")");
|
173
|
+
} else if (current === 'alert') {
|
174
|
+
var alert = Object.keys(newCondition[current]).map(function (item) {
|
175
|
+
return item + " = " + newCondition[current][item];
|
176
|
+
}).join(' && ');
|
177
|
+
param.push("alert(" + alert + ")");
|
178
|
+
}
|
247
179
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
180
|
+
return param;
|
181
|
+
}, []).join(' && ');
|
182
|
+
}
|
183
|
+
|
184
|
+
_ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = (0, _objectWithoutPropertiesLoose2["default"])(_ref5, _excluded); // const url = checkAuth
|
185
|
+
// ? '/appserver/api/v1/cmdb/ci/commonQuery'
|
186
|
+
// : '/api/v1/cmdb/ci/commonQuery';
|
187
|
+
// const url ='/api/v1/cmdb/ci/commonQuery';
|
188
|
+
// let params = {
|
189
|
+
// condition: condition.conditions
|
190
|
+
// ? `${newCondition} && ${condition.conditions}`
|
191
|
+
// : newCondition,
|
192
|
+
// sort: sort || `${sortIndex} ${sortMethod}`,
|
193
|
+
// currentPage,
|
194
|
+
// pageSize,
|
195
|
+
// };
|
196
|
+
// APPBIR MVP
|
197
|
+
// ------------------------------------------------
|
198
|
+
// TODO important 带确认权限接口是否可通 ---
|
199
|
+
|
200
|
+
url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
|
201
|
+
sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
|
202
|
+
params = {
|
203
|
+
condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
|
204
|
+
// APPBIR MVP 临时去掉排序 等接口OK
|
205
|
+
// orders: [{
|
206
|
+
// name: sorts[0],
|
207
|
+
// type: sorts[1]
|
208
|
+
// }],
|
209
|
+
pageIndex: currentPage,
|
210
|
+
pageSize: pageSize
|
211
|
+
};
|
212
|
+
|
213
|
+
if (checkAuth && otherOption) {
|
214
|
+
params = (0, _extends2["default"])({}, params, otherOption);
|
215
|
+
} // 处理 返回结果
|
216
|
+
|
217
|
+
|
218
|
+
_context4.next = 9;
|
219
|
+
return _componentTopologyUtils.request.post(url, params);
|
220
|
+
|
221
|
+
case 9:
|
222
|
+
response = _context4.sent;
|
223
|
+
// TODO ---
|
224
|
+
_ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = (0, _objectWithoutPropertiesLoose2["default"])(_ref6, _excluded2);
|
225
|
+
return _context4.abrupt("return", (0, _extends2["default"])({}, result, {
|
226
|
+
total: totalPage,
|
227
|
+
page: pageIndex,
|
228
|
+
content: data
|
229
|
+
}));
|
230
|
+
|
231
|
+
case 12:
|
232
|
+
case "end":
|
233
|
+
return _context4.stop();
|
252
234
|
}
|
253
235
|
}, _callee4);
|
254
|
-
}));
|
255
|
-
|
256
|
-
return function fetchCommonQuery(_x4, _x5, _x6, _x7, _x8, _x9, _x10) {
|
257
|
-
return _ref4.apply(this, arguments);
|
258
|
-
};
|
259
|
-
}();
|
236
|
+
}))).apply(this, arguments);
|
237
|
+
};
|
260
238
|
/**
|
261
239
|
* cmdb实例查询接口(不涉及权限)
|
262
240
|
* @param {Object} param
|
@@ -267,121 +245,102 @@ var fetchCommonQuery = /*#__PURE__*/function () {
|
|
267
245
|
exports.fetchCommonQuery = fetchCommonQuery;
|
268
246
|
|
269
247
|
function commonQuery(_x11) {
|
270
|
-
return _commonQuery
|
271
|
-
} // 批量属性更新
|
272
|
-
|
273
|
-
|
274
|
-
function _commonQuery() {
|
275
|
-
_commonQuery = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18(param) {
|
276
|
-
return _regenerator["default"].wrap(function _callee18$(_context18) {
|
277
|
-
while (1) {
|
278
|
-
switch (_context18.prev = _context18.next) {
|
279
|
-
case 0:
|
280
|
-
_context18.next = 2;
|
281
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonQuery', param);
|
282
|
-
|
283
|
-
case 2:
|
284
|
-
return _context18.abrupt("return", _context18.sent);
|
285
|
-
|
286
|
-
case 3:
|
287
|
-
case "end":
|
288
|
-
return _context18.stop();
|
289
|
-
}
|
290
|
-
}
|
291
|
-
}, _callee18);
|
292
|
-
}));
|
293
|
-
return _commonQuery.apply(this, arguments);
|
294
|
-
}
|
295
|
-
|
296
|
-
var batchUpdateAttributes = /*#__PURE__*/function () {
|
297
|
-
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(values, fieldName) {
|
298
|
-
var aa, _aa;
|
299
|
-
|
248
|
+
return (_commonQuery = _commonQuery || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(param) {
|
300
249
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
301
|
-
while (1) {
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
_context5.next = 8;
|
306
|
-
break;
|
307
|
-
}
|
308
|
-
|
309
|
-
// 传了要更新的属性名,更新某一个属性
|
310
|
-
aa = {};
|
311
|
-
aa[fieldName] = values[fieldName];
|
312
|
-
_context5.next = 5;
|
313
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
|
314
|
-
id: values.id,
|
315
|
-
attributes: aa
|
316
|
-
}]);
|
317
|
-
|
318
|
-
case 5:
|
319
|
-
return _context5.abrupt("return", _context5.sent);
|
320
|
-
|
321
|
-
case 8:
|
322
|
-
if (!Array.isArray(values)) {
|
323
|
-
_context5.next = 12;
|
324
|
-
break;
|
325
|
-
}
|
250
|
+
while (1) switch (_context5.prev = _context5.next) {
|
251
|
+
case 0:
|
252
|
+
_context5.next = 2;
|
253
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonQuery', param);
|
326
254
|
|
327
|
-
|
328
|
-
|
255
|
+
case 2:
|
256
|
+
return _context5.abrupt("return", _context5.sent);
|
329
257
|
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
case 12:
|
334
|
-
_aa = values.id;
|
335
|
-
delete values.id;
|
336
|
-
_context5.next = 16;
|
337
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
|
338
|
-
id: _aa,
|
339
|
-
attributes: values
|
340
|
-
}]);
|
341
|
-
|
342
|
-
case 16:
|
343
|
-
return _context5.abrupt("return", _context5.sent);
|
344
|
-
|
345
|
-
case 17:
|
346
|
-
case "end":
|
347
|
-
return _context5.stop();
|
348
|
-
}
|
258
|
+
case 3:
|
259
|
+
case "end":
|
260
|
+
return _context5.stop();
|
349
261
|
}
|
350
262
|
}, _callee5);
|
351
|
-
}));
|
352
|
-
|
353
|
-
return function batchUpdateAttributes(_x12, _x13) {
|
354
|
-
return _ref7.apply(this, arguments);
|
355
|
-
};
|
356
|
-
}(); // 创建单个ci实例
|
263
|
+
}))).apply(this, arguments);
|
264
|
+
} // 批量属性更新
|
357
265
|
|
358
266
|
|
359
|
-
|
267
|
+
var batchUpdateAttributes = function batchUpdateAttributes(_x12, _x13) {
|
268
|
+
return (_ref7 = _ref7 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(values, fieldName) {
|
269
|
+
var aa, _aa;
|
360
270
|
|
361
|
-
var createInstance = /*#__PURE__*/function () {
|
362
|
-
var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(values) {
|
363
271
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
364
|
-
while (1) {
|
365
|
-
|
366
|
-
|
367
|
-
_context6.next =
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
272
|
+
while (1) switch (_context6.prev = _context6.next) {
|
273
|
+
case 0:
|
274
|
+
if (!fieldName) {
|
275
|
+
_context6.next = 8;
|
276
|
+
break;
|
277
|
+
}
|
278
|
+
|
279
|
+
// 传了要更新的属性名,更新某一个属性
|
280
|
+
aa = {};
|
281
|
+
aa[fieldName] = values[fieldName];
|
282
|
+
_context6.next = 5;
|
283
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
|
284
|
+
id: values.id,
|
285
|
+
attributes: aa
|
286
|
+
}]);
|
287
|
+
|
288
|
+
case 5:
|
289
|
+
return _context6.abrupt("return", _context6.sent);
|
290
|
+
|
291
|
+
case 8:
|
292
|
+
if (!Array.isArray(values)) {
|
293
|
+
_context6.next = 12;
|
294
|
+
break;
|
295
|
+
}
|
296
|
+
|
297
|
+
_context6.next = 11;
|
298
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', values);
|
299
|
+
|
300
|
+
case 11:
|
301
|
+
return _context6.abrupt("return", _context6.sent);
|
302
|
+
|
303
|
+
case 12:
|
304
|
+
_aa = values.id;
|
305
|
+
delete values.id;
|
306
|
+
_context6.next = 16;
|
307
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
|
308
|
+
id: _aa,
|
309
|
+
attributes: values
|
310
|
+
}]);
|
311
|
+
|
312
|
+
case 16:
|
313
|
+
return _context6.abrupt("return", _context6.sent);
|
314
|
+
|
315
|
+
case 17:
|
316
|
+
case "end":
|
317
|
+
return _context6.stop();
|
377
318
|
}
|
378
319
|
}, _callee6);
|
379
|
-
}));
|
320
|
+
}))).apply(this, arguments);
|
321
|
+
}; // 创建单个ci实例
|
322
|
+
|
323
|
+
|
324
|
+
exports.batchUpdateAttributes = batchUpdateAttributes;
|
325
|
+
|
326
|
+
var createInstance = function createInstance(_x14) {
|
327
|
+
return (_ref8 = _ref8 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(values) {
|
328
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
329
|
+
while (1) switch (_context7.prev = _context7.next) {
|
330
|
+
case 0:
|
331
|
+
_context7.next = 2;
|
332
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/create', values);
|
333
|
+
|
334
|
+
case 2:
|
335
|
+
return _context7.abrupt("return", _context7.sent);
|
380
336
|
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
}
|
337
|
+
case 3:
|
338
|
+
case "end":
|
339
|
+
return _context7.stop();
|
340
|
+
}
|
341
|
+
}, _callee7);
|
342
|
+
}))).apply(this, arguments);
|
343
|
+
};
|
385
344
|
/**
|
386
345
|
* 改变监控状态
|
387
346
|
* @param {object} param 查询传参{"id":"xxxx","manageStatus": 3,//已监控:3,加入监控中:2,取消监控中:1,未监控:0}
|
@@ -392,7 +351,22 @@ var createInstance = /*#__PURE__*/function () {
|
|
392
351
|
exports.createInstance = createInstance;
|
393
352
|
|
394
353
|
function changeManageStatus(_x15) {
|
395
|
-
return _changeManageStatus
|
354
|
+
return (_changeManageStatus = _changeManageStatus || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(param) {
|
355
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
356
|
+
while (1) switch (_context8.prev = _context8.next) {
|
357
|
+
case 0:
|
358
|
+
_context8.next = 2;
|
359
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/changeManageStatus', param);
|
360
|
+
|
361
|
+
case 2:
|
362
|
+
return _context8.abrupt("return", _context8.sent);
|
363
|
+
|
364
|
+
case 3:
|
365
|
+
case "end":
|
366
|
+
return _context8.stop();
|
367
|
+
}
|
368
|
+
}, _callee8);
|
369
|
+
}))).apply(this, arguments);
|
396
370
|
}
|
397
371
|
/**
|
398
372
|
* 批量改变监控状态
|
@@ -401,30 +375,23 @@ function changeManageStatus(_x15) {
|
|
401
375
|
*/
|
402
376
|
|
403
377
|
|
404
|
-
function _changeManageStatus() {
|
405
|
-
_changeManageStatus = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee19(param) {
|
406
|
-
return _regenerator["default"].wrap(function _callee19$(_context19) {
|
407
|
-
while (1) {
|
408
|
-
switch (_context19.prev = _context19.next) {
|
409
|
-
case 0:
|
410
|
-
_context19.next = 2;
|
411
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/changeManageStatus', param);
|
412
|
-
|
413
|
-
case 2:
|
414
|
-
return _context19.abrupt("return", _context19.sent);
|
415
|
-
|
416
|
-
case 3:
|
417
|
-
case "end":
|
418
|
-
return _context19.stop();
|
419
|
-
}
|
420
|
-
}
|
421
|
-
}, _callee19);
|
422
|
-
}));
|
423
|
-
return _changeManageStatus.apply(this, arguments);
|
424
|
-
}
|
425
|
-
|
426
378
|
function batchChangeManageStatus(_x16) {
|
427
|
-
return _batchChangeManageStatus
|
379
|
+
return (_batchChangeManageStatus = _batchChangeManageStatus || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(param) {
|
380
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
381
|
+
while (1) switch (_context9.prev = _context9.next) {
|
382
|
+
case 0:
|
383
|
+
_context9.next = 2;
|
384
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchChangeManageStatus', param);
|
385
|
+
|
386
|
+
case 2:
|
387
|
+
return _context9.abrupt("return", _context9.sent);
|
388
|
+
|
389
|
+
case 3:
|
390
|
+
case "end":
|
391
|
+
return _context9.stop();
|
392
|
+
}
|
393
|
+
}, _callee9);
|
394
|
+
}))).apply(this, arguments);
|
428
395
|
}
|
429
396
|
/**
|
430
397
|
* 计数函数
|
@@ -437,30 +404,23 @@ function batchChangeManageStatus(_x16) {
|
|
437
404
|
*/
|
438
405
|
|
439
406
|
|
440
|
-
function _batchChangeManageStatus() {
|
441
|
-
_batchChangeManageStatus = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee20(param) {
|
442
|
-
return _regenerator["default"].wrap(function _callee20$(_context20) {
|
443
|
-
while (1) {
|
444
|
-
switch (_context20.prev = _context20.next) {
|
445
|
-
case 0:
|
446
|
-
_context20.next = 2;
|
447
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchChangeManageStatus', param);
|
448
|
-
|
449
|
-
case 2:
|
450
|
-
return _context20.abrupt("return", _context20.sent);
|
451
|
-
|
452
|
-
case 3:
|
453
|
-
case "end":
|
454
|
-
return _context20.stop();
|
455
|
-
}
|
456
|
-
}
|
457
|
-
}, _callee20);
|
458
|
-
}));
|
459
|
-
return _batchChangeManageStatus.apply(this, arguments);
|
460
|
-
}
|
461
|
-
|
462
407
|
function commonCount(_x17) {
|
463
|
-
return _commonCount
|
408
|
+
return (_commonCount = _commonCount || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(param) {
|
409
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
410
|
+
while (1) switch (_context10.prev = _context10.next) {
|
411
|
+
case 0:
|
412
|
+
_context10.next = 2;
|
413
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonCount', param);
|
414
|
+
|
415
|
+
case 2:
|
416
|
+
return _context10.abrupt("return", _context10.sent);
|
417
|
+
|
418
|
+
case 3:
|
419
|
+
case "end":
|
420
|
+
return _context10.stop();
|
421
|
+
}
|
422
|
+
}, _callee10);
|
423
|
+
}))).apply(this, arguments);
|
464
424
|
}
|
465
425
|
/**
|
466
426
|
* 批量改变监控状态
|
@@ -469,30 +429,23 @@ function commonCount(_x17) {
|
|
469
429
|
*/
|
470
430
|
|
471
431
|
|
472
|
-
function _commonCount() {
|
473
|
-
_commonCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee21(param) {
|
474
|
-
return _regenerator["default"].wrap(function _callee21$(_context21) {
|
475
|
-
while (1) {
|
476
|
-
switch (_context21.prev = _context21.next) {
|
477
|
-
case 0:
|
478
|
-
_context21.next = 2;
|
479
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonCount', param);
|
480
|
-
|
481
|
-
case 2:
|
482
|
-
return _context21.abrupt("return", _context21.sent);
|
483
|
-
|
484
|
-
case 3:
|
485
|
-
case "end":
|
486
|
-
return _context21.stop();
|
487
|
-
}
|
488
|
-
}
|
489
|
-
}, _callee21);
|
490
|
-
}));
|
491
|
-
return _commonCount.apply(this, arguments);
|
492
|
-
}
|
493
|
-
|
494
432
|
function queryCiWithComponents(_x18) {
|
495
|
-
return _queryCiWithComponents
|
433
|
+
return (_queryCiWithComponents = _queryCiWithComponents || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(mainCiIds) {
|
434
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
435
|
+
while (1) switch (_context11.prev = _context11.next) {
|
436
|
+
case 0:
|
437
|
+
_context11.next = 2;
|
438
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/queryCiWithComponents', mainCiIds);
|
439
|
+
|
440
|
+
case 2:
|
441
|
+
return _context11.abrupt("return", _context11.sent);
|
442
|
+
|
443
|
+
case 3:
|
444
|
+
case "end":
|
445
|
+
return _context11.stop();
|
446
|
+
}
|
447
|
+
}, _callee11);
|
448
|
+
}))).apply(this, arguments);
|
496
449
|
}
|
497
450
|
/**
|
498
451
|
* 连接关系忽略列表查询
|
@@ -504,30 +457,31 @@ function queryCiWithComponents(_x18) {
|
|
504
457
|
*/
|
505
458
|
|
506
459
|
|
507
|
-
function _queryCiWithComponents() {
|
508
|
-
_queryCiWithComponents = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee22(mainCiIds) {
|
509
|
-
return _regenerator["default"].wrap(function _callee22$(_context22) {
|
510
|
-
while (1) {
|
511
|
-
switch (_context22.prev = _context22.next) {
|
512
|
-
case 0:
|
513
|
-
_context22.next = 2;
|
514
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/queryCiWithComponents', mainCiIds);
|
515
|
-
|
516
|
-
case 2:
|
517
|
-
return _context22.abrupt("return", _context22.sent);
|
518
|
-
|
519
|
-
case 3:
|
520
|
-
case "end":
|
521
|
-
return _context22.stop();
|
522
|
-
}
|
523
|
-
}
|
524
|
-
}, _callee22);
|
525
|
-
}));
|
526
|
-
return _queryCiWithComponents.apply(this, arguments);
|
527
|
-
}
|
528
|
-
|
529
460
|
function queryPageIgnoreRelations(_x19, _x20, _x21, _x22, _x23) {
|
530
|
-
return _queryPageIgnoreRelations.
|
461
|
+
return (_queryPageIgnoreRelations = _queryPageIgnoreRelations || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(relationType, currentPage, pageSize, condition, sort) {
|
462
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
463
|
+
while (1) switch (_context12.prev = _context12.next) {
|
464
|
+
case 0:
|
465
|
+
_context12.next = 2;
|
466
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/list', (0, _extends2["default"])({
|
467
|
+
relationType: relationType,
|
468
|
+
currentPage: currentPage,
|
469
|
+
pageSize: pageSize
|
470
|
+
}, condition ? {
|
471
|
+
condition: condition
|
472
|
+
} : {}, sort ? {
|
473
|
+
sort: sort
|
474
|
+
} : {}));
|
475
|
+
|
476
|
+
case 2:
|
477
|
+
return _context12.abrupt("return", _context12.sent);
|
478
|
+
|
479
|
+
case 3:
|
480
|
+
case "end":
|
481
|
+
return _context12.stop();
|
482
|
+
}
|
483
|
+
}, _callee12);
|
484
|
+
}))).apply(this, arguments);
|
531
485
|
}
|
532
486
|
/**
|
533
487
|
* 忽略的连接关系批量删除
|
@@ -535,175 +489,120 @@ function queryPageIgnoreRelations(_x19, _x20, _x21, _x22, _x23) {
|
|
535
489
|
*/
|
536
490
|
|
537
491
|
|
538
|
-
function _queryPageIgnoreRelations() {
|
539
|
-
_queryPageIgnoreRelations = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee23(relationType, currentPage, pageSize, condition, sort) {
|
540
|
-
return _regenerator["default"].wrap(function _callee23$(_context23) {
|
541
|
-
while (1) {
|
542
|
-
switch (_context23.prev = _context23.next) {
|
543
|
-
case 0:
|
544
|
-
_context23.next = 2;
|
545
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/list', (0, _extends2["default"])({
|
546
|
-
relationType: relationType,
|
547
|
-
currentPage: currentPage,
|
548
|
-
pageSize: pageSize
|
549
|
-
}, condition ? {
|
550
|
-
condition: condition
|
551
|
-
} : {}, sort ? {
|
552
|
-
sort: sort
|
553
|
-
} : {}));
|
554
|
-
|
555
|
-
case 2:
|
556
|
-
return _context23.abrupt("return", _context23.sent);
|
557
|
-
|
558
|
-
case 3:
|
559
|
-
case "end":
|
560
|
-
return _context23.stop();
|
561
|
-
}
|
562
|
-
}
|
563
|
-
}, _callee23);
|
564
|
-
}));
|
565
|
-
return _queryPageIgnoreRelations.apply(this, arguments);
|
566
|
-
}
|
567
|
-
|
568
492
|
function deleteIgnoreRelations(_x24) {
|
569
|
-
return _deleteIgnoreRelations
|
570
|
-
|
493
|
+
return (_deleteIgnoreRelations = _deleteIgnoreRelations || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(ids) {
|
494
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
495
|
+
while (1) switch (_context13.prev = _context13.next) {
|
496
|
+
case 0:
|
497
|
+
_context13.next = 2;
|
498
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/batchDeleteById', ids.map(function (id) {
|
499
|
+
return {
|
500
|
+
id: id
|
501
|
+
};
|
502
|
+
}));
|
571
503
|
|
504
|
+
case 2:
|
505
|
+
return _context13.abrupt("return", _context13.sent);
|
572
506
|
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
while (1) {
|
577
|
-
switch (_context24.prev = _context24.next) {
|
578
|
-
case 0:
|
579
|
-
_context24.next = 2;
|
580
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/batchDeleteById', ids.map(function (id) {
|
581
|
-
return {
|
582
|
-
id: id
|
583
|
-
};
|
584
|
-
}));
|
585
|
-
|
586
|
-
case 2:
|
587
|
-
return _context24.abrupt("return", _context24.sent);
|
588
|
-
|
589
|
-
case 3:
|
590
|
-
case "end":
|
591
|
-
return _context24.stop();
|
592
|
-
}
|
507
|
+
case 3:
|
508
|
+
case "end":
|
509
|
+
return _context13.stop();
|
593
510
|
}
|
594
|
-
},
|
595
|
-
}));
|
596
|
-
|
597
|
-
}
|
511
|
+
}, _callee13);
|
512
|
+
}))).apply(this, arguments);
|
513
|
+
} // 上传文件
|
598
514
|
|
599
|
-
|
600
|
-
|
515
|
+
|
516
|
+
var uploadFile = function uploadFile(_x25, _x26, _x27) {
|
517
|
+
return (_ref9 = _ref9 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(files, userId, modelType) {
|
601
518
|
var formData, names, originFiles, config, result;
|
602
|
-
return _regenerator["default"].wrap(function
|
603
|
-
while (1) {
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/import', formData, config);
|
519
|
+
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
520
|
+
while (1) switch (_context14.prev = _context14.next) {
|
521
|
+
case 0:
|
522
|
+
formData = new FormData(); // 用户id
|
523
|
+
|
524
|
+
formData.append('userId', userId);
|
525
|
+
modelType && formData.append('modelType', modelType);
|
526
|
+
names = [];
|
527
|
+
originFiles = [];
|
528
|
+
files.forEach(function (_ref10) {
|
529
|
+
var name = _ref10.name,
|
530
|
+
originFileObj = _ref10.originFileObj;
|
531
|
+
names.push(name);
|
532
|
+
originFiles.push(originFileObj);
|
533
|
+
formData.append('files', originFileObj, name);
|
534
|
+
});
|
535
|
+
config = {
|
536
|
+
headers: {
|
537
|
+
'Content-Type': "multipart/form-data;boundary=" + new Date().getTime()
|
538
|
+
}
|
539
|
+
};
|
540
|
+
_context14.next = 9;
|
541
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/import', formData, config);
|
626
542
|
|
627
|
-
|
628
|
-
|
629
|
-
|
543
|
+
case 9:
|
544
|
+
result = _context14.sent;
|
545
|
+
return _context14.abrupt("return", result);
|
630
546
|
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
}
|
547
|
+
case 11:
|
548
|
+
case "end":
|
549
|
+
return _context14.stop();
|
635
550
|
}
|
636
|
-
},
|
637
|
-
}));
|
638
|
-
|
639
|
-
return function uploadFile(_x25, _x26, _x27) {
|
640
|
-
return _ref9.apply(this, arguments);
|
641
|
-
};
|
642
|
-
}(); // 关闭提示
|
551
|
+
}, _callee14);
|
552
|
+
}))).apply(this, arguments);
|
553
|
+
}; // 关闭提示
|
643
554
|
|
644
555
|
|
645
556
|
exports.uploadFile = uploadFile;
|
646
557
|
|
647
|
-
var closeRecord =
|
648
|
-
|
558
|
+
var closeRecord = function closeRecord(_x28, _x29) {
|
559
|
+
return (_ref11 = _ref11 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(userId, modelType) {
|
649
560
|
var result;
|
650
|
-
return _regenerator["default"].wrap(function
|
651
|
-
while (1) {
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
return _context8.stop();
|
667
|
-
}
|
561
|
+
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
562
|
+
while (1) switch (_context15.prev = _context15.next) {
|
563
|
+
case 0:
|
564
|
+
_context15.next = 2;
|
565
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/delete/import/record', {
|
566
|
+
userId: userId,
|
567
|
+
modelType: modelType
|
568
|
+
});
|
569
|
+
|
570
|
+
case 2:
|
571
|
+
result = _context15.sent;
|
572
|
+
return _context15.abrupt("return", result);
|
573
|
+
|
574
|
+
case 4:
|
575
|
+
case "end":
|
576
|
+
return _context15.stop();
|
668
577
|
}
|
669
|
-
},
|
670
|
-
}));
|
671
|
-
|
672
|
-
return function closeRecord(_x28, _x29) {
|
673
|
-
return _ref11.apply(this, arguments);
|
674
|
-
};
|
675
|
-
}(); // 获取提示信息
|
578
|
+
}, _callee15);
|
579
|
+
}))).apply(this, arguments);
|
580
|
+
}; // 获取提示信息
|
676
581
|
|
677
582
|
|
678
583
|
exports.closeRecord = closeRecord;
|
679
584
|
|
680
|
-
var getRecord =
|
681
|
-
|
682
|
-
return _regenerator["default"].wrap(function
|
683
|
-
while (1) {
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
return _context9.stop();
|
698
|
-
}
|
585
|
+
var getRecord = function getRecord(_x30, _x31) {
|
586
|
+
return (_ref12 = _ref12 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(userId, modelType) {
|
587
|
+
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
588
|
+
while (1) switch (_context16.prev = _context16.next) {
|
589
|
+
case 0:
|
590
|
+
_context16.next = 2;
|
591
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/get/import/record', {
|
592
|
+
userId: userId,
|
593
|
+
modelType: modelType
|
594
|
+
});
|
595
|
+
|
596
|
+
case 2:
|
597
|
+
return _context16.abrupt("return", _context16.sent);
|
598
|
+
|
599
|
+
case 3:
|
600
|
+
case "end":
|
601
|
+
return _context16.stop();
|
699
602
|
}
|
700
|
-
},
|
701
|
-
}));
|
702
|
-
|
703
|
-
return function getRecord(_x30, _x31) {
|
704
|
-
return _ref12.apply(this, arguments);
|
705
|
-
};
|
706
|
-
}();
|
603
|
+
}, _callee16);
|
604
|
+
}))).apply(this, arguments);
|
605
|
+
};
|
707
606
|
/**
|
708
607
|
* 批量创建关系
|
709
608
|
* @param {*} params
|
@@ -713,59 +612,47 @@ var getRecord = /*#__PURE__*/function () {
|
|
713
612
|
|
714
613
|
exports.getRecord = getRecord;
|
715
614
|
|
716
|
-
var batchCreateRelation =
|
717
|
-
|
718
|
-
return _regenerator["default"].wrap(function
|
719
|
-
while (1) {
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchCreate', params);
|
724
|
-
|
725
|
-
case 2:
|
726
|
-
return _context10.abrupt("return", _context10.sent);
|
727
|
-
|
728
|
-
case 3:
|
729
|
-
case "end":
|
730
|
-
return _context10.stop();
|
731
|
-
}
|
732
|
-
}
|
733
|
-
}, _callee10);
|
734
|
-
}));
|
735
|
-
|
736
|
-
return function batchCreateRelation(_x32) {
|
737
|
-
return _ref13.apply(this, arguments);
|
738
|
-
};
|
739
|
-
}();
|
615
|
+
var batchCreateRelation = function batchCreateRelation(_x32) {
|
616
|
+
return (_ref13 = _ref13 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17(params) {
|
617
|
+
return _regenerator["default"].wrap(function _callee17$(_context17) {
|
618
|
+
while (1) switch (_context17.prev = _context17.next) {
|
619
|
+
case 0:
|
620
|
+
_context17.next = 2;
|
621
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchCreate', params);
|
740
622
|
|
741
|
-
|
623
|
+
case 2:
|
624
|
+
return _context17.abrupt("return", _context17.sent);
|
742
625
|
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/queryByEndpoint', {
|
751
|
-
id: id
|
752
|
-
});
|
626
|
+
case 3:
|
627
|
+
case "end":
|
628
|
+
return _context17.stop();
|
629
|
+
}
|
630
|
+
}, _callee17);
|
631
|
+
}))).apply(this, arguments);
|
632
|
+
};
|
753
633
|
|
754
|
-
|
755
|
-
return _context11.abrupt("return", _context11.sent);
|
634
|
+
exports.batchCreateRelation = batchCreateRelation;
|
756
635
|
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
636
|
+
var queryRelationByEndpoint = function queryRelationByEndpoint(_x33) {
|
637
|
+
return (_ref14 = _ref14 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18(id) {
|
638
|
+
return _regenerator["default"].wrap(function _callee18$(_context18) {
|
639
|
+
while (1) switch (_context18.prev = _context18.next) {
|
640
|
+
case 0:
|
641
|
+
_context18.next = 2;
|
642
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/queryByEndpoint', {
|
643
|
+
id: id
|
644
|
+
});
|
645
|
+
|
646
|
+
case 2:
|
647
|
+
return _context18.abrupt("return", _context18.sent);
|
648
|
+
|
649
|
+
case 3:
|
650
|
+
case "end":
|
651
|
+
return _context18.stop();
|
761
652
|
}
|
762
|
-
},
|
763
|
-
}));
|
764
|
-
|
765
|
-
return function queryRelationByEndpoint(_x33) {
|
766
|
-
return _ref14.apply(this, arguments);
|
767
|
-
};
|
768
|
-
}();
|
653
|
+
}, _callee18);
|
654
|
+
}))).apply(this, arguments);
|
655
|
+
};
|
769
656
|
/**
|
770
657
|
* 批量更新关系
|
771
658
|
* @param {*} params
|
@@ -775,30 +662,24 @@ var queryRelationByEndpoint = /*#__PURE__*/function () {
|
|
775
662
|
|
776
663
|
exports.queryRelationByEndpoint = queryRelationByEndpoint;
|
777
664
|
|
778
|
-
var batchUpdateRelation =
|
779
|
-
|
780
|
-
return _regenerator["default"].wrap(function
|
781
|
-
while (1) {
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
return _context12.abrupt("return", _context12.sent);
|
789
|
-
|
790
|
-
case 3:
|
791
|
-
case "end":
|
792
|
-
return _context12.stop();
|
793
|
-
}
|
794
|
-
}
|
795
|
-
}, _callee12);
|
796
|
-
}));
|
665
|
+
var batchUpdateRelation = function batchUpdateRelation(_x34) {
|
666
|
+
return (_ref15 = _ref15 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee19(params) {
|
667
|
+
return _regenerator["default"].wrap(function _callee19$(_context19) {
|
668
|
+
while (1) switch (_context19.prev = _context19.next) {
|
669
|
+
case 0:
|
670
|
+
_context19.next = 2;
|
671
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchUpdateAttributes', params);
|
672
|
+
|
673
|
+
case 2:
|
674
|
+
return _context19.abrupt("return", _context19.sent);
|
797
675
|
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
}
|
676
|
+
case 3:
|
677
|
+
case "end":
|
678
|
+
return _context19.stop();
|
679
|
+
}
|
680
|
+
}, _callee19);
|
681
|
+
}))).apply(this, arguments);
|
682
|
+
};
|
802
683
|
/**
|
803
684
|
* 删除关系,添加到忽略
|
804
685
|
* @param {*} id 关系id
|
@@ -808,32 +689,26 @@ var batchUpdateRelation = /*#__PURE__*/function () {
|
|
808
689
|
|
809
690
|
exports.batchUpdateRelation = batchUpdateRelation;
|
810
691
|
|
811
|
-
var deleteRelation =
|
812
|
-
|
813
|
-
return _regenerator["default"].wrap(function
|
814
|
-
while (1) {
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
return _context13.stop();
|
828
|
-
}
|
692
|
+
var deleteRelation = function deleteRelation(_x35) {
|
693
|
+
return (_ref16 = _ref16 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee20(id) {
|
694
|
+
return _regenerator["default"].wrap(function _callee20$(_context20) {
|
695
|
+
while (1) switch (_context20.prev = _context20.next) {
|
696
|
+
case 0:
|
697
|
+
_context20.next = 2;
|
698
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/delete', {
|
699
|
+
id: id
|
700
|
+
});
|
701
|
+
|
702
|
+
case 2:
|
703
|
+
return _context20.abrupt("return", _context20.sent);
|
704
|
+
|
705
|
+
case 3:
|
706
|
+
case "end":
|
707
|
+
return _context20.stop();
|
829
708
|
}
|
830
|
-
},
|
831
|
-
}));
|
832
|
-
|
833
|
-
return function deleteRelation(_x35) {
|
834
|
-
return _ref16.apply(this, arguments);
|
835
|
-
};
|
836
|
-
}();
|
709
|
+
}, _callee20);
|
710
|
+
}))).apply(this, arguments);
|
711
|
+
};
|
837
712
|
/**
|
838
713
|
* 批量删除关系
|
839
714
|
* @param {[{id: string}]} params
|
@@ -843,30 +718,24 @@ var deleteRelation = /*#__PURE__*/function () {
|
|
843
718
|
|
844
719
|
exports.deleteRelation = deleteRelation;
|
845
720
|
|
846
|
-
var batchDeleteRelation =
|
847
|
-
|
848
|
-
return _regenerator["default"].wrap(function
|
849
|
-
while (1) {
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
return _context14.abrupt("return", _context14.sent);
|
857
|
-
|
858
|
-
case 3:
|
859
|
-
case "end":
|
860
|
-
return _context14.stop();
|
861
|
-
}
|
862
|
-
}
|
863
|
-
}, _callee14);
|
864
|
-
}));
|
721
|
+
var batchDeleteRelation = function batchDeleteRelation(_x36) {
|
722
|
+
return (_ref17 = _ref17 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee21(params) {
|
723
|
+
return _regenerator["default"].wrap(function _callee21$(_context21) {
|
724
|
+
while (1) switch (_context21.prev = _context21.next) {
|
725
|
+
case 0:
|
726
|
+
_context21.next = 2;
|
727
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchDelete', params);
|
728
|
+
|
729
|
+
case 2:
|
730
|
+
return _context21.abrupt("return", _context21.sent);
|
865
731
|
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
}
|
732
|
+
case 3:
|
733
|
+
case "end":
|
734
|
+
return _context21.stop();
|
735
|
+
}
|
736
|
+
}, _callee21);
|
737
|
+
}))).apply(this, arguments);
|
738
|
+
};
|
870
739
|
/**
|
871
740
|
* 强制删除关系
|
872
741
|
* @param {*} id 关系id
|
@@ -876,33 +745,27 @@ var batchDeleteRelation = /*#__PURE__*/function () {
|
|
876
745
|
|
877
746
|
exports.batchDeleteRelation = batchDeleteRelation;
|
878
747
|
|
879
|
-
var forceDeleteRelation =
|
880
|
-
|
881
|
-
return _regenerator["default"].wrap(function
|
882
|
-
while (1) {
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
return _context15.stop();
|
897
|
-
}
|
748
|
+
var forceDeleteRelation = function forceDeleteRelation(_x37) {
|
749
|
+
return (_ref18 = _ref18 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee22(id) {
|
750
|
+
return _regenerator["default"].wrap(function _callee22$(_context22) {
|
751
|
+
while (1) switch (_context22.prev = _context22.next) {
|
752
|
+
case 0:
|
753
|
+
_context22.next = 2;
|
754
|
+
return batchDeleteRelation([{
|
755
|
+
id: id,
|
756
|
+
force: true
|
757
|
+
}]);
|
758
|
+
|
759
|
+
case 2:
|
760
|
+
return _context22.abrupt("return", _context22.sent);
|
761
|
+
|
762
|
+
case 3:
|
763
|
+
case "end":
|
764
|
+
return _context22.stop();
|
898
765
|
}
|
899
|
-
},
|
900
|
-
}));
|
901
|
-
|
902
|
-
return function forceDeleteRelation(_x37) {
|
903
|
-
return _ref18.apply(this, arguments);
|
904
|
-
};
|
905
|
-
}();
|
766
|
+
}, _callee22);
|
767
|
+
}))).apply(this, arguments);
|
768
|
+
};
|
906
769
|
/**
|
907
770
|
* 查询关系
|
908
771
|
* @param {[{id: string}]} params
|
@@ -912,30 +775,24 @@ var forceDeleteRelation = /*#__PURE__*/function () {
|
|
912
775
|
|
913
776
|
exports.forceDeleteRelation = forceDeleteRelation;
|
914
777
|
|
915
|
-
var batchQueryRelationById =
|
916
|
-
|
917
|
-
return _regenerator["default"].wrap(function
|
918
|
-
while (1) {
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
return _context16.abrupt("return", _context16.sent);
|
926
|
-
|
927
|
-
case 3:
|
928
|
-
case "end":
|
929
|
-
return _context16.stop();
|
930
|
-
}
|
931
|
-
}
|
932
|
-
}, _callee16);
|
933
|
-
}));
|
778
|
+
var batchQueryRelationById = function batchQueryRelationById(_x38) {
|
779
|
+
return (_ref19 = _ref19 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee23(params) {
|
780
|
+
return _regenerator["default"].wrap(function _callee23$(_context23) {
|
781
|
+
while (1) switch (_context23.prev = _context23.next) {
|
782
|
+
case 0:
|
783
|
+
_context23.next = 2;
|
784
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchQueryById', params);
|
785
|
+
|
786
|
+
case 2:
|
787
|
+
return _context23.abrupt("return", _context23.sent);
|
934
788
|
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
}
|
789
|
+
case 3:
|
790
|
+
case "end":
|
791
|
+
return _context23.stop();
|
792
|
+
}
|
793
|
+
}, _callee23);
|
794
|
+
}))).apply(this, arguments);
|
795
|
+
};
|
939
796
|
/**
|
940
797
|
* 查询关系
|
941
798
|
* @param {*} ids 关系ids
|
@@ -945,33 +802,27 @@ var batchQueryRelationById = /*#__PURE__*/function () {
|
|
945
802
|
|
946
803
|
exports.batchQueryRelationById = batchQueryRelationById;
|
947
804
|
|
948
|
-
var queryRelationByIds =
|
949
|
-
|
950
|
-
return _regenerator["default"].wrap(function
|
951
|
-
while (1) {
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
return
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
return _context17.abrupt("return", _context17.sent);
|
963
|
-
|
964
|
-
case 3:
|
965
|
-
case "end":
|
966
|
-
return _context17.stop();
|
967
|
-
}
|
968
|
-
}
|
969
|
-
}, _callee17);
|
970
|
-
}));
|
805
|
+
var queryRelationByIds = function queryRelationByIds(_x39) {
|
806
|
+
return (_ref20 = _ref20 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee24(ids) {
|
807
|
+
return _regenerator["default"].wrap(function _callee24$(_context24) {
|
808
|
+
while (1) switch (_context24.prev = _context24.next) {
|
809
|
+
case 0:
|
810
|
+
_context24.next = 2;
|
811
|
+
return batchQueryRelationById(ids.map(function (id) {
|
812
|
+
return {
|
813
|
+
id: id
|
814
|
+
};
|
815
|
+
}));
|
816
|
+
|
817
|
+
case 2:
|
818
|
+
return _context24.abrupt("return", _context24.sent);
|
971
819
|
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
}
|
820
|
+
case 3:
|
821
|
+
case "end":
|
822
|
+
return _context24.stop();
|
823
|
+
}
|
824
|
+
}, _callee24);
|
825
|
+
}))).apply(this, arguments);
|
826
|
+
};
|
976
827
|
|
977
828
|
exports.queryRelationByIds = queryRelationByIds;
|