@riil-frontend/component-topology 6.0.0-alpha.2 → 6.0.0-alpha.21
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 +28 -28
- package/es/components/ColorPanel/components/ColorBlock/index.js +37 -0
- package/es/components/ColorPanel/components/ColorBlock/index.module.scss +8 -0
- package/es/components/ColorPanel/components/FontColorRange/index.js +35 -0
- package/es/components/ColorPanel/components/FontColorRange/index.module.scss +22 -0
- package/es/components/ColorPanel/index.js +199 -0
- package/es/components/ColorPanel/index.module.scss +37 -0
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +7 -2
- package/es/components/collapse/Collapse.module.scss +12 -1
- package/es/core/common/hooks/useHtElements.js +21 -0
- package/es/core/common/icons/useIcons.js +7 -1
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +15 -13
- package/es/core/components/AlarmListPanel/components/index.module.scss +5 -5
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +6 -2
- package/es/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +122 -0
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +74 -20
- package/es/core/components/TopoView/TopoGraphViewPanel.js +20 -0
- package/es/core/components/TopoView/editor.module.scss +1 -0
- package/es/core/components/TopoView/topoView.js +39 -18
- package/es/core/editor/components/Sidebar/Sidebar.js +26 -50
- package/es/core/editor/components/Sidebar/Sidebar.module.scss +5 -1
- package/es/core/editor/components/Sidebar/panes.js +32 -0
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +96 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +8 -33
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +42 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +42 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
- package/es/core/editor/components/Toolbar/EditorToolbar.js +23 -13
- package/es/core/editor/components/Toolbar/Toolbar.js +1 -1
- package/es/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
- package/es/core/editor/components/Toolbar/buttons.js +20 -18
- package/es/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +35 -0
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +56 -7
- package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
- package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +10 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.js +33 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.module.scss +26 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +184 -3
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +53 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +77 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +59 -6
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +36 -4
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +35 -0
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +12 -2
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +12 -2
- package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +3 -2
- package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -4
- package/es/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +109 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/constant.js +64 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.js +101 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +49 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +99 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +42 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +75 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +23 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +10 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +31 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +127 -14
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +28 -22
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +14 -4
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +37 -6
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +90 -12
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +9 -21
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +8 -5
- package/es/core/editor/components/settings/Settings.js +0 -23
- package/es/core/editor/components/settings/Settings.module.scss +1 -2
- package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +76 -0
- package/es/core/editor/components/settings/common/AlignSetting/index.js +18 -72
- package/es/core/editor/components/settings/common/LineType/index.js +12 -119
- package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +3 -3
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +31 -21
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +7 -6
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +48 -0
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js +12 -18
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +13 -46
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/RelateData.js +2 -1
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +8 -9
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
- package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +9 -6
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +8 -4
- package/es/core/editor/hooks/useLayerAddResource.js +28 -0
- package/es/core/{store/models → editor/store}/background.js +0 -0
- package/es/core/{store/models → editor/store}/historyManager.js +0 -0
- package/es/core/{store/models → editor/store}/topoEdit.js +8 -1
- package/es/core/editor/utils/edgeTypeStyleUtil.js +96 -0
- package/es/core/hooks/useCanvasTheme.js +35 -0
- package/es/core/hooks/useTopoEdit.js +36 -58
- package/es/core/models/HistoryManager.js +10 -3
- package/es/core/models/SelectionManager.js +16 -1
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/TopoGraphView.js +8 -2
- package/es/core/models/utils/linkUtils.js +1 -1
- package/es/core/store/coreModels.js +6 -7
- package/es/core/store/models/selection.js +2 -1
- package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
- package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
- package/es/networkTopo/createTopo.js +2 -0
- package/es/networkTopo/services/link.js +2 -2
- package/es/networkTopo/store/topoTreeMod.js +6 -7
- package/es/style.js +1 -0
- package/es/utils/topoData.js +1 -0
- package/lib/components/ColorPanel/components/ColorBlock/index.js +47 -0
- package/lib/components/ColorPanel/components/ColorBlock/index.module.scss +8 -0
- package/lib/components/ColorPanel/components/FontColorRange/index.js +49 -0
- package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +22 -0
- package/lib/components/ColorPanel/index.js +217 -0
- package/lib/components/ColorPanel/index.module.scss +37 -0
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +7 -2
- package/lib/components/collapse/Collapse.module.scss +12 -1
- package/lib/core/common/hooks/useHtElements.js +27 -0
- package/lib/core/common/icons/useIcons.js +7 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +15 -13
- package/lib/core/components/AlarmListPanel/components/index.module.scss +5 -5
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +7 -2
- package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +147 -0
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +74 -20
- package/lib/core/components/TopoView/TopoGraphViewPanel.js +30 -0
- package/lib/core/components/TopoView/editor.module.scss +1 -0
- package/lib/core/components/TopoView/topoView.js +41 -19
- package/lib/core/editor/components/Sidebar/Sidebar.js +25 -52
- package/lib/core/editor/components/Sidebar/Sidebar.module.scss +5 -1
- package/lib/core/editor/components/Sidebar/panes.js +45 -0
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +109 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +8 -32
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +55 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +55 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +3 -1
- package/lib/core/editor/components/Toolbar/EditorToolbar.js +22 -11
- package/lib/core/editor/components/Toolbar/Toolbar.js +1 -1
- package/lib/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
- package/lib/core/editor/components/Toolbar/buttons.js +21 -20
- package/lib/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +50 -0
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +63 -7
- package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
- package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +11 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.js +47 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.module.scss +26 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +194 -3
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +71 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +83 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +61 -5
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +39 -4
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +35 -0
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +13 -2
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +13 -2
- package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +4 -2
- package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -3
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +126 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/constant.js +69 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.js +117 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +61 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +116 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +55 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +93 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +32 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +22 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +44 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +132 -15
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +30 -23
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +20 -4
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +36 -5
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +91 -11
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +11 -24
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +8 -5
- package/lib/core/editor/components/settings/Settings.js +0 -23
- package/lib/core/editor/components/settings/Settings.module.scss +1 -2
- package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +93 -0
- package/lib/core/editor/components/settings/common/AlignSetting/index.js +19 -80
- package/lib/core/editor/components/settings/common/LineType/index.js +13 -126
- package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +2 -2
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +32 -23
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +6 -6
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +63 -0
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js +13 -22
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +12 -50
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/RelateData.js +2 -1
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +6 -8
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
- package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +7 -5
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -1
- package/lib/core/editor/hooks/useLayerAddResource.js +34 -0
- package/lib/core/{store/models → editor/store}/background.js +0 -0
- package/lib/core/{store/models → editor/store}/historyManager.js +0 -0
- package/lib/core/{store/models → editor/store}/topoEdit.js +8 -1
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +109 -0
- package/lib/core/hooks/useCanvasTheme.js +49 -0
- package/lib/core/hooks/useTopoEdit.js +36 -60
- package/lib/core/models/HistoryManager.js +10 -3
- package/lib/core/models/SelectionManager.js +17 -1
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/TopoGraphView.js +8 -2
- package/lib/core/models/utils/linkUtils.js +1 -1
- package/lib/core/store/coreModels.js +5 -7
- package/lib/core/store/models/selection.js +2 -1
- package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
- package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
- package/lib/networkTopo/createTopo.js +3 -0
- package/lib/networkTopo/services/link.js +2 -2
- package/lib/networkTopo/store/topoTreeMod.js +6 -8
- package/lib/style.js +1 -0
- package/lib/utils/topoData.js +1 -0
- package/package.json +2 -2
- package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -4
- package/es/core/editor/components/Toolbar/widgets/AddResourceWidget.js +0 -17
- package/es/core/store/models/topoView.js +0 -36
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -12
- package/lib/core/editor/components/Toolbar/widgets/AddResourceWidget.js +0 -27
- package/lib/core/store/models/topoView.js +0 -47
|
@@ -5,18 +5,44 @@ import topoService from '@riil-frontend/component-topology-common/es/services/to
|
|
|
5
5
|
export default (function (props) {
|
|
6
6
|
var topo = props.topo,
|
|
7
7
|
displaySettingProps = props.displaySettingProps,
|
|
8
|
-
settingRef = props.settingRef
|
|
8
|
+
settingRef = props.settingRef,
|
|
9
|
+
isEditor = props.isEditor;
|
|
9
10
|
|
|
10
|
-
var
|
|
11
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(
|
|
11
|
+
var handleViewerSave = /*#__PURE__*/function () {
|
|
12
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
13
|
+
var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
|
|
12
14
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
13
15
|
while (1) {
|
|
14
16
|
switch (_context.prev = _context.next) {
|
|
15
17
|
case 0:
|
|
18
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
|
19
|
+
// 保存配置
|
|
20
|
+
|
|
21
|
+
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
|
22
|
+
displayConfig = _extends({}, prevDisplayConfig, values);
|
|
23
|
+
_context.next = 5;
|
|
24
|
+
return topoService.saveTopoSettings(topo.id, {
|
|
25
|
+
alarmSwitch: displayConfig.alarmSwitch,
|
|
26
|
+
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
|
27
|
+
extraConfig: JSON.stringify(_extends({}, displayConfig))
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
case 5:
|
|
31
|
+
// 刷新指标配置
|
|
32
|
+
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
|
33
|
+
_context.next = 8;
|
|
34
|
+
return displayConfigDispatchers.update(displayConfig);
|
|
35
|
+
|
|
36
|
+
case 8:
|
|
16
37
|
// 更新节点名称显示隐藏
|
|
17
38
|
topo.attributeMetricDisplay.updateNodesNameVisible();
|
|
39
|
+
extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
|
|
40
|
+
|
|
41
|
+
if (extraOnOk) {
|
|
42
|
+
extraOnOk(displayConfig);
|
|
43
|
+
}
|
|
18
44
|
|
|
19
|
-
case
|
|
45
|
+
case 11:
|
|
20
46
|
case "end":
|
|
21
47
|
return _context.stop();
|
|
22
48
|
}
|
|
@@ -24,12 +50,12 @@ export default (function (props) {
|
|
|
24
50
|
}, _callee);
|
|
25
51
|
}));
|
|
26
52
|
|
|
27
|
-
return function
|
|
53
|
+
return function handleViewerSave() {
|
|
28
54
|
return _ref.apply(this, arguments);
|
|
29
55
|
};
|
|
30
56
|
}();
|
|
31
57
|
|
|
32
|
-
var
|
|
58
|
+
var handleEditorSave = /*#__PURE__*/function () {
|
|
33
59
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
34
60
|
var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
|
|
35
61
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -40,27 +66,20 @@ export default (function (props) {
|
|
|
40
66
|
// 保存配置
|
|
41
67
|
|
|
42
68
|
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
|
43
|
-
displayConfig = _extends({}, prevDisplayConfig, values);
|
|
44
|
-
_context2.next = 5;
|
|
45
|
-
return topoService.saveTopoSettings(topo.id, {
|
|
46
|
-
alarmSwitch: displayConfig.alarmSwitch,
|
|
47
|
-
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
|
48
|
-
extraConfig: JSON.stringify(_extends({}, displayConfig))
|
|
49
|
-
});
|
|
69
|
+
displayConfig = _extends({}, prevDisplayConfig, values); // 刷新指标配置
|
|
50
70
|
|
|
51
|
-
case 5:
|
|
52
|
-
// 刷新指标配置
|
|
53
71
|
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
|
54
|
-
|
|
72
|
+
_context2.next = 6;
|
|
73
|
+
return displayConfigDispatchers.update(displayConfig);
|
|
55
74
|
|
|
56
|
-
|
|
57
|
-
extraOnOk =
|
|
75
|
+
case 6:
|
|
76
|
+
extraOnOk = displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk;
|
|
58
77
|
|
|
59
78
|
if (extraOnOk) {
|
|
60
79
|
extraOnOk(displayConfig);
|
|
61
80
|
}
|
|
62
81
|
|
|
63
|
-
case
|
|
82
|
+
case 8:
|
|
64
83
|
case "end":
|
|
65
84
|
return _context2.stop();
|
|
66
85
|
}
|
|
@@ -68,11 +87,46 @@ export default (function (props) {
|
|
|
68
87
|
}, _callee2);
|
|
69
88
|
}));
|
|
70
89
|
|
|
71
|
-
return function
|
|
90
|
+
return function handleEditorSave() {
|
|
72
91
|
return _ref2.apply(this, arguments);
|
|
73
92
|
};
|
|
74
93
|
}();
|
|
75
94
|
|
|
95
|
+
var save = /*#__PURE__*/function () {
|
|
96
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
97
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
98
|
+
while (1) {
|
|
99
|
+
switch (_context3.prev = _context3.next) {
|
|
100
|
+
case 0:
|
|
101
|
+
if (isEditor) {
|
|
102
|
+
_context3.next = 5;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
_context3.next = 3;
|
|
107
|
+
return handleViewerSave();
|
|
108
|
+
|
|
109
|
+
case 3:
|
|
110
|
+
_context3.next = 7;
|
|
111
|
+
break;
|
|
112
|
+
|
|
113
|
+
case 5:
|
|
114
|
+
_context3.next = 7;
|
|
115
|
+
return handleEditorSave();
|
|
116
|
+
|
|
117
|
+
case 7:
|
|
118
|
+
case "end":
|
|
119
|
+
return _context3.stop();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}, _callee3);
|
|
123
|
+
}));
|
|
124
|
+
|
|
125
|
+
return function save() {
|
|
126
|
+
return _ref3.apply(this, arguments);
|
|
127
|
+
};
|
|
128
|
+
}();
|
|
129
|
+
|
|
76
130
|
return {
|
|
77
131
|
save: save
|
|
78
132
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import useCanvasTheme from "../../hooks/useCanvasTheme";
|
|
3
|
+
import styles from "./TopoView.module.scss";
|
|
4
|
+
export default function TopoGraphViewPanel(props) {
|
|
5
|
+
var topo = props.topo;
|
|
6
|
+
var displayConfig = topo.store.useModelState('displayConfig');
|
|
7
|
+
var canvasTheme = displayConfig.canvasTheme || 'white';
|
|
8
|
+
|
|
9
|
+
var _useCanvasTheme = useCanvasTheme({
|
|
10
|
+
canvasTheme: canvasTheme
|
|
11
|
+
}),
|
|
12
|
+
canvasColor = _useCanvasTheme.canvasColor;
|
|
13
|
+
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: styles.viewPanel,
|
|
16
|
+
style: {
|
|
17
|
+
background: canvasColor
|
|
18
|
+
}
|
|
19
|
+
}, props.children);
|
|
20
|
+
}
|
|
@@ -12,7 +12,6 @@ import ViewerPlugin from "../../viewer/components/plugins/ViewerPlugin";
|
|
|
12
12
|
import TitleBar from "../titlebar/TitleBar";
|
|
13
13
|
import { TPL_TREE } from "../../../utils/template";
|
|
14
14
|
import PropertyView from "../../editor/components/settings/PropertyView";
|
|
15
|
-
import BackgroundView from "../../editor/components/BackgroundView";
|
|
16
15
|
import { updateEdgeExpanded } from "../../utils/edgeUtil";
|
|
17
16
|
import useManageStatus from "../../hooks/useManageStatus";
|
|
18
17
|
import useAlarm from "../../hooks/useAlarm";
|
|
@@ -22,8 +21,10 @@ import { handleClusterNoPermission, upgradeV103GraphClusterNode } from "../../..
|
|
|
22
21
|
import EditorToolbar from "../../editor/components/Toolbar/EditorToolbar";
|
|
23
22
|
import Sidebar from "../../editor/components/Sidebar/Sidebar";
|
|
24
23
|
import HistoryManager from "../../models/HistoryManager";
|
|
24
|
+
import TopoGraphViewPanel from "./TopoGraphViewPanel";
|
|
25
25
|
import styles from "./TopoView.module.scss";
|
|
26
26
|
import editorStyles from "./editor.module.scss";
|
|
27
|
+
var ht = window.ht;
|
|
27
28
|
|
|
28
29
|
var Topology = function Topology(props) {
|
|
29
30
|
var _classnames;
|
|
@@ -57,6 +58,10 @@ var Topology = function Topology(props) {
|
|
|
57
58
|
topoDispatchers = _store$useModel[1];
|
|
58
59
|
|
|
59
60
|
var bizDispatchers = store.useModelDispatchers('topoBizMod');
|
|
61
|
+
|
|
62
|
+
var _store$useModelState = store.useModelState('topoEdit'),
|
|
63
|
+
viewMouseMode = _store$useModelState.viewMouseMode;
|
|
64
|
+
|
|
60
65
|
var topoId = topoState.topoId,
|
|
61
66
|
viewState = topoState.viewState,
|
|
62
67
|
topoData = topoState.topoData,
|
|
@@ -236,15 +241,34 @@ var Topology = function Topology(props) {
|
|
|
236
241
|
}
|
|
237
242
|
};
|
|
238
243
|
|
|
239
|
-
var
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
245
|
+
if (isEditMode) {
|
|
246
|
+
var isCtrlDown = ht.Default.isCtrlDown;
|
|
247
|
+
|
|
248
|
+
if (isCtrlDown(e)) {
|
|
249
|
+
if (e.keyCode === 90) {
|
|
250
|
+
// ctrl+z 撤销
|
|
251
|
+
topo.historyManager.undo();
|
|
252
|
+
} // else if (e.keyCode == 89) {//ctrl+y 重做
|
|
253
|
+
// this.redo();
|
|
254
|
+
// }
|
|
255
|
+
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (e.keyCode === 32) {
|
|
259
|
+
console.log('e.keyCode-viewMouseMode', e.keyCode, viewMouseMode);
|
|
260
|
+
|
|
261
|
+
if (viewMouseMode === 'select') {
|
|
262
|
+
topoEdit.setViewMouseMode('move');
|
|
263
|
+
} else {
|
|
264
|
+
topoEdit.setViewMouseMode('select');
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
244
268
|
};
|
|
245
269
|
|
|
246
|
-
var
|
|
247
|
-
return isEditMode && /*#__PURE__*/React.createElement(
|
|
270
|
+
var renderPropertyView = function renderPropertyView() {
|
|
271
|
+
return isEditMode && /*#__PURE__*/React.createElement(PropertyView, {
|
|
248
272
|
topo: topo,
|
|
249
273
|
editorProps: editorProps
|
|
250
274
|
});
|
|
@@ -253,19 +277,14 @@ var Topology = function Topology(props) {
|
|
|
253
277
|
var renderCanvas = function renderCanvas() {
|
|
254
278
|
var _graphViewProps$creat;
|
|
255
279
|
|
|
256
|
-
return /*#__PURE__*/React.createElement(
|
|
257
|
-
|
|
258
|
-
onKeyDown: function onKeyDown(e) {
|
|
259
|
-
topo.historyManager && topo.historyManager.handleKeyDown(e);
|
|
260
|
-
}
|
|
280
|
+
return /*#__PURE__*/React.createElement(TopoGraphViewPanel, {
|
|
281
|
+
topo: topo
|
|
261
282
|
}, /*#__PURE__*/React.createElement(TopoGraph, _extends({}, graphViewProps, {
|
|
262
283
|
createHtTopoProps: _extends({}, graphViewProps.createHtTopoProps, {
|
|
263
284
|
editor: _extends({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {})
|
|
264
285
|
}),
|
|
265
286
|
data: tData,
|
|
266
287
|
defaultEnterEditMode: defaultEnterEditMode,
|
|
267
|
-
renderPropertyView: renderPropertyView,
|
|
268
|
-
renderBackgroundView: renderBackgroundView,
|
|
269
288
|
onCreate: onGraphCreated,
|
|
270
289
|
onLoaded: handleGraphLoaded,
|
|
271
290
|
onDataLoaded: handleGraphDataLoaded,
|
|
@@ -283,7 +302,8 @@ var Topology = function Topology(props) {
|
|
|
283
302
|
|
|
284
303
|
return /*#__PURE__*/React.createElement("div", {
|
|
285
304
|
className: styles.topoView,
|
|
286
|
-
"data-version": topo.version
|
|
305
|
+
"data-version": topo.version,
|
|
306
|
+
onKeyDown: handleKeyDown
|
|
287
307
|
}, titleBar !== false && (titleBar || /*#__PURE__*/React.createElement(TitleBar, {
|
|
288
308
|
topo: topo,
|
|
289
309
|
viewerProps: viewerProps,
|
|
@@ -295,7 +315,8 @@ var Topology = function Topology(props) {
|
|
|
295
315
|
topoContext: {
|
|
296
316
|
urlParams: urlParams
|
|
297
317
|
},
|
|
298
|
-
editorProps: editorProps
|
|
318
|
+
editorProps: editorProps,
|
|
319
|
+
onKeyDown: handleKeyDown
|
|
299
320
|
}), /*#__PURE__*/React.createElement(_Box, {
|
|
300
321
|
direction: "row",
|
|
301
322
|
flex: 1,
|
|
@@ -307,7 +328,7 @@ var Topology = function Topology(props) {
|
|
|
307
328
|
urlParams: urlParams
|
|
308
329
|
},
|
|
309
330
|
editorProps: editorProps
|
|
310
|
-
}), renderCanvas()), !isEditMode && /*#__PURE__*/React.createElement(ViewerPlugin, {
|
|
331
|
+
}), renderCanvas(), renderPropertyView()), !isEditMode && /*#__PURE__*/React.createElement(ViewerPlugin, {
|
|
311
332
|
topo: topo,
|
|
312
333
|
viewerProps: viewerProps,
|
|
313
334
|
topoContext: topoContext
|
|
@@ -1,60 +1,32 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import ImagePanel from "./views/ImagePanel";
|
|
7
|
-
import BackgroundPanel from "./views/BackgroundPanel";
|
|
8
|
-
import CanvasPanel from "./views/CanvasPanel";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import Tab from "../../../../components/VerticalIconTab";
|
|
5
|
+
import panes from "./panes";
|
|
9
6
|
import styles from "./Sidebar.module.scss";
|
|
10
7
|
|
|
11
8
|
function Sidebar(props) {
|
|
9
|
+
var _classNames;
|
|
10
|
+
|
|
12
11
|
var topo = props.topo;
|
|
13
12
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
var _topo$store$useModel = topo.store.useModel('topoEdit'),
|
|
14
|
+
topoEditState = _topo$store$useModel[0],
|
|
15
|
+
topoEditDispatchers = _topo$store$useModel[1];
|
|
17
16
|
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
content: ComponentPanel
|
|
28
|
-
}, {
|
|
29
|
-
title: '图片',
|
|
30
|
-
key: '3',
|
|
31
|
-
icon: '/img/topo/editor/sidebar/icon/图片.svg',
|
|
32
|
-
content: ImagePanel
|
|
33
|
-
}, {
|
|
34
|
-
title: '背景',
|
|
35
|
-
key: '4',
|
|
36
|
-
icon: '/img/topo/editor/sidebar/icon/背景.svg',
|
|
37
|
-
content: BackgroundPanel
|
|
38
|
-
}, {
|
|
39
|
-
title: '画布',
|
|
40
|
-
key: '5',
|
|
41
|
-
icon: '/img/topo/editor/sidebar/icon/画布.svg',
|
|
42
|
-
content: CanvasPanel
|
|
43
|
-
}].map(function (item) {
|
|
44
|
-
var View = item.content;
|
|
45
|
-
return _extends({}, item, {
|
|
46
|
-
content: function content() {
|
|
47
|
-
return /*#__PURE__*/React.createElement(View, _extends({}, props, {
|
|
48
|
-
topo: topo,
|
|
49
|
-
active: activeKey === item.key
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
});
|
|
17
|
+
var activeKey = topoEditState.resourceTabactiveKey;
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
return function () {
|
|
20
|
+
// 退出编辑模式,关闭资源面板状态
|
|
21
|
+
topoEditDispatchers.update({
|
|
22
|
+
resourceTabactiveKey: null
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
54
26
|
|
|
55
27
|
var renderTabItem = function renderTabItem(pane) {
|
|
56
28
|
var View = pane.content;
|
|
57
|
-
return /*#__PURE__*/React.createElement(
|
|
29
|
+
return /*#__PURE__*/React.createElement(Tab.Item, _extends({
|
|
58
30
|
key: pane.key
|
|
59
31
|
}, pane), /*#__PURE__*/React.createElement(View, {
|
|
60
32
|
topo: topo,
|
|
@@ -65,10 +37,14 @@ function Sidebar(props) {
|
|
|
65
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
66
38
|
className: styles.sidebar
|
|
67
39
|
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: styles.tabsContainer
|
|
69
|
-
}, /*#__PURE__*/React.createElement(
|
|
40
|
+
className: classNames(styles.tabsContainer, (_classNames = {}, _classNames[styles.expanded] = !!activeKey, _classNames))
|
|
41
|
+
}, /*#__PURE__*/React.createElement(Tab, {
|
|
70
42
|
activeKey: activeKey,
|
|
71
|
-
onChange:
|
|
43
|
+
onChange: function onChange(key) {
|
|
44
|
+
return topoEditDispatchers.update({
|
|
45
|
+
resourceTabactiveKey: key
|
|
46
|
+
});
|
|
47
|
+
}
|
|
72
48
|
}, panes.map(renderTabItem))));
|
|
73
49
|
}
|
|
74
50
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import BackgroundPanel from "./views/BackgroundPanel";
|
|
2
|
+
import CanvasPanel from "./views/CanvasPanel";
|
|
3
|
+
import ComponentPanel from "./views/ComponentPanel";
|
|
4
|
+
import ImagePanel from "./views/ImagePanel";
|
|
5
|
+
import LinkPanel from "./views/LinkPanel";
|
|
6
|
+
var panes = [{
|
|
7
|
+
title: '链路',
|
|
8
|
+
key: '1',
|
|
9
|
+
icon: '/img/topo/editor/sidebar/icon/链路.svg',
|
|
10
|
+
content: LinkPanel
|
|
11
|
+
}, {
|
|
12
|
+
title: '组件',
|
|
13
|
+
key: '2',
|
|
14
|
+
icon: '/img/topo/editor/sidebar/icon/组件.svg',
|
|
15
|
+
content: ComponentPanel
|
|
16
|
+
}, {
|
|
17
|
+
title: '图片',
|
|
18
|
+
key: '3',
|
|
19
|
+
icon: '/img/topo/editor/sidebar/icon/图片.svg',
|
|
20
|
+
content: ImagePanel
|
|
21
|
+
}, {
|
|
22
|
+
title: '背景',
|
|
23
|
+
key: '4',
|
|
24
|
+
icon: '/img/topo/editor/sidebar/icon/背景.svg',
|
|
25
|
+
content: BackgroundPanel
|
|
26
|
+
}, {
|
|
27
|
+
title: '画布',
|
|
28
|
+
key: '5',
|
|
29
|
+
icon: '/img/topo/editor/sidebar/icon/画布.svg',
|
|
30
|
+
content: CanvasPanel
|
|
31
|
+
}];
|
|
32
|
+
export default panes;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import _Tag from "@alifd/next/es/tag";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import styles from "./CanvasPanel.module.scss";
|
|
5
|
+
var CANVAS_TOGGLE = [{
|
|
6
|
+
value: 'white',
|
|
7
|
+
label: '白色',
|
|
8
|
+
color: '#FFFFFF',
|
|
9
|
+
globalNodeLabelColor: '#4d6277',
|
|
10
|
+
globalEdgeTagColor: '#4d6277'
|
|
11
|
+
}, {
|
|
12
|
+
value: 'lightblue',
|
|
13
|
+
label: '蓝色',
|
|
14
|
+
color: '#F9FBFF',
|
|
15
|
+
globalNodeLabelColor: '#4d6277',
|
|
16
|
+
globalEdgeTagColor: '#4d6277'
|
|
17
|
+
}, // {
|
|
18
|
+
// value: 'yellow',
|
|
19
|
+
// label: '黄色',
|
|
20
|
+
// color: '#FFFDE6',
|
|
21
|
+
// },
|
|
22
|
+
// {
|
|
23
|
+
// value: 'green',
|
|
24
|
+
// label: '绿色',
|
|
25
|
+
// color: '#EAFFE8',
|
|
26
|
+
// },
|
|
27
|
+
{
|
|
28
|
+
value: 'dark',
|
|
29
|
+
label: '深色',
|
|
30
|
+
color: '#031425',
|
|
31
|
+
globalNodeLabelColor: '#ffffff',
|
|
32
|
+
globalEdgeTagColor: '#ffffff'
|
|
33
|
+
}];
|
|
34
|
+
export default function CanvasPanel(props) {
|
|
35
|
+
var topo = props.topo;
|
|
36
|
+
|
|
37
|
+
var _topo$store$useModel = topo.store.useModel('displayConfig'),
|
|
38
|
+
canvasTheme = _topo$store$useModel[0].canvasTheme,
|
|
39
|
+
displayConfigDispatchers = _topo$store$useModel[1];
|
|
40
|
+
|
|
41
|
+
var value = canvasTheme || 'white';
|
|
42
|
+
|
|
43
|
+
var setCanvasTheme = function setCanvasTheme(themeItem) {
|
|
44
|
+
var theme = themeItem.value;
|
|
45
|
+
topo.historyManager.beginTransaction();
|
|
46
|
+
displayConfigDispatchers.update({
|
|
47
|
+
canvasTheme: theme
|
|
48
|
+
}); // 设置资源标注
|
|
49
|
+
|
|
50
|
+
var _topo$store$getModelS = topo.store.getModelState('displayConfig'),
|
|
51
|
+
nodeLabelStyle = _topo$store$getModelS.nodeLabelStyle,
|
|
52
|
+
defaultEdgeLabelStyle = _topo$store$getModelS.defaultEdgeLabelStyle;
|
|
53
|
+
|
|
54
|
+
var globalNodeLabelStyle = _extends({}, nodeLabelStyle, {
|
|
55
|
+
color: themeItem.globalNodeLabelColor
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
topo.getHtTopo().setGlobalNodeLabelStyle(globalNodeLabelStyle);
|
|
59
|
+
|
|
60
|
+
var globalEdgeTagStyle = _extends({}, defaultEdgeLabelStyle, {
|
|
61
|
+
color: themeItem.globalEdgeTagColor
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
topo.getHtTopo().setGlobalEdgeTagStyle(globalEdgeTagStyle);
|
|
65
|
+
displayConfigDispatchers.update({
|
|
66
|
+
nodeLabelStyle: globalNodeLabelStyle,
|
|
67
|
+
defaultEdgeLabelStyle: globalEdgeTagStyle
|
|
68
|
+
}); // 设置链路标注
|
|
69
|
+
|
|
70
|
+
topo.historyManager.endTransaction();
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: styles.canvasToggle
|
|
75
|
+
}, CANVAS_TOGGLE.map(function (item, index) {
|
|
76
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: styles.canvas,
|
|
78
|
+
key: index
|
|
79
|
+
}, /*#__PURE__*/React.createElement(_Tag.Selectable, {
|
|
80
|
+
className: styles.tag,
|
|
81
|
+
style: {
|
|
82
|
+
background: item.color
|
|
83
|
+
},
|
|
84
|
+
checked: value === item.value,
|
|
85
|
+
onChange: function onChange(checked) {
|
|
86
|
+
setCanvasTheme(item);
|
|
87
|
+
}
|
|
88
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
className: styles.box
|
|
90
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: styles.bgColor
|
|
92
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
className: styles.canvasText
|
|
94
|
+
}, item.label));
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
@import "~@alifd/next/variables.scss";
|
|
2
|
+
|
|
3
|
+
.canvasToggle {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
.canvas {
|
|
7
|
+
.tag {
|
|
8
|
+
border: 1px solid #E4E9EE;
|
|
9
|
+
width: 110px;
|
|
10
|
+
height: 62px;
|
|
11
|
+
border-radius: 2px;
|
|
12
|
+
margin: 16px 0 0 16px;
|
|
13
|
+
:global {
|
|
14
|
+
.#{$css-prefix}tag-body {
|
|
15
|
+
width: 100%;
|
|
16
|
+
padding: 0;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.box {
|
|
21
|
+
position: relative;
|
|
22
|
+
height: 100%;
|
|
23
|
+
user-select: none;
|
|
24
|
+
.bgColor {
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
max-height: 100%;
|
|
27
|
+
display: block;
|
|
28
|
+
margin: auto;
|
|
29
|
+
position: absolute;
|
|
30
|
+
left: 0;
|
|
31
|
+
top: 0;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
right: 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
&::before,
|
|
37
|
+
&::after {
|
|
38
|
+
z-index: 1;
|
|
39
|
+
}
|
|
40
|
+
&:hover {
|
|
41
|
+
.operation {
|
|
42
|
+
display: block;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.operation {
|
|
46
|
+
display: none;
|
|
47
|
+
// z-index: -1;
|
|
48
|
+
position: absolute;
|
|
49
|
+
right: 0;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
left: 0;
|
|
52
|
+
height: 22px;
|
|
53
|
+
text-align: center;
|
|
54
|
+
background: rgba(0, 0, 0, 0.4);
|
|
55
|
+
button {
|
|
56
|
+
height: 100%;
|
|
57
|
+
color: #fff;
|
|
58
|
+
vertical-align: text-bottom;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
.canvasText{
|
|
63
|
+
width: 49px;
|
|
64
|
+
height: 12px;
|
|
65
|
+
margin: 8px 0 0 46px;
|
|
66
|
+
text-align: center;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
.canvas:nth-child(2n){
|
|
70
|
+
margin-left: -7px;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Panel from "./
|
|
1
|
+
import Panel from "./CanvasPanel";
|
|
2
2
|
export default Panel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
|
-
import ImagePalette from "./
|
|
3
|
+
import ImagePalette from "./HtImagePalette";
|
|
4
4
|
import { getNodeDefaultIcons } from "../../../../../common/icons/icon";
|
|
5
5
|
/**
|
|
6
6
|
* 组件面板
|