@riil-frontend/component-topology 12.1.0-dev.1 → 12.1.0-dev.11

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 (68) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.css +1 -1
  3. package/build/index.js +14 -14
  4. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +2 -2
  5. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +2 -2
  6. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +5 -15
  7. package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +2 -27
  8. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +3 -28
  9. package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +6 -52
  10. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +2 -2
  11. package/es/core/editor/components/Toolbar/widgets/components/FontFamilySelect.js +29 -0
  12. package/es/core/editor/components/Toolbar/widgets/components/FontSizeSelect.js +29 -0
  13. package/es/core/editor/components/Toolbar/widgets/components/FontStyleSelect.js +71 -0
  14. package/es/core/editor/components/settings/propertyViews/view/GlobalEdgeToggle.js +2 -2
  15. package/es/core/editor/hooks/useNewElementTheme.js +20 -16
  16. package/es/core/editor/utils/edgeTypeStyleUtil.js +11 -9
  17. package/es/core/hooks/usePolling.js +2 -1
  18. package/es/core/hooks/useTopoEdit.js +169 -231
  19. package/es/core/models/Alarm.js +14 -15
  20. package/es/core/models/AttributeMetricDisplay.js +2 -1
  21. package/es/core/models/HistoryManager.js +11 -9
  22. package/es/core/models/TopoApp.js +23 -31
  23. package/es/core/models/utils/linkUtils.js +20 -19
  24. package/es/core/store/models/topoConfig.js +2 -1
  25. package/es/core/utils/edgeUtil.js +7 -10
  26. package/es/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js +2 -2
  27. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +51 -13
  28. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +1 -1
  29. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
  30. package/es/networkTopo/models/EdgeGroupTagTipBuilder.js +7 -7
  31. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +7 -63
  32. package/es/networkTopo/utils/edgeGroupTagUtil.js +2 -2
  33. package/es/utils/clusterUtil.js +3 -3
  34. package/es/utils/htElementUtils.js +16 -84
  35. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +2 -2
  36. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +2 -2
  37. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +5 -14
  38. package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +3 -28
  39. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +3 -28
  40. package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +6 -56
  41. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +1 -1
  42. package/lib/core/editor/components/Toolbar/widgets/components/FontFamilySelect.js +38 -0
  43. package/lib/core/editor/components/Toolbar/widgets/components/FontSizeSelect.js +38 -0
  44. package/lib/core/editor/components/Toolbar/widgets/components/FontStyleSelect.js +83 -0
  45. package/lib/core/editor/components/settings/propertyViews/view/GlobalEdgeToggle.js +2 -2
  46. package/lib/core/editor/hooks/useNewElementTheme.js +20 -16
  47. package/lib/core/editor/utils/edgeTypeStyleUtil.js +10 -8
  48. package/lib/core/hooks/usePolling.js +6 -5
  49. package/lib/core/hooks/useTopoEdit.js +177 -257
  50. package/lib/core/models/Alarm.js +14 -15
  51. package/lib/core/models/AttributeMetricDisplay.js +6 -6
  52. package/lib/core/models/HistoryManager.js +13 -17
  53. package/lib/core/models/TopoApp.js +22 -29
  54. package/lib/core/models/utils/linkUtils.js +19 -18
  55. package/lib/core/store/models/topoConfig.js +9 -16
  56. package/lib/core/utils/edgeUtil.js +8 -10
  57. package/lib/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js +3 -2
  58. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +52 -13
  59. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +1 -1
  60. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
  61. package/lib/networkTopo/models/EdgeGroupTagTipBuilder.js +6 -6
  62. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +6 -64
  63. package/lib/networkTopo/utils/edgeGroupTagUtil.js +2 -2
  64. package/lib/utils/clusterUtil.js +2 -2
  65. package/lib/utils/htElementUtils.js +19 -93
  66. package/package.json +2 -2
  67. package/es/networkTopo/models/LinkTagsTipsBuilder.js +0 -235
  68. package/lib/networkTopo/models/LinkTagsTipsBuilder.js +0 -245
@@ -459,14 +459,14 @@ var Alarm = /*#__PURE__*/function () {
459
459
  console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
460
460
 
461
461
  if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
462
- _context8.next = 27;
462
+ _context8.next = 25;
463
463
  break;
464
464
  }
465
465
 
466
466
  sendAl = [];
467
467
  idsList = [].concat(nodeIdsList, linkIdsList);
468
- operations = [];
469
- console.log('idsList---------', idsList);
468
+ operations = []; // console.log('idsList---------', idsList)
469
+
470
470
  idsList.forEach(function (idItem) {
471
471
  if (idItem.operation === null) {
472
472
  operations.push(idItem.ciId);
@@ -492,22 +492,21 @@ var Alarm = /*#__PURE__*/function () {
492
492
  if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
493
493
  sendAl.push(obj);
494
494
  }
495
- });
496
- console.log("before-combAlarmData", sendAl, idsList);
495
+ }); // console.log("before-combAlarmData", sendAl, idsList);
497
496
 
498
497
  if (!(sendAl.length > 0)) {
499
- _context8.next = 27;
498
+ _context8.next = 25;
500
499
  break;
501
500
  }
502
501
 
503
502
  rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
504
- _context8.prev = 15;
505
- _context8.next = 18;
503
+ _context8.prev = 13;
504
+ _context8.next = 16;
506
505
  return alarmDispatchers.combAlarmData({
507
506
  alarmdata: sendAl
508
507
  });
509
508
 
510
- case 18:
509
+ case 16:
511
510
  _yield$alarmDispatche2 = _context8.sent;
512
511
  eqFlag = _yield$alarmDispatche2.eqFlag;
513
512
  alarmlist = _yield$alarmDispatche2.alarmlist;
@@ -528,19 +527,19 @@ var Alarm = /*#__PURE__*/function () {
528
527
  }
529
528
  }
530
529
 
531
- _context8.next = 27;
530
+ _context8.next = 25;
532
531
  break;
533
532
 
534
- case 24:
535
- _context8.prev = 24;
536
- _context8.t0 = _context8["catch"](15);
533
+ case 22:
534
+ _context8.prev = 22;
535
+ _context8.t0 = _context8["catch"](13);
537
536
  rlog.error('告警发送异常', _context8.t0);
538
537
 
539
- case 27:
538
+ case 25:
540
539
  case "end":
541
540
  return _context8.stop();
542
541
  }
543
- }, _callee8, this, [[15, 24]]);
542
+ }, _callee8, this, [[13, 22]]);
544
543
  }));
545
544
 
546
545
  function handleAlarmEvent(_x6) {
@@ -1,13 +1,14 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
- import { rlog } from '@riil-frontend/component-topology-utils';
4
+ import Logger from 'loglevel';
5
5
  import { DEFAULT_NODE_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../../constants/ResourceInfoDisplay";
6
6
  import { isMonitoring } from "../utils/manageStatusUtil";
7
7
  import AttributeFormatter from "./attributeFormatter";
8
8
  import DictCache from "./cache/DictCache";
9
9
  import { getNodesNameVisible as _getNodesNameVisible, updateNodesNameVisible as _updateNodesNameVisible } from "./utils/nodeNameVisibleUtil";
10
10
  import { translateCisRefAttributeName } from "../../utils/ciRefAttributeTranslateUtil";
11
+ var rlog = Logger.getLogger('topo');
11
12
 
12
13
  function isGraphField(item) {
13
14
  return item.type === 'graph';
@@ -1,5 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import { rlog } from '@riil-frontend/component-topology-utils';
3
+ import Logger from 'loglevel';
4
+ var log = Logger.getLogger('topo.HistoryManager');
3
5
  var ht = window.ht;
4
6
 
5
7
  var HistoryManager = /*#__PURE__*/function () {
@@ -10,7 +12,7 @@ var HistoryManager = /*#__PURE__*/function () {
10
12
  this.topo = topo;
11
13
  this.htHistoryManager = htHistoryManager;
12
14
  htHistoryManager.clear();
13
- rlog.info('HistoryManager 初始化', htHistoryManager);
15
+ log.info('HistoryManager 初始化', htHistoryManager);
14
16
  this.updateStore = this.updateStore.bind(this);
15
17
  this.init();
16
18
  }
@@ -58,10 +60,10 @@ var HistoryManager = /*#__PURE__*/function () {
58
60
 
59
61
  _proto.setDisabled = function setDisabled(disabled, message) {
60
62
  this.htHistoryManager.setDisabled(disabled);
61
- rlog.debug("HistoryManager.setDisabled " + (disabled ? '禁用' : '启用') + (message ? "(" + message + ")" : '') + ": " + this.toString(), this.getHistories());
63
+ log.debug("HistoryManager.setDisabled " + (disabled ? '禁用' : '启用') + (message ? "(" + message + ")" : '') + ": " + this.toString(), this.getHistories());
62
64
  };
63
65
 
64
- _proto.beginTransaction = function beginTransaction() {
66
+ _proto.beginTransaction = function beginTransaction(name) {
65
67
  var _this = this;
66
68
 
67
69
  this.htHistoryManager.beginTransaction();
@@ -92,7 +94,7 @@ var HistoryManager = /*#__PURE__*/function () {
92
94
  oldValue: _this.topo.store.getModelState(item.modelName)[item.property]
93
95
  });
94
96
  });
95
- rlog.debug("HistoryManager.beginTransaction: " + this.toString(), this.getHistories());
97
+ log.debug("HistoryManager.beginTransaction: " + this.toString(), this.getHistories());
96
98
  };
97
99
 
98
100
  _proto.addStoreHistory = function addStoreHistory() {
@@ -117,16 +119,16 @@ var HistoryManager = /*#__PURE__*/function () {
117
119
  type: 'store',
118
120
  data: storeChanged
119
121
  });
120
- rlog.debug('HistoryManager.addStoreHistory', storeChanged);
122
+ log.debug('HistoryManager.addStoreHistory', storeChanged);
121
123
  }
122
124
 
123
125
  this.storeHistory = [];
124
126
  };
125
127
 
126
- _proto.endTransaction = function endTransaction() {
128
+ _proto.endTransaction = function endTransaction(name) {
127
129
  this.addStoreHistory();
128
130
  this.htHistoryManager.endTransaction();
129
- rlog.debug("HistoryManager.endTransaction: " + this.toString(), this.getHistories());
131
+ log.debug("HistoryManager.endTransaction: " + this.toString(), this.getHistories());
130
132
  };
131
133
 
132
134
  _proto.clear = function clear() {
@@ -170,7 +172,7 @@ var HistoryManager = /*#__PURE__*/function () {
170
172
  return;
171
173
  }
172
174
 
173
- rlog.debug('HistoryManager.undo', this.getHistories(), this.getHistoryIndex());
175
+ log.debug('HistoryManager.undo', this.getHistories(), this.getHistoryIndex());
174
176
  var storeHistory = this.getCurrentStoreHistory(true);
175
177
 
176
178
  if (storeHistory) {
@@ -188,7 +190,7 @@ var HistoryManager = /*#__PURE__*/function () {
188
190
  _proto.redo = function redo() {
189
191
  var _this4 = this;
190
192
 
191
- rlog.debug('HistoryManager.redo', this.getHistories(), this.getHistoryIndex());
193
+ log.debug('HistoryManager.redo', this.getHistories(), this.getHistoryIndex());
192
194
  var storeHistory = this.getCurrentStoreHistory(false);
193
195
 
194
196
  if (storeHistory) {
@@ -10,7 +10,7 @@ import Alarm from "./Alarm";
10
10
  import TopoGraphView from "./TopoGraphView";
11
11
  import createStore from "../store/createStore";
12
12
  import buildProvider from "../components/buildProvider";
13
- import { getEdgeDatas, getGroupDatas, getNodeData, getNodeDatas, getNodes as _getNodes } from "../../utils/htElementUtils";
13
+ import { getEdgeDatas, getGroupDatas, getNodeData, getNodeDatas, getNodes } from "../../utils/htElementUtils";
14
14
  import Test from "../test/Test";
15
15
  import { formatGroups } from "../../utils/topoData";
16
16
  import DictCache from "./cache/DictCache";
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
26
26
 
27
- var version = typeof "12.1.0-dev.1" === 'string' ? "12.1.0-dev.1" : null;
27
+ var version = typeof "12.1.0-dev.11" === 'string' ? "12.1.0-dev.11" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -188,38 +188,29 @@ var Topo = /*#__PURE__*/function () {
188
188
 
189
189
  _proto.getData = function getData() {
190
190
  return {
191
- groups: this.getGroups(),
192
- nodes: this.getNodes(),
193
- lines: this.getLines(),
191
+ groups: getGroupDatas(this.getDataModel()),
192
+ nodes: getNodes(this.getDataModel()).filter(function (node) {
193
+ return !!node.getTag();
194
+ }).map(getNodeData),
194
195
  customNodes: getNodeDatas(this.getDataModel()).filter(function (item) {
195
196
  return !item.id;
196
197
  }),
197
- customLines: this.getEdges().filter(function (item) {
198
+ lines: getEdgeDatas(this.getDataModel()).filter(function (item) {
199
+ return !!item.id;
200
+ }),
201
+ customLines: getEdgeDatas(this.getDataModel()).filter(function (item) {
198
202
  return !item.id;
199
203
  })
200
204
  };
201
- };
202
-
203
- _proto.getGroups = function getGroups() {
204
- return getGroupDatas(this.getDataModel());
205
- };
206
-
207
- _proto.getNodes = function getNodes() {
208
- var nodes = _getNodes(this.getDataModel()).filter(function (node) {
209
- return !!node.getTag();
210
- });
211
-
212
- return nodes.map(getNodeData);
213
- };
205
+ }
206
+ /**
207
+ * @deprecated 待移除。uicbb有使用
208
+ * @returns
209
+ */
210
+ ;
214
211
 
215
212
  _proto.getLines = function getLines() {
216
- return this.getEdges().filter(function (item) {
217
- return !!item.id;
218
- });
219
- };
220
-
221
- _proto.getEdges = function getEdges() {
222
- return getEdgeDatas(this.getDataModel());
213
+ return this.getData().lines;
223
214
  }
224
215
  /**
225
216
  * 全量更新数据
@@ -278,18 +269,19 @@ var Topo = /*#__PURE__*/function () {
278
269
  /*#__PURE__*/
279
270
  function () {
280
271
  var _addElements = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(elements) {
281
- var data;
272
+ var prevData, data;
282
273
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
283
274
  while (1) switch (_context5.prev = _context5.next) {
284
275
  case 0:
276
+ prevData = this.getData();
285
277
  data = {
286
- groups: [].concat(this.getGroups(), elements.groups || []),
287
- nodes: [].concat(this.getNodes(), elements.nodes || []),
288
- lines: [].concat(this.getLines(), elements.lines || [])
278
+ groups: [].concat(prevData.groups, elements.groups || []),
279
+ nodes: [].concat(prevData.nodes, elements.nodes || []),
280
+ lines: [].concat(prevData.lines, elements.lines || [])
289
281
  };
290
282
  this.updateElements(data); // TODO 更新store,触发属性、指标模型加载,更新指标
291
283
 
292
- case 2:
284
+ case 3:
293
285
  case "end":
294
286
  return _context5.stop();
295
287
  }
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import keyBy from "lodash/keyBy";
5
5
  import _ from "lodash"; // 查询所有连线
6
6
 
7
- import { getEdges } from "../../../utils/htElementUtils";
7
+ import { getEdges, isEdgeGroupAgent } from "../../../utils/htElementUtils";
8
8
  import CiTypeCache from "../cache/CiTypeCache";
9
9
  import CiCache from "../cache/CiCache"; // const interfaceTypeMap = {
10
10
  // "network.interface": {
@@ -158,7 +158,8 @@ export var plurals = {
158
158
  2: ["phy"],
159
159
  3: ["agg"],
160
160
  4: ["phy", "agg"]
161
- };
161
+ }; // 待办:移到网络拓扑组件
162
+
162
163
  export var showLinkByConfig = function showLinkByConfig(props) {
163
164
  var _plurals$compatibleWi;
164
165
 
@@ -170,29 +171,29 @@ export var showLinkByConfig = function showLinkByConfig(props) {
170
171
 
171
172
  var gv = topo.getGraphView();
172
173
  var dm = gv.getDataModel();
173
- var edges = getEdges(dm); // console.log("edges", edges);
174
+ var edges = getEdges(dm).filter(function (edge) {
175
+ return !isEdgeGroupAgent(edge);
176
+ }); // console.log("edges", edges);
174
177
 
175
178
  var showPhy = types.indexOf("phy") >= 0;
176
179
  var showAgg = types.indexOf("agg") >= 0; // console.log("edges----types",showType, types,showPhy, showAgg);
177
180
 
178
- if (Array.isArray(edges) && edges.length > 0) {
179
- edges.forEach(function (edge) {
180
- if (showType === 1 || showType === true) {
181
- // 单链路全部显示
182
- // console.log("单链路全部显示", edge);
183
- edge.s("x.visible", true);
184
- } else {
185
- var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
181
+ edges.forEach(function (edge) {
182
+ if (showType === 1 || showType === true) {
183
+ // 单链路全部显示
184
+ // console.log("单链路全部显示", edge);
185
+ edge.s("x.visible", true);
186
+ } else {
187
+ var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
186
188
 
187
- if (isAggLink(d)) {
188
- edge.s("x.visible", showAgg);
189
- } else {
190
- // console.log("edge", edge, d, showAgg);
191
- edge.s("x.visible", showPhy);
192
- }
189
+ if (isAggLink(d)) {
190
+ edge.s("x.visible", showAgg);
191
+ } else {
192
+ // console.log("edge", edge, d, showAgg);
193
+ edge.s("x.visible", showPhy);
193
194
  }
194
- });
195
- }
195
+ }
196
+ });
196
197
  };
197
198
  export var mergeExportLinkData = function mergeExportLinkData(props) {
198
199
  var source = props.source,
@@ -8,13 +8,14 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
8
8
  import { getUUID, isAvailableArray } from "@riil-frontend/utils";
9
9
  import { transformTopoElements } from "@riil-frontend/component-topology-graph/es/utils";
10
10
  import { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
11
- import rlog from "@riil-frontend/component-topology-utils/es/rlog";
11
+ import Logger from 'loglevel';
12
12
  import { removeFromArray } from "../../../utils/format";
13
13
  import { DEFAULT_GROUP } from "../../../utils/template";
14
14
  import { combTopoData, getCiTypes } from "../../../utils/topoData";
15
15
  import { saveTopo as _saveTopo, resToConditions, getLayoutId } from "../../../core/models/topoData";
16
16
  import networkLinkServer from "../../../networkTopo/services/topo/networkLink";
17
17
  import { addLinkData, buildData as buildTopoData } from "../../../networkTopo/getTopoData";
18
+ var rlog = Logger.getLogger('topo');
18
19
 
19
20
  var newGroupWithUUID = function newGroupWithUUID(group) {
20
21
  if (group === void 0) {
@@ -1,12 +1,13 @@
1
1
  import rlog from "@riil-frontend/component-topology-utils/es/rlog";
2
2
  import { showLinkByConfig } from "../models/utils/linkUtils";
3
+ import { isEdgeGroupAgent } from "../../utils/htElementUtils";
3
4
  /**
4
5
  * 是否手工连线
5
6
  * @param {*} edge
6
7
  */
7
8
 
8
9
  export function isCustomEdge(edge) {
9
- return !edge.isEdgeGroupAgent() && (edge.a('type') == 'line' || !edge.a('type'));
10
+ return !isEdgeGroupAgent(edge) && (edge.a('type') == 'line' || !edge.a('type'));
10
11
  }
11
12
  /**
12
13
  * 根据配置更新连线展开折叠状态
@@ -15,7 +16,7 @@ export function isCustomEdge(edge) {
15
16
  */
16
17
 
17
18
  export var updateEdgeExpanded = function updateEdgeExpanded(topo) {
18
- var _topo$historyManager, _topo$historyManager2;
19
+ var _topo$historyManager, _topo$historyManager2, _topo$linkDynamicStyl;
19
20
 
20
21
  var _topo$store$getModelS = topo.store.getModelState("topoMod"),
21
22
  viewState = _topo$store$getModelS.viewState;
@@ -28,8 +29,7 @@ export var updateEdgeExpanded = function updateEdgeExpanded(topo) {
28
29
  }
29
30
 
30
31
  var _topo$store$getModelS2 = topo.store.getModelState("displayConfig"),
31
- expandAllEdges = _topo$store$getModelS2.expandAllEdges; // console.log("expandAllEdges----------", expandAllEdges);
32
-
32
+ expandAllEdges = _topo$store$getModelS2.expandAllEdges;
33
33
 
34
34
  (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '连线展开控制');
35
35
 
@@ -38,10 +38,10 @@ export var updateEdgeExpanded = function updateEdgeExpanded(topo) {
38
38
  topo: topo,
39
39
  showType: 1
40
40
  });
41
- htTopo.collapseAllEdgeGroups();
41
+ htTopo.toggleAllEdgeGroups(false);
42
42
  rlog.debug("updateEdgeExpanded 折叠");
43
43
  } else {
44
- htTopo.expandAllEdgeGroups();
44
+ htTopo.toggleAllEdgeGroups(true);
45
45
  showLinkByConfig({
46
46
  topo: topo,
47
47
  showType: expandAllEdges,
@@ -51,8 +51,5 @@ export var updateEdgeExpanded = function updateEdgeExpanded(topo) {
51
51
  }
52
52
 
53
53
  (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '连线展开控制');
54
-
55
- if (topo.linkDynamicStyleExecutor) {
56
- topo.linkDynamicStyleExecutor.execute();
57
- }
54
+ (_topo$linkDynamicStyl = topo.linkDynamicStyleExecutor) === null || _topo$linkDynamicStyl === void 0 ? void 0 : _topo$linkDynamicStyl.execute();
58
55
  };
@@ -1,5 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import DefaultDetailContent from "../../ResourceDetail/DefaultDetailContent";
3
+ import { isEdgeGroupAgent } from "../../../../../../utils/htElementUtils";
3
4
 
4
5
  function useElementDetailManager(props) {
5
6
  var topo = props.topo,
@@ -62,9 +63,8 @@ function useElementDetailManager(props) {
62
63
  }
63
64
 
64
65
  function openByHtElement(htElement) {
65
- var isEdgeGroupAgent = htElement instanceof ht.Edge && htElement.isEdgeGroupAgent() && !htElement.s('edge.expanded');
66
66
  open({
67
- id: isEdgeGroupAgent || !htElement.getTag() ? "ht:" + htElement.getId() : htElement.getTag(),
67
+ id: isEdgeGroupAgent(htElement) || !htElement.getTag() ? "ht:" + htElement.getId() : htElement.getTag(),
68
68
  htElement: htElement
69
69
  });
70
70
  }
@@ -9,32 +9,70 @@ import BlockBox from "./BlockBox";
9
9
  import Link from "../../../../../../../components/Link";
10
10
  import service from "../../../../../../services/overview";
11
11
  import styles from "./index.module.scss";
12
+ import { getHistory } from '@riil-frontend/component-topology-utils';
12
13
 
13
14
  function formatUrl(url) {
14
- return url;
15
+ var _window, _window$location;
16
+
17
+ console.log(url);
18
+ var prefix = '/default/pagecenter';
19
+
20
+ if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
21
+ return url.split(prefix)[1];
22
+ } else {
23
+ return url;
24
+ }
15
25
  }
16
26
 
17
27
  function EventsCard(props) {
18
28
  var alarmRiskList = props.alarmRiskList,
19
29
  closeDetailDrawer = props.closeDetailDrawer,
20
- onHandleAlarm = props.onHandleAlarm; // 告警table列配置
30
+ onHandleAlarm = props.onHandleAlarm;
31
+
32
+ var jumpTo = function jumpTo(url) {
33
+ closeDetailDrawer();
34
+
35
+ if (topo.viewProps.jumpto) {
36
+ topo.viewProps.jumpto(formatUrl(url));
37
+ } else {
38
+ getHistory().push(formatUrl(url));
39
+ }
40
+ }; // 告警table列配置
41
+
21
42
 
22
43
  var columns = [{
23
44
  title: "描述",
24
45
  dataIndex: "title",
25
46
  key: "title",
26
47
  cell: function cell(value, index, record) {
27
- return /*#__PURE__*/React.createElement("div", {
28
- className: styles["alarm-title"],
29
- title: value,
30
- onClick: closeDetailDrawer
31
- }, /*#__PURE__*/React.createElement(_Icon, {
32
- type: record.icon,
33
- size: "xs",
34
- className: styles["alarm-color-icon"] + " " + record.className
35
- }), /*#__PURE__*/React.createElement(Link, {
36
- to: formatUrl(record.link)
37
- }, value));
48
+ return (
49
+ /*#__PURE__*/
50
+ // <div
51
+ // className={styles["alarm-title"]}
52
+ // title={value}
53
+ // onClick={closeDetailDrawer}
54
+ // >
55
+ // <Icon
56
+ // type={record.icon}
57
+ // size="xs"
58
+ // className={`${styles["alarm-color-icon"]} ${record.className}`}
59
+ // />
60
+ // <Link to={formatUrl(record.link)}>{value}</Link>
61
+ // </div>
62
+ React.createElement("div", {
63
+ className: styles['alarm-title'],
64
+ title: value,
65
+ onClick: function onClick() {
66
+ jumpTo(record.link);
67
+ }
68
+ }, /*#__PURE__*/React.createElement(_Icon, {
69
+ type: record.icon,
70
+ size: "xs",
71
+ className: styles['alarm-color-icon'] + " " + record.className
72
+ }), /*#__PURE__*/React.createElement("span", {
73
+ className: styles.link
74
+ }, value))
75
+ );
38
76
  }
39
77
  }, {
40
78
  title: "时间",
@@ -1,7 +1,7 @@
1
1
  .container {
2
2
  width: 100%;
3
3
  height: 100%;
4
- min-height: 250px;
4
+ min-height: 260px;
5
5
  position: relative;
6
6
  .floatBox{
7
7
  position: absolute;
@@ -154,3 +154,11 @@
154
154
  background-color: transparent;
155
155
  border-color: transparent;
156
156
  }
157
+ .link{
158
+ width: 100%;
159
+ overflow: hidden;
160
+ text-overflow: ellipsis;
161
+ white-space: nowrap;
162
+ color: var(--color-link-1);
163
+ cursor: pointer;
164
+ }
@@ -1,4 +1,4 @@
1
- import { getEdgeGroups } from "../../utils/htElementUtils";
1
+ import { getEdgeGroupAgents, getEdgeGroups } from "../../utils/htElementUtils";
2
2
  import { getEdgeGroupLinkIdConfig } from "../utils/edgeGroupTagUtil";
3
3
 
4
4
  var EdgeGroupTagTipBuilder = /*#__PURE__*/function () {
@@ -16,11 +16,11 @@ var EdgeGroupTagTipBuilder = /*#__PURE__*/function () {
16
16
 
17
17
  var topo = this.topo;
18
18
  var dm = this.topo.getDataModel();
19
- var edgeGroupsTagsTips = getEdgeGroups(dm).map(function (edgeGroup) {
20
- var edge = edgeGroup.getEdges().getArray()[0]; // 获取配置的链路
21
-
22
- var linkId = getEdgeGroupLinkIdConfig(edge, topo);
23
- var edgeGroupId = [edge.getSourceAgent().getId(), edge.getTargetAgent().getId()];
19
+ var edgeGroupAgents = getEdgeGroupAgents(dm);
20
+ var edgeGroupsTagsTips = edgeGroupAgents.map(function (edgeGroupAgent) {
21
+ // 获取配置的链路
22
+ var linkId = getEdgeGroupLinkIdConfig(edgeGroupAgent, topo);
23
+ var edgeGroupId = [edgeGroupAgent.getSource().getId(), edgeGroupAgent.getTarget().getId()];
24
24
  var data = {
25
25
  tags: [],
26
26
  tips: []
@@ -31,7 +31,7 @@ var EdgeGroupTagTipBuilder = /*#__PURE__*/function () {
31
31
  }
32
32
 
33
33
  return {
34
- htId: edge.getId(),
34
+ htId: edgeGroupAgent.getId(),
35
35
  edgeGroupId: edgeGroupId,
36
36
  tags: data.tags,
37
37
  tips: data.tips,
@@ -1,7 +1,5 @@
1
- import { rlog } from '@riil-frontend/component-topology-utils';
2
1
  import { isClusterHtElement } from "../../utils/clusterUtil";
3
- import { getEdgeGroupByNodeTags, getEdges, isNode } from "../../utils/htElementUtils";
4
- import { getLinksBetweenNodes } from "../utils/linkUtil"; // network_link.actual_bandwidth
2
+ import { isNode } from "../../utils/htElementUtils"; // network_link.actual_bandwidth
5
3
 
6
4
  function calcEdgeWidth(actualBandwidth) {
7
5
  if (!actualBandwidth) {
@@ -52,16 +50,17 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
52
50
  var _proto = LinkDynamicStyleExecutor.prototype;
53
51
 
54
52
  _proto.execute = function execute() {
55
- var _this = this;
53
+ var _topo$historyManager,
54
+ _this = this,
55
+ _topo$historyManager2;
56
56
 
57
57
  var topo = this.topo;
58
58
 
59
59
  var _topo$dataModel$getDa = topo.dataModel.getData(),
60
- links = _topo$dataModel$getDa.links,
61
- linkGroups = _topo$dataModel$getDa.linkGroups;
60
+ links = _topo$dataModel$getDa.links;
62
61
 
63
62
  var dataModel = this.topo.getDataModel();
64
- topo.historyManager && topo.historyManager.setDisabled(true, '链路动态样式'); // 1、如果连线可见,设置线宽
63
+ (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '链路动态样式'); // 1、如果连线可见,设置线宽
65
64
 
66
65
  links.forEach(function (link) {
67
66
  var edge = dataModel.getDataByTag(link.id);
@@ -69,63 +68,8 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
69
68
  if (edge) {
70
69
  edge.s('edge.width', _this.calcLinkEdgeWidth(link));
71
70
  }
72
- }); // 2、如果连线组关联链路并可见,设置线宽
73
-
74
- linkGroups.forEach(function (link) {
75
- // 聚合链路是连线/连线组,并可以查询到
76
- var edge = topo.getDataModel().getDataByTag(link.id);
77
-
78
- if (edge) {
79
- edge.s('edge.width', _this.calcLinkEdgeWidth(link));
80
- return;
81
- } // 聚合链路是连线组(编辑模式还未关联业务信息)
82
-
83
-
84
- var edgeGroup = getEdgeGroupByNodeTags(dataModel, link.source, link.target);
85
-
86
- if (edgeGroup) {
87
- var edgeGroupAgent = edgeGroup.getEdgeGroupAgent(); // 判断是显示的连线组元素
88
-
89
- if (edgeGroupAgent) {
90
- edgeGroup.getEdgeGroupAgent().s('edge.width', _this.calcLinkEdgeWidth(link));
91
- }
92
- } else {
93
- rlog.warn('动态链路样式执行:未找到聚合链路的ht元素', link);
94
- }
95
- }); // 3、如果连线组未关联链路并可见,设置线宽。
96
-
97
- var edges = getEdges(dataModel);
98
- edges.forEach(function (edge) {
99
- try {
100
- // 获取两端代理节点
101
- var sourceAgent = edge.getSourceAgent();
102
- var targetAgent = edge.getTargetAgent();
103
- var sourceId = sourceAgent.getTag();
104
- var targetId = targetAgent.getTag(); // 查询是否有聚合链路
105
-
106
- var aggLink = linkGroups.find(function (link) {
107
- return link.source === sourceId && link.target === targetId || link.target === sourceId && link.source === targetId;
108
- }); // 如果连线组未关联链路并可见
109
-
110
- if (!aggLink && edge.isEdgeGroupAgent()) {
111
- // 查询两端代理节点(包含子节点)间的子链路列表
112
- var sourceCiIds = getChildrenNodeCiIds([sourceAgent]);
113
- var targetCiIds = getChildrenNodeCiIds([targetAgent]);
114
- var aggLinks = getLinksBetweenNodes(linkGroups, sourceCiIds, targetCiIds);
115
- var phyLinks = getLinksBetweenNodes(links, sourceCiIds, targetCiIds);
116
- var linkBetweenNodes = aggLinks.length ? aggLinks : phyLinks; // 如果有子链路,计算线宽并设置
117
-
118
- if (linkBetweenNodes.length) {
119
- var edgeWidth = _this.calcEdgeGroupEdgeWidth(linkBetweenNodes);
120
-
121
- edge.s('edge.width', edgeWidth);
122
- }
123
- }
124
- } catch (error) {
125
- rlog.error('连线组未关联链路并可见,设置线宽:异常', edge, error);
126
- }
127
71
  });
128
- topo.historyManager && topo.historyManager.setDisabled(false, '链路动态样式');
72
+ (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '链路动态样式');
129
73
  }
130
74
  /**
131
75
  * 处理单个连线组切换。有链路时设置