@riil-frontend/component-topology 3.5.0-a.9 → 3.5.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 (106) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.css +1 -1
  3. package/build/index.js +12 -12
  4. package/es/components/index.module.scss +3 -114
  5. package/es/core/components/AlarmListPanel/index.js +7 -12
  6. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +8 -5
  7. package/es/core/components/DisplaySettingDrawer/NodeTag.js +10 -5
  8. package/es/core/components/DisplaySettingDrawer/NodeTip.js +10 -5
  9. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +3 -21
  10. package/es/core/components/TopoView/topoView.js +1 -0
  11. package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -140
  12. package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +1 -1
  13. package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +1 -1
  14. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +18 -17
  15. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +62 -18
  16. package/es/core/models/Alarm.js +206 -120
  17. package/es/core/models/DataModel.js +15 -1
  18. package/es/core/models/TopoApp.js +4 -6
  19. package/es/core/models/cache/CiTyeCache.js +4 -0
  20. package/es/core/models/utils/linkUtils.js +87 -42
  21. package/es/core/services/index.js +28 -0
  22. package/es/core/utils/saveSerialize.js +34 -0
  23. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +0 -37
  24. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +31 -28
  25. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +44 -43
  26. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +39 -26
  27. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useCiData.js +0 -0
  28. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +143 -0
  29. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +37 -0
  30. package/es/core/viewer/components/titlebar/BasicTools.js +11 -1
  31. package/es/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +21 -13
  32. package/es/hooks/useGraphAlarmDisplay.js +3 -4
  33. package/es/hooks/useManageStatus.js +1 -1
  34. package/es/hooks/useTopoEdit.js +200 -144
  35. package/es/hooks/useTopoEventListener.js +13 -6
  36. package/es/index.js +3 -2
  37. package/es/models/topoConfig.js +0 -1
  38. package/es/models/topoMod.js +15 -10
  39. package/es/topoCenter/components/Topo404.js +3 -1
  40. package/es/topoCenter/components/TopoNoPermission.js +3 -1
  41. package/es/topoCenter/components/TopoView.js +77 -32
  42. package/es/topoCenter/components/Topology.js +2 -0
  43. package/es/topoCenter/components/editor/propertyViews/edge/EdgePropertyView.js +10 -0
  44. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +5 -20
  45. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +12 -6
  46. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +84 -43
  47. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +60 -34
  48. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +9 -0
  49. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/server.js +62 -19
  50. package/es/topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +157 -0
  51. package/es/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +1 -2
  52. package/es/topoCenter/hooks/editor/useDeleteEdges.js +2 -3
  53. package/es/topoCenter/utils/resourcePermissionUtil.js +18 -12
  54. package/es/utils/topoData.js +15 -13
  55. package/lib/components/index.module.scss +3 -114
  56. package/lib/core/components/AlarmListPanel/index.js +7 -12
  57. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +9 -5
  58. package/lib/core/components/DisplaySettingDrawer/NodeTag.js +11 -5
  59. package/lib/core/components/DisplaySettingDrawer/NodeTip.js +12 -5
  60. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +3 -21
  61. package/lib/core/components/TopoView/topoView.js +1 -0
  62. package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -151
  63. package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +2 -2
  64. package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +1 -1
  65. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -16
  66. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +66 -20
  67. package/lib/core/models/Alarm.js +206 -121
  68. package/lib/core/models/DataModel.js +15 -1
  69. package/lib/core/models/TopoApp.js +4 -6
  70. package/lib/core/models/cache/CiTyeCache.js +4 -0
  71. package/lib/core/models/utils/linkUtils.js +92 -43
  72. package/lib/core/services/index.js +29 -0
  73. package/lib/core/utils/saveSerialize.js +43 -0
  74. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +0 -37
  75. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +29 -26
  76. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +45 -43
  77. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +38 -24
  78. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useCiData.js +1 -0
  79. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +155 -0
  80. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +47 -0
  81. package/lib/core/viewer/components/titlebar/BasicTools.js +11 -1
  82. package/lib/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +22 -15
  83. package/lib/hooks/useGraphAlarmDisplay.js +3 -5
  84. package/lib/hooks/useManageStatus.js +1 -1
  85. package/lib/hooks/useTopoEdit.js +197 -141
  86. package/lib/hooks/useTopoEventListener.js +13 -6
  87. package/lib/index.js +5 -0
  88. package/lib/models/topoConfig.js +0 -1
  89. package/lib/models/topoMod.js +15 -10
  90. package/lib/topoCenter/components/Topo404.js +4 -1
  91. package/lib/topoCenter/components/TopoNoPermission.js +4 -1
  92. package/lib/topoCenter/components/TopoView.js +78 -33
  93. package/lib/topoCenter/components/Topology.js +3 -0
  94. package/lib/topoCenter/components/editor/propertyViews/edge/EdgePropertyView.js +22 -0
  95. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +5 -21
  96. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +13 -8
  97. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +87 -42
  98. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +61 -37
  99. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +9 -0
  100. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/server.js +62 -18
  101. package/lib/topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +183 -0
  102. package/lib/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +1 -2
  103. package/lib/topoCenter/hooks/editor/useDeleteEdges.js +2 -3
  104. package/lib/topoCenter/utils/resourcePermissionUtil.js +20 -12
  105. package/lib/utils/topoData.js +15 -13
  106. package/package.json +5 -5
@@ -27,117 +27,6 @@
27
27
  }
28
28
  }
29
29
 
30
- .layout-aside-loading {
31
- height: 100%;
32
-
33
- :global {
34
- .#{$css-prefix}loading-wrap {
35
- height: 100%;
36
- }
37
- }
38
-
39
- .layout-aside {
40
- // padding: 12px;
41
- height: 100%;
42
- position: relative;
43
-
44
- background: #ffffff;
45
- box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.08);
46
- border-radius: 4px;
47
- border: 1px solid #dcdee3;
48
- padding: 12px;
49
- background: $color-white;
50
- box-shadow: $shadow-1;
51
-
52
- overflow: auto;
53
- border-radius: 4px;
54
-
55
- .tree-tool {
56
- width: 100%;
57
- padding-bottom: 12px;
58
- display: flex;
59
- justify-content: space-between;
60
-
61
- .tree-tool-search {
62
- flex: 1;
63
-
64
- :global {
65
- .#{$css-prefix}select-trigger {
66
- min-width: 70px;
67
- }
68
-
69
- .#{$css-prefix}select {
70
- margin-right: 4px;
71
-
72
- .#{$css-prefix}input.#{$css-prefix}medium {
73
- // width: 100%;
74
- }
75
-
76
- .#{$css-prefix}select-inner {
77
- min-width: 70px !important;
78
- }
79
- }
80
- }
81
- }
82
-
83
- .tree-tool-container {
84
- margin-left: 4px;
85
- }
86
-
87
- .tree-tool-btn {
88
- margin-left: 8px;
89
- height: 28px;
90
- width: 28px;
91
- padding-left: 5px;
92
- text-align: right;
93
- }
94
- }
95
-
96
- .tree {
97
- // height: 100%; // min-width: 208px;
98
- width: 100%;
99
-
100
- :global {
101
- ul {
102
- li {
103
- :global {
104
- .#{$css-prefix}tree-node-inner {
105
- height: 28px;
106
-
107
- .#{$css-prefix}tree-node-label-wrapper {
108
- .#{$css-prefix}tree-node-label {
109
- width: 100%;
110
-
111
- .tree-node-label {
112
- width: 100%;
113
- overflow: hidden;
114
- text-overflow: ellipsis;
115
- white-space: nowrap;
116
-
117
- span:nth-child(3) {
118
- width: 20px;
119
- }
120
- }
121
- }
122
- }
123
- }
124
-
125
- .#{$css-prefix}node-block .#{$css-prefix}tree-node-inner {
126
-
127
- .#{$css-prefix}disabled,
128
- .#{$css-prefix}disabled:hover {
129
- -webkit-text-fill-color: $color-text1-4;
130
- cursor: not-allowed;
131
- }
132
- }
133
- }
134
- }
135
- }
136
- }
137
- }
138
-
139
- .empty {
140
- padding-top: 50%;
141
- }
142
- }
143
- }
30
+ .empty {
31
+ background: transparent;
32
+ }
@@ -9,22 +9,17 @@ import rlog from "@riil-frontend/component-topology-utils/es/rlog";
9
9
 
10
10
  function AlarmListPanel(props, ref) {
11
11
  // 传入参数
12
- var topo = props.topo;
12
+ var topo = props.topo,
13
+ alarmData = props.alarmData,
14
+ onClose = props.onClose;
13
15
 
14
16
  var _useState = useState([]),
15
17
  alarmList = _useState[0],
16
- setAlarmList = _useState[1];
18
+ setAlarmList = _useState[1]; //const { alarmData } = alarmState;
19
+ // const onClose = () => {/* */
20
+ // topo.alarm.switchAlarmPopPanel(false);
21
+ // };
17
22
 
18
- var _topo$store$useModel = topo.store.useModel("topoAlarm"),
19
- alarmState = _topo$store$useModel[0],
20
- alarmDispatchers = _topo$store$useModel[1];
21
-
22
- var alarmData = alarmState.alarmData;
23
-
24
- var onClose = function onClose() {
25
- // console.log("AlarmListPanel-onClose", alarm);
26
- topo.alarm.switchAlarmPopPanel(false);
27
- };
28
23
 
29
24
  useEffect(function () {
30
25
  if (alarmData) {
@@ -1,5 +1,6 @@
1
1
  import _Box from "@alifd/next/es/box";
2
2
  import _Form from "@alifd/next/es/form";
3
+ import _extends from "@babel/runtime/helpers/extends";
3
4
  import _Field from "@alifd/next/es/field";
4
5
  import React, { useEffect, useImperativeHandle, useState } from 'react';
5
6
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
@@ -25,7 +26,9 @@ function DisplaySetting(props, ref) {
25
26
  linkTipConfig = _ref.linkTipConfig,
26
27
  showEdgeExpandConfig = _ref.showEdgeExpandConfig,
27
28
  extraConfig = _ref.extraConfig,
28
- showLinkConfig = _ref.showLinkConfig;
29
+ showLinkConfig = _ref.showLinkConfig,
30
+ nodeTagProps = _ref.nodeTagProps,
31
+ nodeTipProps = _ref.nodeTipProps;
29
32
 
30
33
  var field = _Field.useField({
31
34
  autoUnmount: false,
@@ -54,10 +57,10 @@ function DisplaySetting(props, ref) {
54
57
  label: "\u8D44\u6E90\u6807\u6CE8",
55
58
  helpText: "\u6700\u591A\u652F\u6301\u52FE\u90093\u9879"
56
59
  })
57
- }, /*#__PURE__*/React.createElement(NodeTag, {
60
+ }, /*#__PURE__*/React.createElement(NodeTag, _extends({}, nodeTagProps, {
58
61
  name: "nodeTag",
59
62
  topo: topo
60
- })), linkTagConfig && /*#__PURE__*/React.createElement(_Form.Item, {
63
+ }))), linkTagConfig && /*#__PURE__*/React.createElement(_Form.Item, {
61
64
  label: /*#__PURE__*/React.createElement(Label, {
62
65
  label: "\u94FE\u8DEF\u6807\u6CE8",
63
66
  helpText: "\u6700\u591A\u652F\u6301\u52FE\u90092\u9879"
@@ -72,10 +75,10 @@ function DisplaySetting(props, ref) {
72
75
  helpText: "\u6700\u591A\u652F\u6301\u52FE\u90094\u9879"
73
76
  }),
74
77
  patternTrigger: "onChange"
75
- }, /*#__PURE__*/React.createElement(NodeTip, {
78
+ }, /*#__PURE__*/React.createElement(NodeTip, _extends({}, nodeTipProps, {
76
79
  name: "nodeTip",
77
80
  topo: topo
78
- })), linkTipConfig && /*#__PURE__*/React.createElement(_Form.Item, {
81
+ }))), linkTipConfig && /*#__PURE__*/React.createElement(_Form.Item, {
79
82
  label: /*#__PURE__*/React.createElement(Label, {
80
83
  label: "\u94FE\u8DEF\u60AC\u6D6E\u6846",
81
84
  helpText: "\u6700\u591A\u652F\u6301\u52FE\u90094\u9879"
@@ -1,16 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import PropTypes from 'prop-types';
3
4
  import { DEFAULT_NODE_TAG_COMMON_CONFIG } from "../../../constants/ResourceInfoDisplay";
4
5
  import BasicConfig from "./ResourceDisplay/BasicConfig";
5
- var CommonOptions = [{
6
+ var defaultCommonOptions = [{
6
7
  value: 'graph:name',
7
8
  label: '图片名称'
8
9
  }, {
9
10
  value: 'attribute:display_name',
10
11
  label: '显示名称'
11
- }, {
12
- value: 'attribute:ipv4_address',
13
- label: 'IP地址'
14
12
  }];
15
13
  /**
16
14
  * 资源标注配置
@@ -19,17 +17,24 @@ var CommonOptions = [{
19
17
  */
20
18
 
21
19
  function NodeTag(props, ref) {
20
+ var commonOptions = props.commonOptions;
22
21
  return /*#__PURE__*/React.createElement(BasicConfig, _extends({
23
22
  ref: ref
24
23
  }, props, {
25
24
  limit: 3,
26
25
  elementType: "node",
27
26
  showType: "tag",
28
- commonOptions: CommonOptions,
27
+ commonOptions: commonOptions || defaultCommonOptions,
29
28
  defaultCommonConfig: DEFAULT_NODE_TAG_COMMON_CONFIG,
30
29
  type: "node"
31
30
  }));
32
31
  }
33
32
 
34
33
  ;
34
+ NodeTag.propTypes = {
35
+ commonOptions: PropTypes.array
36
+ };
37
+ NodeTag.defaultProps = {
38
+ commonOptions: defaultCommonOptions
39
+ };
35
40
  export default /*#__PURE__*/React.forwardRef(NodeTag);
@@ -1,11 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import PropTypes from 'prop-types';
3
4
  import { DEFAULT_TIP_COMMON_CONFIG } from "../../../constants/ResourceInfoDisplay";
4
5
  import BasicConfig from "./ResourceDisplay/BasicConfig";
5
- var CommonOptions = [{
6
- value: 'attribute:ipv4_address',
7
- label: 'IP地址'
8
- }, {
6
+ var defaultCommonOptions = [{
9
7
  value: 'attribute:display_name',
10
8
  label: '显示名称'
11
9
  }, {
@@ -19,15 +17,22 @@ var CommonOptions = [{
19
17
  */
20
18
 
21
19
  function NodeTip(props, ref) {
20
+ var commonOptions = props.commonOptions;
22
21
  return /*#__PURE__*/React.createElement(BasicConfig, _extends({
23
22
  ref: ref
24
23
  }, props, {
25
24
  limit: 4,
26
25
  elementType: "node",
27
26
  showType: "tip",
28
- commonOptions: CommonOptions,
27
+ commonOptions: commonOptions || defaultCommonOptions,
29
28
  defaultCommonConfig: DEFAULT_TIP_COMMON_CONFIG
30
29
  }));
31
30
  }
32
31
 
32
+ NodeTip.propTypes = {
33
+ commonOptions: PropTypes.array
34
+ };
35
+ NodeTip.defaultProps = {
36
+ commonOptions: defaultCommonOptions
37
+ };
33
38
  export default /*#__PURE__*/React.forwardRef(NodeTip);
@@ -9,32 +9,14 @@ export default (function (props) {
9
9
 
10
10
  var executeByConfig = /*#__PURE__*/function () {
11
11
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(config) {
12
- var edgeFlowConfig;
13
12
  return _regeneratorRuntime.wrap(function _callee$(_context) {
14
13
  while (1) {
15
14
  switch (_context.prev = _context.next) {
16
15
  case 0:
17
16
  // 更新节点名称显示隐藏
18
- topo.attributeMetricDisplay.updateNodesNameVisible(); // 更新连线展开折叠状态
17
+ topo.attributeMetricDisplay.updateNodesNameVisible();
19
18
 
20
- if (displaySettingProps !== null && displaySettingProps !== void 0 && displaySettingProps.showLinkConfig) {
21
- if (config.expandAllEdges) {
22
- topo.getHtTopo().expandAllEdgeGroups();
23
- } else {
24
- topo.getHtTopo().collapseAllEdgeGroups();
25
- } // 更新连线流动效果
26
-
27
-
28
- edgeFlowConfig = config.edgeFlow ? {
29
- type: config.edgeFlow,
30
- // 必填,支持传送带drip、光点point、箭头arrow
31
- direction: config.edgeFlowDirection || 'from' // 流动方向,可为空,默认源到目的
32
-
33
- } : null;
34
- topo.getHtTopo().setGlobalEdgeFlow(edgeFlowConfig);
35
- }
36
-
37
- case 2:
19
+ case 1:
38
20
  case "end":
39
21
  return _context.stop();
40
22
  }
@@ -74,7 +56,7 @@ export default (function (props) {
74
56
  extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
75
57
 
76
58
  if (extraOnOk) {
77
- extraOnOk();
59
+ extraOnOk(displayConfig);
78
60
  }
79
61
 
80
62
  case 11:
@@ -172,6 +172,7 @@ var Topology = function Topology(props) {
172
172
  case TopoEvent.EVENT_DATA_DELETE:
173
173
  onDeleteElement(event.data);
174
174
  break;
175
+ // FIXME 保存逻辑优化
175
176
 
176
177
  case TopoEvent.EVENT_SAVE_TOPO:
177
178
  onSaveTopo(event.data);
@@ -1,16 +1,13 @@
1
- import _Select from "@alifd/next/es/select";
2
1
  import _Form from "@alifd/next/es/form";
3
2
  import _NumberPicker from "@alifd/next/es/number-picker";
4
3
  import _Field from "@alifd/next/es/field";
5
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
6
4
  import _extends from "@babel/runtime/helpers/extends";
7
5
  import _Collapse from "@alifd/next/es/collapse";
8
- import _regeneratorRuntime from "@babel/runtime/regenerator";
9
- import React, { useState, useEffect } from "react";
10
- import ColorPicker from "../../../../../../common/components/ColorPicker";
11
- import LineType from "../../common/LineType";
12
- import service from "../../../../../../topoCenter/services/link";
13
6
  import rlog from "@riil-frontend/component-topology-utils/es/rlog";
7
+ import React, { useEffect, useState } from "react";
8
+ import ColorPicker from "../../../../../../common/components/ColorPicker";
9
+ import BindExitLinkSelect from "../../../../../../topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect"; // import LineType from "../../common/LineType";
10
+
14
11
  var CollapsePanel = _Collapse.Panel;
15
12
 
16
13
  function parseValues(values, edge) {
@@ -25,56 +22,10 @@ export default function CommonEdgePropertyView(props) {
25
22
  edge = props.edge,
26
23
  values = props.values,
27
24
  _onChange = props.onChange,
28
- editorProps = props.editorProps;
25
+ editorProps = props.editorProps,
26
+ extraDisplaySetting = props.extraDisplaySetting;
29
27
  var store = topo.store;
30
28
 
31
- var _store$useModel = store.useModel("topoConfig"),
32
- editState = _store$useModel[0],
33
- editDispatchers = _store$useModel[1]; // 可关联出口链路
34
-
35
-
36
- var _useState = useState([]),
37
- associatedlinks = _useState[0],
38
- setAssociatedlinks = _useState[1]; // const [isLine, setIsLine] = useState(false);
39
-
40
-
41
- var getLinkByNodes = /*#__PURE__*/function () {
42
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
43
- var result, hasLinkIds, axlink;
44
- return _regeneratorRuntime.wrap(function _callee$(_context) {
45
- while (1) {
46
- switch (_context.prev = _context.next) {
47
- case 0:
48
- _context.next = 2;
49
- return service.queryAssociatedlinks(id);
50
-
51
- case 2:
52
- result = _context.sent;
53
- hasLinkIds = topo.getLines().map(function (line) {
54
- return line.id;
55
- });
56
- axlink = [];
57
- result.data.map(function (exLink) {
58
- if (hasLinkIds.indexOf(exLink.id) < 0) {
59
- axlink.push(exLink);
60
- }
61
- });
62
- rlog.debug("出口链路列表", result.data, axlink);
63
- setAssociatedlinks(axlink);
64
-
65
- case 8:
66
- case "end":
67
- return _context.stop();
68
- }
69
- }
70
- }, _callee);
71
- }));
72
-
73
- return function getLinkByNodes(_x) {
74
- return _ref.apply(this, arguments);
75
- };
76
- }();
77
-
78
29
  var field = _Field.useField({
79
30
  autoUnmount: false,
80
31
  values: parseValues(values, edge),
@@ -86,11 +37,6 @@ export default function CommonEdgePropertyView(props) {
86
37
  }
87
38
  });
88
39
 
89
- useEffect(function () {
90
- console.log("CommonEdgePropertyView-edge", edge, edge.getSource().getTag(), edge.getTarget());
91
- var ids = [edge.getSource().getTag(), edge.getTarget().getTag()];
92
- getLinkByNodes(ids);
93
- }, [edge]);
94
40
  useEffect(function () {
95
41
  field.setValues(parseValues(values, edge));
96
42
  }, [values]);
@@ -103,67 +49,6 @@ export default function CommonEdgePropertyView(props) {
103
49
  }));
104
50
  };
105
51
 
106
- var bindExitLink = /*#__PURE__*/function () {
107
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value) {
108
- var data, exitLink, aobj, config, exconfig, exportLinkIdList, _yield$editDispatcher, elements;
109
-
110
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
111
- while (1) {
112
- switch (_context2.prev = _context2.next) {
113
- case 0:
114
- data = associatedlinks.find(function (link) {
115
- return link.id === value;
116
- });
117
- rlog.debug("bindExitLink--- v, edge", data, edge);
118
- exitLink = {
119
- attributes: [],
120
- ciType: "network_link",
121
- dtype: "link",
122
- id: data.id,
123
- interfaceSource: data["network_link.source_device_id"],
124
- interfaceTarget: data["network_link.destination_device_id"],
125
- metrics: [],
126
- name: data.name,
127
- "network_link.connect_type": "exit",
128
- "network_link.destination_ipv4": data["network_link.destination_ipv4"],
129
- operation: "delete",
130
- connect_type: "exit",
131
- source: data.source_id,
132
- target: data.destination_id,
133
- type: "link"
134
- };
135
- aobj = edge.getAttrObject();
136
- edge.setAttrObject(_extends({}, aobj, exitLink));
137
- edge.setTag(data.id);
138
- config = topo.resourceConfig.getConfigFromHt();
139
- rlog.debug("getConfigFromHt", config, topo.resourceConfig);
140
- exconfig = _extends({}, config);
141
- exportLinkIdList = config.exportLinkIdList;
142
- exportLinkIdList.push(data.id);
143
- topo.resourceConfig.updateConfig(_extends({}, config, {
144
- exportLinkIdList: exportLinkIdList
145
- }));
146
- _context2.next = 14;
147
- return editDispatchers.fetchDataByConfig();
148
-
149
- case 14:
150
- _yield$editDispatcher = _context2.sent;
151
- elements = _yield$editDispatcher.elements;
152
- rlog.debug("fetchDataByConfig", elements);
153
-
154
- case 17:
155
- case "end":
156
- return _context2.stop();
157
- }
158
- }
159
- }, _callee2);
160
- }));
161
-
162
- return function bindExitLink(_x2) {
163
- return _ref2.apply(this, arguments);
164
- };
165
- }();
166
-
167
52
  return /*#__PURE__*/React.createElement(_Form, {
168
53
  field: field,
169
54
  labelAlign: "top"
@@ -215,23 +100,5 @@ export default function CommonEdgePropertyView(props) {
215
100
  value: values["styleMap.edge.color"],
216
101
  align: "br",
217
102
  onChange: setLineColor
218
- })))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Form.Item, {
219
- label: "\u5173\u8054\u51FA\u53E3\u94FE\u8DEF",
220
- style: {
221
- marginBottom: 0
222
- }
223
- }, /*#__PURE__*/React.createElement(_Select, {
224
- style: {
225
- width: 232
226
- },
227
- disabled: associatedlinks.length < 1,
228
- onChange: function onChange(v) {
229
- bindExitLink(v);
230
- }
231
- }, associatedlinks.map(function (item, index) {
232
- return /*#__PURE__*/React.createElement(_Select.Option, {
233
- value: item.id,
234
- key: index
235
- }, item.attributes.display_name);
236
- }))))))));
103
+ })))), extraDisplaySetting))));
237
104
  }
@@ -11,7 +11,7 @@ var commonViews = {
11
11
  * @return {React.ReactNode || null}
12
12
  */
13
13
 
14
- export default function EdgePropertyViewMatch(props) {
14
+ export default function EdgePropertyViewRoute(props) {
15
15
  var topo = props.topo,
16
16
  values = props.values,
17
17
  editorProps = props.editorProps;
@@ -50,7 +50,7 @@ export default function Setting(props) {
50
50
  key: "\u663E\u793A\u8BBE\u7F6E",
51
51
  title: "\u663E\u793A\u8BBE\u7F6E"
52
52
  }, /*#__PURE__*/React.createElement(_Form.Item, {
53
- label: "\u56FE\u7247\u540D\u79F01"
53
+ label: "\u56FE\u7247\u540D\u79F0"
54
54
  }, /*#__PURE__*/React.createElement(_Input, {
55
55
  name: "attrObject.customName"
56
56
  })), showImageSetting && /*#__PURE__*/React.createElement(_Form.Item, {
@@ -3,7 +3,7 @@ import _Field from "@alifd/next/es/field";
3
3
  import _extends from "@babel/runtime/helpers/extends";
4
4
  import _Collapse from "@alifd/next/es/collapse";
5
5
  import _Select from "@alifd/next/es/select";
6
- import React, { useEffect } from 'react';
6
+ import React, { useEffect } from "react";
7
7
  import useHtElement from "../../../../../../common/hooks/useHtElement";
8
8
  import textStyles from "../../../../../../common/text.module.scss";
9
9
  import NodeRelateResourceButton from "./NodeRelateResourceButton";
@@ -12,22 +12,22 @@ var CollapsePanel = _Collapse.Panel;
12
12
 
13
13
  function parseValues(values) {
14
14
  return _extends({}, values, {
15
- 'attrObject.customName': values['attrObject.customName'] || values['attrObject.name'],
16
- 'attrObject.bindTopo': values['attrObject.bindTopo'] || '' // 解决切换节点时关联拓扑选项未重置
15
+ "attrObject.customName": values["attrObject.customName"] || values["attrObject.name"],
16
+ "attrObject.bindTopo": values["attrObject.bindTopo"] || "" // 解决切换节点时关联拓扑选项未重置
17
17
 
18
18
  });
19
19
  }
20
20
 
21
21
  function getBindType(values) {
22
22
  if (values.tag) {
23
- return 'resource';
23
+ return "resource";
24
24
  }
25
25
 
26
26
  if (values.attrObject.bindType) {
27
27
  return values.attrObject.bindType;
28
28
  }
29
29
 
30
- return 'none';
30
+ return "none";
31
31
  }
32
32
 
33
33
  export default function Data(props) {
@@ -57,23 +57,24 @@ export default function Data(props) {
57
57
  }, [values]);
58
58
 
59
59
  var setBindType = function setBindType(newBindType) {
60
- _onChange('attrObject.bindType', newBindType);
60
+ _onChange("attrObject.bindType", newBindType);
61
61
 
62
- if (newBindType === 'topo') {//
62
+ if (newBindType === "topo") {//
63
63
  }
64
64
  };
65
65
 
66
66
  var handleBindTopoChange = function handleBindTopoChange(value, data) {
67
67
  // 设置名称为拓扑名称,清空自定义名称
68
- node.a('name', data.label);
69
- node.a('customName', null);
68
+ node.a("name", data.label);
69
+ node.a("customName", null);
70
+ topoEditApi.deleteExLink(node);
70
71
  };
71
72
 
72
73
  var RelateTopoTree = editorProps === null || editorProps === void 0 ? void 0 : editorProps.relateTopoTree;
73
74
  return /*#__PURE__*/React.createElement(_Collapse, {
74
- defaultExpandedKeys: ['相关资源'],
75
+ defaultExpandedKeys: ["相关资源"],
75
76
  style: {
76
- border: 'none'
77
+ border: "none"
77
78
  }
78
79
  }, /*#__PURE__*/React.createElement(CollapsePanel, {
79
80
  key: "\u76F8\u5173\u8D44\u6E90",
@@ -87,7 +88,7 @@ export default function Data(props) {
87
88
  name: "bindType",
88
89
  value: bindType,
89
90
  style: {
90
- width: '100%',
91
+ width: "100%",
91
92
  marginRight: 8
92
93
  },
93
94
  onChange: setBindType
@@ -97,25 +98,25 @@ export default function Data(props) {
97
98
  value: "resource"
98
99
  }, "\u5173\u8054\u8D44\u6E90"), RelateTopoTree && /*#__PURE__*/React.createElement(Option, {
99
100
  value: "topo"
100
- }, "\u5173\u8054\u62D3\u6251"))), bindType === 'resource' && /*#__PURE__*/React.createElement(_Form.Item, {
101
+ }, "\u5173\u8054\u62D3\u6251"))), bindType === "resource" && /*#__PURE__*/React.createElement(_Form.Item, {
101
102
  label: "\u5173\u8054\u8D44\u6E90"
102
103
  }, /*#__PURE__*/React.createElement("div", {
103
104
  style: {
104
- display: 'flex'
105
+ display: "flex"
105
106
  }
106
107
  }, /*#__PURE__*/React.createElement("div", {
107
108
  className: textStyles.textEllipsis,
108
109
  style: {
109
110
  flex: 1,
110
111
  paddingRight: 16,
111
- color: '#4D6277'
112
+ color: "#4D6277"
112
113
  },
113
114
  title: values.tag ? values.name : null
114
- }, values.tag ? values.name : ''), /*#__PURE__*/React.createElement(NodeRelateResourceButton, {
115
+ }, values.tag ? values.name : ""), /*#__PURE__*/React.createElement(NodeRelateResourceButton, {
115
116
  node: values,
116
117
  topo: topo,
117
118
  topoEditApi: topoEditApi
118
- }))), bindType === 'topo' && RelateTopoTree && /*#__PURE__*/React.createElement(_Form.Item, {
119
+ }))), bindType === "topo" && RelateTopoTree && /*#__PURE__*/React.createElement(_Form.Item, {
119
120
  label: "\u5173\u8054\u62D3\u6251"
120
121
  }, /*#__PURE__*/React.createElement(RelateTopoTree, {
121
122
  name: "attrObject.bindTopo",