@riil-frontend/component-topology 5.0.0-alpha.9 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +20 -20
- package/es/common/components/ColorPicker/ColorPicker.js +5 -3
- package/es/components/BatchAttrMetric/setting.js +3 -5
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -1
- package/es/core/components/DisplaySettingDrawer/LinkTip.js +5 -1
- package/es/core/components/DisplaySettingDrawer/demo/Demo.js +63 -0
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +9 -48
- package/es/core/components/TopoView/TopoView.module.scss +1 -1
- package/es/core/components/TopoView/topoView.js +31 -22
- package/es/core/editor/components/BackgroundView/index.js +74 -35
- package/es/core/editor/components/settings/common/LineType/index.js +7 -1
- package/es/core/editor/components/settings/common/text/FontStyleCheckbox.js +3 -3
- package/es/core/editor/components/settings/common/text/TextStyle.js +21 -6
- package/es/core/editor/components/settings/common/text/fontStyleUtil.js +0 -1
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +12 -1
- package/es/core/editor/components/settings/propertyViews/box/NameInput.js +9 -1
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -1
- package/es/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +2 -0
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -5
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -2
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +12 -1
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +13 -3
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +0 -1
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +2 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +4 -1
- package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +4 -0
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +34 -6
- package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +9 -2
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +30 -1
- package/es/core/editor/components/settings/propertyViews/view/GlobalLayout.js +2 -0
- package/es/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +15 -1
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +0 -1
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +4 -1
- package/es/core/editor/components/titlebar/widgets/DebugTools.js +29 -0
- package/es/core/hooks/useAlarm.js +18 -0
- package/es/core/hooks/useGraphAlarmDisplay.js +25 -3
- package/es/core/hooks/useResourceConfig.js +2 -1
- package/es/core/hooks/useRouterAdapter.js +7 -1
- package/es/core/hooks/useTopoEdit.js +220 -163
- package/es/core/models/AttributeMetricDisplay.js +31 -73
- package/es/core/models/HistoryManager.js +100 -50
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/cache/CiTypeCache.js +10 -44
- package/es/core/models/cache/DictCache.js +2 -1
- package/es/core/models/graph/Background.js +31 -14
- package/es/core/models/tagstips/ElementTagTipConfig.js +46 -12
- package/es/core/models/tagstips/utils.js +1 -1
- package/es/core/models/topoData.js +7 -3
- package/es/core/models/utils/linkUtils.js +18 -0
- package/es/core/store/models/topoAlarm.js +5 -1
- package/es/core/store/models/topoMod.js +6 -31
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +51 -249
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +218 -0
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +0 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +79 -43
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +23 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +11 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +34 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +6 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +62 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +188 -0
- package/es/core/viewer/components/titlebar/BasicTools.js +1 -1
- package/es/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +18 -0
- package/es/core/viewer/components/titlebar/widgets/SettingButton.js +11 -1
- package/es/networkTopo/components/TopoView.js +2 -1
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +164 -225
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +4 -0
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +161 -137
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +104 -0
- package/es/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +17 -7
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +8 -9
- package/es/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +59 -0
- package/es/networkTopo/components/viewer/displaySetting/LinkTagV2.js +10 -4
- package/es/networkTopo/getTopoData.js +11 -14
- package/es/networkTopo/hooks/editor/useDeleteEdges.js +11 -8
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -0
- package/es/networkTopo/models/TopoCenter.js +1 -1
- package/es/networkTopo/services/index.js +6 -4
- package/es/networkTopo/services/link.js +2 -2
- package/es/networkTopo/store/topoCenter.js +5 -2
- package/es/networkTopo/store/topoTreeMod.js +84 -43
- package/es/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +135 -0
- package/es/networkTopo/utils/resourcePermissionUtil.js +10 -6
- package/es/style.js +2 -1
- package/es/utils/ResourceConfigUtil.js +79 -39
- package/es/utils/clusterUtil.js +1 -1
- package/es/utils/htElementUtils.js +0 -1
- package/es/utils/topoData.js +24 -63
- package/es/utils/tree.js +1 -3
- package/lib/common/components/ColorPicker/ColorPicker.js +6 -3
- package/lib/components/BatchAttrMetric/setting.js +3 -6
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +4 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +4 -1
- package/lib/core/components/DisplaySettingDrawer/LinkTip.js +6 -1
- package/lib/core/components/DisplaySettingDrawer/demo/Demo.js +71 -0
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +8 -48
- package/lib/core/components/TopoView/TopoView.module.scss +1 -1
- package/lib/core/components/TopoView/topoView.js +26 -17
- package/lib/core/editor/components/BackgroundView/index.js +75 -35
- package/lib/core/editor/components/settings/common/LineType/index.js +7 -1
- package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.js +5 -4
- package/lib/core/editor/components/settings/common/text/TextStyle.js +23 -7
- package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +0 -1
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +13 -1
- package/lib/core/editor/components/settings/propertyViews/box/NameInput.js +9 -1
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -1
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -5
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -2
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +12 -1
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +17 -3
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +0 -1
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +4 -1
- package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +4 -0
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +36 -6
- package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +9 -2
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +32 -1
- package/lib/core/editor/components/settings/propertyViews/view/GlobalLayout.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +15 -1
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +0 -1
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +5 -1
- package/lib/core/editor/components/titlebar/widgets/DebugTools.js +38 -0
- package/lib/core/hooks/useAlarm.js +19 -0
- package/lib/core/hooks/useGraphAlarmDisplay.js +27 -3
- package/lib/core/hooks/useResourceConfig.js +2 -1
- package/lib/core/hooks/useRouterAdapter.js +8 -1
- package/lib/core/hooks/useTopoEdit.js +219 -162
- package/lib/core/models/AttributeMetricDisplay.js +31 -73
- package/lib/core/models/HistoryManager.js +105 -51
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/cache/CiTypeCache.js +12 -44
- package/lib/core/models/cache/DictCache.js +4 -1
- package/lib/core/models/graph/Background.js +36 -16
- package/lib/core/models/tagstips/ElementTagTipConfig.js +49 -12
- package/lib/core/models/tagstips/utils.js +1 -1
- package/lib/core/models/topoData.js +7 -3
- package/lib/core/models/utils/linkUtils.js +22 -0
- package/lib/core/store/models/topoAlarm.js +5 -1
- package/lib/core/store/models/topoMod.js +7 -32
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +51 -261
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +245 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +0 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +79 -42
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +2 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +36 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +11 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +45 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +11 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +77 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +214 -0
- package/lib/core/viewer/components/titlebar/BasicTools.js +2 -2
- package/lib/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +28 -0
- package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +10 -0
- package/lib/networkTopo/components/TopoView.js +3 -2
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +160 -223
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +12 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +161 -137
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +120 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +19 -7
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +8 -9
- package/lib/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +76 -0
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagV2.js +10 -4
- package/lib/networkTopo/getTopoData.js +10 -13
- package/lib/networkTopo/hooks/editor/useDeleteEdges.js +11 -8
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +2 -1
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -0
- package/lib/networkTopo/models/TopoCenter.js +2 -2
- package/lib/networkTopo/services/index.js +6 -4
- package/lib/networkTopo/services/link.js +2 -2
- package/lib/networkTopo/store/topoCenter.js +5 -2
- package/lib/networkTopo/store/topoTreeMod.js +84 -43
- package/lib/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +137 -0
- package/lib/networkTopo/utils/resourcePermissionUtil.js +11 -6
- package/lib/style.js +2 -1
- package/lib/utils/ResourceConfigUtil.js +78 -37
- package/lib/utils/clusterUtil.js +1 -1
- package/lib/utils/htElementUtils.js +0 -1
- package/lib/utils/topoData.js +25 -64
- package/lib/utils/tree.js +1 -3
- package/package.json +3 -2
|
@@ -20,8 +20,9 @@ function parseValue(value) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
var
|
|
23
|
+
var TextStyle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
24
|
+
var topo = props.topo,
|
|
25
|
+
value = props.value,
|
|
25
26
|
_onChange = props.onChange;
|
|
26
27
|
|
|
27
28
|
var field = _Field.useField({
|
|
@@ -116,7 +117,13 @@ export default function TextStyle(props) {
|
|
|
116
117
|
width: '100%',
|
|
117
118
|
marginRight: 8
|
|
118
119
|
},
|
|
119
|
-
placeholder: "\u8BF7\u8F93\u5165"
|
|
120
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
121
|
+
onFocus: function onFocus() {
|
|
122
|
+
topo.historyManager.beginTransaction();
|
|
123
|
+
},
|
|
124
|
+
onBlur: function onBlur() {
|
|
125
|
+
topo.historyManager.endTransaction();
|
|
126
|
+
}
|
|
120
127
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
121
128
|
style: {
|
|
122
129
|
display: 'flex'
|
|
@@ -138,7 +145,15 @@ export default function TextStyle(props) {
|
|
|
138
145
|
label: "\u989C\u8272"
|
|
139
146
|
}, /*#__PURE__*/React.createElement(ColorPicker, {
|
|
140
147
|
name: "color",
|
|
141
|
-
align: "br"
|
|
148
|
+
align: "br",
|
|
149
|
+
balloonProps: {
|
|
150
|
+
onFocus: function onFocus() {
|
|
151
|
+
topo.historyManager.beginTransaction();
|
|
152
|
+
},
|
|
153
|
+
onBlur: function onBlur() {
|
|
154
|
+
topo.historyManager.endTransaction();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
142
157
|
}))))));
|
|
143
|
-
}
|
|
144
|
-
;
|
|
158
|
+
});
|
|
159
|
+
export default TextStyle;
|
|
@@ -3,6 +3,7 @@ import _Field from "@alifd/next/es/field";
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import _Collapse from "@alifd/next/es/collapse";
|
|
5
5
|
import React, { useEffect } from 'react';
|
|
6
|
+
import useHtElement from "../../../../../common/hooks/useHtElement";
|
|
6
7
|
import NameInput from "./NameInput";
|
|
7
8
|
var CollapsePanel = _Collapse.Panel;
|
|
8
9
|
|
|
@@ -14,6 +15,10 @@ export default function BoxPropertyView(props) {
|
|
|
14
15
|
var topo = props.topo,
|
|
15
16
|
values = props.values,
|
|
16
17
|
_onChange = props.onChange;
|
|
18
|
+
var boxNode = useHtElement({
|
|
19
|
+
topo: topo,
|
|
20
|
+
id: values.id
|
|
21
|
+
});
|
|
17
22
|
|
|
18
23
|
var field = _Field.useField({
|
|
19
24
|
autoUnmount: false,
|
|
@@ -22,6 +27,11 @@ export default function BoxPropertyView(props) {
|
|
|
22
27
|
var newValues = field.getValues();
|
|
23
28
|
|
|
24
29
|
_onChange(name, value, newValues);
|
|
30
|
+
|
|
31
|
+
if (name === 'attrObject.topLeftText') {
|
|
32
|
+
// 修改框名称改变名称背景块大小
|
|
33
|
+
topo.getHtTopo().setRectangleText(boxNode);
|
|
34
|
+
}
|
|
25
35
|
}
|
|
26
36
|
});
|
|
27
37
|
|
|
@@ -42,6 +52,7 @@ export default function BoxPropertyView(props) {
|
|
|
42
52
|
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
43
53
|
label: "\u6807\u9898\u540D\u79F0"
|
|
44
54
|
}, /*#__PURE__*/React.createElement(NameInput, {
|
|
45
|
-
name: "attrObject.topLeftText"
|
|
55
|
+
name: "attrObject.topLeftText",
|
|
56
|
+
topo: topo
|
|
46
57
|
}))))));
|
|
47
58
|
}
|
|
@@ -2,7 +2,8 @@ import _Input from "@alifd/next/es/input";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
4
|
var NameInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
5
|
-
var onChange = props.onChange
|
|
5
|
+
var onChange = props.onChange,
|
|
6
|
+
topo = props.topo;
|
|
6
7
|
|
|
7
8
|
var _useState = useState(props.value),
|
|
8
9
|
value = _useState[0],
|
|
@@ -20,16 +21,23 @@ var NameInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
23
|
|
|
24
|
+
var handleFocus = function handleFocus() {
|
|
25
|
+
topo.historyManager.beginTransaction();
|
|
26
|
+
};
|
|
27
|
+
|
|
23
28
|
var handleBlur = function handleBlur() {
|
|
24
29
|
if (!value) {
|
|
25
30
|
onChange('');
|
|
26
31
|
}
|
|
32
|
+
|
|
33
|
+
topo.historyManager.endTransaction();
|
|
27
34
|
};
|
|
28
35
|
|
|
29
36
|
return /*#__PURE__*/React.createElement(_Input, _extends({}, props, {
|
|
30
37
|
ref: ref,
|
|
31
38
|
value: value,
|
|
32
39
|
onChange: handleChange,
|
|
40
|
+
onFocus: handleFocus,
|
|
33
41
|
onBlur: handleBlur
|
|
34
42
|
}));
|
|
35
43
|
});
|
|
@@ -92,6 +92,12 @@ export default function CommonEdgePropertyView(props) {
|
|
|
92
92
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
93
93
|
style: {
|
|
94
94
|
width: "100%"
|
|
95
|
+
},
|
|
96
|
+
onFocus: function onFocus() {
|
|
97
|
+
topo.historyManager.beginTransaction();
|
|
98
|
+
},
|
|
99
|
+
onBlur: function onBlur() {
|
|
100
|
+
topo.historyManager.endTransaction();
|
|
95
101
|
}
|
|
96
102
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
97
103
|
style: {
|
|
@@ -105,6 +111,14 @@ export default function CommonEdgePropertyView(props) {
|
|
|
105
111
|
}, /*#__PURE__*/React.createElement(ColorPicker, {
|
|
106
112
|
value: values["styleMap.edge.color"],
|
|
107
113
|
align: "br",
|
|
108
|
-
onChange: setLineColor
|
|
114
|
+
onChange: setLineColor,
|
|
115
|
+
balloonProps: {
|
|
116
|
+
onFocus: function onFocus() {
|
|
117
|
+
topo.historyManager.beginTransaction();
|
|
118
|
+
},
|
|
119
|
+
onBlur: function onBlur() {
|
|
120
|
+
topo.historyManager.endTransaction();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
109
123
|
})))), extraDisplaySetting))));
|
|
110
124
|
}
|
|
@@ -18,6 +18,7 @@ export default function GroupNodeList(props) {
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
var handleNodeRemove = function handleNodeRemove(data) {
|
|
21
|
+
topo.historyManager.beginTransaction();
|
|
21
22
|
var node = data.node;
|
|
22
23
|
node.setParent(null);
|
|
23
24
|
var viewRect = topo.getGraphView().getViewRect();
|
|
@@ -26,6 +27,7 @@ export default function GroupNodeList(props) {
|
|
|
26
27
|
|
|
27
28
|
setTimeout(function () {
|
|
28
29
|
node.iv();
|
|
30
|
+
topo.historyManager.endTransaction();
|
|
29
31
|
}, 50);
|
|
30
32
|
};
|
|
31
33
|
|
package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js
CHANGED
|
@@ -20,16 +20,19 @@ export default function GroupExpandSetting(props) {
|
|
|
20
20
|
setLayout = _useState[1];
|
|
21
21
|
|
|
22
22
|
var alignOnChange = function alignOnChange(v) {
|
|
23
|
-
// console.log("setAlignmentBySelectionNodes", v);
|
|
23
|
+
topo.historyManager.beginTransaction(); // console.log("setAlignmentBySelectionNodes", v);
|
|
24
24
|
// topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
|
|
25
|
+
|
|
25
26
|
onChange("groupAlign", v); // topoEditApi.setAlignmentBySelectionNodes(v);
|
|
27
|
+
|
|
28
|
+
topo.historyManager.endTransaction();
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
var layoutOnChange = function layoutOnChange(v) {
|
|
29
|
-
|
|
30
|
-
setLayout(v);
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
topo.historyManager.beginTransaction();
|
|
33
|
+
setLayout(v);
|
|
34
|
+
onChange("layout", v);
|
|
35
|
+
topo.historyManager.endTransaction();
|
|
33
36
|
};
|
|
34
37
|
|
|
35
38
|
useEffect(function () {
|
|
@@ -62,6 +65,7 @@ export default function GroupExpandSetting(props) {
|
|
|
62
65
|
marginBottom: 0
|
|
63
66
|
}
|
|
64
67
|
}, /*#__PURE__*/React.createElement(GroupExpandStatus, {
|
|
68
|
+
topo: topo,
|
|
65
69
|
group: group,
|
|
66
70
|
expanded: expanded,
|
|
67
71
|
setExpanded: function setExpanded(val) {
|
package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js
CHANGED
|
@@ -17,11 +17,19 @@ var list = [{
|
|
|
17
17
|
|
|
18
18
|
export default function GroupExpandStatus(props) {
|
|
19
19
|
var expanded = props.expanded,
|
|
20
|
-
setExpanded = props.setExpanded
|
|
20
|
+
setExpanded = props.setExpanded,
|
|
21
|
+
topo = props.topo;
|
|
22
|
+
|
|
23
|
+
var handleChange = function handleChange(val) {
|
|
24
|
+
topo.historyManager.beginTransaction();
|
|
25
|
+
setExpanded(val);
|
|
26
|
+
topo.historyManager.endTransaction();
|
|
27
|
+
};
|
|
28
|
+
|
|
21
29
|
return /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
22
30
|
dataSource: list,
|
|
23
31
|
value: expanded,
|
|
24
|
-
onChange:
|
|
32
|
+
onChange: handleChange
|
|
25
33
|
});
|
|
26
34
|
}
|
|
27
35
|
;
|
|
@@ -51,6 +51,7 @@ export default function GroupSetting(props) {
|
|
|
51
51
|
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
52
52
|
label: "\u9ED8\u8BA4\u663E\u793A\u65B9\u5F0F"
|
|
53
53
|
}, /*#__PURE__*/React.createElement(GroupExpandStatus, {
|
|
54
|
+
topo: topo,
|
|
54
55
|
group: group,
|
|
55
56
|
expanded: expanded,
|
|
56
57
|
setExpanded: function setExpanded(val) {
|
|
@@ -70,9 +71,13 @@ export default function GroupSetting(props) {
|
|
|
70
71
|
height: values.height
|
|
71
72
|
},
|
|
72
73
|
onChange: function onChange(size) {
|
|
74
|
+
topo.historyManager.beginTransaction();
|
|
75
|
+
|
|
73
76
|
_onChange("width", size.width);
|
|
74
77
|
|
|
75
78
|
_onChange("height", size.height);
|
|
79
|
+
|
|
80
|
+
topo.historyManager.endTransaction();
|
|
76
81
|
},
|
|
77
82
|
settingRuntimeState: settingRuntimeState
|
|
78
83
|
}))));
|
|
@@ -92,7 +97,13 @@ export default function GroupSetting(props) {
|
|
|
92
97
|
}), /*#__PURE__*/React.createElement(_Input, {
|
|
93
98
|
name: "attrObject.name",
|
|
94
99
|
maxLength: 30,
|
|
95
|
-
placeholder: "\u8BF7\u8F93\u5165"
|
|
100
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
101
|
+
onFocus: function onFocus() {
|
|
102
|
+
topo.historyManager.beginTransaction();
|
|
103
|
+
},
|
|
104
|
+
onBlur: function onBlur() {
|
|
105
|
+
topo.historyManager.endTransaction();
|
|
106
|
+
}
|
|
96
107
|
})), expanded ? /*#__PURE__*/React.createElement(GroupExpandSetting, {
|
|
97
108
|
id: id,
|
|
98
109
|
group: group,
|
|
@@ -5,6 +5,7 @@ import _Input from "@alifd/next/es/input";
|
|
|
5
5
|
import _Field from "@alifd/next/es/field";
|
|
6
6
|
import _Collapse from "@alifd/next/es/collapse";
|
|
7
7
|
import React, { useState, useEffect } from 'react';
|
|
8
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
8
9
|
import AlignSetting from "../../../common/AlignSetting"; // import BatchSetNodeSize from '../../view/BatchSetNodeSize';
|
|
9
10
|
|
|
10
11
|
import { SPECIAL_CHARACTER_FORM_ITEM_VALIDATE_PROPS, validateSpecialCharacter } from "../../../../../../../utils/SpecialCharacterValidateUtil"; // import LineType from '../../../common/LineType';
|
|
@@ -24,7 +25,7 @@ export default function LayerSettingTab(props) {
|
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
rlog.debug(values[name], value);
|
|
28
29
|
var newValues = field.getValues();
|
|
29
30
|
|
|
30
31
|
_onChange(name, value, newValues);
|
|
@@ -36,11 +37,14 @@ export default function LayerSettingTab(props) {
|
|
|
36
37
|
}, [values]);
|
|
37
38
|
|
|
38
39
|
var alignOnChange = function alignOnChange(v) {
|
|
39
|
-
|
|
40
|
+
topo.historyManager.beginTransaction();
|
|
41
|
+
rlog.debug('setAlignmentBySelectionNodes', v);
|
|
40
42
|
topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
|
|
41
43
|
|
|
42
44
|
_onChange('groupAlign', v); // topoEditApi.setAlignmentBySelectionNodes(v);
|
|
43
45
|
|
|
46
|
+
|
|
47
|
+
topo.historyManager.endTransaction();
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
return /*#__PURE__*/React.createElement(_Form, {
|
|
@@ -57,7 +61,13 @@ export default function LayerSettingTab(props) {
|
|
|
57
61
|
}), /*#__PURE__*/React.createElement(_Input, {
|
|
58
62
|
name: "styleMap.label",
|
|
59
63
|
maxLength: 30,
|
|
60
|
-
placeholder: "\u8BF7\u8F93\u5165"
|
|
64
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
65
|
+
onFocus: function onFocus() {
|
|
66
|
+
topo.historyManager.beginTransaction();
|
|
67
|
+
},
|
|
68
|
+
onBlur: function onBlur() {
|
|
69
|
+
topo.historyManager.endTransaction();
|
|
70
|
+
}
|
|
61
71
|
})), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
|
|
62
72
|
defaultExpandedKeys: ['布局', '图片', '对齐方式', '线形'],
|
|
63
73
|
style: {
|
package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js
CHANGED
|
@@ -5,6 +5,7 @@ export default function BatchSetNodeIcon(props) {
|
|
|
5
5
|
var topo = props.topo;
|
|
6
6
|
|
|
7
7
|
var setNodeIcon = function setNodeIcon(iconId) {
|
|
8
|
+
topo.historyManager.beginTransaction();
|
|
8
9
|
var selection = topo.getSelectionModel().getSelection().toArray();
|
|
9
10
|
var nodes = selection.filter(function (element) {
|
|
10
11
|
return isNode(element) && !isGroup(element);
|
|
@@ -12,6 +13,7 @@ export default function BatchSetNodeIcon(props) {
|
|
|
12
13
|
nodes.forEach(function (node) {
|
|
13
14
|
node.setImage(iconId);
|
|
14
15
|
});
|
|
16
|
+
topo.historyManager.endTransaction();
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
return /*#__PURE__*/React.createElement(NodeIconSelect, {
|
|
@@ -87,6 +87,7 @@ export default function BatchSetNodeSize(props) {
|
|
|
87
87
|
setSize(_extends({}, size, (_extends2 = {}, _extends2[name] = value, _extends2)));
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
topo.historyManager.beginTransaction();
|
|
90
91
|
nodes.forEach(function (node) {
|
|
91
92
|
if (name === 'width') {
|
|
92
93
|
if (lock) {
|
|
@@ -104,6 +105,7 @@ export default function BatchSetNodeSize(props) {
|
|
|
104
105
|
node.setHeight(value);
|
|
105
106
|
}
|
|
106
107
|
});
|
|
108
|
+
topo.historyManager.endTransaction();
|
|
107
109
|
};
|
|
108
110
|
|
|
109
111
|
var onLockChange = function onLockChange(isLock) {
|
|
@@ -38,10 +38,13 @@ export default function MultipleElementPropertyView(props) {
|
|
|
38
38
|
|
|
39
39
|
var alignOnChange = function alignOnChange(v) {
|
|
40
40
|
console.log('setAlignmentBySelectionNodes', v);
|
|
41
|
-
topo.
|
|
41
|
+
topo.historyManager.beginTransaction();
|
|
42
|
+
topo.getHtTopo().setAlignmentBySelectionNodes(v);
|
|
42
43
|
|
|
43
44
|
_onChange('groupAlign', v); // topoEditApi.setAlignmentBySelectionNodes(v);
|
|
44
45
|
|
|
46
|
+
|
|
47
|
+
topo.historyManager.endTransaction();
|
|
45
48
|
}; // TODO 临时方案,满足应用部署拓扑多选元素属性面板不显示对齐
|
|
46
49
|
|
|
47
50
|
|
|
@@ -68,9 +68,13 @@ export default function Setting(props) {
|
|
|
68
68
|
height: values.height
|
|
69
69
|
},
|
|
70
70
|
onChange: function onChange(size) {
|
|
71
|
+
topo.historyManager.beginTransaction();
|
|
72
|
+
|
|
71
73
|
_onChange('width', size.width);
|
|
72
74
|
|
|
73
75
|
_onChange('height', size.height);
|
|
76
|
+
|
|
77
|
+
topo.historyManager.endTransaction();
|
|
74
78
|
},
|
|
75
79
|
settingRuntimeState: settingRuntimeState
|
|
76
80
|
}))))));
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _Form from "@alifd/next/es/form";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _Field from "@alifd/next/es/field";
|
|
3
4
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
5
|
import _Collapse from "@alifd/next/es/collapse";
|
|
5
6
|
import _Select from "@alifd/next/es/select";
|
|
7
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
8
|
import React, { useEffect } from "react";
|
|
7
9
|
import useHtElement from "../../../../../../common/hooks/useHtElement";
|
|
8
10
|
import textStyles from "../../../../../../common/text.module.scss";
|
|
@@ -54,18 +56,44 @@ export default function Data(props) {
|
|
|
54
56
|
}, [values]);
|
|
55
57
|
|
|
56
58
|
var setBindType = function setBindType(newBindType) {
|
|
59
|
+
topo.historyManager.beginTransaction();
|
|
60
|
+
|
|
57
61
|
_onChange("attrObject.bindType", newBindType);
|
|
58
62
|
|
|
63
|
+
topo.historyManager.endTransaction();
|
|
64
|
+
|
|
59
65
|
if (newBindType === "topo") {//
|
|
60
66
|
}
|
|
61
67
|
};
|
|
62
68
|
|
|
63
|
-
var handleBindTopoChange = function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
var handleBindTopoChange = /*#__PURE__*/function () {
|
|
70
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value, data) {
|
|
71
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
72
|
+
while (1) {
|
|
73
|
+
switch (_context.prev = _context.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
topo.historyManager.beginTransaction(); // 设置名称为拓扑名称,清空自定义名称
|
|
76
|
+
|
|
77
|
+
node.a("name", data.label);
|
|
78
|
+
node.a("customName", null);
|
|
79
|
+
_context.next = 5;
|
|
80
|
+
return topoEditApi.deleteExLink(node);
|
|
81
|
+
|
|
82
|
+
case 5:
|
|
83
|
+
topo.historyManager.endTransaction();
|
|
84
|
+
|
|
85
|
+
case 6:
|
|
86
|
+
case "end":
|
|
87
|
+
return _context.stop();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}, _callee);
|
|
91
|
+
}));
|
|
92
|
+
|
|
93
|
+
return function handleBindTopoChange(_x, _x2) {
|
|
94
|
+
return _ref.apply(this, arguments);
|
|
95
|
+
};
|
|
96
|
+
}();
|
|
69
97
|
|
|
70
98
|
var RelateTopoTree = editorProps === null || editorProps === void 0 ? void 0 : editorProps.relateTopoTree;
|
|
71
99
|
return /*#__PURE__*/React.createElement(_Collapse, {
|
|
@@ -85,8 +85,15 @@ export default function TextPropertyView(props) {
|
|
|
85
85
|
minRows: 4,
|
|
86
86
|
maxRows: 4
|
|
87
87
|
},
|
|
88
|
-
placeholder: "\u6587\u672C\u8F93\u5165"
|
|
88
|
+
placeholder: "\u6587\u672C\u8F93\u5165",
|
|
89
|
+
onFocus: function onFocus() {
|
|
90
|
+
topo.historyManager.beginTransaction();
|
|
91
|
+
},
|
|
92
|
+
onBlur: function onBlur() {
|
|
93
|
+
topo.historyManager.endTransaction();
|
|
94
|
+
}
|
|
89
95
|
})), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(TextStyle, {
|
|
90
|
-
name: "styleMap.textObj"
|
|
96
|
+
name: "styleMap.textObj",
|
|
97
|
+
topo: topo
|
|
91
98
|
})))))));
|
|
92
99
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import NodeSizeInput from "../../common/NodeSizeInput/NodeSizeInput";
|
|
3
5
|
import useBackgroundSizeConfig from "./hooks/useBackgroundSizeConfig";
|
|
@@ -9,13 +11,40 @@ export default function BackgroundSize(props) {
|
|
|
9
11
|
topo: topo,
|
|
10
12
|
current: backgroundConfig.current
|
|
11
13
|
});
|
|
14
|
+
|
|
15
|
+
var setSize = /*#__PURE__*/function () {
|
|
16
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(size) {
|
|
17
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
18
|
+
while (1) {
|
|
19
|
+
switch (_context.prev = _context.next) {
|
|
20
|
+
case 0:
|
|
21
|
+
topo.historyManager.beginTransaction();
|
|
22
|
+
_context.next = 3;
|
|
23
|
+
return backgroundSizeConfig.setSize(size);
|
|
24
|
+
|
|
25
|
+
case 3:
|
|
26
|
+
topo.historyManager.endTransaction();
|
|
27
|
+
|
|
28
|
+
case 4:
|
|
29
|
+
case "end":
|
|
30
|
+
return _context.stop();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}, _callee);
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
return function setSize(_x) {
|
|
37
|
+
return _ref.apply(this, arguments);
|
|
38
|
+
};
|
|
39
|
+
}();
|
|
40
|
+
|
|
12
41
|
return /*#__PURE__*/React.createElement(NodeSizeInput, {
|
|
13
42
|
nodeId: backgroundSizeConfig.nodeId,
|
|
14
43
|
value: backgroundSizeConfig.size,
|
|
15
44
|
max: 100000,
|
|
16
45
|
step: 10,
|
|
17
46
|
lockId: "background",
|
|
18
|
-
onChange:
|
|
47
|
+
onChange: setSize,
|
|
19
48
|
settingRuntimeState: settingRuntimeState
|
|
20
49
|
});
|
|
21
50
|
}
|
|
@@ -13,9 +13,11 @@ export default function GlobalLayout(props) {
|
|
|
13
13
|
|
|
14
14
|
var onChange = function onChange(data) {
|
|
15
15
|
console.log("handleChange", data);
|
|
16
|
+
topo.historyManager.beginTransaction();
|
|
16
17
|
setLayout(data);
|
|
17
18
|
var layouType = data.id === "toward" ? "" + data.id + data.options.subId : data.id;
|
|
18
19
|
topo.getHtTopo().layoutInTopo(layouType);
|
|
20
|
+
topo.historyManager.endTransaction();
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
return /*#__PURE__*/React.createElement(LayoutSettings, {
|
|
@@ -66,6 +66,12 @@ export default function GlobalNodeLabelStyle(props) {
|
|
|
66
66
|
style: {
|
|
67
67
|
width: '100%',
|
|
68
68
|
marginRight: 8
|
|
69
|
+
},
|
|
70
|
+
onFocus: function onFocus() {
|
|
71
|
+
topo.historyManager.beginTransaction();
|
|
72
|
+
},
|
|
73
|
+
onBlur: function onBlur() {
|
|
74
|
+
topo.historyManager.endTransaction();
|
|
69
75
|
}
|
|
70
76
|
}, /*#__PURE__*/React.createElement(Option, {
|
|
71
77
|
value: "\u5B8B\u4F53"
|
|
@@ -102,7 +108,15 @@ export default function GlobalNodeLabelStyle(props) {
|
|
|
102
108
|
}
|
|
103
109
|
}, /*#__PURE__*/React.createElement(ColorPicker, {
|
|
104
110
|
name: "color",
|
|
105
|
-
align: "br"
|
|
111
|
+
align: "br",
|
|
112
|
+
balloonProps: {
|
|
113
|
+
onFocus: function onFocus() {
|
|
114
|
+
topo.historyManager.beginTransaction();
|
|
115
|
+
},
|
|
116
|
+
onBlur: function onBlur() {
|
|
117
|
+
topo.historyManager.endTransaction();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
106
120
|
}))))));
|
|
107
121
|
}
|
|
108
122
|
;
|
|
@@ -9,6 +9,7 @@ import TitleWidget from "../../../components/titlebar/widgets/TitleWidget";
|
|
|
9
9
|
import styles from "../../../components/titlebar/TitleBar.module.scss";
|
|
10
10
|
import { useState } from "react";
|
|
11
11
|
import { useEffect } from "react";
|
|
12
|
+
import DebugTools from "./widgets/DebugTools";
|
|
12
13
|
export default function TopoEditorTitleBar(props) {
|
|
13
14
|
var topo = props.topo,
|
|
14
15
|
topoEditApi = props.topoEditApi;
|
|
@@ -65,7 +66,9 @@ export default function TopoEditorTitleBar(props) {
|
|
|
65
66
|
}, /*#__PURE__*/React.createElement(_Box, {
|
|
66
67
|
direction: "row",
|
|
67
68
|
spacing: 8
|
|
68
|
-
}, /*#__PURE__*/React.createElement(
|
|
69
|
+
}, /*#__PURE__*/React.createElement(DebugTools, {
|
|
70
|
+
topo: topo
|
|
71
|
+
}), /*#__PURE__*/React.createElement(_Button, {
|
|
69
72
|
type: "primary",
|
|
70
73
|
className: styles.button,
|
|
71
74
|
onClick: function onClick() {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import _Button from "@alifd/next/es/button";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export default function DebugTools(props) {
|
|
4
|
+
var topo = props.topo,
|
|
5
|
+
style = props.style;
|
|
6
|
+
var debug = topo.viewProps.debug;
|
|
7
|
+
|
|
8
|
+
if (!debug) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
var printLog = function printLog() {
|
|
13
|
+
console.info("HistoryManager " + topo.historyManager.toString(), topo.historyManager.getHistories(), topo.historyManager.htHistoryManager.getHistoryIndex());
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
style: style
|
|
18
|
+
}, /*#__PURE__*/React.createElement(_Button.Group, null, /*#__PURE__*/React.createElement(_Button, {
|
|
19
|
+
onClick: function onClick() {
|
|
20
|
+
return topo.historyManager.undo();
|
|
21
|
+
}
|
|
22
|
+
}, "\u56DE\u9000"), /*#__PURE__*/React.createElement(_Button, {
|
|
23
|
+
onClick: function onClick() {
|
|
24
|
+
return topo.historyManager.redo();
|
|
25
|
+
}
|
|
26
|
+
}, "\u91CD\u505A"), /*#__PURE__*/React.createElement(_Button, {
|
|
27
|
+
onClick: printLog
|
|
28
|
+
}, "\u6253\u5370\u65E5\u5FD7")));
|
|
29
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import { useEffect } from "react";
|
|
2
3
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
3
4
|
import { useCbbEventListener } from "@riil-frontend/component-riil-event-emitter";
|
|
@@ -90,6 +91,21 @@ export default function useAlarm(options) {
|
|
|
90
91
|
}
|
|
91
92
|
};
|
|
92
93
|
|
|
94
|
+
var handleRelateTopoAlarm = function handleRelateTopoAlarm(data) {
|
|
95
|
+
var relateTopoAlarm = _extends({}, topo.store.getModelState('topoAlarm').relateTopoAlarm);
|
|
96
|
+
|
|
97
|
+
data.forEach(function (item) {
|
|
98
|
+
relateTopoAlarm[item.topoId] = item.alertLevel;
|
|
99
|
+
});
|
|
100
|
+
topo.store.getModelDispatchers('topoAlarm').update({
|
|
101
|
+
relateTopoAlarm: relateTopoAlarm
|
|
102
|
+
});
|
|
103
|
+
rlog.debug("\u5173\u8054\u62D3\u6251\u544A\u8B66\uFF1A\u6536\u5230 " + data.length, {
|
|
104
|
+
received: data,
|
|
105
|
+
all: relateTopoAlarm
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
93
109
|
useCbbEventListener("topo", {
|
|
94
110
|
name: "topo",
|
|
95
111
|
onMessage: function onMessage(data) {
|
|
@@ -99,6 +115,8 @@ export default function useAlarm(options) {
|
|
|
99
115
|
topo.alarm.handleAlarmEvent(data.data);
|
|
100
116
|
} else if (data.type === "risk") {
|
|
101
117
|
handleRiskData(data.data);
|
|
118
|
+
} else if (data.type === "relateTopoAlarm") {
|
|
119
|
+
handleRelateTopoAlarm(data.data);
|
|
102
120
|
}
|
|
103
121
|
}
|
|
104
122
|
});
|