@riil-frontend/component-topology 2.15.19 → 2.15.22

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 (50) hide show
  1. package/build/index.js +7 -7
  2. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -0
  3. package/es/components/ResourceSelectDrawer/ResourceSelectList.js +4 -1
  4. package/es/core/common/icons/defaultIcons.js +3 -9
  5. package/es/core/common/icons/icon.js +1 -22
  6. package/es/core/components/TopoView/topoView.js +1 -0
  7. package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +1 -3
  8. package/es/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -3
  9. package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +2 -2
  10. package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +3 -4
  11. package/es/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +3 -3
  12. package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +4 -4
  13. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +1 -3
  14. package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +1 -3
  15. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +5 -0
  16. package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -7
  17. package/es/core/models/TopoApp.js +1 -1
  18. package/es/core/models/utils/linkUtils.js +3 -0
  19. package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +3 -2
  20. package/es/core/viewer/components/plugins/BaseInfo/index.js +71 -17
  21. package/es/hooks/useTopoEdit.js +16 -5
  22. package/es/index.js +3 -1
  23. package/es/topoCenter/components/editor/propertyViews/LayerRelatedResourceList.js +2 -3
  24. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +1 -3
  25. package/es/topoCenter/hooks/editor/useDeleteEdges.js +19 -11
  26. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -0
  27. package/lib/components/ResourceSelectDrawer/ResourceSelectList.js +4 -1
  28. package/lib/core/common/icons/defaultIcons.js +4 -13
  29. package/lib/core/common/icons/icon.js +1 -30
  30. package/lib/core/components/TopoView/topoView.js +1 -0
  31. package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +1 -3
  32. package/lib/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -3
  33. package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +3 -3
  34. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +3 -4
  35. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +4 -8
  36. package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +4 -4
  37. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +1 -3
  38. package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +1 -3
  39. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +5 -0
  40. package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -7
  41. package/lib/core/models/TopoApp.js +1 -1
  42. package/lib/core/models/utils/linkUtils.js +5 -0
  43. package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +3 -2
  44. package/lib/core/viewer/components/plugins/BaseInfo/index.js +71 -17
  45. package/lib/hooks/useTopoEdit.js +16 -5
  46. package/lib/index.js +17 -2
  47. package/lib/topoCenter/components/editor/propertyViews/LayerRelatedResourceList.js +2 -4
  48. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +1 -3
  49. package/lib/topoCenter/hooks/editor/useDeleteEdges.js +20 -11
  50. package/package.json +3 -3
@@ -51,6 +51,8 @@ function ResourceSelectDrawer(props) {
51
51
 
52
52
  if (shouldClose !== false) {
53
53
  onClose();
54
+ } else {
55
+ setLoading(false);
54
56
  }
55
57
 
56
58
  _context.next = 13;
@@ -23,7 +23,10 @@ function ResourceSelectList(props, ref) {
23
23
  limitTypes: limitTypes || RESOURCE_LIMIT_TYPES,
24
24
  defaultCondition: excludeIds.length ? "!id('" + excludeIds.join('\',\'') + "')" : undefined,
25
25
  request: getRequest(),
26
- tableProps: tableProps
26
+ tableProps: tableProps,
27
+ paginationProps: {
28
+ type: 'simple'
29
+ }
27
30
  });
28
31
  }
29
32
 
@@ -1,16 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import { getIconMap } from '@riil-frontend/component-topology-graph/es/icons/ciTypeIcons';
3
-
4
- function getIconImgUrlById(id) {
5
- return getIconMap()[id];
6
- }
2
+ import { iconFactory } from '@riil-frontend/component-topology-graph';
7
3
  /**
8
4
  * 资源面板图片-默认节点图标
9
5
  *
10
6
  * @type {(*|{url: *})[]}
11
7
  */
12
8
 
13
-
14
9
  export var DEFAULT_NODE_ICONS = [{
15
10
  id: 'ciType.switch',
16
11
  name: '交换机'
@@ -44,7 +39,6 @@ export var DEFAULT_NODE_ICONS = [{
44
39
  name: '互联网'
45
40
  }].map(function (item) {
46
41
  return _extends({}, item, {
47
- url: getIconImgUrlById(item.id)
42
+ url: iconFactory.getIconImageUrl(item.id)
48
43
  });
49
- });
50
- export default _extends({}, getIconMap());
44
+ });
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import defaultIcons, { DEFAULT_NODE_ICONS } from "./defaultIcons";
2
+ import { DEFAULT_NODE_ICONS } from "./defaultIcons";
3
3
  import getNetworkTopoCiTypeIcons from "./networkTopoCiTypeIcons";
4
4
  var groupDefaultIcons = [{
5
5
  id: 'editor.icon.cloud.medium',
@@ -69,13 +69,6 @@ export function transformCustomIcons2HtIcons(icons) {
69
69
  export function getUserCustomIcons(topo) {
70
70
  var uploadIcons = topo.store.getModelState('iconManage').icons;
71
71
  return [].concat(transformCustomIcons2HtIcons(uploadIcons.node));
72
- }
73
- export function getIconMap(topo) {
74
- var bizIconMap = {};
75
- [].concat(groupDefaultIcons, getNodeDefaultIcons(topo), getUserCustomIcons(topo)).forEach(function (icon) {
76
- bizIconMap[icon.id] = icon;
77
- });
78
- return _extends({}, defaultIcons, bizIconMap);
79
72
  } // 获得节点图标列表
80
73
 
81
74
  export function getNodeIconGroups(topo) {
@@ -95,18 +88,4 @@ export function getGroupIconGroups(topo) {
95
88
  name: '自定义',
96
89
  icons: getUserCustomIcons(topo)
97
90
  }];
98
- }
99
- export function getIconById(id, topo) {
100
- var iconMap = getIconMap(topo);
101
- var icon = iconMap[id];
102
-
103
- if (typeof icon === 'string') {
104
- return icon.replace('.json', '.png');
105
- }
106
-
107
- if (!icon) {
108
- console.warn('图标不存在', id, iconMap);
109
- }
110
-
111
- return icon === null || icon === void 0 ? void 0 : icon.url;
112
91
  }
@@ -122,6 +122,7 @@ var TopoView = function TopoView(props) {
122
122
  useEffect(function () {
123
123
  return function () {
124
124
  topoDispatchers.reset();
125
+ clearSelection();
125
126
  };
126
127
  }, []);
127
128
  var onGraphCreated = useCallback(function (topoClient) {
@@ -28,9 +28,7 @@ export default function CommonEdgePropertyView(props) {
28
28
  onChange: function onChange(name, value) {
29
29
  var newValues = field.getValues();
30
30
 
31
- if (values[name] !== value) {
32
- _onChange(name, value, newValues);
33
- }
31
+ _onChange(name, value, newValues);
34
32
  }
35
33
  });
36
34
 
@@ -22,9 +22,7 @@ export default function EdgeGroupSetting(props) {
22
22
  onChange: function onChange(name, value) {
23
23
  var newValues = field.getValues();
24
24
 
25
- if (values[name] !== value) {
26
- _onChange(name, value, newValues);
27
- }
25
+ _onChange(name, value, newValues);
28
26
  }
29
27
  });
30
28
 
@@ -1,9 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import { useState } from "react";
3
3
  import rlog from "@riil-frontend/component-topology-utils/es/rlog";
4
+ import { iconFactory } from "@riil-frontend/component-topology-graph";
4
5
  import sortBy from 'lodash/sortBy';
5
6
  import { getGroupChildrenNodes, getNodeData } from "../../../../../../../../utils/htElementUtils";
6
- import { getIconById } from "../../../../../../../common/icons/icon";
7
7
 
8
8
  function sortResourcesByName(resources) {
9
9
  return sortBy(resources, 'name');
@@ -29,7 +29,7 @@ export default function useGroupRelateResource(props) {
29
29
  })).map(function (item) {
30
30
  return {
31
31
  title: item.name,
32
- img: getIconById(item.image, topo),
32
+ img: iconFactory.getIconImageUrl(item.image),
33
33
  data: item,
34
34
  node: item.node
35
35
  };
@@ -30,9 +30,7 @@ export default function GroupSetting(props) {
30
30
 
31
31
  var newValues = field.getValues();
32
32
 
33
- if (values[name] !== value) {
34
- _onChange(name, value, newValues);
35
- }
33
+ _onChange(name, value, newValues);
36
34
  }
37
35
  });
38
36
 
@@ -92,7 +90,8 @@ export default function GroupSetting(props) {
92
90
  }
93
91
  }), /*#__PURE__*/React.createElement(_Input, {
94
92
  name: "attrObject.name",
95
- maxLength: 30
93
+ maxLength: 30,
94
+ placeholder: "\u8BF7\u8F93\u5165"
96
95
  })), expanded ? /*#__PURE__*/React.createElement(GroupExpandSetting, {
97
96
  group: group,
98
97
  expanded: expanded,
@@ -1,7 +1,7 @@
1
- import React, { useState, useEffect, useRef, useCallback } from 'react';
1
+ import React from 'react';
2
+ import { iconFactory } from '@riil-frontend/component-topology-graph';
2
3
  import ResourceList from "../../../common/GroupNodeList/ResourceList";
3
4
  import { getLayerChildrenNodes } from "../../../../../../../utils/htElementUtils";
4
- import { getIconById } from "../../../../../../common/icons/icon";
5
5
  /**
6
6
  * 分层关联资源列表
7
7
  */
@@ -16,7 +16,7 @@ export default function LayerResourceList(props) {
16
16
  var data = relateDataNodes.map(function (node) {
17
17
  return {
18
18
  title: node.a('name'),
19
- img: getIconById(node.getImage(), topo)
19
+ img: iconFactory.getIconImageUrl(node.getImage())
20
20
  };
21
21
  });
22
22
  return /*#__PURE__*/React.createElement(ResourceList, {
@@ -23,11 +23,10 @@ export default function LayerSettingTab(props) {
23
23
  return;
24
24
  }
25
25
 
26
+ console.error(values[name], value);
26
27
  var newValues = field.getValues();
27
28
 
28
- if (values[name] !== value) {
29
- _onChange(name, value, newValues);
30
- }
29
+ _onChange(name, value, newValues);
31
30
  }
32
31
  });
33
32
 
@@ -56,7 +55,8 @@ export default function LayerSettingTab(props) {
56
55
  }
57
56
  }), /*#__PURE__*/React.createElement(_Input, {
58
57
  name: "styleMap.label",
59
- maxLength: 30
58
+ maxLength: 30,
59
+ placeholder: "\u8BF7\u8F93\u5165"
60
60
  })), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
61
61
  defaultExpandedKeys: ['图片', '对齐方式', '线形'],
62
62
  style: {
@@ -27,9 +27,7 @@ export default function MultipleElementPropertyView(props) {
27
27
  onChange: function onChange(name, value) {
28
28
  var newValues = field.getValues();
29
29
 
30
- if (values[name] !== value) {
31
- _onChange(name, value, newValues);
32
- }
30
+ _onChange(name, value, newValues);
33
31
  }
34
32
  });
35
33
 
@@ -57,9 +57,7 @@ export default function NodePropertyView(props) {
57
57
  onChange: function onChange(name, value) {
58
58
  var newValues = field.getValues();
59
59
 
60
- if (values[name] !== value) {
61
- _onChange(name, value, newValues);
62
- }
60
+ _onChange(name, value, newValues);
63
61
  }
64
62
  });
65
63
 
@@ -19,6 +19,7 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
19
19
 
20
20
  var handleSave = /*#__PURE__*/function () {
21
21
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
22
+ var result;
22
23
  return _regeneratorRuntime.wrap(function _callee$(_context) {
23
24
  while (1) {
24
25
  switch (_context.prev = _context.next) {
@@ -41,6 +42,10 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
41
42
  });
42
43
 
43
44
  case 5:
45
+ result = _context.sent;
46
+ return _context.abrupt("return", result);
47
+
48
+ case 7:
44
49
  case "end":
45
50
  return _context.stop();
46
51
  }
@@ -46,15 +46,13 @@ export default function TextPropertyView(props) {
46
46
  return;
47
47
  }
48
48
 
49
- if (values[name] !== value) {
50
- if (name === 'styleMap.text' && !value) {
51
- _onChange(name, DEFAULT_TEXT_VALUE, newValues);
49
+ if (name === 'styleMap.text' && !value) {
50
+ _onChange(name, DEFAULT_TEXT_VALUE, newValues);
52
51
 
53
- return;
54
- }
55
-
56
- _onChange(name, value, newValues);
52
+ return;
57
53
  }
54
+
55
+ _onChange(name, value, newValues);
58
56
  }
59
57
  });
60
58
 
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
20
20
  import PluginManager from "./PluginManager";
21
21
  import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
22
22
 
23
- var version = typeof "2.15.19" === 'string' ? "2.15.19" : null;
23
+ var version = typeof "2.15.22" === 'string' ? "2.15.22" : null;
24
24
  console.info("\u62D3\u6251\u7248\u672C: " + version);
25
25
  /**
26
26
  * 拓扑显示和编辑
@@ -12,6 +12,9 @@ var interfaceTypeMap = {
12
12
  displayName: '聚合接口'
13
13
  }
14
14
  };
15
+ export function isAggLink(link) {
16
+ return link.attributes['network_link.connect_type'] === 'agg';
17
+ }
15
18
  export function mergeLinksData(links, linkCis, nodes, interfaceCis) {
16
19
  var linkCiMap = keyBy(linkCis, 'id');
17
20
  return links.map(function (link) {
@@ -20,12 +20,13 @@ import { queryCisByIds } from "../../../../../../services";
20
20
  import styles from "./index.module.scss"; // 基本信息
21
21
 
22
22
  function BaseInfoRender(type, data) {
23
+ var _itemCols$type;
24
+
23
25
  var itemCols = {
24
26
  node: [{
25
27
  label: '资源名称:',
26
28
  objKey: 'resource',
27
29
  render: function render(valueData, key) {
28
- console.log('资源名称:', valueData, key);
29
30
  var display_name = valueData.display_name,
30
31
  link = valueData.link;
31
32
  return /*#__PURE__*/React.createElement("div", {
@@ -80,7 +81,7 @@ function BaseInfoRender(type, data) {
80
81
  };
81
82
  return /*#__PURE__*/React.createElement("div", {
82
83
  className: styles['base-info']
83
- }, itemCols[type].map(function (_ref, key) {
84
+ }, (_itemCols$type = itemCols[type]) === null || _itemCols$type === void 0 ? void 0 : _itemCols$type.map(function (_ref, key) {
84
85
  var label = _ref.label,
85
86
  objKey = _ref.objKey,
86
87
  style = _ref.style,
@@ -100,8 +100,11 @@ function BaseInfo(props) {
100
100
  userId = _useState4[0],
101
101
  setUserId = _useState4[1];
102
102
 
103
+ var _useState5 = useState(null),
104
+ paramData = _useState5[0],
105
+ setParamData = _useState5[1];
106
+
103
107
  useEffect(function () {
104
- getUser();
105
108
  var notifier = topo.view.topoClient.notifier;
106
109
  notifier.on(TopoEvent.EVENT_DOUBLE_CLICK, openOverview);
107
110
  notifier.on('topo_element_click', changeOverview);
@@ -117,12 +120,51 @@ function BaseInfo(props) {
117
120
  }, []); // 解决切换拓扑图隐藏概览
118
121
 
119
122
  useEffect(function () {
120
- setVisible(false); // TODO 其他数据重置
123
+ setVisible(false);
124
+ setParamData(null); // TODO 其他数据重置
121
125
  }, [topoId]);
122
126
 
123
127
  function getUser() {
124
128
  return _getUser.apply(this, arguments);
125
- }
129
+ } // function changeOverview (node) {
130
+ // const data = node.getAttrObject()
131
+ // console.log('单击切换基本信息', data);
132
+ // setVisible(prev => {
133
+ // prev && openOverview(data)
134
+ // return prev
135
+ // })
136
+ // }
137
+ // function openOverview (data) {
138
+ // console.log('双击打开基本信息', data);
139
+ // const {
140
+ // id,
141
+ // name,
142
+ // type,
143
+ // ciType,
144
+ // ciName,
145
+ // operation,
146
+ // } = data
147
+ // // 仅展示资源和链路的概览
148
+ // if (!['node', 'link', 'linkGroup'].includes(type)) return
149
+ // // 应用拓扑中没有链路详情
150
+ // if (topo.options.resourceOverviewDrawer?.getData && type === 'link') return
151
+ // // 没有权限不显示
152
+ // if (!operation) return
153
+ // setActiveData({
154
+ // id,
155
+ // name,
156
+ // type: type === 'linkGroup' ? 'link' : type,
157
+ // ciType,
158
+ // ciName
159
+ // })
160
+ // const { metrics } = topo.ciTyeCache.getCiType(ciType)
161
+ // topoDispatchers.update({
162
+ // id,
163
+ // metricCodes: metrics.slice(0, 6).map(item => item.code), // 需要展示的关键指标 code
164
+ // })
165
+ // setVisible(true)
166
+ // }
167
+
126
168
 
127
169
  function _getUser() {
128
170
  _getUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
@@ -148,25 +190,41 @@ function BaseInfo(props) {
148
190
  return _getUser.apply(this, arguments);
149
191
  }
150
192
 
193
+ function onChangeActive(activeNode) {
194
+ console.log('切换基本信息资源', activeNode);
195
+ activeNode && openOverview(_extends({}, activeNode, {
196
+ type: 'node'
197
+ }));
198
+ }
199
+
200
+ useEffect(function () {
201
+ (visible || (paramData === null || paramData === void 0 ? void 0 : paramData.isVisible)) && paramData && init(paramData);
202
+ }, [paramData, visible]);
203
+
151
204
  function changeOverview(node) {
152
205
  var data = node.getAttrObject();
153
206
  console.log('单击切换基本信息', data);
154
- setVisible(function (prev) {
155
- prev && openOverview(data);
156
- return prev;
157
- });
207
+ setParamData(data);
158
208
  }
159
209
 
160
210
  function openOverview(data) {
211
+ console.log('双击打开基本信息', data);
212
+ setParamData(_extends({}, data, {
213
+ isVisible: true
214
+ }));
215
+ }
216
+
217
+ function init(data) {
161
218
  var _topo$options$resourc;
162
219
 
163
- console.log('双击打开基本信息', data);
220
+ console.log('初始化基本信息', data);
164
221
  var id = data.id,
165
222
  name = data.name,
166
223
  type = data.type,
167
224
  ciType = data.ciType,
168
225
  ciName = data.ciName,
169
- operation = data.operation; // 仅展示资源和链路的概览
226
+ operation = data.operation,
227
+ isVisible = data.isVisible; // 仅展示资源和链路的概览
170
228
 
171
229
  if (!['node', 'link', 'linkGroup'].includes(type)) return; // 应用拓扑中没有链路详情
172
230
 
@@ -190,15 +248,11 @@ function BaseInfo(props) {
190
248
  return item.code;
191
249
  }) // 需要展示的关键指标 code
192
250
 
193
- });
194
- setVisible(true);
195
- }
251
+ }); // 显示隐藏
196
252
 
197
- function onChangeActive(activeNode) {
198
- console.log('切换基本信息资源', activeNode);
199
- activeNode && openOverview(_extends({}, activeNode, {
200
- type: 'node'
201
- }));
253
+ isVisible && setVisible(true); // userId
254
+
255
+ userId || getUser();
202
256
  }
203
257
 
204
258
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Drawer, {
@@ -818,7 +818,7 @@ var useTopoEdit = function useTopoEdit(params) {
818
818
 
819
819
  var bindNodeResource = /*#__PURE__*/function () {
820
820
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(params) {
821
- var id, oldResId, newResId, node, groupElement, config, groupId, groupTag, _yield$editDispatcher, elements, nodeRelatedData, replaceOrAddRes;
821
+ var id, oldResId, newResId, node, groupElement, config, groupId, groupTag, _yield$editDispatcher, elements, nodeRelatedDatas, replaceOrAddRes;
822
822
 
823
823
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
824
824
  while (1) {
@@ -845,7 +845,7 @@ var useTopoEdit = function useTopoEdit(params) {
845
845
 
846
846
  groupTag = groupElement.a('tag'); // 容器临时id
847
847
 
848
- config.groups = groups.map(function (g) {
848
+ config.groups = config.groups.map(function (g) {
849
849
  // 匹配到容器,替换资源或增加
850
850
  if (g.id === groupId || g.tag === groupTag) {
851
851
  return _extends({}, g, {
@@ -872,15 +872,26 @@ var useTopoEdit = function useTopoEdit(params) {
872
872
  _yield$editDispatcher = _context7.sent;
873
873
  elements = _yield$editDispatcher.topoDataTrans;
874
874
  // 过滤出关联的节点和连线,通知ht更新
875
- nodeRelatedData = filterElementsByNodeId(elements, newResId);
876
- saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, nodeRelatedData);
875
+ nodeRelatedDatas = filterElementsByNodeId(elements, newResId);
876
+
877
+ if (nodeRelatedDatas.length) {
878
+ _context7.next = 17;
879
+ break;
880
+ }
881
+
882
+ _Message.error('关联资源失败');
883
+
884
+ return _context7.abrupt("return", false);
885
+
886
+ case 17:
887
+ saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, nodeRelatedDatas);
877
888
  node.a('customName', null); // 临时放这里,仅拓扑中心有
878
889
 
879
890
  if (topo.linkDynamicStyleExecutor) {
880
891
  topo.linkDynamicStyleExecutor.execute();
881
892
  }
882
893
 
883
- case 17:
894
+ case 20:
884
895
  case "end":
885
896
  return _context7.stop();
886
897
  }
package/es/index.js CHANGED
@@ -1,4 +1,6 @@
1
+ import { iconFactory } from '@riil-frontend/component-topology-graph';
1
2
  import Topology from "./core/components/TopoView";
3
+ import * as htElementUtils from "./utils/htElementUtils";
2
4
  export * from "./createTopo";
3
5
  export * from "./core/components/titlebar";
4
- export { Topology };
6
+ export { Topology, htElementUtils, iconFactory };
@@ -1,8 +1,7 @@
1
1
  import React, { useState, useEffect, useRef, useCallback } from 'react';
2
- import rlog from '@riil-frontend/component-topology-utils/es/rlog';
2
+ import { iconFactory } from '@riil-frontend/component-topology-graph';
3
3
  import ResourceList from "../../../../core/editor/components/settings/common/GroupNodeList/ResourceList";
4
4
  import { getLayerChildrenNodes } from "../../../../utils/htElementUtils";
5
- import { getIconById } from "../../../../core/common/icons/icon";
6
5
 
7
6
  function getResourceNodes(store, htNodes) {
8
7
  var _store$getModelState = store.getModelState('topoMod'),
@@ -38,7 +37,7 @@ export default function LayerResourceList(props) {
38
37
  resource = _ref.resource;
39
38
  return {
40
39
  title: resource.name,
41
- img: getIconById(node.getImage(), topo)
40
+ img: iconFactory.getIconImageUrl(node.getImage())
42
41
  };
43
42
  }); // rlog.debug('LayerResourceList', {nodes, resourceNodes, data});
44
43
 
@@ -22,9 +22,7 @@ export default function LinkSetting(props) {
22
22
  onChange: function onChange(name, value) {
23
23
  var newValues = field.getValues();
24
24
 
25
- if (values[name] !== value) {
26
- _onChange(name, value, newValues);
27
- }
25
+ _onChange(name, value, newValues);
28
26
  }
29
27
  });
30
28
 
@@ -4,6 +4,7 @@ import _Message from "@alifd/next/es/message";
4
4
  import _Dialog from "@alifd/next/es/dialog";
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
7
+ import { isAggLink } from "../../../core/models/utils/linkUtils";
7
8
  import linkService from "../../services/link";
8
9
  import { getLinkPermission } from "../../utils/linPermissionUtil";
9
10
  /**
@@ -43,6 +44,7 @@ export default (function (_ref) {
43
44
  var deleteLink = function deleteLink(edge) {
44
45
  var id = edge.getTag();
45
46
  var link = topo.dataModel.getDataById(id);
47
+ var isAgg = isAggLink(link);
46
48
 
47
49
  if (!checkLinkDeleteable(link)) {
48
50
  return;
@@ -50,7 +52,7 @@ export default (function (_ref) {
50
52
 
51
53
  var htTopo = topo.getHtTopo();
52
54
  confirmDeleteLink( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
53
- var success, edgesInNodes, _topo$store$getModel, topoState, topoDispatchers, _topoState$data, links, linkGroups;
55
+ var success, edgesInNodes, edgeGroupData, edgeData, _topo$store$getModel, topoState, topoDispatchers, _topoState$data, links, linkGroups;
54
56
 
55
57
  return _regeneratorRuntime.wrap(function _callee$(_context) {
56
58
  while (1) {
@@ -72,26 +74,32 @@ export default (function (_ref) {
72
74
  return _context.abrupt("return");
73
75
 
74
76
  case 6:
75
- _Message.success('删除成功'); // 当前是连线组代理,清空组数据
77
+ _Message.success('删除成功'); // 获取两个节点间的连线数据列表
76
78
 
77
79
 
78
- if (htTopo.isEdgeGroupAgent(edge)) {
79
- // 获取两个节点间的连线数据列表
80
- edgesInNodes = htTopo.getEdgeDatasInNodes(edge.getSource(), edge.getTarget()); // 如果仅一条连线且有连线数据,则清空连线组数据,此时展示连线的数据
80
+ edgesInNodes = htTopo.getEdgeDatasInNodes(edge.getSource(), edge.getTarget());
81
81
 
82
- if (edgesInNodes.length === 1 && htTopo.getEdgeData(edge)) {
82
+ if (edgesInNodes.length >= 2) {
83
+ htTopo.deleteEdge(edge);
84
+ } else {
85
+ // 一根线时
86
+ edgeGroupData = htTopo.getEdgeGroupData(edge.getSource(), edge.getTarget());
87
+ edgeData = htTopo.getEdgeData(edge);
88
+
89
+ if (isAgg && edgeData) {
90
+ // 当前是连线组代理 且 有连线数据,清空组数据
83
91
  htTopo.setEdgeGroupData(edge.getSource(), edge.getTarget(), null);
92
+ } else if (!isAgg && edgeGroupData) {
93
+ htTopo.setEdgeData(edge, null);
84
94
  } else {
85
95
  htTopo.deleteEdge(edge);
86
96
  }
87
- } else {
88
- htTopo.deleteEdge(edge);
89
97
  } // 更新数据
90
98
 
91
99
 
92
100
  _topo$store$getModel = topo.store.getModel('topoMod'), topoState = _topo$store$getModel[0], topoDispatchers = _topo$store$getModel[1];
93
101
  _topoState$data = topoState.data, links = _topoState$data.links, linkGroups = _topoState$data.linkGroups;
94
- _context.next = 12;
102
+ _context.next = 13;
95
103
  return topoDispatchers.update({
96
104
  data: _extends({}, topoState.data, {
97
105
  links: links.filter(function (link) {
@@ -103,11 +111,11 @@ export default (function (_ref) {
103
111
  })
104
112
  });
105
113
 
106
- case 12:
114
+ case 13:
107
115
  // 刷新链路动态线宽
108
116
  topo.linkDynamicStyleExecutor.execute();
109
117
 
110
- case 13:
118
+ case 14:
111
119
  case "end":
112
120
  return _context.stop();
113
121
  }
@@ -68,6 +68,8 @@ function ResourceSelectDrawer(props) {
68
68
 
69
69
  if (shouldClose !== false) {
70
70
  onClose();
71
+ } else {
72
+ setLoading(false);
71
73
  }
72
74
 
73
75
  _context.next = 13;
@@ -37,7 +37,10 @@ function ResourceSelectList(props, ref) {
37
37
  limitTypes: limitTypes || _ResourceTypeLimit.RESOURCE_LIMIT_TYPES,
38
38
  defaultCondition: excludeIds.length ? "!id('" + excludeIds.join('\',\'') + "')" : undefined,
39
39
  request: (0, _componentTopologyCommon.getRequest)(),
40
- tableProps: tableProps
40
+ tableProps: tableProps,
41
+ paginationProps: {
42
+ type: 'simple'
43
+ }
41
44
  });
42
45
  }
43
46