@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
@@ -26,52 +26,48 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
26
26
|
* @constructor
|
27
27
|
*/
|
28
28
|
var BindResourceDrawer = function BindResourceDrawer(props) {
|
29
|
+
var _ref;
|
30
|
+
|
29
31
|
var visible = props.visible,
|
30
32
|
topoEditApi = props.topoEditApi,
|
31
33
|
node = props.node,
|
32
34
|
currentResId = props.currentResId,
|
33
35
|
onClose = props.onClose;
|
34
36
|
|
35
|
-
var handleSave =
|
36
|
-
|
37
|
+
var handleSave = function handleSave(_x) {
|
38
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(selected) {
|
37
39
|
var result;
|
38
40
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
39
|
-
while (1) {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
return _context.stop();
|
66
|
-
}
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
42
|
+
case 0:
|
43
|
+
if (selected) {
|
44
|
+
_context.next = 3;
|
45
|
+
break;
|
46
|
+
}
|
47
|
+
|
48
|
+
_message["default"].error('请选择一项资源。');
|
49
|
+
|
50
|
+
return _context.abrupt("return", false);
|
51
|
+
|
52
|
+
case 3:
|
53
|
+
_context.next = 5;
|
54
|
+
return topoEditApi.bindNodeResource({
|
55
|
+
id: node.id,
|
56
|
+
newResId: selected,
|
57
|
+
oldResId: currentResId
|
58
|
+
});
|
59
|
+
|
60
|
+
case 5:
|
61
|
+
result = _context.sent;
|
62
|
+
return _context.abrupt("return", result);
|
63
|
+
|
64
|
+
case 7:
|
65
|
+
case "end":
|
66
|
+
return _context.stop();
|
67
67
|
}
|
68
68
|
}, _callee);
|
69
|
-
}));
|
70
|
-
|
71
|
-
return function handleSave(_x) {
|
72
|
-
return _ref.apply(this, arguments);
|
73
|
-
};
|
74
|
-
}();
|
69
|
+
}))).apply(this, arguments);
|
70
|
+
};
|
75
71
|
|
76
72
|
return /*#__PURE__*/_react["default"].createElement(_NetworkTopoResourceSelectDrawer["default"], {
|
77
73
|
visible: visible,
|
@@ -56,6 +56,8 @@ function getBindType(values) {
|
|
56
56
|
}
|
57
57
|
|
58
58
|
function Data(props) {
|
59
|
+
var _ref;
|
60
|
+
|
59
61
|
var node = props.node,
|
60
62
|
topo = props.topo,
|
61
63
|
topoEditApi = props.topoEditApi,
|
@@ -94,34 +96,28 @@ function Data(props) {
|
|
94
96
|
}
|
95
97
|
};
|
96
98
|
|
97
|
-
var handleBindTopoChange =
|
98
|
-
|
99
|
+
var handleBindTopoChange = function handleBindTopoChange(_x, _x2) {
|
100
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(value, data) {
|
99
101
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
100
|
-
while (1) {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
return _context.stop();
|
116
|
-
}
|
102
|
+
while (1) switch (_context.prev = _context.next) {
|
103
|
+
case 0:
|
104
|
+
topo.historyManager.beginTransaction(); // 设置名称为拓扑名称,清空自定义名称
|
105
|
+
|
106
|
+
node.a('name', data.label);
|
107
|
+
node.a('customName', null);
|
108
|
+
_context.next = 5;
|
109
|
+
return topoEditApi.deleteExLink(node);
|
110
|
+
|
111
|
+
case 5:
|
112
|
+
topo.historyManager.endTransaction();
|
113
|
+
|
114
|
+
case 6:
|
115
|
+
case "end":
|
116
|
+
return _context.stop();
|
117
117
|
}
|
118
118
|
}, _callee);
|
119
|
-
}));
|
120
|
-
|
121
|
-
return function handleBindTopoChange(_x, _x2) {
|
122
|
-
return _ref.apply(this, arguments);
|
123
|
-
};
|
124
|
-
}();
|
119
|
+
}))).apply(this, arguments);
|
120
|
+
};
|
125
121
|
|
126
122
|
var RelateTopoTree = editorProps === null || editorProps === void 0 ? void 0 : editorProps.relateTopoTree;
|
127
123
|
return /*#__PURE__*/_react["default"].createElement(_collapse["default"], {
|
@@ -16,6 +16,8 @@ var _NodeSizeInput = _interopRequireDefault(require("../../common/NodeSizeInput/
|
|
16
16
|
var _useBackgroundSizeConfig = _interopRequireDefault(require("./hooks/useBackgroundSizeConfig"));
|
17
17
|
|
18
18
|
function BackgroundSize(props) {
|
19
|
+
var _ref;
|
20
|
+
|
19
21
|
var topo = props.topo,
|
20
22
|
backgroundConfig = props.backgroundConfig,
|
21
23
|
settingRuntimeState = props.settingRuntimeState;
|
@@ -24,31 +26,25 @@ function BackgroundSize(props) {
|
|
24
26
|
current: backgroundConfig.current
|
25
27
|
});
|
26
28
|
|
27
|
-
var setSize =
|
28
|
-
|
29
|
+
var setSize = function setSize(_x) {
|
30
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(size) {
|
29
31
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
30
|
-
while (1) {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
return _context.stop();
|
43
|
-
}
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
33
|
+
case 0:
|
34
|
+
topo.historyManager.beginTransaction();
|
35
|
+
_context.next = 3;
|
36
|
+
return backgroundSizeConfig.setSize(size);
|
37
|
+
|
38
|
+
case 3:
|
39
|
+
topo.historyManager.endTransaction();
|
40
|
+
|
41
|
+
case 4:
|
42
|
+
case "end":
|
43
|
+
return _context.stop();
|
44
44
|
}
|
45
45
|
}, _callee);
|
46
|
-
}));
|
47
|
-
|
48
|
-
return function setSize(_x) {
|
49
|
-
return _ref.apply(this, arguments);
|
50
|
-
};
|
51
|
-
}();
|
46
|
+
}))).apply(this, arguments);
|
47
|
+
};
|
52
48
|
|
53
49
|
return /*#__PURE__*/_react["default"].createElement(_NodeSizeInput["default"], {
|
54
50
|
nodeId: backgroundSizeConfig.nodeId,
|
@@ -34,6 +34,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
34
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
35
35
|
|
36
36
|
function TopoEditorTitleBar(props) {
|
37
|
+
var _ref;
|
38
|
+
|
37
39
|
var topo = props.topo,
|
38
40
|
topoEditApi = props.topoEditApi;
|
39
41
|
var store = topo.store;
|
@@ -48,30 +50,24 @@ function TopoEditorTitleBar(props) {
|
|
48
50
|
exitFlag = _useState[0],
|
49
51
|
setExitFlag = _useState[1];
|
50
52
|
|
51
|
-
var saveAndExit =
|
52
|
-
|
53
|
+
var saveAndExit = function saveAndExit() {
|
54
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
53
55
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
54
|
-
while (1) {
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
return _context.stop();
|
66
|
-
}
|
56
|
+
while (1) switch (_context.prev = _context.next) {
|
57
|
+
case 0:
|
58
|
+
_context.next = 2;
|
59
|
+
return topo.save();
|
60
|
+
|
61
|
+
case 2:
|
62
|
+
setExitFlag(true);
|
63
|
+
|
64
|
+
case 3:
|
65
|
+
case "end":
|
66
|
+
return _context.stop();
|
67
67
|
}
|
68
68
|
}, _callee);
|
69
|
-
}));
|
70
|
-
|
71
|
-
return function saveAndExit() {
|
72
|
-
return _ref.apply(this, arguments);
|
73
|
-
};
|
74
|
-
}();
|
69
|
+
}))).apply(this, arguments);
|
70
|
+
};
|
75
71
|
|
76
72
|
(0, _react.useEffect)(function () {
|
77
73
|
if (!saving && exitFlag) {
|
@@ -100,53 +96,39 @@ function TopoEditorTitleBar(props) {
|
|
100
96
|
}, "\u4FDD\u5B58"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
101
97
|
className: _TitleBarModule["default"].button,
|
102
98
|
onClick: function onClick() {
|
99
|
+
var _onOk, _onCancel;
|
100
|
+
|
103
101
|
_dialog["default"].confirm({
|
104
102
|
title: '提示',
|
105
103
|
content: '若直接退出,图上修改的内容将不会保存!',
|
106
|
-
onOk: function () {
|
107
|
-
|
104
|
+
onOk: function onOk() {
|
105
|
+
return (_onOk = _onOk || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
108
106
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
109
|
-
while (1) {
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
return _context2.stop();
|
117
|
-
}
|
107
|
+
while (1) switch (_context2.prev = _context2.next) {
|
108
|
+
case 0:
|
109
|
+
saveAndExit();
|
110
|
+
|
111
|
+
case 1:
|
112
|
+
case "end":
|
113
|
+
return _context2.stop();
|
118
114
|
}
|
119
115
|
}, _callee2);
|
120
|
-
}));
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
}
|
125
|
-
|
126
|
-
return onOk;
|
127
|
-
}(),
|
128
|
-
onCancel: function () {
|
129
|
-
var _onCancel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
116
|
+
}))).apply(this, arguments);
|
117
|
+
},
|
118
|
+
onCancel: function onCancel() {
|
119
|
+
return (_onCancel = _onCancel || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
130
120
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
131
|
-
while (1) {
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
return _context3.stop();
|
139
|
-
}
|
121
|
+
while (1) switch (_context3.prev = _context3.next) {
|
122
|
+
case 0:
|
123
|
+
topo.exitEditMode();
|
124
|
+
|
125
|
+
case 1:
|
126
|
+
case "end":
|
127
|
+
return _context3.stop();
|
140
128
|
}
|
141
129
|
}, _callee3);
|
142
|
-
}));
|
143
|
-
|
144
|
-
function onCancel() {
|
145
|
-
return _onCancel.apply(this, arguments);
|
146
|
-
}
|
147
|
-
|
148
|
-
return onCancel;
|
149
|
-
}(),
|
130
|
+
}))).apply(this, arguments);
|
131
|
+
},
|
150
132
|
cancelProps: {
|
151
133
|
children: '退出'
|
152
134
|
},
|
@@ -34,8 +34,8 @@ function useKeyboardShortcut(props) {
|
|
34
34
|
|
35
35
|
if (e.keyCode === 32 && e.target.nodeName !== 'TEXTAREA') {
|
36
36
|
// 空格
|
37
|
-
var _topo$store$
|
38
|
-
viewMouseMode = _topo$store$
|
37
|
+
var _topo$store$getModelS2 = topo.store.getModelState('topoEdit'),
|
38
|
+
viewMouseMode = _topo$store$getModelS2.viewMouseMode;
|
39
39
|
|
40
40
|
topoEdit.setViewMouseMode(viewMouseMode === 'select' ? 'move' : 'select');
|
41
41
|
}
|
@@ -39,10 +39,10 @@ function useNewElementTheme(props) {
|
|
39
39
|
return item.name === theme;
|
40
40
|
});
|
41
41
|
|
42
|
-
var
|
42
|
+
var _ThemeUtil2 = (0, _themeUtil["default"])({
|
43
43
|
topo: topo
|
44
44
|
}),
|
45
|
-
setElementTheme =
|
45
|
+
setElementTheme = _ThemeUtil2.setElementTheme;
|
46
46
|
|
47
47
|
setElementTheme(data, themeConfig); // 临时放这里,新加入节点按配置显示隐藏名称
|
48
48
|
|
@@ -46,17 +46,15 @@ var _default = {
|
|
46
46
|
|
47
47
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
48
48
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
49
|
-
while (1) {
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
});
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
50
|
+
case 0:
|
51
|
+
_this.update({
|
52
|
+
current: extraConfig.background
|
53
|
+
});
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
}
|
55
|
+
case 1:
|
56
|
+
case "end":
|
57
|
+
return _context.stop();
|
60
58
|
}
|
61
59
|
}, _callee);
|
62
60
|
}))();
|
@@ -48,12 +48,10 @@ function _default(topo) {
|
|
48
48
|
init: function init(payload, rootState) {
|
49
49
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
50
50
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
51
|
-
while (1) {
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
return _context.stop();
|
56
|
-
}
|
51
|
+
while (1) switch (_context.prev = _context.next) {
|
52
|
+
case 0:
|
53
|
+
case "end":
|
54
|
+
return _context.stop();
|
57
55
|
}
|
58
56
|
}, _callee);
|
59
57
|
}))();
|
@@ -79,14 +79,12 @@ function isNodeAllEdges(topo) {
|
|
79
79
|
return nodeLineList[i]._id == edge._id;
|
80
80
|
}).length == 0) {
|
81
81
|
inEdges = true;
|
82
|
-
return
|
82
|
+
return 1; // break
|
83
83
|
}
|
84
84
|
};
|
85
85
|
|
86
86
|
for (var i = 0; i < nodeLineList.length; i++) {
|
87
|
-
|
88
|
-
|
89
|
-
if (_ret === "break") break;
|
87
|
+
if (_loop(i)) break;
|
90
88
|
}
|
91
89
|
});
|
92
90
|
return inEdges;
|