@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
@@ -27,6 +27,8 @@ function filterUnExistedFields(fields, ciTypeMeta) {
|
|
27
27
|
|
28
28
|
|
29
29
|
var AttributeMetricDisplay = /*#__PURE__*/function () {
|
30
|
+
var _loadData, _loadAttributeAndMetric, _translateRefAttribute;
|
31
|
+
|
30
32
|
function AttributeMetricDisplay(topo) {
|
31
33
|
var _this$topo$options$ta;
|
32
34
|
|
@@ -310,57 +312,47 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
310
312
|
*/
|
311
313
|
;
|
312
314
|
|
313
|
-
_proto.loadData =
|
314
|
-
|
315
|
-
function () {
|
316
|
-
var _loadData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
315
|
+
_proto.loadData = function loadData(_x) {
|
316
|
+
return (_loadData = _loadData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
317
317
|
var topo, ciDatas, bizDispatchers;
|
318
318
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
319
|
-
while (1) {
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
return _context.stop();
|
353
|
-
}
|
319
|
+
while (1) switch (_context.prev = _context.next) {
|
320
|
+
case 0:
|
321
|
+
// rlog.debug('AttributeMetricDisplay.loadAttributeAndMetric', data);
|
322
|
+
topo = this.topo; // 设置ciType
|
323
|
+
|
324
|
+
ciDatas = data.filter(function (item) {
|
325
|
+
// 过滤不存在的ci,解决编辑模式删除资源后切换到显示模式报错
|
326
|
+
return !!topo.dataModel.getDataById(item.id);
|
327
|
+
}).map(function (item) {
|
328
|
+
return _extends({
|
329
|
+
ciType: topo.dataModel.getDataById(item.id).ciType
|
330
|
+
}, item);
|
331
|
+
}); // 翻译引用属性
|
332
|
+
|
333
|
+
_context.next = 4;
|
334
|
+
return this.translateRefAttribute(ciDatas);
|
335
|
+
|
336
|
+
case 4:
|
337
|
+
ciDatas = _context.sent;
|
338
|
+
bizDispatchers = topo.store.getModelDispatchers('topoBizMod');
|
339
|
+
_context.next = 8;
|
340
|
+
return bizDispatchers.setAttrsAndMetrics(ciDatas);
|
341
|
+
|
342
|
+
case 8:
|
343
|
+
_context.next = 10;
|
344
|
+
return DictCache.init();
|
345
|
+
|
346
|
+
case 10:
|
347
|
+
this.updateTagsTips();
|
348
|
+
|
349
|
+
case 11:
|
350
|
+
case "end":
|
351
|
+
return _context.stop();
|
354
352
|
}
|
355
353
|
}, _callee, this);
|
356
|
-
}));
|
357
|
-
|
358
|
-
function loadData(_x) {
|
359
|
-
return _loadData.apply(this, arguments);
|
360
|
-
}
|
361
|
-
|
362
|
-
return loadData;
|
363
|
-
}()
|
354
|
+
}))).apply(this, arguments);
|
355
|
+
}
|
364
356
|
/**
|
365
357
|
* 加载标注、悬浮框数据
|
366
358
|
* 业务拓扑使用
|
@@ -369,31 +361,21 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
369
361
|
*/
|
370
362
|
;
|
371
363
|
|
372
|
-
_proto.loadAttributeAndMetric =
|
373
|
-
|
374
|
-
function () {
|
375
|
-
var _loadAttributeAndMetric = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
|
364
|
+
_proto.loadAttributeAndMetric = function loadAttributeAndMetric(_x2) {
|
365
|
+
return (_loadAttributeAndMetric = _loadAttributeAndMetric || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
|
376
366
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
377
|
-
while (1) {
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
return _context2.stop();
|
386
|
-
}
|
367
|
+
while (1) switch (_context2.prev = _context2.next) {
|
368
|
+
case 0:
|
369
|
+
_context2.next = 2;
|
370
|
+
return this.loadData(data);
|
371
|
+
|
372
|
+
case 2:
|
373
|
+
case "end":
|
374
|
+
return _context2.stop();
|
387
375
|
}
|
388
376
|
}, _callee2, this);
|
389
|
-
}));
|
390
|
-
|
391
|
-
function loadAttributeAndMetric(_x2) {
|
392
|
-
return _loadAttributeAndMetric.apply(this, arguments);
|
393
|
-
}
|
394
|
-
|
395
|
-
return loadAttributeAndMetric;
|
396
|
-
}()
|
377
|
+
}))).apply(this, arguments);
|
378
|
+
}
|
397
379
|
/**
|
398
380
|
* 临时由前端翻译引用属性名称
|
399
381
|
* @param {array<{id, ciType, attributeMap: {}, ...}>} ciDatas
|
@@ -401,95 +383,85 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
401
383
|
*/
|
402
384
|
;
|
403
385
|
|
404
|
-
_proto.translateRefAttribute =
|
405
|
-
|
406
|
-
function () {
|
407
|
-
var _translateRefAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(ciDatas) {
|
386
|
+
_proto.translateRefAttribute = function translateRefAttribute(_x3) {
|
387
|
+
return (_translateRefAttribute = _translateRefAttribute || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(ciDatas) {
|
408
388
|
var _this4 = this;
|
409
389
|
|
410
390
|
var refIdMap, ciRefAttributeMap, refIds, refCiMap;
|
411
391
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
412
|
-
while (1) {
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
}
|
435
|
-
|
436
|
-
ciRefAttributeMap[id].push({
|
437
|
-
attrCode: attributeMeta.code,
|
438
|
-
id: refId
|
439
|
-
});
|
440
|
-
});
|
441
|
-
} else {
|
442
|
-
rlog.warn("\u63A8\u9001\u5C5E\u6027\u6307\u6807\u6570\u636E\uFF1A\u672A\u67E5\u8BE2\u5230ciType " + ciType, ciData);
|
443
|
-
}
|
444
|
-
});
|
445
|
-
refIds = Object.keys(refIdMap);
|
392
|
+
while (1) switch (_context3.prev = _context3.next) {
|
393
|
+
case 0:
|
394
|
+
// 查找引用字段及值
|
395
|
+
refIdMap = {};
|
396
|
+
ciRefAttributeMap = {};
|
397
|
+
ciDatas.forEach(function (ciData) {
|
398
|
+
var id = ciData.id,
|
399
|
+
ciType = ciData.ciType,
|
400
|
+
attributeMap = ciData.attributeMap;
|
401
|
+
ciRefAttributeMap[id] = [];
|
402
|
+
|
403
|
+
var ciTypeMeta = _this4.topo.ciTyeCache.getCiType(ciType);
|
404
|
+
|
405
|
+
if (ciTypeMeta) {
|
406
|
+
ciTypeMeta.attributes.filter(function (attributeMeta) {
|
407
|
+
return !!attributeMeta.refCi;
|
408
|
+
}).forEach(function (attributeMeta) {
|
409
|
+
var refId = attributeMap[attributeMeta.code];
|
410
|
+
|
411
|
+
if (refId && !refIdMap[refId]) {
|
412
|
+
refIdMap[refId] = true;
|
413
|
+
}
|
446
414
|
|
447
|
-
|
448
|
-
|
449
|
-
|
415
|
+
ciRefAttributeMap[id].push({
|
416
|
+
attrCode: attributeMeta.code,
|
417
|
+
id: refId
|
418
|
+
});
|
419
|
+
});
|
420
|
+
} else {
|
421
|
+
rlog.warn("\u63A8\u9001\u5C5E\u6027\u6307\u6807\u6570\u636E\uFF1A\u672A\u67E5\u8BE2\u5230ciType " + ciType, ciData);
|
450
422
|
}
|
423
|
+
});
|
424
|
+
refIds = Object.keys(refIdMap);
|
451
425
|
|
452
|
-
|
426
|
+
if (refIds.length) {
|
427
|
+
_context3.next = 6;
|
428
|
+
break;
|
429
|
+
}
|
453
430
|
|
454
|
-
|
455
|
-
_context3.next = 8;
|
456
|
-
return this.topo.ciCache.load(refIds);
|
431
|
+
return _context3.abrupt("return", ciDatas);
|
457
432
|
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
var id = ciData.id;
|
433
|
+
case 6:
|
434
|
+
_context3.next = 8;
|
435
|
+
return this.topo.ciCache.load(refIds);
|
462
436
|
|
463
|
-
|
437
|
+
case 8:
|
438
|
+
refCiMap = _context3.sent;
|
439
|
+
return _context3.abrupt("return", ciDatas.map(function (ciData) {
|
440
|
+
var id = ciData.id;
|
464
441
|
|
465
|
-
|
466
|
-
var refCi = refCiMap[refAttrs.id];
|
442
|
+
var attributeMap = _extends({}, ciData.attributeMap);
|
467
443
|
|
468
|
-
|
469
|
-
|
470
|
-
displayName: refCi.attributes.display_name
|
471
|
-
};
|
472
|
-
}
|
473
|
-
});
|
474
|
-
return _extends({}, ciData, {
|
475
|
-
attributeMap: attributeMap
|
476
|
-
});
|
477
|
-
}));
|
444
|
+
ciRefAttributeMap[id].forEach(function (refAttrs) {
|
445
|
+
var refCi = refCiMap[refAttrs.id];
|
478
446
|
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
447
|
+
if (refCi) {
|
448
|
+
attributeMap[refAttrs.attrCode + "_object"] = {
|
449
|
+
displayName: refCi.attributes.display_name
|
450
|
+
};
|
451
|
+
}
|
452
|
+
});
|
453
|
+
return _extends({}, ciData, {
|
454
|
+
attributeMap: attributeMap
|
455
|
+
});
|
456
|
+
}));
|
457
|
+
|
458
|
+
case 10:
|
459
|
+
case "end":
|
460
|
+
return _context3.stop();
|
483
461
|
}
|
484
462
|
}, _callee3, this);
|
485
|
-
}));
|
486
|
-
|
487
|
-
function translateRefAttribute(_x3) {
|
488
|
-
return _translateRefAttribute.apply(this, arguments);
|
489
|
-
}
|
490
|
-
|
491
|
-
return translateRefAttribute;
|
492
|
-
}()
|
463
|
+
}))).apply(this, arguments);
|
464
|
+
}
|
493
465
|
/**
|
494
466
|
* 推送标注、悬浮框数据 => ht
|
495
467
|
* @returns
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import corePlugins from "./plugins";
|
2
2
|
|
3
3
|
var PluginManager = /*#__PURE__*/function () {
|
4
|
-
/**
|
5
|
-
* @type {Array}
|
6
|
-
*/
|
7
4
|
function PluginManager(topo) {
|
8
5
|
this.topo = void 0;
|
9
6
|
this.pluginMap = {};
|
7
|
+
|
8
|
+
/**
|
9
|
+
* @type {Array}
|
10
|
+
*/
|
10
11
|
this.plugins = void 0;
|
11
12
|
this.topo = topo;
|
12
13
|
this.init(corePlugins);
|
@@ -10,6 +10,9 @@ var SelectionModel = /*#__PURE__*/function () {
|
|
10
10
|
this.topo = null;
|
11
11
|
this.inited = false;
|
12
12
|
|
13
|
+
/**
|
14
|
+
* 同步选中元素到store
|
15
|
+
*/
|
13
16
|
this.updateSelection = function () {
|
14
17
|
try {
|
15
18
|
var selectionModel = _this.topo.getSelectionModel();
|
@@ -87,11 +90,7 @@ var SelectionModel = /*#__PURE__*/function () {
|
|
87
90
|
_proto.getSelection = function getSelection() {
|
88
91
|
var selectionModel = this.topo.getSelectionModel();
|
89
92
|
return selectionModel.getSelection().getArray();
|
90
|
-
}
|
91
|
-
/**
|
92
|
-
* 同步选中元素到store
|
93
|
-
*/
|
94
|
-
;
|
93
|
+
};
|
95
94
|
|
96
95
|
_proto.handleSelectionChange = function handleSelectionChange(e) {
|
97
96
|
rlog.info('Selection handleSelectionChange', e);
|