@riil-frontend/component-topology 6.0.0-alpha.9 → 6.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.
Files changed (376) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +35 -35
  5. package/demo/CHANGELOG/CHANGELOG.md +5 -0
  6. package/es/components/ColorPanel/components/ColorBlock/index.js +37 -0
  7. package/es/components/ColorPanel/components/ColorBlock/index.module.scss +9 -0
  8. package/es/components/ColorPanel/components/FontColorRange/index.js +35 -0
  9. package/es/components/ColorPanel/components/FontColorRange/index.module.scss +25 -0
  10. package/es/components/ColorPanel/index.js +260 -0
  11. package/es/components/ColorPanel/index.module.scss +35 -0
  12. package/es/components/VerticalIconTab/VerticalIconTab.js +11 -1
  13. package/es/components/VerticalIconTab/VerticalIconTab.module.scss +2 -0
  14. package/es/components/collapse/Collapse.js +22 -3
  15. package/es/components/collapse/Collapse.module.scss +24 -0
  16. package/es/components/collapse/index.js +2 -0
  17. package/es/core/common/hooks/useHtElements.js +21 -0
  18. package/es/core/common/icons/icon.js +40 -0
  19. package/es/core/common/icons/useIcons.js +5 -19
  20. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
  21. package/es/core/components/AlarmListPanel/components/index.module.scss +5 -5
  22. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  23. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +9 -3
  24. package/es/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +122 -0
  25. package/es/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
  26. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -22
  27. package/es/core/components/TopoView/GraphViewPanel.js +22 -0
  28. package/es/core/components/TopoView/editor.module.scss +1 -0
  29. package/es/core/components/TopoView/topoView.js +30 -60
  30. package/es/core/components/titlebar/TitleBar.module.scss +1 -1
  31. package/es/core/editor/components/EditorPlugin.js +18 -2
  32. package/es/core/editor/components/Sidebar/Sidebar.js +29 -7
  33. package/es/core/editor/components/Sidebar/panes.js +10 -5
  34. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +11 -30
  35. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +109 -0
  36. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useUpdateHtTopoDefaultTagStyle.js +27 -0
  37. package/es/core/editor/components/Sidebar/views/CanvasPanel/utils/elementThemeUtil.js +0 -0
  38. package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +3 -3
  39. package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +12 -1
  40. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +12 -1
  41. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +3 -3
  42. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +27 -8
  43. package/es/core/editor/components/Toolbar/buttons.js +2 -2
  44. package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +1 -1
  45. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +3 -3
  46. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +46 -2
  47. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +98 -6
  48. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +59 -25
  49. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +3 -5
  50. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +77 -0
  51. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +52 -5
  52. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +166 -16
  53. package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +42 -0
  54. package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +26 -12
  55. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +37 -12
  56. package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +92 -39
  57. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +4 -2
  58. package/es/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +1 -2
  59. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +99 -0
  60. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  61. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +42 -0
  62. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  63. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +75 -0
  64. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  65. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +23 -0
  66. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +10 -0
  67. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  68. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  69. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  70. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  71. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +31 -0
  72. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  73. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +130 -15
  74. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +107 -23
  75. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +33 -0
  76. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +2 -2
  77. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +20 -7
  78. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +40 -35
  79. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  80. package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +10 -4
  81. package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +10 -1
  82. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +2 -2
  83. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +4 -0
  84. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +19 -8
  85. package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +21 -7
  86. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +52 -0
  87. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +67 -0
  88. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +41 -0
  89. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +65 -0
  90. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +65 -0
  91. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +14 -0
  92. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +73 -0
  93. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +69 -0
  94. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +37 -0
  95. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +124 -0
  96. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +31 -0
  97. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +98 -0
  98. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +20 -0
  99. package/es/core/editor/components/plugins/AddElementThemePlugin.js +11 -0
  100. package/es/core/editor/components/settings/CloseablePanel.js +33 -0
  101. package/es/core/editor/components/settings/CloseablePanel.module.scss +21 -0
  102. package/es/core/editor/components/settings/PropertyView.js +50 -11
  103. package/es/core/editor/components/settings/Settings.js +37 -122
  104. package/es/core/editor/components/settings/Settings.module.scss +7 -11
  105. package/es/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +3 -3
  106. package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +80 -0
  107. package/es/core/editor/components/settings/common/AlignSetting/index.js +20 -72
  108. package/es/core/editor/components/settings/common/GroupNodeList/ResourceList.module.scss +1 -0
  109. package/es/core/editor/components/settings/common/LineType/index.js +11 -102
  110. package/es/core/editor/components/settings/common/NameInput.js +24 -0
  111. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +21 -18
  112. package/es/core/editor/components/settings/common/text/fontStyleUtil.js +21 -19
  113. package/es/core/editor/components/settings/core/PropertyViewManager.js +81 -0
  114. package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +22 -0
  115. package/es/core/editor/components/settings/core/getPropertyViewType.js +34 -0
  116. package/es/core/editor/components/settings/core/updateElementProperty.js +21 -0
  117. package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +6 -13
  118. package/es/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +58 -0
  119. package/es/core/editor/components/settings/propertyViews/box/NameInput.js +5 -4
  120. package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +12 -3
  121. package/es/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +7 -8
  122. package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +9 -23
  123. package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +10 -0
  124. package/es/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -6
  125. package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +13 -21
  126. package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.module.scss +8 -1
  127. package/es/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +28 -0
  128. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +75 -0
  129. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -15
  130. package/es/core/editor/components/settings/propertyViews/group/cluster/ClusterGroupRelateData.js +8 -6
  131. package/es/core/editor/components/settings/propertyViews/index.js +4 -6
  132. package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +57 -0
  133. package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyView.js +11 -17
  134. package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyView.module.scss +10 -0
  135. package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyViewV1.js +27 -0
  136. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -7
  137. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  138. package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +8 -32
  139. package/es/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +53 -0
  140. package/es/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +49 -0
  141. package/es/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +5 -4
  142. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
  143. package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +1 -0
  144. package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -20
  145. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +8 -4
  146. package/es/core/editor/config/themes.js +105 -0
  147. package/es/core/editor/hooks/useKeyboardShortcut.js +39 -0
  148. package/es/core/editor/hooks/useNewElementTheme.js +46 -0
  149. package/es/core/editor/store/topoEdit.js +44 -37
  150. package/es/core/editor/utils/edgeTypeStyleUtil.js +34 -11
  151. package/es/core/editor/utils/textStyleUtil.js +0 -0
  152. package/es/core/editor/utils/themeUtil.js +32 -0
  153. package/es/core/hooks/useCanvasTheme.js +54 -0
  154. package/es/core/hooks/useManageStatus.js +1 -9
  155. package/es/core/hooks/usePolling.js +2 -5
  156. package/es/core/hooks/useTopoEdit.js +15 -8
  157. package/es/core/models/Alarm.js +2 -2
  158. package/es/core/models/AttributeMetricDisplay.js +4 -0
  159. package/es/core/models/HistoryManager.js +13 -8
  160. package/es/core/models/{SelectionManager.js → SelectionModel.js} +55 -22
  161. package/es/core/models/TopoApp.js +6 -5
  162. package/es/core/models/selection/ignoreList.js +1 -0
  163. package/es/core/models/utils/linkUtils.js +5 -6
  164. package/es/core/store/models/customIcon.js +1 -3
  165. package/es/core/store/models/selection.js +2 -1
  166. package/es/core/store/models/topoBizMod.js +0 -3
  167. package/es/core/store/models/topoConfig.js +10 -12
  168. package/es/core/store/models/topoMod.js +26 -28
  169. package/es/core/utils/edgeUtil.js +6 -0
  170. package/es/core/utils/showGraphManageStatusUtil.js +7 -1
  171. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +18 -13
  172. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +38 -19
  173. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
  174. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
  175. package/es/core/viewer/components/plugins/ViewerPlugin.js +10 -4
  176. package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  177. package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  178. package/es/networkTopo/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -1
  179. package/es/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +39 -6
  180. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +10 -16
  181. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +37 -0
  182. package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +1 -1
  183. package/es/networkTopo/components/editor/useEditorProps.js +1 -3
  184. package/es/networkTopo/createTopo.js +2 -0
  185. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  186. package/es/networkTopo/services/link.js +2 -2
  187. package/es/networkTopo/store/topoTreeMod.js +6 -7
  188. package/es/style.js +28 -27
  189. package/es/utils/htElementUtils.js +3 -0
  190. package/es/utils/topoData.js +1 -0
  191. package/lib/components/ColorPanel/components/ColorBlock/index.js +47 -0
  192. package/lib/components/ColorPanel/components/ColorBlock/index.module.scss +9 -0
  193. package/lib/components/ColorPanel/components/FontColorRange/index.js +49 -0
  194. package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +25 -0
  195. package/lib/components/ColorPanel/index.js +279 -0
  196. package/lib/components/ColorPanel/index.module.scss +35 -0
  197. package/lib/components/VerticalIconTab/VerticalIconTab.js +14 -1
  198. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +2 -0
  199. package/lib/components/collapse/Collapse.js +28 -3
  200. package/lib/components/collapse/Collapse.module.scss +24 -0
  201. package/lib/components/collapse/index.js +11 -0
  202. package/lib/core/common/hooks/useHtElements.js +27 -0
  203. package/lib/core/common/icons/icon.js +47 -0
  204. package/lib/core/common/icons/useIcons.js +7 -18
  205. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
  206. package/lib/core/components/AlarmListPanel/components/index.module.scss +5 -5
  207. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  208. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +10 -3
  209. package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +147 -0
  210. package/lib/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
  211. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -22
  212. package/lib/core/components/TopoView/GraphViewPanel.js +32 -0
  213. package/lib/core/components/TopoView/editor.module.scss +1 -0
  214. package/lib/core/components/TopoView/topoView.js +36 -67
  215. package/lib/core/components/titlebar/TitleBar.module.scss +1 -1
  216. package/lib/core/editor/components/EditorPlugin.js +26 -2
  217. package/lib/core/editor/components/Sidebar/Sidebar.js +28 -6
  218. package/lib/core/editor/components/Sidebar/panes.js +10 -5
  219. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +12 -31
  220. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +123 -0
  221. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useUpdateHtTopoDefaultTagStyle.js +37 -0
  222. package/lib/core/editor/components/Sidebar/views/CanvasPanel/utils/elementThemeUtil.js +1 -0
  223. package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
  224. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +13 -1
  225. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +13 -1
  226. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +3 -3
  227. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +36 -12
  228. package/lib/core/editor/components/Toolbar/buttons.js +2 -2
  229. package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +1 -1
  230. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +3 -3
  231. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +48 -2
  232. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +100 -6
  233. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +58 -24
  234. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +3 -3
  235. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +83 -0
  236. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +53 -4
  237. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +172 -16
  238. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +42 -0
  239. package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +27 -11
  240. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +38 -11
  241. package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +96 -39
  242. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +4 -2
  243. package/lib/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +1 -2
  244. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +116 -0
  245. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  246. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +55 -0
  247. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  248. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +93 -0
  249. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  250. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +32 -0
  251. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +22 -0
  252. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  253. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  254. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  255. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  256. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +44 -0
  257. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  258. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +135 -16
  259. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +110 -23
  260. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +33 -0
  261. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +2 -2
  262. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +21 -7
  263. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +40 -34
  264. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  265. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +13 -4
  266. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +10 -1
  267. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +2 -2
  268. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +4 -0
  269. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +19 -8
  270. package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +22 -7
  271. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +66 -0
  272. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +82 -0
  273. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +58 -0
  274. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +86 -0
  275. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +88 -0
  276. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +28 -0
  277. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +90 -0
  278. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +90 -0
  279. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +54 -0
  280. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +141 -0
  281. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +46 -0
  282. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +111 -0
  283. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +31 -0
  284. package/lib/core/editor/components/plugins/AddElementThemePlugin.js +20 -0
  285. package/lib/core/editor/components/settings/CloseablePanel.js +46 -0
  286. package/lib/core/editor/components/settings/CloseablePanel.module.scss +21 -0
  287. package/lib/core/editor/components/settings/PropertyView.js +59 -12
  288. package/lib/core/editor/components/settings/Settings.js +40 -122
  289. package/lib/core/editor/components/settings/Settings.module.scss +7 -11
  290. package/lib/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +3 -3
  291. package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +97 -0
  292. package/lib/core/editor/components/settings/common/AlignSetting/index.js +21 -80
  293. package/lib/core/editor/components/settings/common/GroupNodeList/ResourceList.module.scss +1 -0
  294. package/lib/core/editor/components/settings/common/LineType/index.js +11 -109
  295. package/lib/core/editor/components/settings/common/NameInput.js +38 -0
  296. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +21 -19
  297. package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +25 -20
  298. package/lib/core/editor/components/settings/core/PropertyViewManager.js +91 -0
  299. package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +33 -0
  300. package/lib/core/editor/components/settings/core/getPropertyViewType.js +40 -0
  301. package/lib/core/editor/components/settings/core/updateElementProperty.js +27 -0
  302. package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +6 -13
  303. package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +76 -0
  304. package/lib/core/editor/components/settings/propertyViews/box/NameInput.js +6 -5
  305. package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -3
  306. package/lib/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +9 -12
  307. package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +7 -23
  308. package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +19 -0
  309. package/lib/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -6
  310. package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +14 -25
  311. package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.module.scss +8 -1
  312. package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +43 -0
  313. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +98 -0
  314. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +8 -14
  315. package/lib/core/editor/components/settings/propertyViews/group/cluster/ClusterGroupRelateData.js +9 -7
  316. package/lib/core/editor/components/settings/propertyViews/index.js +4 -9
  317. package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +75 -0
  318. package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyView.js +12 -20
  319. package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyView.module.scss +10 -0
  320. package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyViewV1.js +40 -0
  321. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +4 -6
  322. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  323. package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +8 -35
  324. package/lib/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +68 -0
  325. package/lib/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +64 -0
  326. package/lib/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +6 -5
  327. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
  328. package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +1 -0
  329. package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -20
  330. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -1
  331. package/lib/core/editor/config/themes.js +114 -0
  332. package/lib/core/editor/hooks/useKeyboardShortcut.js +49 -0
  333. package/lib/core/editor/hooks/useNewElementTheme.js +57 -0
  334. package/lib/core/editor/store/topoEdit.js +46 -40
  335. package/lib/core/editor/utils/edgeTypeStyleUtil.js +38 -11
  336. package/lib/core/editor/utils/textStyleUtil.js +1 -0
  337. package/lib/core/editor/utils/themeUtil.js +39 -0
  338. package/lib/core/hooks/useCanvasTheme.js +68 -0
  339. package/lib/core/hooks/useManageStatus.js +1 -9
  340. package/lib/core/hooks/usePolling.js +2 -5
  341. package/lib/core/hooks/useTopoEdit.js +16 -8
  342. package/lib/core/models/Alarm.js +2 -2
  343. package/lib/core/models/AttributeMetricDisplay.js +4 -0
  344. package/lib/core/models/HistoryManager.js +13 -8
  345. package/lib/core/models/{SelectionManager.js → SelectionModel.js} +57 -22
  346. package/lib/core/models/TopoApp.js +7 -5
  347. package/lib/core/models/selection/ignoreList.js +6 -0
  348. package/lib/core/models/utils/linkUtils.js +5 -6
  349. package/lib/core/store/models/customIcon.js +1 -3
  350. package/lib/core/store/models/selection.js +2 -1
  351. package/lib/core/store/models/topoBizMod.js +0 -3
  352. package/lib/core/store/models/topoConfig.js +9 -18
  353. package/lib/core/store/models/topoMod.js +27 -29
  354. package/lib/core/utils/edgeUtil.js +6 -0
  355. package/lib/core/utils/showGraphManageStatusUtil.js +7 -1
  356. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +18 -13
  357. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +38 -19
  358. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
  359. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
  360. package/lib/core/viewer/components/plugins/ViewerPlugin.js +11 -3
  361. package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  362. package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  363. package/lib/networkTopo/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -0
  364. package/lib/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +45 -7
  365. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +10 -18
  366. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +50 -0
  367. package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +1 -1
  368. package/lib/networkTopo/components/editor/useEditorProps.js +1 -4
  369. package/lib/networkTopo/createTopo.js +3 -0
  370. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  371. package/lib/networkTopo/services/link.js +2 -2
  372. package/lib/networkTopo/store/topoTreeMod.js +6 -8
  373. package/lib/style.js +28 -27
  374. package/lib/utils/htElementUtils.js +5 -0
  375. package/lib/utils/topoData.js +1 -0
  376. package/package.json +5 -4
@@ -13,19 +13,16 @@ var alarmLink = function alarmLink(alarmInfo) {
13
13
  var getNode = function getNode(topo, alarmInfo) {
14
14
  var id = alarmInfo.resourceId || alarmInfo.ciId;
15
15
  var node = topo.getHtTopo().getGraphView().dm().getDataByTag(id);
16
+ var ele = getNodeParents(node);
17
+ topo.getHtTopo().getGraphView().fitData(ele, true, 20, true);
18
+ topo.getHtTopo().getGraphView().dm().getSelectionModel().setSelection(ele);
19
+ };
16
20
 
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
- }
21
+ var getNodeParents = function getNodeParents(node) {
22
+ if (node.getParent() && node.getParent().isExpanded && !node.getParent().isExpanded()) {
23
+ return getNodeParents(node.getParent());
26
24
  } else {
27
- topo.getHtTopo().getGraphView().fitData(node, true, 20, true);
28
- topo.getHtTopo().getGraphView().dm().getSelectionModel().setSelection(node);
25
+ return node;
29
26
  }
30
27
  };
31
28
 
@@ -41,7 +38,9 @@ function AlarmListItem(props) {
41
38
  size: "xs",
42
39
  className: styles['alarm-color-icon'] + " alarm-color-icon-lv" + alarmInfo.alertLevel
43
40
  })
44
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
41
+ }, /*#__PURE__*/React.createElement("span", {
42
+ className: styles.content
43
+ }, /*#__PURE__*/React.createElement("div", {
45
44
  className: styles.list,
46
45
  onClick: function onClick() {
47
46
  getNode(topo, alarmInfo);
@@ -71,7 +70,9 @@ function RiskListItem(props) {
71
70
  size: "xs",
72
71
  className: styles['alarm-color-icon'] + " alarm-color-icon-lv2"
73
72
  })
74
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
73
+ }, /*#__PURE__*/React.createElement("span", {
74
+ className: styles.content
75
+ }, /*#__PURE__*/React.createElement("div", {
75
76
  className: styles.list,
76
77
  onClick: function onClick() {
77
78
  getNode(topo, alarmInfo);
@@ -12,13 +12,13 @@
12
12
  }
13
13
 
14
14
  }
15
- .list{
16
- width: 81%;
17
- float: left;
15
+ .content{
16
+ display: flex;
17
+ }
18
+ .list{
19
+ flex: 1;
18
20
  }
19
21
  .listLink{
20
- float: right;
21
- width: 17%;
22
22
  font-size: 12px;
23
23
  color: #4C89FF;
24
24
  height: 100%;
@@ -19,7 +19,8 @@ import BooleanRadio from "../../../components/BooleanRadio";
19
19
 
20
20
  function DisplaySetting(props, ref) {
21
21
  var topo = props.topo,
22
- displaySettingProps = props.displaySettingProps;
22
+ displaySettingProps = props.displaySettingProps,
23
+ isEditor = props.isEditor;
23
24
  var displayConfig = topo.store.getModelState('displayConfig');
24
25
 
25
26
  var _ref = displaySettingProps || {},
@@ -7,10 +7,12 @@ import rlog from '@riil-frontend/component-topology-utils/lib/rlog';
7
7
  import Drawer from "../../../components/Drawer";
8
8
  import DisplaySetting from "./DisplaySetting";
9
9
  import useDisplaySetting from "./hooks/useDisplaySetting";
10
+ import EditorDisplaySetting from "./EditorDisplaySetting";
10
11
  export default function DisplaySettingDrawer(props) {
11
12
  var visible = props.visible,
12
13
  topo = props.topo,
13
14
  displaySettingProps = props.displaySettingProps,
15
+ isEditor = props.isEditor,
14
16
  onClose = props.onClose;
15
17
  var settingRef = useRef();
16
18
 
@@ -19,7 +21,8 @@ export default function DisplaySettingDrawer(props) {
19
21
  setLoading = _useState[1];
20
22
 
21
23
  var displaySetting = useDisplaySetting(_extends({}, props, {
22
- settingRef: settingRef
24
+ settingRef: settingRef,
25
+ isEditor: isEditor
23
26
  }));
24
27
 
25
28
  var handleOk = /*#__PURE__*/function () {
@@ -37,7 +40,9 @@ export default function DisplaySettingDrawer(props) {
37
40
  setLoading(false);
38
41
  onClose();
39
42
 
40
- _Message.success('保存成功');
43
+ if (!isEditor) {
44
+ _Message.success('保存成功');
45
+ }
41
46
 
42
47
  _context.next = 14;
43
48
  break;
@@ -63,6 +68,7 @@ export default function DisplaySettingDrawer(props) {
63
68
  };
64
69
  }();
65
70
 
71
+ var DisplaySettingWidget = isEditor ? EditorDisplaySetting : DisplaySetting;
66
72
  return /*#__PURE__*/React.createElement(Drawer, {
67
73
  title: "\u663E\u793A\u8BBE\u7F6E",
68
74
  visible: visible,
@@ -74,7 +80,7 @@ export default function DisplaySettingDrawer(props) {
74
80
 
75
81
  },
76
82
  buttons: ['保存', '取消']
77
- }, visible && /*#__PURE__*/React.createElement(DisplaySetting, {
83
+ }, visible && /*#__PURE__*/React.createElement(DisplaySettingWidget, {
78
84
  ref: settingRef,
79
85
  topo: topo,
80
86
  displaySettingProps: displaySettingProps
@@ -0,0 +1,122 @@
1
+ import _Box from "@alifd/next/es/box";
2
+ import _Form from "@alifd/next/es/form";
3
+ import _extends from "@babel/runtime/helpers/extends";
4
+ import _Field from "@alifd/next/es/field";
5
+ import React, { useEffect, useImperativeHandle, useState } from 'react';
6
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
7
+ import NodeTag from "./NodeTag";
8
+ import EdgeFlow from "./EdgeFlow";
9
+ import NodeTip from "./NodeTip";
10
+ import LineExpandAllRadioGroup from "./LineExpandAllRadioGroup";
11
+ import EdgeFlowDirection from "./EdgeFlowDirection";
12
+ import BooleanRadio from "../../../components/BooleanRadio";
13
+ /**
14
+ * 显示设置
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+
20
+ function EditorDisplaySetting(props, ref) {
21
+ var topo = props.topo,
22
+ displaySettingProps = props.displaySettingProps;
23
+ var displayConfig = topo.store.getModelState('displayConfig');
24
+
25
+ var _ref = displaySettingProps || {},
26
+ linkTagConfig = _ref.linkTagConfig,
27
+ linkTipConfig = _ref.linkTipConfig,
28
+ showEdgeExpandConfig = _ref.showEdgeExpandConfig,
29
+ extraConfig = _ref.extraConfig,
30
+ showLinkConfig = _ref.showLinkConfig,
31
+ nodeTagProps = _ref.nodeTagProps,
32
+ nodeTipProps = _ref.nodeTipProps,
33
+ isNetworkTopo = _ref.isNetworkTopo;
34
+
35
+ var field = _Field.useField({
36
+ autoUnmount: false,
37
+ values: {
38
+ alarmSwitch: displayConfig.alarmSwitch,
39
+ alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
40
+ nodeTag: displayConfig.nodeTag,
41
+ nodeTip: displayConfig.nodeTip,
42
+ linkTag: displayConfig.linkTag,
43
+ linkTip: displayConfig.linkTip,
44
+ expandAllEdges: displayConfig.expandAllEdges,
45
+ edgeFlow: displayConfig.edgeFlow,
46
+ edgeFlowDirection: displayConfig.edgeFlowDirection
47
+ },
48
+ onChange: function onChange(name, value) {
49
+ rlog.debug('DisplaySetting-onChange', name, value); // 告警静默设置
50
+
51
+ if (name === 'alarmSwitch') {
52
+ field.setValue('alarmListDefaultOpen', !!value);
53
+ }
54
+ }
55
+ });
56
+
57
+ useImperativeHandle(ref, function () {
58
+ return field;
59
+ });
60
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Form, {
61
+ field: field,
62
+ labelAlign: "top"
63
+ }, /*#__PURE__*/React.createElement(_Form.Item, {
64
+ label: /*#__PURE__*/React.createElement(Label, {
65
+ label: "\u8D44\u6E90\u6807\u6CE8",
66
+ helpText: "\u6700\u591A\u652F\u6301\u52FE\u90093\u9879"
67
+ })
68
+ }, /*#__PURE__*/React.createElement(NodeTag, _extends({}, nodeTagProps, {
69
+ name: "nodeTag",
70
+ topo: topo
71
+ }))), linkTagConfig && /*#__PURE__*/React.createElement(_Form.Item, {
72
+ label: /*#__PURE__*/React.createElement(Label, {
73
+ label: "\u94FE\u8DEF\u6807\u6CE8",
74
+ helpText: "\u6700\u591A\u652F\u6301\u52FE\u90092\u9879"
75
+ }),
76
+ patternTrigger: "onChange"
77
+ }, linkTagConfig({
78
+ name: "linkTag",
79
+ topo: topo
80
+ })), /*#__PURE__*/React.createElement(_Form.Item, {
81
+ label: /*#__PURE__*/React.createElement(Label, {
82
+ label: "\u8D44\u6E90\u60AC\u6D6E\u6846",
83
+ helpText: "\u6700\u591A\u652F\u6301\u52FE\u90094\u9879"
84
+ }),
85
+ patternTrigger: "onChange"
86
+ }, /*#__PURE__*/React.createElement(NodeTip, _extends({}, nodeTipProps, {
87
+ name: "nodeTip",
88
+ topo: topo
89
+ }))), linkTipConfig && /*#__PURE__*/React.createElement(_Form.Item, {
90
+ label: /*#__PURE__*/React.createElement(Label, {
91
+ label: "\u94FE\u8DEF\u60AC\u6D6E\u6846",
92
+ helpText: "\u6700\u591A\u652F\u6301\u52FE\u90094\u9879"
93
+ }),
94
+ patternTrigger: "onChange"
95
+ }, linkTipConfig({
96
+ name: "linkTip",
97
+ topo: topo
98
+ })), showEdgeExpandConfig && /*#__PURE__*/React.createElement(_Form.Item, {
99
+ label: /*#__PURE__*/React.createElement(LineExpandAllRadioGroup.Label, null),
100
+ patternTrigger: "onChange"
101
+ }, /*#__PURE__*/React.createElement(LineExpandAllRadioGroup, {
102
+ name: "expandAllEdges",
103
+ isNetworkTopo: isNetworkTopo
104
+ }))));
105
+ }
106
+
107
+ ;
108
+
109
+ function Label(props) {
110
+ var label = props.label,
111
+ helpText = props.helpText;
112
+ return /*#__PURE__*/React.createElement(_Box, {
113
+ direction: "row",
114
+ spacing: 12
115
+ }, /*#__PURE__*/React.createElement("div", null, label), /*#__PURE__*/React.createElement("div", {
116
+ style: {
117
+ color: '#638DB7'
118
+ }
119
+ }, helpText));
120
+ }
121
+
122
+ export default /*#__PURE__*/React.forwardRef(EditorDisplaySetting);
@@ -22,8 +22,6 @@ var LineExpandAllRadioGroup = /*#__PURE__*/React.forwardRef(function LineExpandA
22
22
  pluralType = _useState2[0],
23
23
  setPluralType = _useState2[1];
24
24
 
25
- console.log("LineExpandAllRadioGroup-value", value, pluralType);
26
-
27
25
  var handleTypeChange = function handleTypeChange(newValue) {
28
26
  setShowType(newValue); // console.log("handleTypeChange---newValue", newValue, pluralType);
29
27
 
@@ -64,7 +62,6 @@ var LineExpandAllRadioGroup = /*#__PURE__*/React.forwardRef(function LineExpandA
64
62
  }
65
63
  }
66
64
 
67
- console.log("creatTypeValue", v);
68
65
  return v;
69
66
  }; // useEffect(() => {
70
67
  // setPluralType(plurals[compatibleWith(value)] ?? []);
@@ -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 executeByConfig = /*#__PURE__*/function () {
11
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(config) {
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 1:
45
+ case 11:
20
46
  case "end":
21
47
  return _context.stop();
22
48
  }
@@ -24,43 +50,44 @@ export default (function (props) {
24
50
  }, _callee);
25
51
  }));
26
52
 
27
- return function executeByConfig(_x) {
53
+ return function handleViewerSave() {
28
54
  return _ref.apply(this, arguments);
29
55
  };
30
56
  }();
31
57
 
32
- var save = /*#__PURE__*/function () {
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) {
36
62
  while (1) {
37
63
  switch (_context2.prev = _context2.next) {
38
64
  case 0:
65
+ topo.historyManager.beginTransaction();
39
66
  values = settingRef.current.getValues(); // console.info('保存显示配置', values)
40
67
  // 保存配置
41
68
 
42
69
  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
- });
70
+ displayConfig = _extends({}, prevDisplayConfig, values); // 刷新指标配置
50
71
 
51
- case 5:
52
- // 刷新指标配置
53
72
  displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
54
- displayConfigDispatchers.update(displayConfig); // 按配置执行
73
+ _context2.next = 7;
74
+ return displayConfigDispatchers.update(displayConfig);
55
75
 
56
- executeByConfig(displayConfig);
57
- extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
76
+ case 7:
77
+ extraOnOk = displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk;
58
78
 
59
- if (extraOnOk) {
60
- extraOnOk(displayConfig);
79
+ if (!extraOnOk) {
80
+ _context2.next = 11;
81
+ break;
61
82
  }
62
83
 
63
- case 10:
84
+ _context2.next = 11;
85
+ return extraOnOk(displayConfig);
86
+
87
+ case 11:
88
+ topo.historyManager.endTransaction();
89
+
90
+ case 12:
64
91
  case "end":
65
92
  return _context2.stop();
66
93
  }
@@ -68,11 +95,46 @@ export default (function (props) {
68
95
  }, _callee2);
69
96
  }));
70
97
 
71
- return function save() {
98
+ return function handleEditorSave() {
72
99
  return _ref2.apply(this, arguments);
73
100
  };
74
101
  }();
75
102
 
103
+ var save = /*#__PURE__*/function () {
104
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
105
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
106
+ while (1) {
107
+ switch (_context3.prev = _context3.next) {
108
+ case 0:
109
+ if (isEditor) {
110
+ _context3.next = 5;
111
+ break;
112
+ }
113
+
114
+ _context3.next = 3;
115
+ return handleViewerSave();
116
+
117
+ case 3:
118
+ _context3.next = 7;
119
+ break;
120
+
121
+ case 5:
122
+ _context3.next = 7;
123
+ return handleEditorSave();
124
+
125
+ case 7:
126
+ case "end":
127
+ return _context3.stop();
128
+ }
129
+ }
130
+ }, _callee3);
131
+ }));
132
+
133
+ return function save() {
134
+ return _ref3.apply(this, arguments);
135
+ };
136
+ }();
137
+
76
138
  return {
77
139
  save: save
78
140
  };
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import useCanvasTheme from "../../hooks/useCanvasTheme";
3
+ import styles from "./TopoView.module.scss";
4
+ export default function GraphViewPanel(props) {
5
+ var topo = props.topo,
6
+ hideBackgroundColor = props.hideBackgroundColor;
7
+ var displayConfig = topo.store.useModelState('displayConfig');
8
+ var themeName = displayConfig.canvasTheme || 'white';
9
+
10
+ var _useCanvasTheme = useCanvasTheme({
11
+ topo: topo,
12
+ themeName: themeName
13
+ }),
14
+ canvasColor = _useCanvasTheme.canvasColor;
15
+
16
+ return /*#__PURE__*/React.createElement("div", {
17
+ className: styles.viewPanel,
18
+ style: {
19
+ background: hideBackgroundColor ? null : canvasColor
20
+ }
21
+ }, props.children);
22
+ }
@@ -1,3 +1,4 @@
1
1
  .borderLine {
2
+ position: relative;
2
3
  border-top: 1px solid #E6E7EB;
3
4
  }
@@ -4,25 +4,26 @@ import React, { useState, useEffect, useRef, useCallback } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import classnames from 'classnames';
6
6
  import TopoGraph, { TopoEvent } from '@riil-frontend/component-topology-graph';
7
- import rlog from '@riil-frontend/component-topology-utils/es/rlog';
8
- import useTopoEdit from "../../hooks/useTopoEdit";
7
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog'; // 通用
8
+
9
9
  import showMessage from "../../utils/showMessage";
10
- import EditorPlugin from "../../editor/components/EditorPlugin";
11
- import ViewerPlugin from "../../viewer/components/plugins/ViewerPlugin";
12
10
  import TitleBar from "../titlebar/TitleBar";
13
11
  import { TPL_TREE } from "../../../utils/template";
14
- import PropertyView from "../../editor/components/settings/PropertyView";
15
- import BackgroundView from "../../editor/components/BackgroundView";
16
12
  import { updateEdgeExpanded } from "../../utils/edgeUtil";
17
- import useManageStatus from "../../hooks/useManageStatus";
18
- import useAlarm from "../../hooks/useAlarm";
19
13
  import useRouterAdapter from "../../hooks/useRouterAdapter";
20
14
  import { fixLink } from "../../utils/graphLinkUtil";
21
15
  import { handleClusterNoPermission, upgradeV103GraphClusterNode } from "../../../utils/clusterUtil";
16
+ import GraphViewPanel from "./GraphViewPanel";
17
+ import styles from "./TopoView.module.scss"; // 显示模式
18
+
19
+ import ViewerPlugin from "../../viewer/components/plugins/ViewerPlugin"; // 编辑模式
20
+
21
+ import useTopoEdit from "../../hooks/useTopoEdit";
22
+ import EditorPlugin from "../../editor/components/EditorPlugin";
22
23
  import EditorToolbar from "../../editor/components/Toolbar/EditorToolbar";
23
24
  import Sidebar from "../../editor/components/Sidebar/Sidebar";
25
+ import PropertyView from "../../editor/components/settings/PropertyView";
24
26
  import HistoryManager from "../../models/HistoryManager";
25
- import styles from "./TopoView.module.scss";
26
27
  import editorStyles from "./editor.module.scss";
27
28
 
28
29
  var Topology = function Topology(props) {
@@ -56,9 +57,9 @@ var Topology = function Topology(props) {
56
57
  topoState = _store$useModel[0],
57
58
  topoDispatchers = _store$useModel[1];
58
59
 
59
- var bizDispatchers = store.useModelDispatchers('topoBizMod');
60
60
  var topoId = topoState.topoId,
61
61
  viewState = topoState.viewState,
62
+ graphLoaded = topoState.graphLoaded,
62
63
  topoData = topoState.topoData,
63
64
  urlParams = topoState.urlParams;
64
65
  var isEditMode = viewState === 'edit';
@@ -67,11 +68,10 @@ var Topology = function Topology(props) {
67
68
 
68
69
  var _useState = useState(buildLoadOptions ? buildLoadOptions(topoData) : topoData),
69
70
  tData = _useState[0],
70
- setTData = _useState[1]; // TODO 临时放这里,当前监听内容较多
71
+ setTData = _useState[1];
71
72
 
73
+ useRouterAdapter(props); // 编辑模式----
72
74
 
73
- var selectionManager = topo.selectionManager;
74
- useRouterAdapter(props);
75
75
  var topoEdit = useTopoEdit({
76
76
  topo: topo,
77
77
  topoId: topoId,
@@ -84,25 +84,11 @@ var Topology = function Topology(props) {
84
84
  isLayerTopo: isLayerTopo
85
85
  });
86
86
  topo.topoEdit = topoEdit;
87
- var onExitEdit = topoEdit.onExitEdit,
88
- onBindData = topoEdit.onBindData,
89
- onDeleteElement = topoEdit.onDeleteElement,
90
- onSaveTopo = topoEdit.onSaveTopo;
91
- var titleBarRef = useRef();
92
- useAlarm({
93
- topo: topo
94
- });
95
- useManageStatus({
96
- topo: topo
97
- });
98
87
  useEffect(function () {
99
88
  if (viewState === 'view' && topoId) {
100
89
  // TODO 移到模型中
101
90
  // rlog.debug('useEffect-viewState', topoId, viewState);
102
91
  setTData(null);
103
- bizDispatchers.update({
104
- setConfig: null
105
- });
106
92
  }
107
93
  }, [topoId, viewState]);
108
94
  useEffect(function () {
@@ -112,7 +98,8 @@ var Topology = function Topology(props) {
112
98
  useEffect(function () {
113
99
  // 拓扑退出注销
114
100
  return function () {
115
- selectionManager.destroy();
101
+ rlog.info('TopoView 退出');
102
+ topo.selectionModel.destroy();
116
103
  topoDispatchers.reset();
117
104
  };
118
105
  }, []);
@@ -140,7 +127,7 @@ var Topology = function Topology(props) {
140
127
  topo.historyManager = new HistoryManager(topo, htHistoryManager);
141
128
  }
142
129
 
143
- selectionManager.init();
130
+ topo.selectionModel.init();
144
131
  topoDispatchers.update({
145
132
  graphLoaded2: true
146
133
  });
@@ -159,7 +146,7 @@ var Topology = function Topology(props) {
159
146
  fixLink(topo);
160
147
  handleClusterNoPermission(topo);
161
148
  updateEdgeExpanded(topo);
162
- selectionManager.init();
149
+ topo.selectionModel.init();
163
150
  topoDispatchers.update({
164
151
  graphLoaded: true
165
152
  });
@@ -171,7 +158,7 @@ var Topology = function Topology(props) {
171
158
  if (onLoad) {
172
159
  onLoad();
173
160
  }
174
- }, [topoData]); // TODO 之后把事件方法都转移出去
161
+ }, [topoData]);
175
162
 
176
163
  var rightEventHandle = function rightEventHandle(event) {
177
164
  rlog.debug('右键事件', event);
@@ -207,16 +194,16 @@ var Topology = function Topology(props) {
207
194
  break;
208
195
 
209
196
  case TopoEvent.EVENT_DATA_PICK:
210
- onBindData(event.data);
197
+ topoEdit.onBindData(event.data);
211
198
  break;
212
199
 
213
200
  case TopoEvent.EVENT_DATA_DELETE:
214
- onDeleteElement(event.data);
201
+ topoEdit.onDeleteElement(event.data);
215
202
  break;
216
203
  // FIXME 保存逻辑优化
217
204
 
218
205
  case TopoEvent.EVENT_SAVE_TOPO:
219
- onSaveTopo(event.data);
206
+ topoEdit.onSaveTopo(event.data);
220
207
  break;
221
208
 
222
209
  case TopoEvent.EVENT_REFRESH:
@@ -224,7 +211,7 @@ var Topology = function Topology(props) {
224
211
  break;
225
212
 
226
213
  case TopoEvent.EVENT_EDIT_EXIT:
227
- onExitEdit(event.data);
214
+ topoEdit.onExitEdit(event.data);
228
215
  break;
229
216
 
230
217
  case TopoEvent.EVENT_CONTEXT_TOOL:
@@ -236,36 +223,17 @@ var Topology = function Topology(props) {
236
223
  }
237
224
  };
238
225
 
239
- var renderPropertyView = function renderPropertyView() {
240
- return isEditMode && /*#__PURE__*/React.createElement(PropertyView, {
241
- topo: topo,
242
- editorProps: editorProps
243
- });
244
- };
245
-
246
- var renderBackgroundView = function renderBackgroundView() {
247
- return isEditMode && /*#__PURE__*/React.createElement(BackgroundView, {
248
- topo: topo,
249
- editorProps: editorProps
250
- });
251
- };
252
-
253
226
  var renderCanvas = function renderCanvas() {
254
227
  var _graphViewProps$creat;
255
228
 
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, {
229
+ return /*#__PURE__*/React.createElement(GraphViewPanel, _extends({
230
+ topo: topo
231
+ }, props), /*#__PURE__*/React.createElement(TopoGraph, _extends({}, graphViewProps, {
262
232
  createHtTopoProps: _extends({}, graphViewProps.createHtTopoProps, {
263
233
  editor: _extends({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {})
264
234
  }),
265
235
  data: tData,
266
236
  defaultEnterEditMode: defaultEnterEditMode,
267
- renderPropertyView: renderPropertyView,
268
- renderBackgroundView: renderBackgroundView,
269
237
  onCreate: onGraphCreated,
270
238
  onLoaded: handleGraphLoaded,
271
239
  onDataLoaded: handleGraphDataLoaded,
@@ -300,21 +268,23 @@ var Topology = function Topology(props) {
300
268
  direction: "row",
301
269
  flex: 1,
302
270
  className: classnames((_classnames = {}, _classnames[editorStyles.borderLine] = isEditMode, _classnames))
303
- }, isEditMode && /*#__PURE__*/React.createElement(Sidebar, {
271
+ }, isEditMode && /*#__PURE__*/React.createElement(Sidebar, _extends({
304
272
  topo: topo,
305
273
  topoEdit: topoEdit,
306
274
  topoContext: {
307
275
  urlParams: urlParams
308
276
  },
309
277
  editorProps: editorProps
310
- }), renderCanvas()), !isEditMode && /*#__PURE__*/React.createElement(ViewerPlugin, {
278
+ }, editorProps === null || editorProps === void 0 ? void 0 : editorProps.sidebarProps)), renderCanvas(), isEditMode && graphLoaded && /*#__PURE__*/React.createElement(PropertyView, {
279
+ topo: topo,
280
+ editorProps: editorProps
281
+ })), !isEditMode && /*#__PURE__*/React.createElement(ViewerPlugin, {
311
282
  topo: topo,
312
283
  viewerProps: viewerProps,
313
284
  topoContext: topoContext
314
285
  }), isEditMode && /*#__PURE__*/React.createElement(EditorPlugin, {
315
286
  topo: topo,
316
287
  topoEdit: topoEdit,
317
- titleBarRef: titleBarRef,
318
288
  topoContext: {
319
289
  urlParams: urlParams
320
290
  },