@riil-frontend/component-topology 5.0.18 → 6.0.0-alpha.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 +29 -29
- package/es/components/VerticalIconTab/VerticalIconTab.js +58 -0
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +63 -0
- package/es/components/VerticalIconTab/index.js +2 -0
- package/es/components/collapse/Collapse.js +7 -0
- package/es/components/collapse/Collapse.module.scss +33 -0
- package/es/components/collapse/CollapseFullheight.module.scss +20 -0
- package/es/components/collapse/Panel.js +3 -0
- package/es/core/common/icons/icon.js +18 -5
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +41 -10
- package/es/core/components/AlarmListPanel/components/index.module.scss +26 -0
- package/es/core/components/AlarmListPanel/index.js +9 -5
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +5 -19
- package/es/core/components/TopoView/TopoView.module.scss +0 -4
- package/es/core/components/TopoView/editor.module.scss +3 -0
- package/es/core/components/TopoView/topoView.js +67 -33
- package/es/core/editor/components/Sidebar/Sidebar.js +75 -0
- package/es/core/editor/components/Sidebar/Sidebar.module.scss +15 -0
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +10 -0
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/index.js +2 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +4 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -0
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +41 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +20 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +45 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +44 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +28 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/index.js +2 -0
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +43 -0
- package/es/core/editor/components/Toolbar/EditorToolbar.js +40 -0
- package/es/core/editor/components/Toolbar/Toolbar.js +10 -0
- package/es/core/editor/components/Toolbar/Toolbar.module.scss +21 -0
- package/es/core/editor/components/Toolbar/buttons.js +36 -0
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +23 -0
- package/es/core/editor/components/Toolbar/widgets/AddResourceWidget.js +17 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +46 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +17 -0
- package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +19 -0
- package/es/core/editor/components/Toolbar/widgets/Divider.js +10 -0
- package/es/core/editor/components/Toolbar/widgets/Divider.module.scss +6 -0
- package/es/core/editor/components/Toolbar/widgets/Dropdown.js +14 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +46 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +44 -0
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +44 -0
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +40 -0
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +35 -0
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +62 -0
- package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +22 -0
- package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +29 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +28 -0
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +47 -0
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +46 -0
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +42 -0
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/SearchWidget.js +40 -0
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +49 -0
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +64 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.js +19 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.module.scss +8 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +27 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.module.scss +10 -0
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +34 -0
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +30 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +47 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.module.scss +10 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +30 -0
- package/es/core/editor/components/Toolbar/widgets/components/MenuSelect.js +20 -0
- package/es/core/editor/components/Toolbar/widgets.js +0 -0
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +24 -8
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.module.scss +4 -3
- package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +4 -2
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -15
- package/es/core/models/HistoryManager.js +32 -6
- package/es/core/models/SelectionManager.js +7 -0
- package/es/core/models/TopoApp.js +4 -2
- package/es/core/store/coreModels.js +5 -5
- package/es/core/store/models/displayConfig.js +2 -2
- package/es/core/store/models/historyManager.js +31 -0
- package/es/core/viewer/components/titlebar/widgets/SearchWidget.js +3 -1
- package/es/networkTopo/components/TopoView.js +2 -98
- package/es/networkTopo/components/Topology.js +3 -33
- package/es/networkTopo/components/editor/useEditorProps.js +34 -0
- package/es/networkTopo/hooks/useLinkDynamicStyle.js +1 -1
- package/es/style.js +1 -1
- package/lib/components/VerticalIconTab/VerticalIconTab.js +74 -0
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +63 -0
- package/lib/components/VerticalIconTab/index.js +11 -0
- package/lib/components/collapse/Collapse.js +15 -0
- package/lib/components/collapse/Collapse.module.scss +33 -0
- package/lib/components/collapse/CollapseFullheight.module.scss +20 -0
- package/lib/components/collapse/Panel.js +3 -0
- package/lib/core/common/icons/icon.js +20 -5
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +40 -9
- package/lib/core/components/AlarmListPanel/components/index.module.scss +26 -0
- package/lib/core/components/AlarmListPanel/index.js +10 -6
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +5 -19
- package/lib/core/components/TopoView/TopoView.module.scss +0 -4
- package/lib/core/components/TopoView/editor.module.scss +3 -0
- package/lib/core/components/TopoView/topoView.js +69 -32
- package/lib/core/editor/components/Sidebar/Sidebar.js +95 -0
- package/lib/core/editor/components/Sidebar/Sidebar.module.scss +15 -0
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +19 -0
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/index.js +11 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +12 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +11 -0
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +53 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +34 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +58 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +56 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +43 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/index.js +11 -0
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +56 -0
- package/lib/{networkTopo/components/viewer/titlebar/MoreButtonMenu.js → core/editor/components/Toolbar/EditorToolbar.js} +36 -29
- package/lib/core/editor/components/Toolbar/Toolbar.js +19 -0
- package/lib/core/editor/components/Toolbar/Toolbar.module.scss +21 -0
- package/lib/core/editor/components/Toolbar/buttons.js +62 -0
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +33 -0
- package/lib/core/editor/components/Toolbar/widgets/AddResourceWidget.js +27 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +27 -0
- package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +29 -0
- package/lib/core/editor/components/Toolbar/widgets/Divider.js +19 -0
- package/lib/core/editor/components/Toolbar/widgets/Divider.module.scss +6 -0
- package/lib/core/editor/components/Toolbar/widgets/Dropdown.js +26 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +61 -0
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +58 -0
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +54 -0
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +49 -0
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +76 -0
- package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +31 -0
- package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +38 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +40 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +64 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +59 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/SearchWidget.js +53 -0
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +64 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.js +31 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.module.scss +8 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +40 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.module.scss +10 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +48 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +30 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +64 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.module.scss +10 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +41 -0
- package/lib/core/editor/components/Toolbar/widgets/components/MenuSelect.js +30 -0
- package/lib/core/editor/components/Toolbar/widgets.js +1 -0
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +25 -8
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.module.scss +4 -3
- package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +5 -2
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +5 -11
- package/lib/core/models/HistoryManager.js +32 -5
- package/lib/core/models/SelectionManager.js +7 -0
- package/lib/core/models/TopoApp.js +4 -1
- package/lib/core/store/coreModels.js +6 -6
- package/lib/core/store/models/displayConfig.js +2 -3
- package/lib/core/store/models/historyManager.js +41 -0
- package/lib/core/viewer/components/titlebar/widgets/SearchWidget.js +3 -1
- package/lib/networkTopo/components/TopoView.js +2 -104
- package/lib/networkTopo/components/Topology.js +3 -41
- package/lib/networkTopo/components/editor/useEditorProps.js +49 -0
- package/lib/networkTopo/hooks/useLinkDynamicStyle.js +2 -2
- package/lib/style.js +1 -1
- package/package.json +3 -3
- package/es/core/components/DisplaySettingDrawer/LinkTip.js +0 -41
- package/es/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +0 -59
- package/es/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +0 -24
- package/es/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +0 -23
- package/es/networkTopo/components/viewer/displaySetting/LinkTagV2.js +0 -93
- package/es/networkTopo/components/viewer/titlebar/MoreButtonMenu.js +0 -32
- package/es/networkTopo/components/viewer/titlebar/ViewerTools.js +0 -9
- package/es/networkTopo/components/viewer/titlebar/useSetDefaultTopo.js +0 -30
- package/lib/core/components/DisplaySettingDrawer/LinkTip.js +0 -55
- package/lib/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +0 -76
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +0 -35
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +0 -23
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagV2.js +0 -108
- package/lib/networkTopo/components/viewer/titlebar/ViewerTools.js +0 -19
- package/lib/networkTopo/components/viewer/titlebar/useSetDefaultTopo.js +0 -40
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import _Tab from "@alifd/next/es/tab";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import styles from "./VerticalIconTab.module.scss";
|
|
6
|
+
/**
|
|
7
|
+
* 自定义标题
|
|
8
|
+
* @param {*} param0
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
function CustomTabItem(_ref) {
|
|
13
|
+
var title = _ref.title,
|
|
14
|
+
icon = _ref.icon;
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: "v-icon-tab-item"
|
|
17
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
18
|
+
src: icon,
|
|
19
|
+
alt: ""
|
|
20
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: "tab-title"
|
|
22
|
+
}, title));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 竖向
|
|
26
|
+
* @param {*} props
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
function VerticalIconTab(props) {
|
|
32
|
+
var _classNames;
|
|
33
|
+
|
|
34
|
+
var activeKey = props.activeKey,
|
|
35
|
+
onChange = props.onChange;
|
|
36
|
+
|
|
37
|
+
var handleClick = function handleClick() {
|
|
38
|
+
onChange(null);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return /*#__PURE__*/React.createElement(_Tab, _extends({
|
|
42
|
+
shape: "wrapped",
|
|
43
|
+
tabPosition: "left",
|
|
44
|
+
tabRender: function tabRender(key, props) {
|
|
45
|
+
return /*#__PURE__*/React.createElement(CustomTabItem, _extends({
|
|
46
|
+
key: key
|
|
47
|
+
}, props));
|
|
48
|
+
}
|
|
49
|
+
}, props, {
|
|
50
|
+
className: styles.tabs,
|
|
51
|
+
navClassName: styles.nav,
|
|
52
|
+
contentClassName: classNames(styles.content, (_classNames = {}, _classNames[styles.hide] = !activeKey, _classNames)),
|
|
53
|
+
onClick: handleClick
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
VerticalIconTab.Item = _Tab.Item;
|
|
58
|
+
export default VerticalIconTab;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@import '~@alifd/next/variables.scss';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.tabs {
|
|
5
|
+
height: 100%;
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// 导航
|
|
10
|
+
.nav {
|
|
11
|
+
width: 60px;
|
|
12
|
+
height: 100%;
|
|
13
|
+
padding-top: 4px;
|
|
14
|
+
// border-right: 1px solid #E6E7EB;
|
|
15
|
+
background: none !important;
|
|
16
|
+
|
|
17
|
+
:global {
|
|
18
|
+
|
|
19
|
+
.#{$css-prefix}tabs-tab {
|
|
20
|
+
background-color: transparent !important;
|
|
21
|
+
|
|
22
|
+
&.active .v-icon-tab-item {
|
|
23
|
+
background-color: rgba(76, 137, 255, 0.1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 图标区
|
|
28
|
+
.v-icon-tab-item {
|
|
29
|
+
height: 76px;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
margin: 0 4px;
|
|
35
|
+
border-radius: 4px;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
background-color: rgba(76, 137, 255, 0.1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 标签页内容区
|
|
45
|
+
.content {
|
|
46
|
+
width: 260px;
|
|
47
|
+
height: 100%;
|
|
48
|
+
transition: all .1s linear;
|
|
49
|
+
border-right: 1px solid var(--tab-wrapped-border-line-color);
|
|
50
|
+
|
|
51
|
+
:global {
|
|
52
|
+
.#{$css-prefix}tabs-tabpane {
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
overflow: auto;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.hide {
|
|
60
|
+
width: 0;
|
|
61
|
+
border-right: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import "@alifd/next/variables";
|
|
2
|
+
|
|
3
|
+
.collapse {
|
|
4
|
+
:global {
|
|
5
|
+
|
|
6
|
+
// 折叠模板标题
|
|
7
|
+
.#{$css-prefix}collapse-panel:not(:first-child) {
|
|
8
|
+
border-top: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.#{$css-prefix}collapse-panel-title:hover {
|
|
12
|
+
background: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.#{$css-prefix}collapse-panel-title {
|
|
16
|
+
background: none;
|
|
17
|
+
font-size: 12px;
|
|
18
|
+
padding-left: 32px;
|
|
19
|
+
|
|
20
|
+
&>.#{$css-prefix}collapse-panel-icon {
|
|
21
|
+
left: 12px;
|
|
22
|
+
margin-top: 0;
|
|
23
|
+
margin-left: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.#{$css-prefix}collapse-panel-content,
|
|
28
|
+
.#{$css-prefix}collapse-panel-expanded>.#{$css-prefix}collapse-panel-content {
|
|
29
|
+
padding-left: 32px;
|
|
30
|
+
padding-top: 8px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import "@alifd/next/variables";
|
|
2
|
+
|
|
3
|
+
.fullheight {
|
|
4
|
+
height: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
|
|
8
|
+
.panelFullHeight {
|
|
9
|
+
height: 100%;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
|
|
13
|
+
:global {
|
|
14
|
+
.#{$css-prefix}collapse-panel-content {
|
|
15
|
+
flex: 1;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -12,6 +12,19 @@ export function getNodeDefaultIcons(topo) {
|
|
|
12
12
|
export function getGroupDefaultIcons(topo) {
|
|
13
13
|
return [].concat(topoManager.iconLibManager.getIcons());
|
|
14
14
|
}
|
|
15
|
+
export function getUserCustomIconsForHt(topo) {
|
|
16
|
+
return getUserCustomIcons(topo).map(function (_ref) {
|
|
17
|
+
var id = _ref.id,
|
|
18
|
+
name = _ref.name,
|
|
19
|
+
url = _ref.url,
|
|
20
|
+
jsonUrl = _ref.jsonUrl;
|
|
21
|
+
return {
|
|
22
|
+
id: id,
|
|
23
|
+
name: name,
|
|
24
|
+
url: jsonUrl || url
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
}
|
|
15
28
|
/**
|
|
16
29
|
* 获取编辑模式左侧图片列表
|
|
17
30
|
* @param {*} topo
|
|
@@ -22,11 +35,11 @@ export function getEditorIcons(topo) {
|
|
|
22
35
|
// 默认图标
|
|
23
36
|
system: getNodeDefaultIcons(topo),
|
|
24
37
|
// 自定义上传图标
|
|
25
|
-
custom: getUserCustomIcons(topo).map(function (
|
|
26
|
-
var id =
|
|
27
|
-
name =
|
|
28
|
-
url =
|
|
29
|
-
jsonUrl =
|
|
38
|
+
custom: getUserCustomIcons(topo).map(function (_ref2) {
|
|
39
|
+
var id = _ref2.id,
|
|
40
|
+
name = _ref2.name,
|
|
41
|
+
url = _ref2.url,
|
|
42
|
+
jsonUrl = _ref2.jsonUrl;
|
|
30
43
|
return {
|
|
31
44
|
id: id,
|
|
32
45
|
name: name,
|
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
import _List from "@alifd/next/es/list";
|
|
2
2
|
import _Icon from "@alifd/next/es/icon";
|
|
3
|
-
import React, { useState, useEffect } from
|
|
3
|
+
import React, { useState, useEffect } from 'react';
|
|
4
4
|
import styles from "./index.module.scss";
|
|
5
5
|
import { PAGE_TYPE } from "../constants/uicbb";
|
|
6
6
|
import Link from "../../../../components/Link";
|
|
7
7
|
|
|
8
8
|
var alarmLink = function alarmLink(alarmInfo) {
|
|
9
|
-
// console.log(
|
|
9
|
+
// console.log('alarmLink', alarmInfo);
|
|
10
10
|
return "/default/pagecenter/" + PAGE_TYPE.ALERT_DETAIL + "/view/" + alarmInfo.alertId + "?alertId=" + alarmInfo.alertId + "&resId=" + alarmInfo.ciId + "&title=" + alarmInfo.alertObject + "&ruleId=" + alarmInfo.ruleId + "&ciCode=" + alarmInfo.ciTypeCode + "&ciType=" + alarmInfo.ciType;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
var getNode = function getNode(topo, alarmInfo) {
|
|
14
|
+
var id = alarmInfo.resourceId || alarmInfo.ciId;
|
|
15
|
+
var node = topo.getHtTopo().getGraphView().dm().getDataByTag(id);
|
|
16
|
+
|
|
17
|
+
if (node.getParent()) {
|
|
18
|
+
var data = node.getParent();
|
|
19
|
+
topo.getHtTopo().getGraphView().fitData(data, true, 20, true); // eslint-disable-next-line no-underscore-dangle, eqeqeq
|
|
20
|
+
|
|
21
|
+
if (data._animation.start[0] != 'hide') {
|
|
22
|
+
topo.getHtTopo().getGraphView().dm().getSelectionModel().setSelection(node);
|
|
23
|
+
} else {
|
|
24
|
+
topo.getHtTopo().getGraphView().dm().getSelectionModel().setSelection(data);
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
topo.getHtTopo().getGraphView().fitData(node, true, 20, true);
|
|
28
|
+
topo.getHtTopo().getGraphView().dm().getSelectionModel().setSelection(node);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
13
32
|
function AlarmListItem(props) {
|
|
14
33
|
// 传入参数
|
|
15
34
|
var topo = props.topo,
|
|
@@ -20,13 +39,19 @@ function AlarmListItem(props) {
|
|
|
20
39
|
media: /*#__PURE__*/React.createElement(_Icon, {
|
|
21
40
|
type: "gaojing-3",
|
|
22
41
|
size: "xs",
|
|
23
|
-
className: styles[
|
|
42
|
+
className: styles['alarm-color-icon'] + " alarm-color-icon-lv" + alarmInfo.alertLevel
|
|
24
43
|
})
|
|
25
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
26
|
-
|
|
44
|
+
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: styles.list,
|
|
46
|
+
onClick: function onClick() {
|
|
47
|
+
getNode(topo, alarmInfo);
|
|
48
|
+
}
|
|
49
|
+
}, "" + alarmInfo.alertObject + alarmInfo.alertTitle), /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: styles.listLink
|
|
27
51
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
52
|
+
onClick: onClick,
|
|
28
53
|
to: alarmLink(alarmInfo)
|
|
29
|
-
}, ""
|
|
54
|
+
}, "\u67E5\u770B\u8BE6\u60C5"))));
|
|
30
55
|
}
|
|
31
56
|
|
|
32
57
|
function RiskListItem(props) {
|
|
@@ -44,13 +69,19 @@ function RiskListItem(props) {
|
|
|
44
69
|
media: /*#__PURE__*/React.createElement(_Icon, {
|
|
45
70
|
type: "Overall_risk_full",
|
|
46
71
|
size: "xs",
|
|
47
|
-
className: styles[
|
|
72
|
+
className: styles['alarm-color-icon'] + " alarm-color-icon-lv2"
|
|
48
73
|
})
|
|
49
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
50
|
-
|
|
74
|
+
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: styles.list,
|
|
76
|
+
onClick: function onClick() {
|
|
77
|
+
getNode(topo, alarmInfo);
|
|
78
|
+
}
|
|
79
|
+
}, " ", "" + alarmInfo.ciName + alarmInfo.itemName), /*#__PURE__*/React.createElement("div", {
|
|
80
|
+
className: styles.listLink
|
|
51
81
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
82
|
+
onClick: onClick,
|
|
52
83
|
to: riskLink(alarmInfo)
|
|
53
|
-
}, ""
|
|
84
|
+
}, "\u67E5\u770B\u8BE6\u60C5"))));
|
|
54
85
|
}
|
|
55
86
|
|
|
56
87
|
function ListItem(props) {
|
|
@@ -4,4 +4,30 @@
|
|
|
4
4
|
height: 12px;
|
|
5
5
|
font-size: 12px;
|
|
6
6
|
}
|
|
7
|
+
:global{
|
|
8
|
+
.next-list-item-content>span{
|
|
9
|
+
width: 100%;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
.list{
|
|
16
|
+
width: 81%;
|
|
17
|
+
float: left;
|
|
7
18
|
}
|
|
19
|
+
.listLink{
|
|
20
|
+
float: right;
|
|
21
|
+
width: 17%;
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
color: #4C89FF;
|
|
24
|
+
height: 100%;
|
|
25
|
+
display:flex;
|
|
26
|
+
:global{
|
|
27
|
+
a{
|
|
28
|
+
color: #4C89FF !important;
|
|
29
|
+
align-self: center;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _List from "@alifd/next/es/list";
|
|
2
2
|
import _Button from "@alifd/next/es/button";
|
|
3
3
|
import _Card from "@alifd/next/es/card";
|
|
4
|
-
import React, { useState, useEffect } from
|
|
4
|
+
import React, { useState, useEffect } from 'react';
|
|
5
|
+
import NoDataPage from '@riil-frontend/component-no-data-page';
|
|
6
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
5
7
|
import AlarmListItem from "./components/AlarmListItem";
|
|
6
|
-
import NoDataPage from "@riil-frontend/component-no-data-page";
|
|
7
8
|
import styles from "./index.module.scss";
|
|
8
9
|
import { alarmListDemo } from "./mocks";
|
|
9
|
-
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
10
10
|
import Link from "../../../components/Link";
|
|
11
11
|
import useAlarmList from "./hooks/useAlarmList";
|
|
12
12
|
|
|
@@ -37,7 +37,10 @@ function AlarmListPanel(props, ref) {
|
|
|
37
37
|
className: styles.listTitleLink,
|
|
38
38
|
to: "/default/alarmCenter/alarmList"
|
|
39
39
|
}, "\u67E5\u770B\u6240\u6709\u544A\u8B66"))),
|
|
40
|
-
extra:
|
|
40
|
+
extra:
|
|
41
|
+
/*#__PURE__*/
|
|
42
|
+
// eslint-disable-next-line jsx-a11y/interactive-supports-focus
|
|
43
|
+
React.createElement("a", {
|
|
41
44
|
role: "button",
|
|
42
45
|
"aria-label": "\u5173\u95ED",
|
|
43
46
|
className: "next-dialog-close",
|
|
@@ -66,7 +69,8 @@ function AlarmListPanel(props, ref) {
|
|
|
66
69
|
alarmInfo: item,
|
|
67
70
|
key: index,
|
|
68
71
|
Link: Link,
|
|
69
|
-
onClick: onClose
|
|
72
|
+
onClick: onClose,
|
|
73
|
+
topo: topo
|
|
70
74
|
});
|
|
71
75
|
}
|
|
72
76
|
}))));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useState, useEffect, useRef, useCallback, useImperativeHandle, forwardRef, useMemo } from "react";
|
|
3
|
-
import { TopoEvent } from "@riil-frontend/component-topology-graph";
|
|
4
3
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
5
4
|
import BatchAttrMetricDrawer from "../../../components/BatchAttrMetric";
|
|
6
5
|
/**
|
|
@@ -47,28 +46,15 @@ var ResourceDiplayInfoSetting = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
47
46
|
|
|
48
47
|
var saveMarkSetting = function saveMarkSetting(showType, parm, selectType) {
|
|
49
48
|
rlog.debug("saveMarkSetting", showType, parm);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
data: parm
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (elementType === "link") {
|
|
59
|
-
onChange({
|
|
60
|
-
isCustom: true,
|
|
61
|
-
data: parm
|
|
62
|
-
});
|
|
63
|
-
}
|
|
49
|
+
onChange({
|
|
50
|
+
isCustom: true,
|
|
51
|
+
data: parm
|
|
52
|
+
});
|
|
64
53
|
};
|
|
65
54
|
|
|
66
55
|
useImperativeHandle(ref, function () {
|
|
67
56
|
return {
|
|
68
|
-
show: openMarkSetting
|
|
69
|
-
openGlobalTootipSetting: function openGlobalTootipSetting() {
|
|
70
|
-
openMarkSetting();
|
|
71
|
-
}
|
|
57
|
+
show: openMarkSetting
|
|
72
58
|
};
|
|
73
59
|
});
|
|
74
60
|
var newValue = useMemo(function () {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import _Box from "@alifd/next/es/box";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useState, useEffect, useRef, useCallback
|
|
3
|
+
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import classnames from 'classnames';
|
|
5
6
|
import TopoGraph, { TopoEvent } from '@riil-frontend/component-topology-graph';
|
|
@@ -18,16 +19,19 @@ import useAlarm from "../../hooks/useAlarm";
|
|
|
18
19
|
import useRouterAdapter from "../../hooks/useRouterAdapter";
|
|
19
20
|
import { fixLink } from "../../utils/graphLinkUtil";
|
|
20
21
|
import { handleClusterNoPermission, upgradeV103GraphClusterNode } from "../../../utils/clusterUtil";
|
|
21
|
-
import
|
|
22
|
+
import EditorToolbar from "../../editor/components/Toolbar/EditorToolbar";
|
|
23
|
+
import Sidebar from "../../editor/components/Sidebar/Sidebar";
|
|
22
24
|
import HistoryManager from "../../models/HistoryManager";
|
|
23
25
|
import styles from "./TopoView.module.scss";
|
|
26
|
+
import editorStyles from "./editor.module.scss";
|
|
24
27
|
|
|
25
28
|
var Topology = function Topology(props) {
|
|
26
|
-
var _classnames
|
|
29
|
+
var _classnames;
|
|
27
30
|
|
|
28
31
|
var topo = props.topo,
|
|
29
32
|
defaultEnterEditMode = props.defaultEnterEditMode,
|
|
30
33
|
titleBar = props.titleBar,
|
|
34
|
+
toolbar = props.toolbar,
|
|
31
35
|
buildLoadOptions = props.buildLoadOptions,
|
|
32
36
|
onReady = props.onReady,
|
|
33
37
|
onLoaded = props.onLoaded,
|
|
@@ -66,9 +70,7 @@ var Topology = function Topology(props) {
|
|
|
66
70
|
setTData = _useState[1]; // TODO 临时放这里,当前监听内容较多
|
|
67
71
|
|
|
68
72
|
|
|
69
|
-
var selectionManager =
|
|
70
|
-
return new SelectionManager(topo);
|
|
71
|
-
}, []);
|
|
73
|
+
var selectionManager = topo.selectionManager;
|
|
72
74
|
useRouterAdapter(props);
|
|
73
75
|
var topoEdit = useTopoEdit({
|
|
74
76
|
topo: topo,
|
|
@@ -123,7 +125,11 @@ var Topology = function Topology(props) {
|
|
|
123
125
|
}
|
|
124
126
|
}, []);
|
|
125
127
|
var handleGraphDataLoaded = useCallback(function () {
|
|
126
|
-
rlog.info('TopoView.handleGraphDataLoaded',
|
|
128
|
+
rlog.info('TopoView.handleGraphDataLoaded', new Date().toString(), {
|
|
129
|
+
topoMod: topo.store.getState().topoMod,
|
|
130
|
+
topoData: topoData,
|
|
131
|
+
htElements: topo.getDataModel().getDatas().toArray()
|
|
132
|
+
});
|
|
127
133
|
upgradeV103GraphClusterNode(topo, topoData);
|
|
128
134
|
fixLink(topo);
|
|
129
135
|
handleClusterNoPermission(topo);
|
|
@@ -144,7 +150,11 @@ var Topology = function Topology(props) {
|
|
|
144
150
|
}
|
|
145
151
|
}, [topoData]);
|
|
146
152
|
var handleGraphLoaded = useCallback(function () {
|
|
147
|
-
rlog.info('TopoView.handleGraphLoaded',
|
|
153
|
+
rlog.info('TopoView.handleGraphLoaded', new Date().toString(), {
|
|
154
|
+
topoMod: topo.store.getState().topoMod,
|
|
155
|
+
topoData: topoData,
|
|
156
|
+
htElements: topo.getDataModel().getDatas().toArray()
|
|
157
|
+
});
|
|
148
158
|
upgradeV103GraphClusterNode(topo, topoData);
|
|
149
159
|
fixLink(topo);
|
|
150
160
|
handleClusterNoPermission(topo);
|
|
@@ -240,6 +250,37 @@ var Topology = function Topology(props) {
|
|
|
240
250
|
});
|
|
241
251
|
};
|
|
242
252
|
|
|
253
|
+
var renderCanvas = function renderCanvas() {
|
|
254
|
+
var _graphViewProps$creat;
|
|
255
|
+
|
|
256
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
257
|
+
className: styles.viewPanel,
|
|
258
|
+
onKeyDown: function onKeyDown(e) {
|
|
259
|
+
topo.historyManager && topo.historyManager.handleKeyDown(e);
|
|
260
|
+
}
|
|
261
|
+
}, /*#__PURE__*/React.createElement(TopoGraph, _extends({}, graphViewProps, {
|
|
262
|
+
createHtTopoProps: _extends({}, graphViewProps.createHtTopoProps, {
|
|
263
|
+
editor: _extends({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {})
|
|
264
|
+
}),
|
|
265
|
+
data: tData,
|
|
266
|
+
defaultEnterEditMode: defaultEnterEditMode,
|
|
267
|
+
renderPropertyView: renderPropertyView,
|
|
268
|
+
renderBackgroundView: renderBackgroundView,
|
|
269
|
+
onCreate: onGraphCreated,
|
|
270
|
+
onLoaded: handleGraphLoaded,
|
|
271
|
+
onDataLoaded: handleGraphDataLoaded,
|
|
272
|
+
onDestroy: onDestroy,
|
|
273
|
+
onEvent: handleEvent,
|
|
274
|
+
style: {
|
|
275
|
+
width: '100%',
|
|
276
|
+
height: '100%',
|
|
277
|
+
position: 'relative',
|
|
278
|
+
overflow: 'hidden'
|
|
279
|
+
},
|
|
280
|
+
debugId: topo.debugId
|
|
281
|
+
})));
|
|
282
|
+
};
|
|
283
|
+
|
|
243
284
|
return /*#__PURE__*/React.createElement("div", {
|
|
244
285
|
className: styles.topoView,
|
|
245
286
|
"data-version": topo.version
|
|
@@ -248,32 +289,25 @@ var Topology = function Topology(props) {
|
|
|
248
289
|
viewerProps: viewerProps,
|
|
249
290
|
onEnterEdit: onEnterEdit,
|
|
250
291
|
topoEditApi: topoEdit
|
|
251
|
-
})), /*#__PURE__*/React.createElement(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
onDestroy: onDestroy,
|
|
268
|
-
onEvent: handleEvent,
|
|
269
|
-
style: {
|
|
270
|
-
width: '100%',
|
|
271
|
-
height: '100%',
|
|
272
|
-
position: 'relative',
|
|
273
|
-
overflow: 'hidden'
|
|
292
|
+
})), isEditMode && /*#__PURE__*/React.createElement(EditorToolbar, {
|
|
293
|
+
topo: topo,
|
|
294
|
+
topoEdit: topoEdit,
|
|
295
|
+
topoContext: {
|
|
296
|
+
urlParams: urlParams
|
|
297
|
+
},
|
|
298
|
+
editorProps: editorProps
|
|
299
|
+
}), /*#__PURE__*/React.createElement(_Box, {
|
|
300
|
+
direction: "row",
|
|
301
|
+
flex: 1,
|
|
302
|
+
className: classnames((_classnames = {}, _classnames[editorStyles.borderLine] = isEditMode, _classnames))
|
|
303
|
+
}, isEditMode && /*#__PURE__*/React.createElement(Sidebar, {
|
|
304
|
+
topo: topo,
|
|
305
|
+
topoEdit: topoEdit,
|
|
306
|
+
topoContext: {
|
|
307
|
+
urlParams: urlParams
|
|
274
308
|
},
|
|
275
|
-
|
|
276
|
-
}))), !isEditMode && /*#__PURE__*/React.createElement(ViewerPlugin, {
|
|
309
|
+
editorProps: editorProps
|
|
310
|
+
}), renderCanvas()), !isEditMode && /*#__PURE__*/React.createElement(ViewerPlugin, {
|
|
277
311
|
topo: topo,
|
|
278
312
|
viewerProps: viewerProps,
|
|
279
313
|
topoContext: topoContext
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import VerticalIconTab from "../../../../components/VerticalIconTab";
|
|
4
|
+
import LinkPanel from "./views/LinkPanel";
|
|
5
|
+
import ComponentPanel from "./views/ComponentPanel";
|
|
6
|
+
import ImagePanel from "./views/ImagePanel";
|
|
7
|
+
import BackgroundPanel from "./views/BackgroundPanel";
|
|
8
|
+
import CanvasPanel from "./views/CanvasPanel";
|
|
9
|
+
import styles from "./Sidebar.module.scss";
|
|
10
|
+
|
|
11
|
+
function Sidebar(props) {
|
|
12
|
+
var topo = props.topo;
|
|
13
|
+
|
|
14
|
+
var _useState = useState(null),
|
|
15
|
+
activeKey = _useState[0],
|
|
16
|
+
setActivekey = _useState[1];
|
|
17
|
+
|
|
18
|
+
var panes = [{
|
|
19
|
+
title: '链路',
|
|
20
|
+
key: '1',
|
|
21
|
+
icon: '/img/topo/editor/sidebar/icon/链路.svg',
|
|
22
|
+
content: LinkPanel
|
|
23
|
+
}, {
|
|
24
|
+
title: '组件',
|
|
25
|
+
key: '2',
|
|
26
|
+
icon: '/img/topo/editor/sidebar/icon/组件.svg',
|
|
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
|
+
});
|
|
54
|
+
|
|
55
|
+
var renderTabItem = function renderTabItem(pane) {
|
|
56
|
+
var View = pane.content;
|
|
57
|
+
return /*#__PURE__*/React.createElement(VerticalIconTab.Item, _extends({
|
|
58
|
+
key: pane.key
|
|
59
|
+
}, pane), /*#__PURE__*/React.createElement(View, {
|
|
60
|
+
topo: topo,
|
|
61
|
+
active: activeKey === pane.key
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: styles.sidebar
|
|
67
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: styles.tabsContainer
|
|
69
|
+
}, /*#__PURE__*/React.createElement(VerticalIconTab, {
|
|
70
|
+
activeKey: activeKey,
|
|
71
|
+
onChange: setActivekey
|
|
72
|
+
}, panes.map(renderTabItem))));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default Sidebar;
|