@riil-frontend/component-topology 6.0.20 → 7.0.0-dev.10
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 +1 -1
- package/build/index.css +1 -1
- package/build/index.js +13 -13
- package/es/core/components/TopoView/topoView.js +15 -20
- package/es/core/components/titlebar/index.js +2 -1
- package/es/core/editor/components/EditorPlugin.js +1 -2
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +1 -9
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -11
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +18 -14
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +4 -4
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +16 -9
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/es/core/editor/hooks/useUpdateHtTopoDefaultTagStyle.js +2 -2
- package/es/core/hooks/useTopoEdit.js +131 -169
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +3 -3
- package/es/core/store/coreModels.js +2 -0
- package/es/core/store/models/selection.js +3 -1
- package/es/core/store/models/topoConfig.js +7 -5
- package/es/core/store/models/topoMod.js +1 -1
- package/es/core/store/models/viewer/resourceDetail.js +31 -0
- package/es/core/utils/saveSerialize.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +2 -5
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +72 -43
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +136 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +9 -16
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +119 -117
- package/es/core/viewer/components/titlebar/BasicTools.js +3 -16
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
- package/es/networkTopo/getTopoData.js +2 -3
- package/es/networkTopo/store/topoCenter.js +27 -4
- package/es/style.js +22 -22
- package/lib/core/components/TopoView/topoView.js +15 -21
- package/lib/core/components/titlebar/index.js +5 -1
- package/lib/core/editor/components/EditorPlugin.js +1 -3
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +1 -9
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -12
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +18 -15
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +4 -4
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +16 -10
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/lib/core/editor/hooks/useUpdateHtTopoDefaultTagStyle.js +2 -2
- package/lib/core/hooks/useTopoEdit.js +131 -169
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +7 -11
- package/lib/core/store/coreModels.js +3 -0
- package/lib/core/store/models/selection.js +3 -1
- package/lib/core/store/models/topoConfig.js +7 -5
- package/lib/core/store/models/topoMod.js +1 -1
- package/lib/core/store/models/viewer/resourceDetail.js +40 -0
- package/lib/core/utils/saveSerialize.js +1 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +2 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +71 -46
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +156 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +9 -16
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +119 -117
- package/lib/core/viewer/components/titlebar/BasicTools.js +3 -17
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
- package/lib/networkTopo/getTopoData.js +3 -5
- package/lib/networkTopo/store/topoCenter.js +27 -4
- package/lib/style.js +22 -22
- package/package.json +2 -2
- package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
- package/lib/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -25
@@ -7,7 +7,6 @@ import TopoGraph, { TopoEvent } from '@riil-frontend/component-topology-graph';
|
|
7
7
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog'; // 通用
|
8
8
|
|
9
9
|
import showMessage from "../../utils/showMessage";
|
10
|
-
import TitleBar from "../titlebar/TitleBar";
|
11
10
|
import { TPL_TREE } from "../../../utils/template";
|
12
11
|
import { updateEdgeExpanded } from "../../utils/edgeUtil";
|
13
12
|
import useRouterAdapter from "../../hooks/useRouterAdapter";
|
@@ -39,7 +38,6 @@ var Topology = function Topology(props) {
|
|
39
38
|
onLoad = props.onLoad,
|
40
39
|
onDestroy = props.onDestroy,
|
41
40
|
onRefreshTopo = props.onRefresh,
|
42
|
-
onEnterEdit = props.onEnterEdit,
|
43
41
|
onSave = props.onSave,
|
44
42
|
nodeDeleteable = props.nodeDeleteable,
|
45
43
|
onNodeDelete = props.onNodeDelete,
|
@@ -149,7 +147,19 @@ var Topology = function Topology(props) {
|
|
149
147
|
topo.selectionModel.init();
|
150
148
|
topoDispatchers.update({
|
151
149
|
graphLoaded: true
|
152
|
-
});
|
150
|
+
}); // url选中元素
|
151
|
+
|
152
|
+
var _topo$store$getModelS = topo.store.getModelState('selection'),
|
153
|
+
initSelectionId = _topo$store$getModelS.initSelectionId;
|
154
|
+
|
155
|
+
if (initSelectionId) {
|
156
|
+
var ele = topo.getHtTopo().getGraphView().dm().getDataByTag(initSelectionId);
|
157
|
+
topo.getHtTopo().getGraphView().sm().setSelection([ele]);
|
158
|
+
var selectionDispatchers = topo.store.getModelDispatchers('selection');
|
159
|
+
selectionDispatchers.update({
|
160
|
+
initSelectionId: null
|
161
|
+
});
|
162
|
+
}
|
153
163
|
|
154
164
|
if (onLoaded) {
|
155
165
|
onLoaded(topoData);
|
@@ -193,10 +203,6 @@ var Topology = function Topology(props) {
|
|
193
203
|
rightEventHandle(event);
|
194
204
|
break;
|
195
205
|
|
196
|
-
case TopoEvent.EVENT_DATA_PICK:
|
197
|
-
topoEdit.onBindData(event.data);
|
198
|
-
break;
|
199
|
-
|
200
206
|
case TopoEvent.EVENT_DATA_DELETE:
|
201
207
|
topoEdit.onDeleteElement(event.data);
|
202
208
|
break;
|
@@ -210,10 +216,6 @@ var Topology = function Topology(props) {
|
|
210
216
|
onRefresh(event.data);
|
211
217
|
break;
|
212
218
|
|
213
|
-
case TopoEvent.EVENT_EDIT_EXIT:
|
214
|
-
topoEdit.onExitEdit(event.data);
|
215
|
-
break;
|
216
|
-
|
217
219
|
case TopoEvent.EVENT_CONTEXT_TOOL:
|
218
220
|
rlog.debug('自定义工具栏事件', event);
|
219
221
|
break;
|
@@ -252,12 +254,7 @@ var Topology = function Topology(props) {
|
|
252
254
|
return /*#__PURE__*/React.createElement("div", {
|
253
255
|
className: styles.topoView,
|
254
256
|
"data-version": topo.version
|
255
|
-
}, titleBar !== false &&
|
256
|
-
topo: topo,
|
257
|
-
viewerProps: viewerProps,
|
258
|
-
onEnterEdit: onEnterEdit,
|
259
|
-
topoEditApi: topoEdit
|
260
|
-
})), isEditMode && /*#__PURE__*/React.createElement(EditorToolbar, {
|
257
|
+
}, titleBar !== false && titleBar, isEditMode && /*#__PURE__*/React.createElement(EditorToolbar, {
|
261
258
|
topo: topo,
|
262
259
|
topoEdit: topoEdit,
|
263
260
|
topoContext: {
|
@@ -299,8 +296,6 @@ Topology.propTypes = {
|
|
299
296
|
viewerProps: PropTypes.object,
|
300
297
|
editorProps: PropTypes.object,
|
301
298
|
topoContext: PropTypes.object,
|
302
|
-
// 进入编辑模式
|
303
|
-
onEnterEdit: PropTypes.func,
|
304
299
|
onRefresh: PropTypes.func,
|
305
300
|
onSave: PropTypes.func,
|
306
301
|
nodeDeleteable: PropTypes.func,
|
@@ -312,7 +307,7 @@ Topology.propTypes = {
|
|
312
307
|
/**
|
313
308
|
* @deprecated 工具栏
|
314
309
|
*/
|
315
|
-
titleBar: PropTypes.
|
310
|
+
titleBar: PropTypes.any
|
316
311
|
};
|
317
312
|
Topology.defaultProps = {
|
318
313
|
defaultEnterEditMode: false,
|
@@ -5,4 +5,5 @@ import NodesDragSwitch from "../../viewer/components/titlebar/widgets/NodesDragS
|
|
5
5
|
import AlarmListShowButton from "../../viewer/components/titlebar/widgets/AlarmListShowButton";
|
6
6
|
import TitleWidget from "./widgets/TitleWidget";
|
7
7
|
import ViewerTools from "../../viewer/components/titlebar/ViewerTools";
|
8
|
-
|
8
|
+
import DebugTools from "../../editor/components/titlebar/widgets/DebugTools";
|
9
|
+
export { TitleBar, SearchWidget, NodesDragSwitch, DisplaySettingButton, AlarmListShowButton, TitleWidget, ViewerTools, DebugTools };
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useEffect } from 'react';
|
3
3
|
import CustomIconPlugin from "./CustomIconPlugin";
|
4
4
|
import SaveLoading from "./plugins/SaveLoading";
|
5
|
-
import MultipleResourceSelectPlugin from "./plugins/MultipleResourceSelectPlugin";
|
6
5
|
import GroupAddResourceDrawerPlugin from "./GroupAddResourceDrawerPlugin";
|
7
6
|
import MetricPollingPlugin from "../../viewer/components/plugins/MetricPollingPlugin";
|
8
7
|
import AddElementThemePlugin from "./plugins/AddElementThemePlugin";
|
@@ -27,7 +26,7 @@ export default function TopoEditorPlugin(props) {
|
|
27
26
|
return null;
|
28
27
|
}
|
29
28
|
|
30
|
-
var plugins = [CorePlugin, SaveLoading, AddElementThemePlugin, CustomIconPlugin, GroupAddResourceDrawerPlugin,
|
29
|
+
var plugins = [CorePlugin, SaveLoading, AddElementThemePlugin, CustomIconPlugin, GroupAddResourceDrawerPlugin, MetricPollingPlugin].concat((editorProps === null || editorProps === void 0 ? void 0 : editorProps.plugins) || []);
|
31
30
|
return /*#__PURE__*/React.createElement(React.Fragment, null, plugins.map(function (Plugin, index) {
|
32
31
|
return /*#__PURE__*/React.createElement(Plugin, _extends({
|
33
32
|
key: index,
|
@@ -52,16 +52,8 @@ function FontStyleButton(props) {
|
|
52
52
|
underline: underline
|
53
53
|
})),
|
54
54
|
value = _useState2[0],
|
55
|
-
setValue = _useState2[1];
|
55
|
+
setValue = _useState2[1];
|
56
56
|
|
57
|
-
|
58
|
-
var selection = topo.selectionModel.useHtSelection();
|
59
|
-
useEffect(function () {
|
60
|
-
var containText = selection.filter(function (ele) {
|
61
|
-
return isText(ele);
|
62
|
-
}).length;
|
63
|
-
setDisabled(!containText);
|
64
|
-
}, [selection]);
|
65
57
|
useEffect(function () {
|
66
58
|
setValue(buildValue({
|
67
59
|
bold: bold,
|
@@ -4,21 +4,21 @@ var _excluded = ["color", "background", "opacity", "bold", "italic"];
|
|
4
4
|
import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
|
5
5
|
import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
|
6
6
|
export function getTextStyle(element) {
|
7
|
-
var underline = null;
|
8
7
|
return _extends({
|
9
8
|
color: parseColor(element.a('edge.tag.color')),
|
10
9
|
fontFamily: element.a('edge.tag.fontFamily') || '微软雅黑',
|
11
|
-
|
10
|
+
fontSize: element.a('edge.tag.fontSize'),
|
11
|
+
bold: !!element.a('edge.tag.fontBold'),
|
12
|
+
italic: !!element.a('edge.tag.fontItalic')
|
12
13
|
}, parseBackground(element.a('edge.tag.background')));
|
13
14
|
}
|
14
15
|
export function setTextStyle(element, style, topo) {
|
15
|
-
var
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
otherStyle = _objectWithoutPropertiesLoose(_fontStyleUtil$remove, _excluded);
|
16
|
+
var color = style.color,
|
17
|
+
background = style.background,
|
18
|
+
opacity = style.opacity,
|
19
|
+
bold = style.bold,
|
20
|
+
italic = style.italic,
|
21
|
+
otherStyle = _objectWithoutPropertiesLoose(style, _excluded);
|
22
22
|
|
23
23
|
var tagStyle = _extends({}, otherStyle);
|
24
24
|
|
@@ -55,11 +55,11 @@ export function setTextStyle(element, style, topo) {
|
|
55
55
|
*/
|
56
56
|
|
57
57
|
export function getEnabledFields(element) {
|
58
|
-
return ['fontFamily', 'color', 'background', 'opacity'];
|
58
|
+
return ['fontFamily', 'color', 'background', 'opacity', 'fontSize', 'bold', 'italic'];
|
59
59
|
}
|
60
60
|
export function getFieldDisabled(element) {
|
61
61
|
return {
|
62
|
-
fontSize:
|
62
|
+
fontSize: false
|
63
63
|
};
|
64
64
|
}
|
65
65
|
export default {
|
@@ -1,23 +1,23 @@
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
-
var _excluded = ["color", "background", "opacity", "bold", "italic"];
|
3
|
+
var _excluded = ["color", "background", "opacity", "bold", "italic", "underline"];
|
4
4
|
import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
|
5
5
|
import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
|
6
6
|
export function getTextStyle(element) {
|
7
|
-
var underline =
|
7
|
+
var underline = !!element.a('node.tag.fontUnderline');
|
8
8
|
return _extends({
|
9
9
|
color: parseColor(element.a('ht.color')),
|
10
10
|
underline: underline
|
11
11
|
}, fontStyleUtil.toMap(element.a('ht.font')), parseBackground(element.a('ht.background')));
|
12
12
|
}
|
13
13
|
export function setTextStyle(element, style, topo) {
|
14
|
-
var
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
otherStyle = _objectWithoutPropertiesLoose(
|
14
|
+
var color = style.color,
|
15
|
+
background = style.background,
|
16
|
+
opacity = style.opacity,
|
17
|
+
bold = style.bold,
|
18
|
+
italic = style.italic,
|
19
|
+
underline = style.underline,
|
20
|
+
otherStyle = _objectWithoutPropertiesLoose(style, _excluded);
|
21
21
|
|
22
22
|
var tagStyle = _extends({}, otherStyle);
|
23
23
|
|
@@ -33,6 +33,10 @@ export function setTextStyle(element, style, topo) {
|
|
33
33
|
tagStyle.fontItalic = italic;
|
34
34
|
}
|
35
35
|
|
36
|
+
if ('underline' in style) {
|
37
|
+
tagStyle.fontUnderline = underline;
|
38
|
+
}
|
39
|
+
|
36
40
|
if ('background' in style) {
|
37
41
|
// 背景颜色
|
38
42
|
var prevStyle = getTextStyle(element);
|
@@ -48,7 +52,7 @@ export function setTextStyle(element, style, topo) {
|
|
48
52
|
}
|
49
53
|
}
|
50
54
|
export function getEnabledFields(element) {
|
51
|
-
return ['fontFamily', 'color', 'background', 'opacity'];
|
55
|
+
return ['fontFamily', 'color', 'background', 'opacity', 'fontSize', 'bold', 'italic', 'underline'];
|
52
56
|
}
|
53
57
|
/**
|
54
58
|
* 获得字段是否禁用
|
@@ -59,10 +63,10 @@ export function getEnabledFields(element) {
|
|
59
63
|
|
60
64
|
export function getFieldDisabled(element) {
|
61
65
|
return {
|
62
|
-
fontSize:
|
63
|
-
bold:
|
64
|
-
italic:
|
65
|
-
underline:
|
66
|
+
fontSize: false,
|
67
|
+
bold: false,
|
68
|
+
italic: false,
|
69
|
+
underline: false
|
66
70
|
};
|
67
71
|
}
|
68
72
|
export default {
|
@@ -4,10 +4,10 @@ var _excluded = ["Component"];
|
|
4
4
|
import React, { useMemo } from 'react';
|
5
5
|
import { setGlobalTagStyle, useValues } from "./globalTag";
|
6
6
|
var fieldDisabled = {
|
7
|
-
fontSize:
|
8
|
-
bold:
|
9
|
-
italic:
|
10
|
-
underline:
|
7
|
+
fontSize: false,
|
8
|
+
bold: false,
|
9
|
+
italic: false,
|
10
|
+
underline: false
|
11
11
|
};
|
12
12
|
|
13
13
|
function GlobalTagStyleSetting(props) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
var _excluded = ["color", "background", "opacity"],
|
4
|
-
_excluded2 = ["color", "background", "opacity", "bold", "italic"];
|
4
|
+
_excluded2 = ["color", "background", "opacity", "bold", "italic", "underline"];
|
5
5
|
import fontStyleUtil from "../../../../../settings/common/text/fontStyleUtil";
|
6
6
|
import { formatBackgroundRgbaColor, parseBackground, formatRgbaColor } from "../ElementTextStyleSetting/colorUtil";
|
7
7
|
var defaultStyle = {
|
@@ -15,7 +15,10 @@ export function useValues(topo) {
|
|
15
15
|
return _extends({
|
16
16
|
color: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.color) || defaultStyle.color,
|
17
17
|
fontFamily: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontFamily) || defaultStyle.fontFamily,
|
18
|
-
fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize
|
18
|
+
fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize,
|
19
|
+
bold: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.bold,
|
20
|
+
italic: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.italic,
|
21
|
+
underline: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.underline
|
19
22
|
}, parseBackground(nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.background));
|
20
23
|
}
|
21
24
|
export var setGlobalTagStyle = function setGlobalTagStyle(topo, styleData) {
|
@@ -61,13 +64,13 @@ function buildStyle(styleData, prevTagStyle) {
|
|
61
64
|
}
|
62
65
|
|
63
66
|
function buildGlobalStyle(styleData) {
|
64
|
-
var
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
otherStyle = _objectWithoutPropertiesLoose(
|
67
|
+
var color = styleData.color,
|
68
|
+
background = styleData.background,
|
69
|
+
opacity = styleData.opacity,
|
70
|
+
bold = styleData.bold,
|
71
|
+
italic = styleData.italic,
|
72
|
+
underline = styleData.underline,
|
73
|
+
otherStyle = _objectWithoutPropertiesLoose(styleData, _excluded2);
|
71
74
|
|
72
75
|
var tagStyle = _extends({}, otherStyle);
|
73
76
|
|
@@ -83,6 +86,10 @@ function buildGlobalStyle(styleData) {
|
|
83
86
|
tagStyle.fontItalic = italic;
|
84
87
|
}
|
85
88
|
|
89
|
+
if ('underline' in styleData) {
|
90
|
+
tagStyle.fontUnderline = underline;
|
91
|
+
}
|
92
|
+
|
86
93
|
if ('background' in styleData) {
|
87
94
|
// 背景颜色
|
88
95
|
tagStyle.background = formatRgbaColor(background);
|
@@ -142,7 +142,8 @@ export default function Data(props) {
|
|
142
142
|
nodeElement: node,
|
143
143
|
node: values,
|
144
144
|
topo: topo,
|
145
|
-
topoEditApi: topoEditApi
|
145
|
+
topoEditApi: topoEditApi,
|
146
|
+
nodeBindResourceDrawerComponent: editorProps.nodeBindResourceDrawerComponent
|
146
147
|
}))), bindType === "topo" && RelateTopoTree && /*#__PURE__*/React.createElement(_Form.Item, {
|
147
148
|
label: "\u5173\u8054\u62D3\u6251"
|
148
149
|
}, /*#__PURE__*/React.createElement(RelateTopoTree, {
|
package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import _Button from "@alifd/next/es/button";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import React, { useState } from 'react';
|
4
|
-
import
|
4
|
+
import DefaultBindResourceDrawer from "./BindResourceDrawer";
|
5
5
|
import { isClusterMemberHtElement } from "../../../../../../../utils/clusterUtil";
|
6
6
|
/**
|
7
7
|
* @return {React.ReactNode | null}
|
@@ -13,7 +13,8 @@ export default function NodeRelateResourceButton(props) {
|
|
13
13
|
var nodeElement = props.nodeElement,
|
14
14
|
topo = props.topo,
|
15
15
|
topoEditApi = props.topoEditApi,
|
16
|
-
node = props.node
|
16
|
+
node = props.node,
|
17
|
+
nodeBindResourceDrawerComponent = props.nodeBindResourceDrawerComponent;
|
17
18
|
var hide = isClusterMemberHtElement(nodeElement) || ((_node$attrObject$data = node.attrObject.data) === null || _node$attrObject$data === void 0 ? void 0 : _node$attrObject$data.relateResource) === false;
|
18
19
|
var currentResId = node.tag;
|
19
20
|
|
@@ -21,6 +22,7 @@ export default function NodeRelateResourceButton(props) {
|
|
21
22
|
visible = _useState[0],
|
22
23
|
setVisible = _useState[1];
|
23
24
|
|
25
|
+
var BindResourceDrawer = nodeBindResourceDrawerComponent || DefaultBindResourceDrawer;
|
24
26
|
return !hide ? /*#__PURE__*/React.createElement(_Button, {
|
25
27
|
type: "primary",
|
26
28
|
text: true,
|
@@ -22,7 +22,7 @@ export default function useKeyboardShortcut(props) {
|
|
22
22
|
|
23
23
|
}
|
24
24
|
|
25
|
-
if (e.keyCode === 32) {
|
25
|
+
if (e.keyCode === 32 && e.target.nodeName !== 'TEXTAREA') {
|
26
26
|
// 空格
|
27
27
|
var _topo$store$getModelS = topo.store.getModelState('topoEdit'),
|
28
28
|
viewMouseMode = _topo$store$getModelS.viewMouseMode;
|
@@ -13,12 +13,12 @@ function useUpdateHtTopoDefaultTagStyle(props) {
|
|
13
13
|
var nodeLabelStyle = displayConfig.nodeLabelStyle,
|
14
14
|
defaultEdgeLabelStyle = displayConfig.defaultEdgeLabelStyle;
|
15
15
|
useEffect(function () {
|
16
|
-
if (nodeLabelStyle) {
|
16
|
+
if (nodeLabelStyle && topo.getHtTopo().setDefaultNodeLabelStyle) {
|
17
17
|
topo.getHtTopo().setDefaultNodeLabelStyle(nodeLabelStyle);
|
18
18
|
}
|
19
19
|
}, [nodeLabelStyle]);
|
20
20
|
useEffect(function () {
|
21
|
-
if (defaultEdgeLabelStyle) {
|
21
|
+
if (defaultEdgeLabelStyle && topo.getHtTopo().setDefaultEdgeTagStyle) {
|
22
22
|
topo.getHtTopo().setDefaultEdgeTagStyle(defaultEdgeLabelStyle);
|
23
23
|
}
|
24
24
|
}, [defaultEdgeLabelStyle]);
|