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