@riil-frontend/component-topology 12.0.0-dev.9 → 12.1.0-dev.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 (90) 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/components/TemplateButton/index.module.scss +1 -1
  5. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +58 -3
  6. package/es/core/components/TopoView/topoView.js +5 -1
  7. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +5 -12
  8. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -10
  9. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
  10. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +9 -0
  11. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -2
  12. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
  13. package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
  14. package/es/core/editor/utils/copyElementUtil.js +12 -0
  15. package/es/core/editor/utils/edgeTypeStyleUtil.js +8 -30
  16. package/es/core/hooks/useAlarm.js +131 -81
  17. package/es/core/hooks/useCmpLinkAlarm.js +153 -0
  18. package/es/core/hooks/useEventData.js +1 -2
  19. package/es/core/hooks/useGraphAlarmDisplay.js +91 -56
  20. package/es/core/hooks/useResourceConfig.js +1 -3
  21. package/es/core/hooks/useTopoEdit.js +31 -43
  22. package/es/core/models/Alarm.js +69 -142
  23. package/es/core/models/AttributeMetricDisplay.js +9 -3
  24. package/es/core/models/TopoApp.js +1 -1
  25. package/es/core/models/cache/CiCache.d.ts +1 -1
  26. package/es/core/models/cache/CiCache.js +3 -3
  27. package/es/core/models/topoData.js +0 -1
  28. package/es/core/models/utils/linkUtils.js +20 -13
  29. package/es/core/services/topo/basic.js +2 -2
  30. package/es/core/store/models/topoConfig.js +7 -10
  31. package/es/core/store/models/topoMod.js +81 -134
  32. package/es/core/utils/edgeUtil.js +8 -0
  33. package/es/core/utils/metricUtil.js +8 -4
  34. package/es/core/utils/showGraphManageStatusUtil.js +3 -2
  35. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
  36. package/es/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  37. package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
  38. package/es/networkTopo/components/TopoView.js +6 -11
  39. package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
  40. package/es/networkTopo/services/topo/basic.js +3 -3
  41. package/es/networkTopo/store/topoCenter.js +260 -223
  42. package/es/style.js +1 -1
  43. package/es/utils/ResourceConfigUtil.js +3 -36
  44. package/es/utils/ciRefAttributeTranslateUtil.d.ts +9 -2
  45. package/es/utils/ciRefAttributeTranslateUtil.js +8 -9
  46. package/es/utils/topoData.js +1 -1
  47. package/lib/components/TemplateButton/index.module.scss +1 -1
  48. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +60 -3
  49. package/lib/core/components/TopoView/topoView.js +5 -1
  50. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +6 -12
  51. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
  52. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
  53. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
  54. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
  55. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
  56. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
  57. package/lib/core/editor/utils/copyElementUtil.js +15 -0
  58. package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -31
  59. package/lib/core/hooks/useAlarm.js +130 -79
  60. package/lib/core/hooks/useCmpLinkAlarm.js +166 -0
  61. package/lib/core/hooks/useEventData.js +1 -2
  62. package/lib/core/hooks/useGraphAlarmDisplay.js +91 -55
  63. package/lib/core/hooks/useResourceConfig.js +1 -3
  64. package/lib/core/hooks/useTopoEdit.js +30 -42
  65. package/lib/core/models/Alarm.js +69 -144
  66. package/lib/core/models/AttributeMetricDisplay.js +10 -2
  67. package/lib/core/models/TopoApp.js +1 -1
  68. package/lib/core/models/cache/CiCache.d.ts +1 -1
  69. package/lib/core/models/cache/CiCache.js +3 -3
  70. package/lib/core/models/topoData.js +0 -1
  71. package/lib/core/models/utils/linkUtils.js +21 -13
  72. package/lib/core/services/topo/basic.js +2 -2
  73. package/lib/core/store/models/topoConfig.js +7 -10
  74. package/lib/core/store/models/topoMod.js +81 -134
  75. package/lib/core/utils/edgeUtil.js +10 -0
  76. package/lib/core/utils/metricUtil.js +8 -4
  77. package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
  78. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
  79. package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  80. package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
  81. package/lib/networkTopo/components/TopoView.js +5 -14
  82. package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
  83. package/lib/networkTopo/services/topo/basic.js +3 -3
  84. package/lib/networkTopo/store/topoCenter.js +262 -225
  85. package/lib/style.js +1 -1
  86. package/lib/utils/ResourceConfigUtil.js +3 -38
  87. package/lib/utils/ciRefAttributeTranslateUtil.d.ts +9 -2
  88. package/lib/utils/ciRefAttributeTranslateUtil.js +8 -9
  89. package/lib/utils/topoData.js +1 -1
  90. package/package.json +2 -2
@@ -2,8 +2,7 @@ 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
4
  import keyBy from "lodash/keyBy";
5
- import _ from "lodash";
6
- import { queryCisByIds, queryModelAsset } from "../../services"; // 查询所有连线
5
+ import _ from "lodash"; // 查询所有连线
7
6
 
8
7
  import { getEdges } from "../../../utils/htElementUtils";
9
8
  import CiTypeCache from "../cache/CiTypeCache";
@@ -32,7 +31,20 @@ export function isCrucialLink(link) {
32
31
  */
33
32
 
34
33
  export function isExitLink(link) {
35
- return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
34
+ var _link$attributes;
35
+
36
+ return (link === null || link === void 0 ? void 0 : (_link$attributes = link.attributes) === null || _link$attributes === void 0 ? void 0 : _link$attributes.destination_type) === "ip";
37
+ }
38
+ /**
39
+ * 是否聚合链路
40
+ * @param {*} link
41
+ * @returns
42
+ */
43
+
44
+ export function isAggLink(link) {
45
+ var _link$attributes2, _link$attributes3;
46
+
47
+ return (link === null || link === void 0 ? void 0 : (_link$attributes2 = link.attributes) === null || _link$attributes2 === void 0 ? void 0 : _link$attributes2.destination_type) === "network.agg_interface" && (link === null || link === void 0 ? void 0 : (_link$attributes3 = link.attributes) === null || _link$attributes3 === void 0 ? void 0 : _link$attributes3.source_type) === "network.agg_interface";
36
48
  }
37
49
  export function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
38
50
  var linkCiMap = keyBy(links, "id");
@@ -83,7 +95,7 @@ function _getLinksDetail() {
83
95
  return _regeneratorRuntime.wrap(function _callee$(_context) {
84
96
  while (1) switch (_context.prev = _context.next) {
85
97
  case 0:
86
- if (!(!links || !links.length)) {
98
+ if (links !== null && links !== void 0 && links.length) {
87
99
  _context.next = 2;
88
100
  break;
89
101
  }
@@ -91,9 +103,6 @@ function _getLinksDetail() {
91
103
  return _context.abrupt("return", []);
92
104
 
93
105
  case 2:
94
- // const linkCis = await topoService.relation.batchQueryRelation(
95
- // links.map((link) => link.id)
96
- // );
97
106
  linkCis = links;
98
107
  interfaceIds = [].concat(linkCis.map(function (item) {
99
108
  return item.attributes.source_id;
@@ -171,17 +180,15 @@ export var showLinkByConfig = function showLinkByConfig(props) {
171
180
  if (showType === 1 || showType === true) {
172
181
  // 单链路全部显示
173
182
  // console.log("单链路全部显示", edge);
174
- edge.s("2d.visible", true);
183
+ edge.s("x.visible", true);
175
184
  } else {
176
- var _d$attributes, _d$attributes2;
177
-
178
185
  var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
179
186
 
180
- if ((d === null || d === void 0 ? void 0 : (_d$attributes = d.attributes) === null || _d$attributes === void 0 ? void 0 : _d$attributes.destination_type) === "network.agg_interface" && (d === null || d === void 0 ? void 0 : (_d$attributes2 = d.attributes) === null || _d$attributes2 === void 0 ? void 0 : _d$attributes2.source_type) === "network.agg_interface") {
181
- edge.s("2d.visible", showAgg);
187
+ if (isAggLink(d)) {
188
+ edge.s("x.visible", showAgg);
182
189
  } else {
183
190
  // console.log("edge", edge, d, showAgg);
184
- edge.s("2d.visible", showPhy);
191
+ edge.s("x.visible", showPhy);
185
192
  }
186
193
  }
187
194
  });
@@ -104,7 +104,7 @@ export default {
104
104
  * @param {Array} groups
105
105
  * @returns
106
106
  */
107
- getTopoDataByResource: function getTopoDataByResource(id, resources, groups, exportLinkIdList) {
107
+ getTopoDataByResource: function getTopoDataByResource(id, resources, groups) {
108
108
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
109
109
  var data, obj;
110
110
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -123,7 +123,7 @@ export default {
123
123
  obj = prepareGroupParams(data);
124
124
  _context.next = 5;
125
125
  return request.post(API_ROOT + "/structure/byCondition/" + id, _extends({}, obj, {
126
- exportLinkIdList: exportLinkIdList
126
+ exportLinkIdList: []
127
127
  }));
128
128
 
129
129
  case 5:
@@ -35,7 +35,6 @@ var initialState = {
35
35
  "static": []
36
36
  },
37
37
  groups: [],
38
- exportLinkIdList: [],
39
38
  // config: {
40
39
  // view: null,
41
40
  // groups: [],
@@ -243,18 +242,17 @@ export default function (topoApp) {
243
242
  var _this2 = this;
244
243
 
245
244
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
246
- var editState, resources, _editState$groups, groups, _editState$ipNodes, ipNodes, query, data;
245
+ var editState, resources, _editState$groups, groups, query, data;
247
246
 
248
247
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
249
248
  while (1) switch (_context2.prev = _context2.next) {
250
249
  case 0:
251
250
  editState = rootState.topoConfig;
252
- resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups, _editState$ipNodes = editState.ipNodes, ipNodes = _editState$ipNodes === void 0 ? [] : _editState$ipNodes;
251
+ resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups;
253
252
  query = {
254
253
  id: rootState.topoMod.topoId,
255
254
  resources: resources,
256
- groups: groups,
257
- ipNodes: ipNodes
255
+ groups: groups
258
256
  };
259
257
  _context2.next = 5;
260
258
  return _this2.getTopoByConditions(query);
@@ -303,13 +301,13 @@ export default function (topoApp) {
303
301
  var _this4 = this;
304
302
 
305
303
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
306
- var topoId, resources, groups, exportLinkIdList, ipNodes, viewConditions, groupInfo, data, _yield$Promise$all, dataWithLinkDetail, _combTopoData, topoData, resAndMetrics, topoDataTrans;
304
+ var topoId, resources, groups, viewConditions, groupInfo, data, _yield$Promise$all, dataWithLinkDetail, _combTopoData, topoData, resAndMetrics, topoDataTrans;
307
305
 
308
306
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
309
307
  while (1) switch (_context4.prev = _context4.next) {
310
308
  case 0:
311
309
  rlog.debug("getTopoByConditions--------", params);
312
- topoId = params.id, resources = params.resources, groups = params.groups, exportLinkIdList = params.exportLinkIdList, ipNodes = params.ipNodes;
310
+ topoId = params.id, resources = params.resources, groups = params.groups;
313
311
  viewConditions = resToConditions(resources);
314
312
  groupInfo = isAvailableArray(groups) && groups.map(function (group) {
315
313
  return _extends({}, group, {
@@ -319,7 +317,7 @@ export default function (topoApp) {
319
317
  });
320
318
  rlog.debug("getTopoByConditions--------", viewConditions, groupInfo);
321
319
  _context4.next = 7;
322
- return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList, ipNodes);
320
+ return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo);
323
321
 
324
322
  case 7:
325
323
  data = _context4.sent;
@@ -458,8 +456,7 @@ export default function (topoApp) {
458
456
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
459
457
  while (1) switch (_context8.prev = _context8.next) {
460
458
  case 0:
461
- ids = data.ids, ip = data.ip; // console.log("queryAllLinkByIp", ids, ip);
462
-
459
+ ids = data.ids, ip = data.ip;
463
460
  _context8.next = 3;
464
461
  return networkLinkServer.queryLinksByIp(ids, ip);
465
462
 
@@ -208,76 +208,23 @@ export default function (topoApp) {
208
208
  enterEditMode: function enterEditMode(playload, rootState) {
209
209
  topoApp.enterEditMode();
210
210
  },
211
- openDefaultTopoPage: function openDefaultTopoPage(conditions, rootState) {
212
- var _this3 = this;
213
-
211
+ refreshPermission: function refreshPermission() {
214
212
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
215
- var topoId, treeData;
216
213
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
217
214
  while (1) switch (_context3.prev = _context3.next) {
218
215
  case 0:
219
- if (conditions === void 0) {
220
- conditions = {};
221
- }
222
-
223
- topoId = rootState.topoTreeMod.defId;
224
-
225
- if (!topoId) {
226
- // 查找第一个
227
- treeData = rootState.topoTreeMod.treeData;
228
- loopTreeByKey(treeData, 'type', 1, function (item, index, arr) {
229
- if (!topoId) {
230
- topoId = item.id;
231
- }
232
- });
233
- } // 右侧切换拓扑图
234
-
235
-
236
- _this3.openTopoPage({
237
- id: topoId
238
- });
239
-
240
- case 4:
241
- case "end":
242
- return _context3.stop();
243
- }
244
- }, _callee3);
245
- }))();
246
- },
247
- refreshPermission: function refreshPermission() {
248
- var _this4 = this;
249
-
250
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
251
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
252
- while (1) switch (_context4.prev = _context4.next) {
253
- case 0:
254
- _context4.next = 2;
216
+ _context3.next = 2;
255
217
  return dispatch.functionAuth.refresh();
256
218
 
257
219
  case 2:
258
- _context4.next = 4;
259
- return _this4.refreshTopoTree();
260
-
261
- case 4:
262
- case "end":
263
- return _context4.stop();
264
- }
265
- }, _callee4);
266
- }))();
267
- },
268
- refreshTopoTree: function refreshTopoTree() {
269
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
270
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
271
- while (1) switch (_context5.prev = _context5.next) {
272
- case 0:
273
- _context5.next = 2;
220
+ _context3.next = 4;
274
221
  return dispatch.topoTreeMod.refreshTree();
275
222
 
276
- case 2:
223
+ case 4:
277
224
  case "end":
278
- return _context5.stop();
225
+ return _context3.stop();
279
226
  }
280
- }, _callee5);
227
+ }, _callee3);
281
228
  }))();
282
229
  },
283
230
 
@@ -292,19 +239,19 @@ export default function (topoApp) {
292
239
  * @return {Promise<void>}
293
240
  */
294
241
  initTopoData: function initTopoData(props, state) {
295
- var _this5 = this;
242
+ var _this3 = this;
296
243
 
297
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
244
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
298
245
  var _result$config;
299
246
 
300
247
  var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, graphConfig, topoConfig, extraConfig, _combTopoData, topoData, resAndMetrics, _yield$Promise$all, newData, endTime;
301
248
 
302
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
303
- while (1) switch (_context6.prev = _context6.next) {
249
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
250
+ while (1) switch (_context4.prev = _context4.next) {
304
251
  case 0:
305
252
  startTime = moment();
306
253
  topoId = props.topoId, data = props.data, linkToData = props.linkTo, refresh = props.refresh, clear = props.clear;
307
- _context6.next = 4;
254
+ _context4.next = 4;
308
255
  return topoApp.open(topoId);
309
256
 
310
257
  case 4:
@@ -327,7 +274,7 @@ export default function (topoApp) {
327
274
  });
328
275
  }
329
276
 
330
- _this5.update(startState);
277
+ _this3.update(startState);
331
278
 
332
279
  dispatch.topoBizMod.update({
333
280
  pollingSwitch: false
@@ -337,24 +284,24 @@ export default function (topoApp) {
337
284
  permission = 'write';
338
285
 
339
286
  if (!topoApp.options.usePermission) {
340
- _context6.next = 19;
287
+ _context4.next = 19;
341
288
  break;
342
289
  }
343
290
 
344
- _context6.next = 14;
345
- return _this5.getTopoPermission({
291
+ _context4.next = 14;
292
+ return _this3.getTopoPermission({
346
293
  id: topoId
347
294
  });
348
295
 
349
296
  case 14:
350
- permission = _context6.sent;
297
+ permission = _context4.sent;
351
298
 
352
299
  if (topoPermissonUtil.isReadable(permission)) {
353
- _context6.next = 19;
300
+ _context4.next = 19;
354
301
  break;
355
302
  }
356
303
 
357
- _this5.update({
304
+ _this3.update({
358
305
  loading: false,
359
306
  topoData: null,
360
307
  data: null,
@@ -363,26 +310,26 @@ export default function (topoApp) {
363
310
  });
364
311
 
365
312
  topoApp.options.onLoad();
366
- return _context6.abrupt("return");
313
+ return _context4.abrupt("return");
367
314
 
368
315
  case 19:
369
316
  if (!data) {
370
- _context6.next = 30;
317
+ _context4.next = 30;
371
318
  break;
372
319
  }
373
320
 
374
321
  graphConfig = {};
375
322
 
376
323
  if (!topoId) {
377
- _context6.next = 27;
324
+ _context4.next = 27;
378
325
  break;
379
326
  }
380
327
 
381
- _context6.next = 24;
328
+ _context4.next = 24;
382
329
  return topoService.getTopoData(topoId);
383
330
 
384
331
  case 24:
385
- topoConfig = _context6.sent;
332
+ topoConfig = _context4.sent;
386
333
  if (!topoConfig) rlog.error("\u672A\u67E5\u8BE2\u5230\u62D3\u6251id " + topoId + " \u7684\u6570\u636E\uFF0C\u8BF7\u68C0\u67E5");
387
334
  graphConfig = {
388
335
  global: topoConfig === null || topoConfig === void 0 ? void 0 : topoConfig.global,
@@ -392,23 +339,23 @@ export default function (topoApp) {
392
339
 
393
340
  case 27:
394
341
  result = _extends({}, data, graphConfig);
395
- _context6.next = 33;
342
+ _context4.next = 33;
396
343
  break;
397
344
 
398
345
  case 30:
399
- _context6.next = 32;
346
+ _context4.next = 32;
400
347
  return topoApp.options.loadData(topoId, topoApp.serverApi);
401
348
 
402
349
  case 32:
403
- result = _context6.sent;
350
+ result = _context4.sent;
404
351
 
405
352
  case 33:
406
353
  if (result) {
407
- _context6.next = 37;
354
+ _context4.next = 37;
408
355
  break;
409
356
  }
410
357
 
411
- _this5.update({
358
+ _this3.update({
412
359
  loading: false,
413
360
  data: null,
414
361
  globalConfig: null,
@@ -417,17 +364,17 @@ export default function (topoApp) {
417
364
  });
418
365
 
419
366
  topoApp.options.onLoad();
420
- return _context6.abrupt("return");
367
+ return _context4.abrupt("return");
421
368
 
422
369
  case 37:
423
370
  result = parseTopoData(result);
424
371
  rlog.debug('topoMod.initTopoData 查询数据完成', topoId, linkTo, result);
425
- _context6.next = 41;
372
+ _context4.next = 41;
426
373
  return dispatch.customIcon.loadCustomIcons();
427
374
 
428
375
  case 41:
429
376
  extraConfig = result.global.extraConfig;
430
- _context6.next = 44;
377
+ _context4.next = 44;
431
378
  return dispatch.displayConfig.setConfig(_extends({}, extraConfig, {
432
379
  alarmSwitch: result.global.alarmSwitch,
433
380
  alarmListDefaultOpen: result.global.alarmListDefaultOpen
@@ -441,8 +388,8 @@ export default function (topoApp) {
441
388
  globalConfig: extraConfig
442
389
  }), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics; // rlog.debug("topoMod.initTopoData combTopoData", { topoData, resAndMetrics, });
443
390
 
444
- _context6.next = 47;
445
- return _this5.update({
391
+ _context4.next = 47;
392
+ return _this3.update({
446
393
  currentTopo: topoData.config,
447
394
  data: result,
448
395
  globalConfig: extraConfig,
@@ -457,15 +404,15 @@ export default function (topoApp) {
457
404
 
458
405
  topoApp.alarm.open(); // 加载标注悬浮框数据
459
406
 
460
- _context6.next = 52;
407
+ _context4.next = 52;
461
408
  return Promise.all([addLinkData(result), topoApp.ciTyeCache.load(getCiTypes(result)), topoApp.elementTagTipConfig.init(result) // 暂停新配置开发
462
409
  ]);
463
410
 
464
411
  case 52:
465
- _yield$Promise$all = _context6.sent;
412
+ _yield$Promise$all = _context4.sent;
466
413
  newData = _yield$Promise$all[0];
467
- _context6.next = 56;
468
- return _this5.update({
414
+ _context4.next = 56;
415
+ return _this3.update({
469
416
  data: newData
470
417
  });
471
418
 
@@ -478,15 +425,15 @@ export default function (topoApp) {
478
425
  rlog.info('topoMod.initTopoData 初始化拓扑图数据完成. 耗时: ', endTime.diff(startTime, 'seconds', true));
479
426
  topoApp.options.onLoad();
480
427
 
481
- _this5.update({
428
+ _this3.update({
482
429
  loading: false
483
430
  });
484
431
 
485
432
  case 62:
486
433
  case "end":
487
- return _context6.stop();
434
+ return _context4.stop();
488
435
  }
489
- }, _callee6);
436
+ }, _callee4);
490
437
  }))();
491
438
  },
492
439
 
@@ -494,21 +441,21 @@ export default function (topoApp) {
494
441
  * 刷新拓扑图
495
442
  */
496
443
  refreshTopo: function refreshTopo(payload, rootState) {
497
- var _this6 = this;
444
+ var _this4 = this;
498
445
 
499
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
446
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
500
447
  var _payload, clear;
501
448
 
502
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
503
- while (1) switch (_context7.prev = _context7.next) {
449
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
450
+ while (1) switch (_context5.prev = _context5.next) {
504
451
  case 0:
505
452
  if (payload === void 0) {
506
453
  payload = {};
507
454
  }
508
455
 
509
456
  _payload = payload, clear = _payload.clear;
510
- _context7.next = 4;
511
- return _this6.initTopoData({
457
+ _context5.next = 4;
458
+ return _this4.initTopoData({
512
459
  topoId: rootState.topoMod.topoId,
513
460
  refresh: true,
514
461
  clear: clear
@@ -516,18 +463,18 @@ export default function (topoApp) {
516
463
 
517
464
  case 4:
518
465
  case "end":
519
- return _context7.stop();
466
+ return _context5.stop();
520
467
  }
521
- }, _callee7);
468
+ }, _callee5);
522
469
  }))();
523
470
  },
524
471
  operationTopoPage: function operationTopoPage(conditions, state) {
525
- var _this7 = this;
472
+ var _this5 = this;
526
473
 
527
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
474
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
528
475
  var td;
529
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
530
- while (1) switch (_context8.prev = _context8.next) {
476
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
477
+ while (1) switch (_context6.prev = _context6.next) {
531
478
  case 0:
532
479
  if (conditions === void 0) {
533
480
  conditions = {};
@@ -535,7 +482,7 @@ export default function (topoApp) {
535
482
 
536
483
  if (conditions.id === state.topoMod.topoId) {
537
484
  if (conditions.type === 'delete') {
538
- _this7.update({
485
+ _this5.update({
539
486
  topoId: conditions.defId
540
487
  });
541
488
  }
@@ -547,7 +494,7 @@ export default function (topoApp) {
547
494
  })
548
495
  });
549
496
 
550
- _this7.update({
497
+ _this5.update({
551
498
  topoData: td
552
499
  });
553
500
  }
@@ -555,29 +502,29 @@ export default function (topoApp) {
555
502
 
556
503
  case 2:
557
504
  case "end":
558
- return _context8.stop();
505
+ return _context6.stop();
559
506
  }
560
- }, _callee8);
507
+ }, _callee6);
561
508
  }))();
562
509
  },
563
510
  openPermissionSetting: function openPermissionSetting(payload, rootState) {
564
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
565
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
566
- while (1) switch (_context9.prev = _context9.next) {
511
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
512
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
513
+ while (1) switch (_context7.prev = _context7.next) {
567
514
  case 0:
568
515
  dispatch.permissionSetting.open();
569
516
 
570
517
  case 1:
571
518
  case "end":
572
- return _context9.stop();
519
+ return _context7.stop();
573
520
  }
574
- }, _callee9);
521
+ }, _callee7);
575
522
  }))();
576
523
  },
577
524
  updateDelId: function updateDelId(conditions, state) {
578
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
579
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
580
- while (1) switch (_context10.prev = _context10.next) {
525
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
526
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
527
+ while (1) switch (_context8.prev = _context8.next) {
581
528
  case 0:
582
529
  if (conditions === void 0) {
583
530
  conditions = '';
@@ -587,49 +534,49 @@ export default function (topoApp) {
587
534
 
588
535
  case 2:
589
536
  case "end":
590
- return _context10.stop();
537
+ return _context8.stop();
591
538
  }
592
- }, _callee10);
539
+ }, _callee8);
593
540
  }))();
594
541
  },
595
542
  getTopoPermission: function getTopoPermission(playload, rootState) {
596
- var _this8 = this;
543
+ var _this6 = this;
597
544
 
598
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
545
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
599
546
  var id, update, topoPermission;
600
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
601
- while (1) switch (_context11.prev = _context11.next) {
547
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
548
+ while (1) switch (_context9.prev = _context9.next) {
602
549
  case 0:
603
550
  id = playload.id, update = playload.update;
604
- _context11.prev = 1;
605
- _context11.next = 4;
551
+ _context9.prev = 1;
552
+ _context9.next = 4;
606
553
  return topoApp.serverApi.auth.getTopoPermission(id);
607
554
 
608
555
  case 4:
609
- topoPermission = _context11.sent;
556
+ topoPermission = _context9.sent;
610
557
  rlog.debug('查询拓扑权限', topoPermission);
611
- _context11.next = 11;
558
+ _context9.next = 11;
612
559
  break;
613
560
 
614
561
  case 8:
615
- _context11.prev = 8;
616
- _context11.t0 = _context11["catch"](1);
617
- rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context11.t0); // 尚未区分拓扑图不存在还是接口请求报错
562
+ _context9.prev = 8;
563
+ _context9.t0 = _context9["catch"](1);
564
+ rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context9.t0); // 尚未区分拓扑图不存在还是接口请求报错
618
565
 
619
566
  case 11:
620
567
  if (update !== false) {
621
- _this8.update({
568
+ _this6.update({
622
569
  topoPermission: topoPermission
623
570
  });
624
571
  }
625
572
 
626
- return _context11.abrupt("return", topoPermission);
573
+ return _context9.abrupt("return", topoPermission);
627
574
 
628
575
  case 13:
629
576
  case "end":
630
- return _context11.stop();
577
+ return _context9.stop();
631
578
  }
632
- }, _callee11, null, [[1, 8]]);
579
+ }, _callee9, null, [[1, 8]]);
633
580
  }))();
634
581
  }
635
582
  };
@@ -1,5 +1,13 @@
1
1
  import rlog from "@riil-frontend/component-topology-utils/es/rlog";
2
2
  import { showLinkByConfig } from "../models/utils/linkUtils";
3
+ /**
4
+ * 是否手工连线
5
+ * @param {*} edge
6
+ */
7
+
8
+ export function isCustomEdge(edge) {
9
+ return !edge.isEdgeGroupAgent() && (edge.a('type') == 'line' || !edge.a('type'));
10
+ }
3
11
  /**
4
12
  * 根据配置更新连线展开折叠状态
5
13
  *
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import { metricValueFormat } from '@riil-frontend/utils';
2
3
  import DictCache from "../models/cache/DictCache";
3
4
  /**
@@ -15,16 +16,19 @@ export function formatMetric(val, metricModel) {
15
16
  if (metricModel) {
16
17
  var _result$value;
17
18
 
18
- // 分级字典特殊处理
19
- if (metricModel.dict && !DictCache.getDictObject()[metricModel.code]) {
20
- val = metricModel.dict[val];
19
+ var dictObject = _extends({}, DictCache.getDictObject()); // 分级字典特殊处理
20
+
21
+
22
+ if (metricModel.dict) {
23
+ // val = metricModel.dict[val]
24
+ dictObject[metricModel.code] = metricModel.dict;
21
25
  }
22
26
 
23
27
  var result = metricValueFormat({
24
28
  value: val,
25
29
  dataType: metricModel.dataType,
26
30
  changeValue: metricModel.changeValue,
27
- dict: DictCache.getDictObject(),
31
+ dict: dictObject,
28
32
  unit: metricModel.unit,
29
33
  code: metricModel.code
30
34
  });