@riil-frontend/component-topology 9.0.0-a.8 → 9.0.1

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 (115) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.css +1 -1
  3. package/build/index.js +15 -15
  4. package/es/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
  5. package/es/core/components/TopoView/GraphViewPanel.js +17 -4
  6. package/es/core/components/TopoView/TopoView.module.scss +17 -3
  7. package/es/core/editor/components/BackgroundView/index.module.scss +3 -0
  8. package/es/core/editor/components/EditorPlugin.js +4 -1
  9. package/es/core/editor/components/Sidebar/Sidebar.module.scss +7 -7
  10. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
  11. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +1 -0
  12. package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
  13. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
  14. package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
  15. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +20 -5
  16. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
  17. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
  18. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
  19. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
  20. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
  21. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
  22. package/es/core/editor/components/settings/core/getPropertyViewType.js +3 -0
  23. package/es/core/editor/components/settings/core/updateElementProperty.js +6 -1
  24. package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -3
  25. package/es/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +3 -2
  26. package/es/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +95 -0
  27. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +46 -14
  28. package/es/core/editor/config/themes.js +53 -2
  29. package/es/core/editor/utils/edgeTypeStyleUtil.js +38 -0
  30. package/es/core/hooks/useCanvasTheme.js +12 -4
  31. package/es/core/hooks/useResourceConfig.js +2 -1
  32. package/es/core/hooks/useTopoEdit.js +120 -19
  33. package/es/core/hooks/useTopoFullscreen.js +32 -0
  34. package/es/core/models/AttributeMetricDisplay.js +89 -74
  35. package/es/core/models/TopoApp.js +1 -1
  36. package/es/core/models/attributeFormatter/index.js +16 -16
  37. package/es/core/models/topoData.js +16 -9
  38. package/es/core/models/utils/linkUtils.js +52 -27
  39. package/es/core/store/models/topoConfig.js +51 -20
  40. package/es/core/test/Test.js +52 -0
  41. package/es/core/utils/graphLinkUtil.js +11 -6
  42. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +16 -2
  43. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +8 -78
  44. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
  45. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +27 -37
  46. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +57 -1
  47. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +6 -0
  48. package/es/networkTopo/getTopoData.js +2 -1
  49. package/es/networkTopo/models/IpNodeTagsTipsBuilder.js +113 -0
  50. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +8 -8
  51. package/es/networkTopo/models/TopoCenter.js +4 -3
  52. package/es/networkTopo/services/link.js +1 -1
  53. package/es/networkTopo/services/topo/basic.js +27 -26
  54. package/es/networkTopo/services/topo/networkLink.js +45 -3
  55. package/es/networkTopo/utils/exitLinkUtil.js +257 -0
  56. package/es/style.js +1 -0
  57. package/es/utils/ResourceConfigUtil.js +5 -4
  58. package/es/utils/htElementDataUtil.js +1 -7
  59. package/es/utils/htElementUtils.js +21 -21
  60. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
  61. package/lib/core/components/TopoView/GraphViewPanel.js +18 -3
  62. package/lib/core/components/TopoView/TopoView.module.scss +17 -3
  63. package/lib/core/editor/components/BackgroundView/index.module.scss +3 -0
  64. package/lib/core/editor/components/EditorPlugin.js +7 -1
  65. package/lib/core/editor/components/Sidebar/Sidebar.module.scss +7 -7
  66. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
  67. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +1 -0
  68. package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
  69. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
  70. package/lib/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
  71. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +19 -3
  72. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
  73. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
  74. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
  75. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
  76. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
  77. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
  78. package/lib/core/editor/components/settings/core/getPropertyViewType.js +3 -0
  79. package/lib/core/editor/components/settings/core/updateElementProperty.js +6 -1
  80. package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +3 -3
  81. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +3 -1
  82. package/lib/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +111 -0
  83. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +48 -14
  84. package/lib/core/editor/config/themes.js +53 -2
  85. package/lib/core/editor/utils/edgeTypeStyleUtil.js +39 -0
  86. package/lib/core/hooks/useCanvasTheme.js +12 -4
  87. package/lib/core/hooks/useResourceConfig.js +2 -1
  88. package/lib/core/hooks/useTopoEdit.js +121 -18
  89. package/lib/core/hooks/useTopoFullscreen.js +42 -0
  90. package/lib/core/models/AttributeMetricDisplay.js +85 -74
  91. package/lib/core/models/TopoApp.js +1 -1
  92. package/lib/core/models/attributeFormatter/index.js +14 -14
  93. package/lib/core/models/topoData.js +16 -9
  94. package/lib/core/models/utils/linkUtils.js +53 -26
  95. package/lib/core/store/models/topoConfig.js +56 -19
  96. package/lib/core/test/Test.js +52 -0
  97. package/lib/core/utils/graphLinkUtil.js +10 -5
  98. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +15 -1
  99. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +7 -78
  100. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
  101. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +27 -36
  102. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +58 -1
  103. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +6 -0
  104. package/lib/networkTopo/getTopoData.js +2 -1
  105. package/lib/networkTopo/models/IpNodeTagsTipsBuilder.js +123 -0
  106. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +8 -8
  107. package/lib/networkTopo/models/TopoCenter.js +4 -3
  108. package/lib/networkTopo/services/topo/basic.js +28 -28
  109. package/lib/networkTopo/services/topo/networkLink.js +45 -3
  110. package/lib/networkTopo/utils/exitLinkUtil.js +269 -0
  111. package/lib/style.js +1 -0
  112. package/lib/utils/ResourceConfigUtil.js +4 -4
  113. package/lib/utils/htElementDataUtil.js +0 -10
  114. package/lib/utils/htElementUtils.js +21 -21
  115. package/package.json +2 -2
@@ -3,8 +3,8 @@
3
3
 
4
4
  .tabs {
5
5
  height: 100%;
6
-
7
- }
6
+ display: flex;
7
+ }
8
8
 
9
9
  // 导航
10
10
  .nav {
@@ -49,17 +49,23 @@
49
49
 
50
50
  // 标签页内容区
51
51
  .content {
52
- width: 260px;
52
+ // width: 260px;
53
53
  height: 100%;
54
54
  border-left: none !important;
55
- border-right: 1px solid var(--tab-wrapped-border-line-color);
56
55
  transition: width .1s linear;
56
+ overflow: initial !important;
57
57
 
58
58
  :global {
59
59
  .#{$css-prefix}tabs-tabpane {
60
- width: 100%;
60
+ position: absolute;
61
+ left: 0;
62
+ top: 0;
63
+ z-index: 1;
64
+ // width: 250px;
61
65
  height: 100%;
62
66
  overflow: auto;
67
+ background: #FFF;
68
+ border-right: 1px solid var(--tab-wrapped-border-line-color);
63
69
  }
64
70
  }
65
71
 
@@ -1,7 +1,11 @@
1
- import React, { useEffect } from 'react';
1
+ import React, { useEffect, useRef } from 'react';
2
+ import classNames from 'classnames';
2
3
  import useCanvasTheme from "../../hooks/useCanvasTheme";
4
+ import useTopoFullscreen from "../../hooks/useTopoFullscreen";
3
5
  import styles from "./TopoView.module.scss";
4
6
  export default function GraphViewPanel(props) {
7
+ var _classNames;
8
+
5
9
  var topo = props.topo,
6
10
  hideBackgroundColor = props.hideBackgroundColor;
7
11
  var displayConfig = topo.store.useModelState('displayConfig');
@@ -12,8 +16,14 @@ export default function GraphViewPanel(props) {
12
16
  themeName: themeName,
13
17
  hideBackgroundColor: hideBackgroundColor
14
18
  }),
15
- canvasColor = _useCanvasTheme.canvasColor;
19
+ canvasColor = _useCanvasTheme.canvasColor,
20
+ canvasbackgroundImage = _useCanvasTheme.canvasbackgroundImage;
16
21
 
22
+ var panelRef = useRef();
23
+ useTopoFullscreen({
24
+ topo: topo,
25
+ panelRef: panelRef
26
+ });
17
27
  useEffect(function () {
18
28
  // eslint-disable-next-line no-underscore-dangle
19
29
  window._debugtopo = topo; // eslint-disable-next-line no-underscore-dangle
@@ -29,9 +39,12 @@ export default function GraphViewPanel(props) {
29
39
  };
30
40
 
31
41
  return /*#__PURE__*/React.createElement("div", {
32
- className: styles.viewPanel,
33
- style: {
42
+ ref: panelRef,
43
+ className: classNames(styles.viewPanel, (_classNames = {}, _classNames[styles.backgroundImg] = !!canvasbackgroundImage, _classNames)),
44
+ style: canvasColor ? {
34
45
  background: canvasColor
46
+ } : {
47
+ backgroundImage: "url(" + canvasbackgroundImage + ")"
35
48
  },
36
49
  onFocus: onFocus
37
50
  }, props.children);
@@ -10,14 +10,28 @@
10
10
  flex: 1;
11
11
  overflow: hidden;
12
12
  position: relative;
13
+
14
+ &.backgroundImg {
15
+ /* 背景图垂直、水平均居中 */
16
+ background-position: center center;
17
+ /* 背景图不平铺 */
18
+ background-repeat: no-repeat;
19
+ /* 当内容高度大于图片高度时,背景图像的位置相对于viewport固定 */
20
+ background-attachment: fixed;
21
+ /* 让背景图基于容器大小伸缩 */
22
+ background-size: cover;
23
+ /* 设置背景颜色,背景图加载过程中会显示背景色 */
24
+ // background-color: #464646;
25
+ }
13
26
  }
14
27
 
15
28
  // 解决拓扑图容器绝对定位z-index>0时浮层和右键菜单不显示问题
16
29
  :global {
17
- body > .ht-ui-view {
30
+ body>.ht-ui-view {
18
31
  z-index: 10000;
19
32
  }
20
- body > div[ht="ht-view ht.ui.ContextMenu"] {
33
+
34
+ body>div[ht="ht-view ht.ui.ContextMenu"] {
21
35
  z-index: 1000;
22
36
  }
23
- }
37
+ }
@@ -1,8 +1,11 @@
1
1
  @import "~@alifd/next/variables.scss";
2
2
 
3
3
  .background-view {
4
+ width: 260px;
4
5
  padding: 16px;
5
6
  background: #fff;
7
+ height: 100%;
8
+ overflow: auto;
6
9
  .option {
7
10
  text-align: right;
8
11
  button {
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useEffect } from 'react';
3
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
4
  import CustomIconPlugin from "./CustomIconPlugin";
4
5
  import SaveLoading from "./plugins/SaveLoading";
5
6
  import GroupAddResourceDrawerPlugin from "./GroupAddResourceDrawerPlugin";
@@ -17,7 +18,9 @@ export default function TopoEditorPlugin(props) {
17
18
  graphLoaded = _topo$store$useModelS.graphLoaded;
18
19
 
19
20
  useEffect(function () {
21
+ rlog.debug('TopoEditorPlugin 进来了');
20
22
  return function () {
23
+ rlog.debug('TopoEditorPlugin 进来了');
21
24
  topoEdit.reset();
22
25
  };
23
26
  }, []);
@@ -29,7 +32,7 @@ export default function TopoEditorPlugin(props) {
29
32
  var plugins = [CorePlugin, SaveLoading, AddElementThemePlugin, CustomIconPlugin, GroupAddResourceDrawerPlugin, MetricPollingPlugin].concat((editorProps === null || editorProps === void 0 ? void 0 : editorProps.plugins) || []);
30
33
  return /*#__PURE__*/React.createElement(React.Fragment, null, plugins.map(function (Plugin, index) {
31
34
  return /*#__PURE__*/React.createElement(Plugin, _extends({
32
- key: index,
35
+ key: Plugin.pluginName || index,
33
36
  store: store
34
37
  }, props));
35
38
  }));
@@ -1,19 +1,19 @@
1
1
  .sidebar {
2
2
  // border-right: 1px solid #E6E7EB;
3
3
  position: relative;
4
- width: 60px;
4
+ // width: 60px;
5
5
 
6
6
  .tabsContainer {
7
- position: absolute;
8
- width: 60px;
7
+ // position: absolute;
8
+ // left: 0;
9
+ // top: 0;
10
+ // z-index: 1;
11
+ // width: 60px;
9
12
  height: 100%;
10
- left: 0;
11
- top: 0;
12
- z-index: 1;
13
13
  background: #FFF;
14
14
 
15
15
  &.expanded {
16
- width: 320px;
16
+ // width: 320px;
17
17
  }
18
18
  }
19
19
  }
@@ -21,7 +21,7 @@ export default function CanvasPanel(props) {
21
21
  }, /*#__PURE__*/React.createElement(_Tag.Selectable, {
22
22
  className: styles.tag,
23
23
  style: {
24
- background: item.color
24
+ background: item.color || "url(" + item.backgroundImageThumbnail + ")"
25
25
  },
26
26
  checked: item.name === canvasThemeName,
27
27
  onChange: function onChange(checked) {
@@ -1,6 +1,7 @@
1
1
  @import "~@alifd/next/variables.scss";
2
2
 
3
3
  .canvasToggle {
4
+ width: 260px;
4
5
  display: flex;
5
6
  flex-wrap: wrap;
6
7
  .canvas {
@@ -34,7 +34,7 @@ export default function ComponentPanel(props) {
34
34
  return /*#__PURE__*/React.createElement("div", {
35
35
  ref: divRef,
36
36
  style: {
37
- width: '100%',
37
+ width: '260px',
38
38
  height: '100%'
39
39
  }
40
40
  });
@@ -24,7 +24,8 @@ export default function ImagePanel(props) {
24
24
  accordion: true,
25
25
  defaultExpandedKeys: ['资源图片'],
26
26
  style: {
27
- border: 'none'
27
+ border: 'none',
28
+ minWidth: '300px'
28
29
  },
29
30
  fullheight: true,
30
31
  noContentPadding: true
@@ -34,7 +34,7 @@ function LinkPanel(props) {
34
34
  return /*#__PURE__*/React.createElement("div", {
35
35
  ref: divRef,
36
36
  style: {
37
- width: '100%',
37
+ width: '260px',
38
38
  height: '100%'
39
39
  }
40
40
  });
@@ -1,8 +1,9 @@
1
+ import _Checkbox from "@alifd/next/es/checkbox";
1
2
  import _Field from "@alifd/next/es/field";
2
3
  import _Select from "@alifd/next/es/select";
3
4
  import _Form from "@alifd/next/es/form";
4
- import React, { useEffect } from 'react';
5
- import { getEdgesBySelection, loopEdgesAndChildren } from "../../../../utils/edgeTypeStyleUtil";
5
+ import React, { useEffect, useState } from 'react';
6
+ import { getEdgesBySelection, loopEdgesAndChildren, isNodeAllEdges } from "../../../../utils/edgeTypeStyleUtil";
6
7
  import styles from "./EdgeType.module.scss";
7
8
  import LineType from "./LineType";
8
9
  var FormItem = _Form.Item;
@@ -80,6 +81,8 @@ function getValuesByEdges(topo) {
80
81
  var edgeValues = [];
81
82
  edges.forEach(function (edge) {
82
83
  edgeValues.push({
84
+ baseAgreement: false,
85
+ //,
83
86
  lineButton: edge.s('edge.type'),
84
87
  startPoint: getStartPoint(edge),
85
88
  endPoint: getEndPoint(edge),
@@ -90,8 +93,9 @@ function getValuesByEdges(topo) {
90
93
  }
91
94
 
92
95
  var selectionEdges = getEdgesBySelection(topo);
93
- var edgeValues = getEdgesValues(selectionEdges);
96
+ var edgeValues = getEdgesValues(selectionEdges, topo);
94
97
  var values = {
98
+ baseAgreement: false,
95
99
  lineButton: undefined,
96
100
  startPoint: undefined,
97
101
  endPoint: undefined,
@@ -117,6 +121,10 @@ function EdgeType(props) {
117
121
  selection = props.selection,
118
122
  _onChange = props.onChange;
119
123
 
124
+ var _useState = useState(false),
125
+ disable = _useState[0],
126
+ setDisable = _useState[1];
127
+
120
128
  var field = _Field.useField({
121
129
  autoUnmount: false,
122
130
  values: getValuesByEdges(topo),
@@ -131,6 +139,8 @@ function EdgeType(props) {
131
139
 
132
140
  useEffect(function () {
133
141
  field.setValues(getValuesByEdges(topo));
142
+ field.setValue('baseAgreement', topo.getHtTopo().getEdgeMultarc(getEdgesBySelection(topo)));
143
+ setDisable(isNodeAllEdges(topo));
134
144
  }, [selection]);
135
145
  return /*#__PURE__*/React.createElement("div", {
136
146
  className: styles.lineBox
@@ -139,8 +149,13 @@ function EdgeType(props) {
139
149
  inline: true,
140
150
  labelAlign: "top"
141
151
  }, /*#__PURE__*/React.createElement(FormItem, null, /*#__PURE__*/React.createElement(LineType, {
142
- name: "lineButton"
143
- })), /*#__PURE__*/React.createElement(FormItem, {
152
+ name: "lineButton",
153
+ disable: !!field.getValue('baseAgreement')
154
+ })), /*#__PURE__*/React.createElement(FormItem, null, /*#__PURE__*/React.createElement(_Checkbox, {
155
+ name: "baseAgreement",
156
+ onChange: _onChange,
157
+ disabled: disable
158
+ }, "\u81EA\u52A8\u8C03\u6574")), /*#__PURE__*/React.createElement(FormItem, {
144
159
  label: "\u8D77\u70B9"
145
160
  }, /*#__PURE__*/React.createElement(_Select, {
146
161
  name: "startPoint",
@@ -5,7 +5,6 @@
5
5
  background: #FFFFFF;
6
6
  border-radius: 4px;
7
7
  margin-bottom: -7px;
8
-
9
8
  :global {
10
9
  .#{$css-prefix}form-item:first-child{
11
10
  margin-top: 0;
@@ -15,6 +14,11 @@
15
14
  margin-top: 7px;
16
15
  margin-bottom: 7px;
17
16
  }
17
+ .#{$css-prefix}form-item:nth-child(2){
18
+ display: block !important;
19
+ margin-top: 7px;
20
+ margin-bottom: 0px;
21
+ }
18
22
  .#{$css-prefix}form.#{$css-prefix}inline .#{$css-prefix}form-item:not(:last-child) {
19
23
  margin-right: 8px;
20
24
  .#{$css-prefix}select-trigger {
@@ -20,28 +20,47 @@ var LINE_TYPE_OPTIONS = [{
20
20
  value: 'ortho',
21
21
  label: '双折线',
22
22
  icon: 'topo_linear_icon_bilinear'
23
+ }, {
24
+ value: 'ripple',
25
+ label: '单弧线',
26
+ icon: 'topo_linear_icon_arc_line'
23
27
  }, {
24
28
  value: 'doublearc',
25
29
  label: '双弧线',
26
30
  icon: 'topo_linear_icon_arcline'
31
+ }, {
32
+ value: 'points',
33
+ label: '自由线形',
34
+ icon: 'topo_linear_icon_pointsline'
27
35
  }];
28
36
  var LineType = /*#__PURE__*/React.forwardRef(function (props, ref) {
29
37
  var value = props.value,
30
- onChange = props.onChange;
38
+ onChange = props.onChange,
39
+ disable = props.disable;
31
40
 
32
41
  function lineButton(item) {
33
- var _classNames;
42
+ if (disable) {
43
+ return /*#__PURE__*/React.createElement(_Button, {
44
+ className: styles.redioBtnDisable
45
+ }, /*#__PURE__*/React.createElement("img", {
46
+ src: "/img/topo/editor/lineType/" + item.icon + "_disable.svg",
47
+ alt: "",
48
+ className: styles.iconImg
49
+ }));
50
+ } else {
51
+ var _classNames;
34
52
 
35
- return /*#__PURE__*/React.createElement(_Button, {
36
- className: classNames(styles.redioBtn, (_classNames = {}, _classNames[styles.selected] = value === item.value, _classNames)),
37
- onClick: function onClick() {
38
- onChange(item.value);
39
- }
40
- }, /*#__PURE__*/React.createElement("img", {
41
- src: "/img/topo/editor/lineType/" + item.icon + ".svg",
42
- alt: "",
43
- className: styles.iconImg
44
- }));
53
+ return /*#__PURE__*/React.createElement(_Button, {
54
+ className: classNames(styles.redioBtn, (_classNames = {}, _classNames[styles.selected] = value === item.value, _classNames)),
55
+ onClick: function onClick() {
56
+ onChange(item.value);
57
+ }
58
+ }, /*#__PURE__*/React.createElement("img", {
59
+ src: "/img/topo/editor/lineType/" + item.icon + ".svg",
60
+ alt: "",
61
+ className: styles.iconImg
62
+ }));
63
+ }
45
64
  }
46
65
 
47
66
  return /*#__PURE__*/React.createElement("div", {
@@ -1,5 +1,15 @@
1
1
  .lineType{
2
2
  display:flex;
3
+ .redioBtnDisable {
4
+ width: 24px;
5
+ height: 24px;
6
+ border-radius: 4px;
7
+ border: none !important;
8
+ color: #4D6277;
9
+ padding: 0;
10
+ margin-right: 10px;
11
+ text-align: center;
12
+ }
3
13
  .redioBtn {
4
14
  width: 24px;
5
15
  height: 24px;
@@ -7,9 +17,9 @@
7
17
  border: none !important;
8
18
  color: #4D6277;
9
19
  padding: 0;
10
- margin-right: 16px;
20
+ margin-right: 10px;
11
21
  text-align: center;
12
-
22
+
13
23
  .iconImg {
14
24
  vertical-align: middle;
15
25
  }
@@ -49,6 +49,12 @@ function EdgeTypeButton(props) {
49
49
  return;
50
50
  }
51
51
 
52
+ if (name == 'baseAgreement') {
53
+ /** TODO: 自动调整api调用*/
54
+ htTopo.setEdgeMultarc(edges, value);
55
+ return;
56
+ }
57
+
52
58
  setEdgesAndChildren(topo, edges, function (edge) {
53
59
  if (name === 'startPoint') {
54
60
  // 删除设置
@@ -15,7 +15,7 @@ function FontSizeSelect(props) {
15
15
  style: {
16
16
  width: 18
17
17
  }
18
- }, val || 12);
18
+ }, val || 20);
19
19
  },
20
20
  disabled: disabled,
21
21
  onSelect: function onSelect(val) {
@@ -15,7 +15,7 @@ export function getTextStyle(element) {
15
15
  color: parseColor(element.s('group.title.color')),
16
16
  underline: underline
17
17
  }, fontStyleUtil.toMap(element.s('group.title.font')), {
18
- fontSize: font.fontSize || 12,
18
+ fontSize: font.fontSize || (isClusterHtElement(element) ? 20 : 24),
19
19
  fontFamily: font.fontFamily || '微软雅黑'
20
20
  }, parseBackground(element.s('group.title.background')));
21
21
  }
@@ -8,6 +8,9 @@ function getPropertyViewType(selection) {
8
8
  if (!selectionSize) {
9
9
  // 未选
10
10
  viewType = 'view';
11
+ } else if ((selectionElement === null || selectionElement === void 0 ? void 0 : selectionElement.getLayer()) === 'backgroundImage') {
12
+ // 背景图
13
+ viewType = 'view';
11
14
  } else if (selectionSize >= 2) {
12
15
  // 多选
13
16
  viewType = 'multiple';
@@ -1,6 +1,11 @@
1
1
  export default function updateElementProperty(topo, name, value) {
2
2
  // const element = topo.getDataModel().getDataById(selection[0].id);
3
- var element = topo.getSelectionModel().getFirstData(); // console.info("updateElementProperty",topo.getSelectionModel().getSelection(), { selection, element, name, value });
3
+ var element = topo.getSelectionModel().getFirstData();
4
+ console.info("updateElementProperty", topo.getSelectionModel().getSelection(), {
5
+ element: element,
6
+ name: name,
7
+ value: value
8
+ });
4
9
 
5
10
  if (name.startsWith('attrObject.')) {
6
11
  element.setAttr(name.replace('attrObject.', ''), value);
@@ -1,8 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import { iconFactory } from "@riil-frontend/component-topology-graph";
3
3
  import sortBy from "lodash/sortBy";
4
- import { getGroupChildrenResourceElements } from "../../../../../../../../utils/htElementDataUtil";
5
- import { getNodeData } from "../../../../../../../../utils/htElementUtils";
4
+ import { getGroupChildren, getNodeData } from "../../../../../../../../utils/htElementUtils";
6
5
 
7
6
  function sortResourcesByName(resources) {
8
7
  return sortBy(resources, "name");
@@ -19,7 +18,9 @@ export default function useGroupRelateResource(props) {
19
18
  } : _props$useGroupSortRe; // const [resources, setResources] = useState([]);
20
19
  // 过滤出资源
21
20
 
22
- var resourceNodes = getGroupChildrenResourceElements(group); // 资源按名称排序
21
+ var resourceNodes = getGroupChildren(group).filter(function (item) {
22
+ return !!item.getTag();
23
+ }); // 资源按名称排序
23
24
 
24
25
  var useSortNodes = useGroupSortResources || ((_topo$options$editor = topo.options.editor) === null || _topo$options$editor === void 0 ? void 0 : _topo$options$editor.sortResources) || sortResourcesByName;
25
26
  var data = useSortNodes(resourceNodes.map(function (node) {
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import { iconFactory } from '@riil-frontend/component-topology-graph';
3
3
  import ResourceList from "../../../common/GroupNodeList/ResourceList";
4
- import { getLayerChildrenResourceElements } from "../../../../../../../utils/htElementDataUtil";
4
+ import { getLayerChildren } from "../../../../../../../utils/htElementUtils";
5
+ import { isResourceElement } from "../../../../../../../utils/htElementDataUtil";
5
6
  /**
6
7
  * 分层关联资源列表
7
8
  */
@@ -9,7 +10,7 @@ import { getLayerChildrenResourceElements } from "../../../../../../../utils/htE
9
10
  export default function LayerResourceList(props) {
10
11
  var topo = props.topo,
11
12
  layer = props.layer;
12
- var relateDataNodes = getLayerChildrenResourceElements(layer);
13
+ var relateDataNodes = getLayerChildren(layer).filter(isResourceElement);
13
14
  var data = relateDataNodes.map(function (node) {
14
15
  return {
15
16
  title: node.a('name'),
@@ -0,0 +1,95 @@
1
+ import _Button from "@alifd/next/es/button";
2
+ import _Input from "@alifd/next/es/input";
3
+ import _Form from "@alifd/next/es/form";
4
+ import React, { useState, useEffect } from "react";
5
+ import { isUniqueIp } from "../../../../../../../networkTopo/utils/exitLinkUtil";
6
+ var FormItem = _Form.Item;
7
+ /**
8
+ * @return {React.ReactNode | null}
9
+ */
10
+
11
+ export default function BindIpInput(props) {
12
+ var _values$attrObjectBi;
13
+
14
+ var nodeElement = props.nodeElement,
15
+ topo = props.topo,
16
+ topoEditApi = props.topoEditApi,
17
+ values = props.values,
18
+ onChange = props.onChange,
19
+ fieldItem = props.fieldItem; // const currentResId = node.tag;
20
+ // console.log(
21
+ // "nodeElement, topo, topoEditApi, node",
22
+ // nodeElement,
23
+ // topo,
24
+ // topoEditApi,
25
+ // values
26
+ // );
27
+
28
+ var _useState = useState(""),
29
+ error = _useState[0],
30
+ setError = _useState[1];
31
+
32
+ var _useState2 = useState((_values$attrObjectBi = values["attrObject.bindIp"]) !== null && _values$attrObjectBi !== void 0 ? _values$attrObjectBi : ""),
33
+ txtValue = _useState2[0],
34
+ setTxtValue = _useState2[1];
35
+
36
+ var saveIp = function saveIp(v) {
37
+ fieldItem.validate(function (errors, vals) {
38
+ if (errors) {
39
+ console.error("saveIp-error", errors, vals);
40
+ } else {
41
+ setError("");
42
+ onChange(txtValue);
43
+ topoEditApi.relateNodeIp(txtValue, nodeElement);
44
+ }
45
+ });
46
+ };
47
+
48
+ useEffect(function () {
49
+ fieldItem.reset();
50
+ setTxtValue(values["attrObject.bindIp"]);
51
+ }, [values]);
52
+
53
+ var inputChange = function inputChange(v) {
54
+ setTxtValue(v); // onChange(v);
55
+ }; // 图片节点验证ip唯一性
56
+
57
+
58
+ var checkIp = function checkIp(rule, value, callback) {
59
+ var dm = topo.getDataModel();
60
+ var isUnique = isUniqueIp(dm, value, nodeElement); // console.log("checkIp", isUnique);
61
+
62
+ if (!isUnique) {
63
+ return callback("ip不能重复");
64
+ } else {
65
+ return callback();
66
+ }
67
+ };
68
+
69
+ return /*#__PURE__*/React.createElement("div", {
70
+ style: {
71
+ display: "flex"
72
+ }
73
+ }, /*#__PURE__*/React.createElement(FormItem, {
74
+ label: "\u5173\u8054IP",
75
+ pattern: /^((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))$/,
76
+ patternTrigger: "onBlur",
77
+ patternMessage: "IP\u5730\u5740\u683C\u5F0F\u4E0D\u6B63\u786E",
78
+ validator: checkIp
79
+ }, /*#__PURE__*/React.createElement(_Input, {
80
+ placeholder: "\u8BF7\u8F93\u5165Ip\u5730\u5740",
81
+ name: "attrObject.bindIp",
82
+ state: error,
83
+ value: txtValue,
84
+ maxLength: 128,
85
+ onChange: inputChange
86
+ })), /*#__PURE__*/React.createElement(_Button, {
87
+ type: "primary",
88
+ text: true,
89
+ onClick: saveIp,
90
+ style: {
91
+ marginLeft: 10,
92
+ marginTop: 27
93
+ }
94
+ }, "\u4FDD\u5B58"));
95
+ }