@riil-frontend/component-topology 11.0.34 → 12.0.0-dev.1
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 +57 -34
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/MultiResourceDrawer/index.js +16 -18
- package/es/components/ResourceList/ResourceSelect.js +48 -50
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +24 -26
- package/es/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -25
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- 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 +119 -129
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +20 -22
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +15 -17
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +7 -9
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +11 -13
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +21 -23
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -12
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +21 -27
- package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
- 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/copyElementUtil.js +171 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +117 -121
- package/es/core/hooks/useResourceConfig.js +58 -66
- package/es/core/hooks/useTopoEdit.js +473 -503
- package/es/core/models/Alarm.js +281 -298
- package/es/core/models/AttributeMetricDisplay.js +101 -107
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +205 -240
- package/es/core/models/TopoGraphView.js +18 -21
- package/es/core/models/cache/CiCache.js +28 -27
- package/es/core/models/cache/CiTypeCache.js +37 -41
- package/es/core/models/cache/DictCache.js +33 -35
- package/es/core/models/graph/Background.js +15 -17
- package/es/core/models/plugins/resourceWebControllUrl.js +76 -82
- package/es/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/es/core/models/topoData.js +68 -70
- package/es/core/models/utils/linkUtils.js +41 -43
- 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 +9 -11
- package/es/core/services/cmdb.js +20 -20
- package/es/core/services/index.js +39 -45
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +10 -12
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +120 -134
- 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 +18 -20
- package/es/core/utils/metricUtil.js +5 -0
- package/es/core/utils/saveSerialize.js +9 -11
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +343 -357
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +189 -205
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -37
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +17 -19
- package/es/networkTopo/components/Link/hook.js +73 -77
- package/es/networkTopo/components/Link/index.js +86 -94
- package/es/networkTopo/components/Link/setting.js +42 -44
- package/es/networkTopo/getTopoData.js +63 -69
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +30 -32
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +18 -22
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +422 -470
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +18 -24
- package/es/networkTopo/services/metric.js +23 -27
- package/es/networkTopo/services/model.js +445 -509
- 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 +52 -54
- package/lib/components/BatchAttrMetric/setting.js +1 -1
- package/lib/components/MultiResourceDrawer/index.js +16 -18
- package/lib/components/ResourceList/ResourceSelect.js +48 -50
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -29
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +30 -32
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- 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 +118 -128
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -24
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +19 -21
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -10
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +12 -14
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +26 -28
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -14
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +25 -31
- package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
- 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/copyElementUtil.js +182 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +116 -120
- package/lib/core/hooks/useResourceConfig.js +58 -66
- package/lib/core/hooks/useTopoEdit.js +465 -495
- package/lib/core/models/Alarm.js +275 -292
- package/lib/core/models/AttributeMetricDisplay.js +104 -110
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +205 -240
- package/lib/core/models/TopoGraphView.js +18 -21
- package/lib/core/models/cache/CiCache.js +33 -32
- package/lib/core/models/cache/CiTypeCache.js +38 -42
- package/lib/core/models/cache/DictCache.js +33 -35
- package/lib/core/models/graph/Background.js +16 -18
- package/lib/core/models/plugins/resourceWebControllUrl.js +74 -80
- package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/lib/core/models/topoData.js +69 -71
- package/lib/core/models/utils/linkUtils.js +41 -43
- 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 +10 -12
- package/lib/core/services/cmdb.js +22 -22
- package/lib/core/services/index.js +45 -51
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +12 -14
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +120 -134
- 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 +22 -24
- package/lib/core/utils/metricUtil.js +5 -0
- package/lib/core/utils/saveSerialize.js +9 -11
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +344 -358
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +190 -206
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +29 -33
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -20
- package/lib/networkTopo/components/Link/hook.js +73 -77
- package/lib/networkTopo/components/Link/index.js +87 -95
- package/lib/networkTopo/components/Link/setting.js +42 -44
- package/lib/networkTopo/getTopoData.js +63 -69
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -33
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +18 -22
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +422 -470
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +21 -27
- package/lib/networkTopo/services/metric.js +27 -31
- package/lib/networkTopo/services/model.js +445 -509
- 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 +59 -61
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +5 -3
package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js
CHANGED
@@ -54,34 +54,32 @@ function BoxBackgroundSetting(props) {
|
|
54
54
|
var backgroundChang = /*#__PURE__*/function () {
|
55
55
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(value, type) {
|
56
56
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
57
|
-
while (1) {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
_context.next = 7;
|
62
|
-
break;
|
63
|
-
}
|
64
|
-
|
65
|
-
topo.historyManager.beginTransaction();
|
66
|
-
_context.next = 4;
|
67
|
-
return setStyle({
|
68
|
-
backgroundColor: value
|
69
|
-
});
|
70
|
-
|
71
|
-
case 4:
|
72
|
-
topo.historyManager.endTransaction();
|
73
|
-
_context.next = 8;
|
57
|
+
while (1) switch (_context.prev = _context.next) {
|
58
|
+
case 0:
|
59
|
+
if (!(type === 'select')) {
|
60
|
+
_context.next = 7;
|
74
61
|
break;
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
62
|
+
}
|
63
|
+
|
64
|
+
topo.historyManager.beginTransaction();
|
65
|
+
_context.next = 4;
|
66
|
+
return setStyle({
|
67
|
+
backgroundColor: value
|
68
|
+
});
|
69
|
+
|
70
|
+
case 4:
|
71
|
+
topo.historyManager.endTransaction();
|
72
|
+
_context.next = 8;
|
73
|
+
break;
|
74
|
+
|
75
|
+
case 7:
|
76
|
+
setStyle({
|
77
|
+
backgroundColor: value
|
78
|
+
});
|
79
|
+
|
80
|
+
case 8:
|
81
|
+
case "end":
|
82
|
+
return _context.stop();
|
85
83
|
}
|
86
84
|
}, _callee);
|
87
85
|
}));
|
@@ -110,34 +108,32 @@ function BoxBackgroundSetting(props) {
|
|
110
108
|
var borderColorChang = /*#__PURE__*/function () {
|
111
109
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(value, type) {
|
112
110
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
113
|
-
while (1) {
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
_context2.next = 7;
|
118
|
-
break;
|
119
|
-
}
|
120
|
-
|
121
|
-
topo.historyManager.beginTransaction();
|
122
|
-
_context2.next = 4;
|
123
|
-
return setStyle({
|
124
|
-
borderColor: value
|
125
|
-
});
|
126
|
-
|
127
|
-
case 4:
|
128
|
-
topo.historyManager.endTransaction();
|
129
|
-
_context2.next = 8;
|
111
|
+
while (1) switch (_context2.prev = _context2.next) {
|
112
|
+
case 0:
|
113
|
+
if (!(type === 'select')) {
|
114
|
+
_context2.next = 7;
|
130
115
|
break;
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
116
|
+
}
|
117
|
+
|
118
|
+
topo.historyManager.beginTransaction();
|
119
|
+
_context2.next = 4;
|
120
|
+
return setStyle({
|
121
|
+
borderColor: value
|
122
|
+
});
|
123
|
+
|
124
|
+
case 4:
|
125
|
+
topo.historyManager.endTransaction();
|
126
|
+
_context2.next = 8;
|
127
|
+
break;
|
128
|
+
|
129
|
+
case 7:
|
130
|
+
setStyle({
|
131
|
+
borderColor: value
|
132
|
+
});
|
133
|
+
|
134
|
+
case 8:
|
135
|
+
case "end":
|
136
|
+
return _context2.stop();
|
141
137
|
}
|
142
138
|
}, _callee2);
|
143
139
|
}));
|
@@ -56,34 +56,32 @@ function FontColorDropdown(props) {
|
|
56
56
|
var colorChang = /*#__PURE__*/function () {
|
57
57
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(value, type) {
|
58
58
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
59
|
-
while (1) {
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
_context.next = 7;
|
64
|
-
break;
|
65
|
-
}
|
66
|
-
|
67
|
-
topo.historyManager.beginTransaction();
|
68
|
-
_context.next = 4;
|
69
|
-
return setStyle({
|
70
|
-
color: value
|
71
|
-
});
|
72
|
-
|
73
|
-
case 4:
|
74
|
-
topo.historyManager.endTransaction();
|
75
|
-
_context.next = 8;
|
59
|
+
while (1) switch (_context.prev = _context.next) {
|
60
|
+
case 0:
|
61
|
+
if (!(type === 'select')) {
|
62
|
+
_context.next = 7;
|
76
63
|
break;
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
64
|
+
}
|
65
|
+
|
66
|
+
topo.historyManager.beginTransaction();
|
67
|
+
_context.next = 4;
|
68
|
+
return setStyle({
|
69
|
+
color: value
|
70
|
+
});
|
71
|
+
|
72
|
+
case 4:
|
73
|
+
topo.historyManager.endTransaction();
|
74
|
+
_context.next = 8;
|
75
|
+
break;
|
76
|
+
|
77
|
+
case 7:
|
78
|
+
setStyle({
|
79
|
+
background: value
|
80
|
+
});
|
81
|
+
|
82
|
+
case 8:
|
83
|
+
case "end":
|
84
|
+
return _context.stop();
|
87
85
|
}
|
88
86
|
}, _callee);
|
89
87
|
}));
|
@@ -96,34 +94,32 @@ function FontColorDropdown(props) {
|
|
96
94
|
var backgroundChang = /*#__PURE__*/function () {
|
97
95
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(value, type) {
|
98
96
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
99
|
-
while (1) {
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
_context2.next = 7;
|
104
|
-
break;
|
105
|
-
}
|
106
|
-
|
107
|
-
topo.historyManager.beginTransaction();
|
108
|
-
_context2.next = 4;
|
109
|
-
return setStyle({
|
110
|
-
background: value
|
111
|
-
});
|
112
|
-
|
113
|
-
case 4:
|
114
|
-
topo.historyManager.endTransaction();
|
115
|
-
_context2.next = 8;
|
97
|
+
while (1) switch (_context2.prev = _context2.next) {
|
98
|
+
case 0:
|
99
|
+
if (!(type === 'select')) {
|
100
|
+
_context2.next = 7;
|
116
101
|
break;
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
102
|
+
}
|
103
|
+
|
104
|
+
topo.historyManager.beginTransaction();
|
105
|
+
_context2.next = 4;
|
106
|
+
return setStyle({
|
107
|
+
background: value
|
108
|
+
});
|
109
|
+
|
110
|
+
case 4:
|
111
|
+
topo.historyManager.endTransaction();
|
112
|
+
_context2.next = 8;
|
113
|
+
break;
|
114
|
+
|
115
|
+
case 7:
|
116
|
+
setStyle({
|
117
|
+
background: value
|
118
|
+
});
|
119
|
+
|
120
|
+
case 8:
|
121
|
+
case "end":
|
122
|
+
return _context2.stop();
|
127
123
|
}
|
128
124
|
}, _callee2);
|
129
125
|
}));
|
@@ -28,20 +28,18 @@ var LayerAddResourceDrawer = function LayerAddResourceDrawer(props) {
|
|
28
28
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(selected) {
|
29
29
|
var layerData;
|
30
30
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
31
|
-
while (1) {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
return _context.stop();
|
44
|
-
}
|
31
|
+
while (1) switch (_context.prev = _context.next) {
|
32
|
+
case 0:
|
33
|
+
layerData = {
|
34
|
+
id: layer.tag,
|
35
|
+
tag: layer.attrObject.tag
|
36
|
+
};
|
37
|
+
_context.next = 3;
|
38
|
+
return topoEdit.addLayerResources(layerData, selected);
|
39
|
+
|
40
|
+
case 3:
|
41
|
+
case "end":
|
42
|
+
return _context.stop();
|
45
43
|
}
|
46
44
|
}, _callee);
|
47
45
|
}));
|
@@ -36,34 +36,32 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
36
36
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(selected) {
|
37
37
|
var result;
|
38
38
|
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
|
-
}
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
40
|
+
case 0:
|
41
|
+
if (selected) {
|
42
|
+
_context.next = 3;
|
43
|
+
break;
|
44
|
+
}
|
45
|
+
|
46
|
+
_message["default"].error('请选择一项资源。');
|
47
|
+
|
48
|
+
return _context.abrupt("return", false);
|
49
|
+
|
50
|
+
case 3:
|
51
|
+
_context.next = 5;
|
52
|
+
return topoEditApi.bindNodeResource({
|
53
|
+
id: node.id,
|
54
|
+
newResId: selected,
|
55
|
+
oldResId: currentResId
|
56
|
+
});
|
57
|
+
|
58
|
+
case 5:
|
59
|
+
result = _context.sent;
|
60
|
+
return _context.abrupt("return", result);
|
61
|
+
|
62
|
+
case 7:
|
63
|
+
case "end":
|
64
|
+
return _context.stop();
|
67
65
|
}
|
68
66
|
}, _callee);
|
69
67
|
}));
|
@@ -97,23 +97,21 @@ function Data(props) {
|
|
97
97
|
var handleBindTopoChange = /*#__PURE__*/function () {
|
98
98
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(value, data) {
|
99
99
|
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
|
-
}
|
100
|
+
while (1) switch (_context.prev = _context.next) {
|
101
|
+
case 0:
|
102
|
+
topo.historyManager.beginTransaction(); // 设置名称为拓扑名称,清空自定义名称
|
103
|
+
|
104
|
+
node.a('name', data.label);
|
105
|
+
node.a('customName', null);
|
106
|
+
_context.next = 5;
|
107
|
+
return topoEditApi.deleteExLink(node);
|
108
|
+
|
109
|
+
case 5:
|
110
|
+
topo.historyManager.endTransaction();
|
111
|
+
|
112
|
+
case 6:
|
113
|
+
case "end":
|
114
|
+
return _context.stop();
|
117
115
|
}
|
118
116
|
}, _callee);
|
119
117
|
}));
|
@@ -27,20 +27,18 @@ function BackgroundSize(props) {
|
|
27
27
|
var setSize = /*#__PURE__*/function () {
|
28
28
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(size) {
|
29
29
|
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
|
-
}
|
30
|
+
while (1) switch (_context.prev = _context.next) {
|
31
|
+
case 0:
|
32
|
+
topo.historyManager.beginTransaction();
|
33
|
+
_context.next = 3;
|
34
|
+
return backgroundSizeConfig.setSize(size);
|
35
|
+
|
36
|
+
case 3:
|
37
|
+
topo.historyManager.endTransaction();
|
38
|
+
|
39
|
+
case 4:
|
40
|
+
case "end":
|
41
|
+
return _context.stop();
|
44
42
|
}
|
45
43
|
}, _callee);
|
46
44
|
}));
|
@@ -51,19 +51,17 @@ function TopoEditorTitleBar(props) {
|
|
51
51
|
var saveAndExit = /*#__PURE__*/function () {
|
52
52
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
53
53
|
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
|
-
}
|
54
|
+
while (1) switch (_context.prev = _context.next) {
|
55
|
+
case 0:
|
56
|
+
_context.next = 2;
|
57
|
+
return topo.save();
|
58
|
+
|
59
|
+
case 2:
|
60
|
+
setExitFlag(true);
|
61
|
+
|
62
|
+
case 3:
|
63
|
+
case "end":
|
64
|
+
return _context.stop();
|
67
65
|
}
|
68
66
|
}, _callee);
|
69
67
|
}));
|
@@ -106,15 +104,13 @@ function TopoEditorTitleBar(props) {
|
|
106
104
|
onOk: function () {
|
107
105
|
var _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
116
|
}));
|
@@ -128,15 +124,13 @@ function TopoEditorTitleBar(props) {
|
|
128
124
|
onCancel: function () {
|
129
125
|
var _onCancel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
130
126
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
131
|
-
while (1) {
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
return _context3.stop();
|
139
|
-
}
|
127
|
+
while (1) switch (_context3.prev = _context3.next) {
|
128
|
+
case 0:
|
129
|
+
topo.exitEditMode();
|
130
|
+
|
131
|
+
case 1:
|
132
|
+
case "end":
|
133
|
+
return _context3.stop();
|
140
134
|
}
|
141
135
|
}, _callee3);
|
142
136
|
}));
|
@@ -1,49 +1,52 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
3
5
|
exports.__esModule = true;
|
4
6
|
exports["default"] = useKeyboardShortcut;
|
5
7
|
|
6
|
-
var
|
8
|
+
var _hotkeysJs = _interopRequireDefault(require("hotkeys-js"));
|
9
|
+
|
10
|
+
var _react = require("react");
|
11
|
+
|
12
|
+
var _copyElementUtil = require("../utils/copyElementUtil");
|
13
|
+
|
14
|
+
function initKeyboardShortcuts(props) {
|
15
|
+
var topo = props.topo,
|
16
|
+
topoEdit = props.topoEdit; // 撤销
|
17
|
+
|
18
|
+
(0, _hotkeysJs["default"])('ctrl+z, command+z', function (event) {
|
19
|
+
topo.historyManager.undo();
|
20
|
+
}); // 重做
|
21
|
+
|
22
|
+
(0, _hotkeysJs["default"])('ctrl+y, command+y', function (event) {}); // 空格:切换选择/移动
|
7
23
|
|
8
|
-
|
24
|
+
(0, _hotkeysJs["default"])('space', function (event) {
|
25
|
+
var _topo$store$getModelS = topo.store.getModelState('topoEdit'),
|
26
|
+
viewMouseMode = _topo$store$getModelS.viewMouseMode;
|
9
27
|
|
10
|
-
|
28
|
+
topoEdit.setViewMouseMode(viewMouseMode === 'select' ? 'move' : 'select');
|
29
|
+
}); // 复制
|
30
|
+
|
31
|
+
(0, _hotkeysJs["default"])('ctrl+c, command+c', function (event) {
|
32
|
+
return (0, _copyElementUtil.handleCopyHotkey)(event, props);
|
33
|
+
}); // 粘贴
|
34
|
+
|
35
|
+
(0, _hotkeysJs["default"])('ctrl+v, command+v', function (event) {
|
36
|
+
return (0, _copyElementUtil.handlePasteHotkey)(event, props);
|
37
|
+
});
|
38
|
+
}
|
39
|
+
|
40
|
+
function unbindKeyboardShortcuts(props) {
|
41
|
+
_hotkeysJs["default"].unbind();
|
42
|
+
} // 快捷键
|
11
43
|
|
12
|
-
var ht = window.ht; // 快捷键
|
13
44
|
|
14
45
|
function useKeyboardShortcut(props) {
|
15
|
-
var topo = props.topo,
|
16
|
-
topoEdit = props.topoEdit;
|
17
46
|
(0, _react.useEffect)(function () {
|
18
|
-
|
19
|
-
if (e.target.tagName === 'INPUT') {
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
|
23
|
-
var isCtrlDown = ht.Default.isCtrlDown;
|
24
|
-
|
25
|
-
if (isCtrlDown(e)) {
|
26
|
-
if (e.keyCode === 90) {
|
27
|
-
// ctrl+z 撤销
|
28
|
-
topo.historyManager.undo();
|
29
|
-
} // else if (e.keyCode == 89) {//ctrl+y 重做
|
30
|
-
// this.redo();
|
31
|
-
// }
|
32
|
-
|
33
|
-
}
|
34
|
-
|
35
|
-
if (e.keyCode === 32 && e.target.nodeName !== 'TEXTAREA') {
|
36
|
-
// 空格
|
37
|
-
var _topo$store$getModelS = topo.store.getModelState('topoEdit'),
|
38
|
-
viewMouseMode = _topo$store$getModelS.viewMouseMode;
|
39
|
-
|
40
|
-
topoEdit.setViewMouseMode(viewMouseMode === 'select' ? 'move' : 'select');
|
41
|
-
}
|
42
|
-
};
|
43
|
-
|
44
|
-
window.addEventListener('keydown', handleKeyDown);
|
47
|
+
initKeyboardShortcuts(props);
|
45
48
|
return function () {
|
46
|
-
|
49
|
+
unbindKeyboardShortcuts(props);
|
47
50
|
};
|
48
51
|
}, []);
|
49
52
|
}
|
@@ -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
|
}))();
|