@riil-frontend/component-topology 11.0.35 → 12.0.0-dev.2
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.js +45 -29
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/MultiResourceDrawer/index.js +8 -6
- package/es/components/ResourceList/ResourceSelect.js +8 -7
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
- package/es/components/SingleResourceDrawer/SelectDrawer.js +8 -6
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
- package/es/core/editor/components/BackgroundView/index.js +73 -54
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -5
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
- package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
- package/es/core/editor/utils/copyElementUtil.js +174 -0
- package/es/core/hooks/useCiAttributeChange.js +6 -3
- package/es/core/hooks/usePolling.js +21 -13
- package/es/core/hooks/useResourceConfig.js +37 -21
- package/es/core/hooks/useTopoEdit.js +202 -139
- package/es/core/models/Alarm.js +104 -38
- package/es/core/models/AttributeMetricDisplay.js +36 -14
- package/es/core/models/TopoApp.js +197 -75
- package/es/core/models/TopoGraphView.js +20 -10
- package/es/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
- package/es/core/models/cache/CiCache.js +12 -6
- package/es/core/models/cache/CiTypeCache.js +20 -10
- package/es/core/models/cache/DictCache.js +10 -6
- package/es/core/models/graph/Background.js +9 -6
- package/es/core/models/plugins/resourceWebControllUrl.js +21 -8
- package/es/core/models/tagstips/ElementTagTipConfig.js +20 -10
- package/es/core/models/topoData.js +7 -5
- package/es/core/models/utils/linkUtils.js +8 -5
- package/es/core/services/cmdb/metric.js +7 -5
- package/es/core/services/cmdb.js +9 -5
- package/es/core/services/index.js +23 -9
- package/es/core/services/topo/tagtip.js +7 -5
- package/es/core/store/models/customIcon.js +11 -6
- package/es/core/utils/imageUtil.js +7 -5
- package/es/core/utils/metricUtil.js +13 -1
- package/es/core/utils/saveSerialize.js +7 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +8 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +47 -34
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +74 -34
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -26
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +15 -7
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
- package/es/networkTopo/components/Link/hook.js +21 -14
- package/es/networkTopo/components/Link/index.js +32 -18
- package/es/networkTopo/components/Link/setting.js +8 -6
- package/es/networkTopo/getTopoData.js +23 -10
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
- package/es/networkTopo/models/TopoCenter.js +24 -10
- package/es/networkTopo/services/cmdb.js +333 -233
- package/es/networkTopo/services/mdc.js +24 -15
- package/es/networkTopo/services/metric.js +16 -11
- package/es/networkTopo/services/model.js +412 -283
- package/es/networkTopo/utils/exportData.js +7 -5
- package/es/utils/clipboardUtil.d.ts +7 -0
- package/es/utils/clipboardUtil.js +104 -0
- package/lib/components/BatchAttrMetric/setting.js +1 -1
- package/lib/components/MultiResourceDrawer/index.js +8 -6
- package/lib/components/ResourceList/ResourceSelect.js +8 -6
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +8 -6
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
- package/lib/core/editor/components/BackgroundView/index.js +74 -55
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -4
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
- package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
- package/lib/core/editor/utils/copyElementUtil.js +187 -0
- package/lib/core/hooks/useCiAttributeChange.js +6 -3
- package/lib/core/hooks/usePolling.js +21 -13
- package/lib/core/hooks/useResourceConfig.js +37 -21
- package/lib/core/hooks/useTopoEdit.js +202 -139
- package/lib/core/models/Alarm.js +104 -38
- package/lib/core/models/AttributeMetricDisplay.js +36 -14
- package/lib/core/models/TopoApp.js +197 -75
- package/lib/core/models/TopoGraphView.js +20 -10
- package/lib/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
- package/lib/core/models/cache/CiCache.js +12 -6
- package/lib/core/models/cache/CiTypeCache.js +20 -10
- package/lib/core/models/cache/DictCache.js +10 -6
- package/lib/core/models/graph/Background.js +9 -6
- package/lib/core/models/plugins/resourceWebControllUrl.js +21 -8
- package/lib/core/models/tagstips/ElementTagTipConfig.js +20 -10
- package/lib/core/models/topoData.js +7 -4
- package/lib/core/models/utils/linkUtils.js +8 -4
- package/lib/core/services/cmdb/metric.js +7 -4
- package/lib/core/services/cmdb.js +9 -4
- package/lib/core/services/index.js +21 -8
- package/lib/core/services/topo/tagtip.js +7 -4
- package/lib/core/store/models/customIcon.js +11 -6
- package/lib/core/utils/imageUtil.js +7 -4
- package/lib/core/utils/metricUtil.js +13 -1
- package/lib/core/utils/saveSerialize.js +7 -4
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +49 -36
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +73 -35
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +14 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
- package/lib/networkTopo/components/Link/hook.js +23 -15
- package/lib/networkTopo/components/Link/index.js +32 -18
- package/lib/networkTopo/components/Link/setting.js +8 -6
- package/lib/networkTopo/getTopoData.js +23 -10
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
- package/lib/networkTopo/models/TopoCenter.js +24 -10
- package/lib/networkTopo/services/cmdb.js +336 -235
- package/lib/networkTopo/services/mdc.js +24 -14
- package/lib/networkTopo/services/metric.js +16 -10
- package/lib/networkTopo/services/model.js +414 -284
- package/lib/networkTopo/utils/exportData.js +7 -4
- package/lib/utils/clipboardUtil.d.ts +7 -0
- package/lib/utils/clipboardUtil.js +113 -0
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +3 -2
@@ -24,15 +24,13 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
24
24
|
import SelectionModel from "./SelectionModel";
|
25
25
|
import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
|
26
26
|
|
27
|
-
var version = typeof "
|
27
|
+
var version = typeof "12.0.0-dev.2" === 'string' ? "12.0.0-dev.2" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
31
31
|
*/
|
32
32
|
|
33
33
|
var Topo = /*#__PURE__*/function () {
|
34
|
-
var _exit, _load, _clear, _updateElements, _addElements, _updateData, _open, _close, _refresh, _openViewMode, _onTopoDataLoaded, _enterEditMode, _exitEditMode, _triggerSaveEvent, _save, _exportImage, _switchToViewMode, _switchToEditMode;
|
35
|
-
|
36
34
|
function Topo(options) {
|
37
35
|
this.options = void 0;
|
38
36
|
this.id = void 0;
|
@@ -95,8 +93,10 @@ var Topo = /*#__PURE__*/function () {
|
|
95
93
|
*/
|
96
94
|
;
|
97
95
|
|
98
|
-
_proto.exit =
|
99
|
-
|
96
|
+
_proto.exit =
|
97
|
+
/*#__PURE__*/
|
98
|
+
function () {
|
99
|
+
var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
100
100
|
var topoDispatchers;
|
101
101
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
102
102
|
while (1) switch (_context.prev = _context.next) {
|
@@ -113,11 +113,17 @@ var Topo = /*#__PURE__*/function () {
|
|
113
113
|
return _context.stop();
|
114
114
|
}
|
115
115
|
}, _callee, this);
|
116
|
-
}))
|
117
|
-
|
116
|
+
}));
|
117
|
+
|
118
|
+
function exit() {
|
119
|
+
return _exit.apply(this, arguments);
|
120
|
+
}
|
121
|
+
|
122
|
+
return exit;
|
123
|
+
}();
|
118
124
|
|
119
|
-
_proto.load = function
|
120
|
-
|
125
|
+
_proto.load = /*#__PURE__*/function () {
|
126
|
+
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data, options) {
|
121
127
|
var _data$groups, groups, _data$nodes, nodes, links, lines, topoDispatchers;
|
122
128
|
|
123
129
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
@@ -144,11 +150,17 @@ var Topo = /*#__PURE__*/function () {
|
|
144
150
|
return _context2.stop();
|
145
151
|
}
|
146
152
|
}, _callee2, this);
|
147
|
-
}))
|
148
|
-
|
153
|
+
}));
|
154
|
+
|
155
|
+
function load(_x, _x2) {
|
156
|
+
return _load.apply(this, arguments);
|
157
|
+
}
|
149
158
|
|
150
|
-
|
151
|
-
|
159
|
+
return load;
|
160
|
+
}();
|
161
|
+
|
162
|
+
_proto.clear = /*#__PURE__*/function () {
|
163
|
+
var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
152
164
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
153
165
|
while (1) switch (_context3.prev = _context3.next) {
|
154
166
|
case 0:
|
@@ -156,8 +168,14 @@ var Topo = /*#__PURE__*/function () {
|
|
156
168
|
return _context3.stop();
|
157
169
|
}
|
158
170
|
}, _callee3);
|
159
|
-
}))
|
160
|
-
|
171
|
+
}));
|
172
|
+
|
173
|
+
function clear() {
|
174
|
+
return _clear.apply(this, arguments);
|
175
|
+
}
|
176
|
+
|
177
|
+
return clear;
|
178
|
+
}();
|
161
179
|
|
162
180
|
_proto.getId = function getId() {
|
163
181
|
return this.id;
|
@@ -210,8 +228,10 @@ var Topo = /*#__PURE__*/function () {
|
|
210
228
|
*/
|
211
229
|
;
|
212
230
|
|
213
|
-
_proto.updateElements =
|
214
|
-
|
231
|
+
_proto.updateElements =
|
232
|
+
/*#__PURE__*/
|
233
|
+
function () {
|
234
|
+
var _updateElements = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
|
215
235
|
var _data$groups2, groups, _data$nodes2, nodes, links, lines;
|
216
236
|
|
217
237
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
@@ -239,8 +259,14 @@ var Topo = /*#__PURE__*/function () {
|
|
239
259
|
return _context4.stop();
|
240
260
|
}
|
241
261
|
}, _callee4, this);
|
242
|
-
}))
|
243
|
-
|
262
|
+
}));
|
263
|
+
|
264
|
+
function updateElements(_x3) {
|
265
|
+
return _updateElements.apply(this, arguments);
|
266
|
+
}
|
267
|
+
|
268
|
+
return updateElements;
|
269
|
+
}()
|
244
270
|
/**
|
245
271
|
* 追加元素
|
246
272
|
*
|
@@ -248,8 +274,10 @@ var Topo = /*#__PURE__*/function () {
|
|
248
274
|
*/
|
249
275
|
;
|
250
276
|
|
251
|
-
_proto.addElements =
|
252
|
-
|
277
|
+
_proto.addElements =
|
278
|
+
/*#__PURE__*/
|
279
|
+
function () {
|
280
|
+
var _addElements = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(elements) {
|
253
281
|
var data;
|
254
282
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
255
283
|
while (1) switch (_context5.prev = _context5.next) {
|
@@ -266,8 +294,14 @@ var Topo = /*#__PURE__*/function () {
|
|
266
294
|
return _context5.stop();
|
267
295
|
}
|
268
296
|
}, _callee5, this);
|
269
|
-
}))
|
270
|
-
|
297
|
+
}));
|
298
|
+
|
299
|
+
function addElements(_x4) {
|
300
|
+
return _addElements.apply(this, arguments);
|
301
|
+
}
|
302
|
+
|
303
|
+
return addElements;
|
304
|
+
}()
|
271
305
|
/**
|
272
306
|
* 全量更新数据
|
273
307
|
*
|
@@ -275,8 +309,10 @@ var Topo = /*#__PURE__*/function () {
|
|
275
309
|
*/
|
276
310
|
;
|
277
311
|
|
278
|
-
_proto.updateData =
|
279
|
-
|
312
|
+
_proto.updateData =
|
313
|
+
/*#__PURE__*/
|
314
|
+
function () {
|
315
|
+
var _updateData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(data) {
|
280
316
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
281
317
|
while (1) switch (_context6.prev = _context6.next) {
|
282
318
|
case 0:
|
@@ -287,8 +323,14 @@ var Topo = /*#__PURE__*/function () {
|
|
287
323
|
return _context6.stop();
|
288
324
|
}
|
289
325
|
}, _callee6, this);
|
290
|
-
}))
|
291
|
-
|
326
|
+
}));
|
327
|
+
|
328
|
+
function updateData(_x5) {
|
329
|
+
return _updateData.apply(this, arguments);
|
330
|
+
}
|
331
|
+
|
332
|
+
return updateData;
|
333
|
+
}();
|
292
334
|
|
293
335
|
_proto.replaceNode = function replaceNode(id, newNode) {
|
294
336
|
this.view.replaceNode(id, newNode); // TODO 更新store,触发属性、指标模型加载,更新指标
|
@@ -305,8 +347,8 @@ var Topo = /*#__PURE__*/function () {
|
|
305
347
|
this.view.fitContent(anim, padding, notZoomIn);
|
306
348
|
};
|
307
349
|
|
308
|
-
_proto.open = function
|
309
|
-
|
350
|
+
_proto.open = /*#__PURE__*/function () {
|
351
|
+
var _open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, mode) {
|
310
352
|
var lastId;
|
311
353
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
312
354
|
while (1) switch (_context7.prev = _context7.next) {
|
@@ -326,11 +368,17 @@ var Topo = /*#__PURE__*/function () {
|
|
326
368
|
return _context7.stop();
|
327
369
|
}
|
328
370
|
}, _callee7, this);
|
329
|
-
}))
|
330
|
-
|
371
|
+
}));
|
372
|
+
|
373
|
+
function open(_x6, _x7) {
|
374
|
+
return _open.apply(this, arguments);
|
375
|
+
}
|
331
376
|
|
332
|
-
|
333
|
-
|
377
|
+
return open;
|
378
|
+
}();
|
379
|
+
|
380
|
+
_proto.close = /*#__PURE__*/function () {
|
381
|
+
var _close = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
334
382
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
335
383
|
while (1) switch (_context8.prev = _context8.next) {
|
336
384
|
case 0:
|
@@ -352,11 +400,17 @@ var Topo = /*#__PURE__*/function () {
|
|
352
400
|
return _context8.stop();
|
353
401
|
}
|
354
402
|
}, _callee8, this);
|
355
|
-
}))
|
356
|
-
|
403
|
+
}));
|
404
|
+
|
405
|
+
function close() {
|
406
|
+
return _close.apply(this, arguments);
|
407
|
+
}
|
408
|
+
|
409
|
+
return close;
|
410
|
+
}();
|
357
411
|
|
358
|
-
_proto.refresh = function
|
359
|
-
|
412
|
+
_proto.refresh = /*#__PURE__*/function () {
|
413
|
+
var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
360
414
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
361
415
|
while (1) switch (_context9.prev = _context9.next) {
|
362
416
|
case 0:
|
@@ -364,8 +418,14 @@ var Topo = /*#__PURE__*/function () {
|
|
364
418
|
return _context9.stop();
|
365
419
|
}
|
366
420
|
}, _callee9);
|
367
|
-
}))
|
368
|
-
|
421
|
+
}));
|
422
|
+
|
423
|
+
function refresh() {
|
424
|
+
return _refresh.apply(this, arguments);
|
425
|
+
}
|
426
|
+
|
427
|
+
return refresh;
|
428
|
+
}();
|
369
429
|
|
370
430
|
_proto.getGraphView = function getGraphView() {
|
371
431
|
return this.view.topoClient.getGraphView();
|
@@ -392,8 +452,8 @@ var Topo = /*#__PURE__*/function () {
|
|
392
452
|
this.view.topoClient.searchElements(filterType, value);
|
393
453
|
};
|
394
454
|
|
395
|
-
_proto.openViewMode = function
|
396
|
-
|
455
|
+
_proto.openViewMode = /*#__PURE__*/function () {
|
456
|
+
var _openViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(id) {
|
397
457
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
398
458
|
while (1) switch (_context10.prev = _context10.next) {
|
399
459
|
case 0:
|
@@ -401,8 +461,14 @@ var Topo = /*#__PURE__*/function () {
|
|
401
461
|
return _context10.stop();
|
402
462
|
}
|
403
463
|
}, _callee10);
|
404
|
-
}))
|
405
|
-
|
464
|
+
}));
|
465
|
+
|
466
|
+
function openViewMode(_x8) {
|
467
|
+
return _openViewMode.apply(this, arguments);
|
468
|
+
}
|
469
|
+
|
470
|
+
return openViewMode;
|
471
|
+
}();
|
406
472
|
|
407
473
|
_proto.isViewMode = function isViewMode() {
|
408
474
|
return !this.isEditMode();
|
@@ -416,8 +482,8 @@ var Topo = /*#__PURE__*/function () {
|
|
416
482
|
return this.store.getModelState('topoMod').graphLoaded;
|
417
483
|
};
|
418
484
|
|
419
|
-
_proto.onTopoDataLoaded = function
|
420
|
-
|
485
|
+
_proto.onTopoDataLoaded = /*#__PURE__*/function () {
|
486
|
+
var _onTopoDataLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(topoData) {
|
421
487
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
422
488
|
while (1) switch (_context11.prev = _context11.next) {
|
423
489
|
case 0:
|
@@ -428,15 +494,23 @@ var Topo = /*#__PURE__*/function () {
|
|
428
494
|
return _context11.stop();
|
429
495
|
}
|
430
496
|
}, _callee11, this);
|
431
|
-
}))
|
432
|
-
|
497
|
+
}));
|
498
|
+
|
499
|
+
function onTopoDataLoaded(_x9) {
|
500
|
+
return _onTopoDataLoaded.apply(this, arguments);
|
501
|
+
}
|
502
|
+
|
503
|
+
return onTopoDataLoaded;
|
504
|
+
}()
|
433
505
|
/**
|
434
506
|
* 进入编辑模式
|
435
507
|
*/
|
436
508
|
;
|
437
509
|
|
438
|
-
_proto.enterEditMode =
|
439
|
-
|
510
|
+
_proto.enterEditMode =
|
511
|
+
/*#__PURE__*/
|
512
|
+
function () {
|
513
|
+
var _enterEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
440
514
|
var topoDispatchers, iconManageDispatchers;
|
441
515
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
442
516
|
while (1) switch (_context12.prev = _context12.next) {
|
@@ -488,11 +562,17 @@ var Topo = /*#__PURE__*/function () {
|
|
488
562
|
return _context12.stop();
|
489
563
|
}
|
490
564
|
}, _callee12, this);
|
491
|
-
}))
|
492
|
-
};
|
565
|
+
}));
|
493
566
|
|
494
|
-
|
495
|
-
|
567
|
+
function enterEditMode() {
|
568
|
+
return _enterEditMode.apply(this, arguments);
|
569
|
+
}
|
570
|
+
|
571
|
+
return enterEditMode;
|
572
|
+
}();
|
573
|
+
|
574
|
+
_proto.exitEditMode = /*#__PURE__*/function () {
|
575
|
+
var _exitEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
496
576
|
var editDispatchers;
|
497
577
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
498
578
|
while (1) switch (_context13.prev = _context13.next) {
|
@@ -517,15 +597,23 @@ var Topo = /*#__PURE__*/function () {
|
|
517
597
|
return _context13.stop();
|
518
598
|
}
|
519
599
|
}, _callee13, this);
|
520
|
-
}))
|
521
|
-
|
600
|
+
}));
|
601
|
+
|
602
|
+
function exitEditMode() {
|
603
|
+
return _exitEditMode.apply(this, arguments);
|
604
|
+
}
|
605
|
+
|
606
|
+
return exitEditMode;
|
607
|
+
}()
|
522
608
|
/**
|
523
609
|
* 后续待优化,移除该接口,由ht提供原子接口获取相关数据
|
524
610
|
*/
|
525
611
|
;
|
526
612
|
|
527
|
-
_proto.triggerSaveEvent =
|
528
|
-
|
613
|
+
_proto.triggerSaveEvent =
|
614
|
+
/*#__PURE__*/
|
615
|
+
function () {
|
616
|
+
var _triggerSaveEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
529
617
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
530
618
|
while (1) switch (_context14.prev = _context14.next) {
|
531
619
|
case 0:
|
@@ -536,15 +624,23 @@ var Topo = /*#__PURE__*/function () {
|
|
536
624
|
return _context14.stop();
|
537
625
|
}
|
538
626
|
}, _callee14, this);
|
539
|
-
}))
|
540
|
-
|
627
|
+
}));
|
628
|
+
|
629
|
+
function triggerSaveEvent() {
|
630
|
+
return _triggerSaveEvent.apply(this, arguments);
|
631
|
+
}
|
632
|
+
|
633
|
+
return triggerSaveEvent;
|
634
|
+
}()
|
541
635
|
/**
|
542
636
|
* FIXME 待优化,移除该接口,由ht提供原子接口获取相关数据
|
543
637
|
*/
|
544
638
|
;
|
545
639
|
|
546
|
-
_proto.save =
|
547
|
-
|
640
|
+
_proto.save =
|
641
|
+
/*#__PURE__*/
|
642
|
+
function () {
|
643
|
+
var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
548
644
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
549
645
|
while (1) switch (_context15.prev = _context15.next) {
|
550
646
|
case 0:
|
@@ -555,8 +651,14 @@ var Topo = /*#__PURE__*/function () {
|
|
555
651
|
return _context15.stop();
|
556
652
|
}
|
557
653
|
}, _callee15, this);
|
558
|
-
}))
|
559
|
-
|
654
|
+
}));
|
655
|
+
|
656
|
+
function save() {
|
657
|
+
return _save.apply(this, arguments);
|
658
|
+
}
|
659
|
+
|
660
|
+
return save;
|
661
|
+
}()
|
560
662
|
/**
|
561
663
|
* 导出为图片
|
562
664
|
*
|
@@ -564,8 +666,10 @@ var Topo = /*#__PURE__*/function () {
|
|
564
666
|
*/
|
565
667
|
;
|
566
668
|
|
567
|
-
_proto.exportImage =
|
568
|
-
|
669
|
+
_proto.exportImage =
|
670
|
+
/*#__PURE__*/
|
671
|
+
function () {
|
672
|
+
var _exportImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(name) {
|
569
673
|
var fileName;
|
570
674
|
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
571
675
|
while (1) switch (_context16.prev = _context16.next) {
|
@@ -582,8 +686,14 @@ var Topo = /*#__PURE__*/function () {
|
|
582
686
|
return _context16.stop();
|
583
687
|
}
|
584
688
|
}, _callee16, this);
|
585
|
-
}))
|
586
|
-
|
689
|
+
}));
|
690
|
+
|
691
|
+
function exportImage(_x10) {
|
692
|
+
return _exportImage.apply(this, arguments);
|
693
|
+
}
|
694
|
+
|
695
|
+
return exportImage;
|
696
|
+
}();
|
587
697
|
|
588
698
|
_proto.loadAlarm = function loadAlarm(alarmList) {
|
589
699
|
this.alarm.updateState({
|
@@ -591,8 +701,8 @@ var Topo = /*#__PURE__*/function () {
|
|
591
701
|
});
|
592
702
|
};
|
593
703
|
|
594
|
-
_proto.switchToViewMode = function
|
595
|
-
|
704
|
+
_proto.switchToViewMode = /*#__PURE__*/function () {
|
705
|
+
var _switchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
596
706
|
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
597
707
|
while (1) switch (_context17.prev = _context17.next) {
|
598
708
|
case 0:
|
@@ -600,11 +710,17 @@ var Topo = /*#__PURE__*/function () {
|
|
600
710
|
return _context17.stop();
|
601
711
|
}
|
602
712
|
}, _callee17);
|
603
|
-
}))
|
604
|
-
|
713
|
+
}));
|
714
|
+
|
715
|
+
function switchToViewMode() {
|
716
|
+
return _switchToViewMode.apply(this, arguments);
|
717
|
+
}
|
718
|
+
|
719
|
+
return switchToViewMode;
|
720
|
+
}();
|
605
721
|
|
606
|
-
_proto.switchToEditMode = function
|
607
|
-
|
722
|
+
_proto.switchToEditMode = /*#__PURE__*/function () {
|
723
|
+
var _switchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
|
608
724
|
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
609
725
|
while (1) switch (_context18.prev = _context18.next) {
|
610
726
|
case 0:
|
@@ -612,8 +728,14 @@ var Topo = /*#__PURE__*/function () {
|
|
612
728
|
return _context18.stop();
|
613
729
|
}
|
614
730
|
}, _callee18);
|
615
|
-
}))
|
616
|
-
|
731
|
+
}));
|
732
|
+
|
733
|
+
function switchToEditMode() {
|
734
|
+
return _switchToEditMode.apply(this, arguments);
|
735
|
+
}
|
736
|
+
|
737
|
+
return switchToEditMode;
|
738
|
+
}();
|
617
739
|
|
618
740
|
_proto.initStore = function initStore() {
|
619
741
|
var store = createStore(this, this.options.storeModels || {});
|
@@ -9,8 +9,6 @@ import Background from "./graph/Background";
|
|
9
9
|
*/
|
10
10
|
|
11
11
|
var TopoGraphView = /*#__PURE__*/function () {
|
12
|
-
var _switchToViewMode, _switchToEditMode;
|
13
|
-
|
14
12
|
function TopoGraphView() {
|
15
13
|
this.store = void 0;
|
16
14
|
|
@@ -52,8 +50,8 @@ var TopoGraphView = /*#__PURE__*/function () {
|
|
52
50
|
this.topoClient.getGraphView().fitContent(anim, padding, notZoomIn);
|
53
51
|
};
|
54
52
|
|
55
|
-
_proto.switchToViewMode = function
|
56
|
-
|
53
|
+
_proto.switchToViewMode = /*#__PURE__*/function () {
|
54
|
+
var _switchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
57
55
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
58
56
|
while (1) switch (_context.prev = _context.next) {
|
59
57
|
case 0:
|
@@ -64,11 +62,17 @@ var TopoGraphView = /*#__PURE__*/function () {
|
|
64
62
|
return _context.stop();
|
65
63
|
}
|
66
64
|
}, _callee, this);
|
67
|
-
}))
|
68
|
-
|
65
|
+
}));
|
66
|
+
|
67
|
+
function switchToViewMode() {
|
68
|
+
return _switchToViewMode.apply(this, arguments);
|
69
|
+
}
|
70
|
+
|
71
|
+
return switchToViewMode;
|
72
|
+
}();
|
69
73
|
|
70
|
-
_proto.switchToEditMode = function
|
71
|
-
|
74
|
+
_proto.switchToEditMode = /*#__PURE__*/function () {
|
75
|
+
var _switchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
72
76
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
73
77
|
while (1) switch (_context2.prev = _context2.next) {
|
74
78
|
case 0:
|
@@ -79,8 +83,14 @@ var TopoGraphView = /*#__PURE__*/function () {
|
|
79
83
|
return _context2.stop();
|
80
84
|
}
|
81
85
|
}, _callee2, this);
|
82
|
-
}))
|
83
|
-
|
86
|
+
}));
|
87
|
+
|
88
|
+
function switchToEditMode() {
|
89
|
+
return _switchToEditMode.apply(this, arguments);
|
90
|
+
}
|
91
|
+
|
92
|
+
return switchToEditMode;
|
93
|
+
}();
|
84
94
|
|
85
95
|
_proto.loadAlarm = function loadAlarm(alarms) {
|
86
96
|
this.topoClient.loadAlarm(alarms);
|
@@ -13,11 +13,6 @@ export default function commonTransform(options) {
|
|
13
13
|
if (ciData[attrType + "Map"][fieldCode + "_object"]) {
|
14
14
|
fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
|
15
15
|
}
|
16
|
-
} // 分级字典特殊处理
|
17
|
-
|
18
|
-
|
19
|
-
if (fieldMeta.dict) {
|
20
|
-
fieldValue = fieldMeta.dict[fieldValue];
|
21
16
|
}
|
22
17
|
|
23
18
|
return {
|
@@ -6,8 +6,6 @@ import { queryCisByIds } from "../../services";
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
var CiCache = /*#__PURE__*/function () {
|
9
|
-
var _load;
|
10
|
-
|
11
9
|
function CiCache() {
|
12
10
|
/**
|
13
11
|
* @param {object<string, object>}
|
@@ -22,8 +20,10 @@ var CiCache = /*#__PURE__*/function () {
|
|
22
20
|
* @param ids {string[]}
|
23
21
|
* @returns {Promise<Object>}
|
24
22
|
*/
|
25
|
-
_proto.load =
|
26
|
-
|
23
|
+
_proto.load =
|
24
|
+
/*#__PURE__*/
|
25
|
+
function () {
|
26
|
+
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ids) {
|
27
27
|
var _this = this;
|
28
28
|
|
29
29
|
var unloadCiIds, cis, map;
|
@@ -60,8 +60,14 @@ var CiCache = /*#__PURE__*/function () {
|
|
60
60
|
return _context.stop();
|
61
61
|
}
|
62
62
|
}, _callee, this);
|
63
|
-
}))
|
64
|
-
|
63
|
+
}));
|
64
|
+
|
65
|
+
function load(_x) {
|
66
|
+
return _load.apply(this, arguments);
|
67
|
+
}
|
68
|
+
|
69
|
+
return load;
|
70
|
+
}();
|
65
71
|
|
66
72
|
_proto.getCi = function getCi(id) {
|
67
73
|
return this.ciMap[id];
|
@@ -10,16 +10,14 @@ import keyBy from 'lodash/keyBy';
|
|
10
10
|
*/
|
11
11
|
|
12
12
|
var CiTypeCache = /*#__PURE__*/function () {
|
13
|
-
var _getCiTypeMap, _load;
|
14
|
-
|
15
13
|
function CiTypeCache() {
|
16
14
|
this.ciTypeMap = {};
|
17
15
|
}
|
18
16
|
|
19
17
|
var _proto = CiTypeCache.prototype;
|
20
18
|
|
21
|
-
_proto.getCiTypeMap = function
|
22
|
-
|
19
|
+
_proto.getCiTypeMap = /*#__PURE__*/function () {
|
20
|
+
var _getCiTypeMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ciTypeIds) {
|
23
21
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
24
22
|
while (1) switch (_context.prev = _context.next) {
|
25
23
|
case 0:
|
@@ -44,11 +42,17 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
44
42
|
return _context.stop();
|
45
43
|
}
|
46
44
|
}, _callee, this, [[0, 5]]);
|
47
|
-
}))
|
48
|
-
|
45
|
+
}));
|
46
|
+
|
47
|
+
function getCiTypeMap(_x) {
|
48
|
+
return _getCiTypeMap.apply(this, arguments);
|
49
|
+
}
|
50
|
+
|
51
|
+
return getCiTypeMap;
|
52
|
+
}();
|
49
53
|
|
50
|
-
_proto.load = function
|
51
|
-
|
54
|
+
_proto.load = /*#__PURE__*/function () {
|
55
|
+
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(ciTypeIds) {
|
52
56
|
var _this = this;
|
53
57
|
|
54
58
|
var unLoadCiTypeIds, ciTypeMetas;
|
@@ -71,8 +75,14 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
71
75
|
return _context2.stop();
|
72
76
|
}
|
73
77
|
}, _callee2, this);
|
74
|
-
}))
|
75
|
-
|
78
|
+
}));
|
79
|
+
|
80
|
+
function load(_x2) {
|
81
|
+
return _load.apply(this, arguments);
|
82
|
+
}
|
83
|
+
|
84
|
+
return load;
|
85
|
+
}();
|
76
86
|
|
77
87
|
_proto.addCiTypes = function addCiTypes(ciTypeMetas) {
|
78
88
|
var _this2 = this;
|
@@ -8,8 +8,6 @@ import rlog from '@riil-frontend/component-topology-utils/lib/rlog';
|
|
8
8
|
*/
|
9
9
|
|
10
10
|
var DictCache = /*#__PURE__*/function () {
|
11
|
-
var _init;
|
12
|
-
|
13
11
|
function DictCache() {
|
14
12
|
this.dists = void 0;
|
15
13
|
this.dictObject = void 0;
|
@@ -17,8 +15,8 @@ var DictCache = /*#__PURE__*/function () {
|
|
17
15
|
|
18
16
|
var _proto = DictCache.prototype;
|
19
17
|
|
20
|
-
_proto.init = function
|
21
|
-
|
18
|
+
_proto.init = /*#__PURE__*/function () {
|
19
|
+
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
22
20
|
var distsStr, dicts;
|
23
21
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
24
22
|
while (1) switch (_context.prev = _context.next) {
|
@@ -61,8 +59,14 @@ var DictCache = /*#__PURE__*/function () {
|
|
61
59
|
return _context.stop();
|
62
60
|
}
|
63
61
|
}, _callee, this);
|
64
|
-
}))
|
65
|
-
|
62
|
+
}));
|
63
|
+
|
64
|
+
function init() {
|
65
|
+
return _init.apply(this, arguments);
|
66
|
+
}
|
67
|
+
|
68
|
+
return init;
|
69
|
+
}();
|
66
70
|
|
67
71
|
_proto.getDictObject = function getDictObject() {
|
68
72
|
return this.dictObject;
|