@riil-frontend/component-topology 7.0.0-dev.12 → 7.0.0-dev.14

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 (29) hide show
  1. package/build/index.css +1 -1
  2. package/build/index.js +1 -1
  3. package/es/core/editor/components/Toolbar/buttons.js +2 -2
  4. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +9 -2
  5. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  6. package/es/core/hooks/usePolling.js +1 -6
  7. package/es/core/hooks/useTopoEdit.js +3 -1
  8. package/es/core/models/Alarm.js +12 -24
  9. package/es/core/models/TopoApp.js +1 -1
  10. package/es/core/models/utils/linkUtils.js +0 -3
  11. package/es/core/store/models/topoMod.js +7 -6
  12. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
  13. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  14. package/es/networkTopo/getTopoData.js +16 -27
  15. package/es/networkTopo/hooks/editor/useDeleteEdges.js +1 -3
  16. package/lib/core/editor/components/Toolbar/buttons.js +2 -2
  17. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +9 -3
  18. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  19. package/lib/core/hooks/usePolling.js +1 -6
  20. package/lib/core/hooks/useTopoEdit.js +3 -1
  21. package/lib/core/models/Alarm.js +12 -24
  22. package/lib/core/models/TopoApp.js +1 -1
  23. package/lib/core/models/utils/linkUtils.js +0 -5
  24. package/lib/core/store/models/topoMod.js +9 -6
  25. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
  26. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  27. package/lib/networkTopo/getTopoData.js +16 -28
  28. package/lib/networkTopo/hooks/editor/useDeleteEdges.js +1 -4
  29. package/package.json +2 -2
@@ -32,7 +32,7 @@ export default function getButtons(isNetworkTopo) {
32
32
  Divider, NodeImageButton, // 替换图片
33
33
  NodeSizeButton, // 图片尺寸
34
34
  Divider, Layout, // 布局方式
35
- NodeAlignWidget // 对齐方式
36
- // SearchWidget, // 搜索
35
+ NodeAlignWidget, // 对齐方式
36
+ SearchWidget // 搜索
37
37
  ]);
38
38
  }
@@ -1,16 +1,23 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  var _excluded = ["color", "background", "opacity", "bold", "italic"];
4
- import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
5
4
  import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
6
5
  export function getTextStyle(element) {
6
+ var opacity = element.a('edge.tag.opacity');
7
+
8
+ if (opacity === null || opacity === undefined) {
9
+ opacity = 1;
10
+ }
11
+
7
12
  return _extends({
8
13
  color: parseColor(element.a('edge.tag.color')),
9
14
  fontFamily: element.a('edge.tag.fontFamily') || '微软雅黑',
10
15
  fontSize: element.a('edge.tag.fontSize'),
11
16
  bold: !!element.a('edge.tag.fontBold'),
12
17
  italic: !!element.a('edge.tag.fontItalic')
13
- }, parseBackground(element.a('edge.tag.background')));
18
+ }, parseBackground(element.a('edge.tag.background')), {
19
+ opacity: opacity
20
+ });
14
21
  }
15
22
  export function setTextStyle(element, style, topo) {
16
23
  var color = style.color,
@@ -86,6 +86,11 @@ export function getTextStyle(htSelection, styleNames) {
86
86
 
87
87
  var val = fieldValueList[0];
88
88
  var different = fieldValueList.filter(function (item) {
89
+ // 如果是颜色,特殊处理
90
+ if (item && val && item.rgb) {
91
+ return item.rgb.r + "," + item.rgb.g + "," + item.rgb.b + "," + item.rgb.a !== val.rgb.r + "," + val.rgb.g + "," + val.rgb.b + "," + val.rgb.a;
92
+ }
93
+
89
94
  return item !== val;
90
95
  });
91
96
 
@@ -13,12 +13,7 @@ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
13
13
  var usePolling = function usePolling(props) {
14
14
  var topo = props.topo;
15
15
  var store = topo.store;
16
- var topoState = store.useModelState('topoMod');
17
-
18
- var _store$useModel = store.useModel('topoBizMod'),
19
- bizState = _store$useModel[0],
20
- bizDispatchers = _store$useModel[1];
21
-
16
+ var bizState = store.useModelState('topoBizMod');
22
17
  var resAndMetrics = bizState.resAndMetrics,
23
18
  pollingSwitch = bizState.pollingSwitch;
24
19
  var displayConfig = topo.store.useModelState('displayConfig');
@@ -53,8 +53,10 @@ var useTopoEdit = function useTopoEdit(params) {
53
53
  setComboResData = _useState2[1];
54
54
 
55
55
  var reset = function reset() {
56
+ var _topo$historyManager;
57
+
56
58
  topoEditDispatchers.reset();
57
- topo.historyManager.destroy();
59
+ (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.destroy();
58
60
  };
59
61
  /**
60
62
  * 增加资源到视图
@@ -220,23 +220,11 @@ var Alarm = /*#__PURE__*/function () {
220
220
 
221
221
  _proto.hmGetTopoAlarm = /*#__PURE__*/function () {
222
222
  var _hmGetTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
223
- var _this$topo$store$getS, data, resAndMetrics, topoData, _this$getState2, alarmIsOpened, alarmOpening, nodeIdsList, linkIdsList, resIdsList, mainCiIdList, endTime, startTime, parms, result;
224
-
223
+ var mainCiIdList, endTime, startTime, parms, result;
225
224
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
226
225
  while (1) {
227
226
  switch (_context3.prev = _context3.next) {
228
227
  case 0:
229
- _this$topo$store$getS = this.topo.store.getState().topoMod, data = _this$topo$store$getS.data, resAndMetrics = _this$topo$store$getS.resAndMetrics, topoData = _this$topo$store$getS.topoData;
230
- _this$getState2 = this.getState(), alarmIsOpened = _this$getState2.alarmIsOpened, alarmOpening = _this$getState2.alarmOpening; // const { nodes, links } = data;
231
-
232
- nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList, resIdsList = resAndMetrics.resIdsList; // rlog.debug(
233
- // "获取告警列表--resAndMetrics,topoData,data",
234
- // this.topo,
235
- // resAndMetrics,
236
- // topoData,
237
- // data
238
- // );
239
-
240
228
  mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
241
229
  return !!ci.operation;
242
230
  }) // 过滤掉权限
@@ -245,7 +233,7 @@ var Alarm = /*#__PURE__*/function () {
245
233
  });
246
234
 
247
235
  if (!(mainCiIdList.length === 0)) {
248
- _context3.next = 7;
236
+ _context3.next = 4;
249
237
  break;
250
238
  }
251
239
 
@@ -255,7 +243,7 @@ var Alarm = /*#__PURE__*/function () {
255
243
  });
256
244
  return _context3.abrupt("return");
257
245
 
258
- case 7:
246
+ case 4:
259
247
  //rlog.debug("获取告警列表", mainCiIdList);
260
248
  endTime = null; // new Date().valueOf();
261
249
 
@@ -280,10 +268,10 @@ var Alarm = /*#__PURE__*/function () {
280
268
  endTime: endTime
281
269
  }
282
270
  };
283
- _context3.next = 12;
271
+ _context3.next = 9;
284
272
  return topoService.getAlarmByIds(parms);
285
273
 
286
- case 12:
274
+ case 9:
287
275
  result = _context3.sent;
288
276
  rlog.debug("getAlarmById-result", result); // if (alarmIsOpened) {
289
277
  // //this.topo.loadAlarm(result.datas);
@@ -294,7 +282,7 @@ var Alarm = /*#__PURE__*/function () {
294
282
  // alarmPanelIsOpen: result.datas.length > 0,
295
283
  // });
296
284
 
297
- case 14:
285
+ case 11:
298
286
  case "end":
299
287
  return _context3.stop();
300
288
  }
@@ -389,14 +377,14 @@ var Alarm = /*#__PURE__*/function () {
389
377
  var _openTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
390
378
  var _this2 = this;
391
379
 
392
- var _this$getState3, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
380
+ var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
393
381
 
394
382
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
395
383
  while (1) {
396
384
  switch (_context6.prev = _context6.next) {
397
385
  case 0:
398
386
  // 如果当前拓扑图开启中或已开启则退出
399
- _this$getState3 = this.getState(), alarmOpening = _this$getState3.alarmOpening, topoAlarmIsOpen = _this$getState3.topoAlarmIsOpen;
387
+ _this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
400
388
 
401
389
  if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
402
390
  _context6.next = 3;
@@ -456,14 +444,14 @@ var Alarm = /*#__PURE__*/function () {
456
444
  /*#__PURE__*/
457
445
  function () {
458
446
  var _closeTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
459
- var _this$getState4, alarmIsOpened, alarmOpening;
447
+ var _this$getState3, alarmIsOpened, alarmOpening;
460
448
 
461
449
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
462
450
  while (1) {
463
451
  switch (_context7.prev = _context7.next) {
464
452
  case 0:
465
453
  // 如果未开启则退出
466
- _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened, alarmOpening = _this$getState4.alarmOpening;
454
+ _this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
467
455
 
468
456
  if (!(!alarmIsOpened && !alarmOpening)) {
469
457
  _context7.next = 3;
@@ -550,13 +538,13 @@ var Alarm = /*#__PURE__*/function () {
550
538
  /*#__PURE__*/
551
539
  function () {
552
540
  var _handleAlarmEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(alertData) {
553
- var _this$getState5, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
541
+ var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
554
542
 
555
543
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
556
544
  while (1) {
557
545
  switch (_context9.prev = _context9.next) {
558
546
  case 0:
559
- _this$getState5 = this.getState(), alarmIsOpened = _this$getState5.alarmIsOpened;
547
+ _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
560
548
  resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
561
549
  resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
562
550
  alarmDispatchers = this.topo.store.getModelDispatchers("topoAlarm"); // 添加事件
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
23
23
  import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
25
25
 
26
- var version = typeof "7.0.0-dev.12" === 'string' ? "7.0.0-dev.12" : null;
26
+ var version = typeof "7.0.0-dev.14" === 'string' ? "7.0.0-dev.14" : null;
27
27
  console.info("\u62D3\u6251\u7248\u672C: " + version);
28
28
  /**
29
29
  * 拓扑显示和编辑
@@ -33,9 +33,6 @@ export function isCrucialLink(link) {
33
33
  export function isExitLink(link) {
34
34
  return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes['destination_id']);
35
35
  }
36
- export function isAggLink(link) {
37
- return link.attributes["network_link.connect_type"] === "agg";
38
- }
39
36
  export var getInterfaceObject = /*#__PURE__*/function () {
40
37
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(codes) {
41
38
  var query, promises, result, ifDoc;
@@ -606,15 +606,16 @@ export default function (topoApp) {
606
606
 
607
607
  case 4:
608
608
  topoPermission = _context11.sent;
609
- _context11.next = 10;
609
+ rlog.debug('查询拓扑权限', topoPermission);
610
+ _context11.next = 11;
610
611
  break;
611
612
 
612
- case 7:
613
- _context11.prev = 7;
613
+ case 8:
614
+ _context11.prev = 8;
614
615
  _context11.t0 = _context11["catch"](1);
615
616
  rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context11.t0); // 尚未区分拓扑图不存在还是接口请求报错
616
617
 
617
- case 10:
618
+ case 11:
618
619
  if (update !== false) {
619
620
  _this8.update({
620
621
  topoPermission: topoPermission
@@ -623,12 +624,12 @@ export default function (topoApp) {
623
624
 
624
625
  return _context11.abrupt("return", topoPermission);
625
626
 
626
- case 12:
627
+ case 13:
627
628
  case "end":
628
629
  return _context11.stop();
629
630
  }
630
631
  }
631
- }, _callee11, null, [[1, 7]]);
632
+ }, _callee11, null, [[1, 8]]);
632
633
  }))();
633
634
  }
634
635
  };
@@ -1,7 +1,6 @@
1
1
  import _Message from "@alifd/next/es/message";
2
2
  import _Table from "@alifd/next/es/table";
3
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
- import _Button from "@alifd/next/es/button";
5
4
  import _Icon from "@alifd/next/es/icon";
6
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
6
  import React from 'react';
@@ -56,30 +55,34 @@ function EventsCard(props) {
56
55
  title: moment(value).format('YYYY-MM-DD HH:mm:ss')
57
56
  }, moment(value).format('YYYY-MM-DD HH:mm:ss'));
58
57
  }
59
- }, {
60
- title: '操作',
61
- dataIndex: 'status',
62
- key: 'status',
63
- width: 64,
64
- cell: function cell(status, index, record) {
65
- if (record.type === 'alarm') {
66
- return status === 'toDeal' ? /*#__PURE__*/React.createElement(_Button, {
67
- text: true,
68
- type: "primary",
69
- onClick: function onClick() {
70
- return alarmRiskOperation(record.type, record.params);
71
- }
72
- }, "\u53D7\u7406") : /*#__PURE__*/React.createElement(_Button, {
73
- disabled: true,
74
- text: true,
75
- type: "primary"
76
- }, "\u5DF2\u53D7\u7406");
77
- } else {
78
- // return <Button text type="primary" onClick={() => alarmRiskOperation(record.type, record)}>受理</Button>
79
- return '';
80
- }
81
- }
82
- }]; // 告警/风险 操作 (受理)
58
+ } // 临时屏蔽告警操作列,后续版本按权限显示 2023-3-6 20:23:45
59
+ // {
60
+ // title: '操作',
61
+ // dataIndex: 'status',
62
+ // key: 'status',
63
+ // width: 64,
64
+ // cell: (status, index, record) => {
65
+ // if (record.type === 'alarm') {
66
+ // return status === 'toDeal' ? (
67
+ // <Button
68
+ // text
69
+ // type="primary"
70
+ // onClick={() => alarmRiskOperation(record.type, record.params)}
71
+ // >
72
+ // 受理
73
+ // </Button>
74
+ // ) : (
75
+ // <Button disabled text type="primary">
76
+ // 已受理
77
+ // </Button>
78
+ // );
79
+ // } else {
80
+ // // return <Button text type="primary" onClick={() => alarmRiskOperation(record.type, record)}>受理</Button>
81
+ // return '';
82
+ // }
83
+ // },
84
+ // },
85
+ ]; // 告警/风险 操作 (受理)
83
86
 
84
87
  function alarmRiskOperation(_x, _x2) {
85
88
  return _alarmRiskOperation.apply(this, arguments);
@@ -101,6 +101,7 @@
101
101
  }
102
102
  .alarm {
103
103
  margin-top: 12px;
104
+ margin-bottom: 16px;
104
105
  .alarm-title {
105
106
  overflow: hidden;
106
107
  text-overflow: ellipsis;
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import { getLinksDetail } from "../core/models/utils/linkUtils";
5
- import { queryCisByIds } from "../core/services";
6
5
  import { addTopoDataResourcePermission } from "./utils/resourcePermissionUtil"; // import "./utils/__tests__/resourcePermissionUtil.test";
7
6
 
8
7
  export function addLinkData(_x, _x2) {
@@ -16,7 +15,7 @@ export function addLinkData(_x, _x2) {
16
15
 
17
16
  function _addLinkData() {
18
17
  _addLinkData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(oldLinks, nodes) {
19
- var links;
18
+ var links, networkLinks, otherLinks;
20
19
  return _regeneratorRuntime.wrap(function _callee$(_context) {
21
20
  while (1) {
22
21
  switch (_context.prev = _context.next) {
@@ -32,18 +31,24 @@ function _addLinkData() {
32
31
  }
33
32
 
34
33
  return true;
35
- });
34
+ }); // 如果是网络链路,补充详情信息
35
+
36
36
  _context.next = 3;
37
- return getLinksDetail(links, nodes);
37
+ return getLinksDetail(links.filter(function (link) {
38
+ return !link.ciType;
39
+ }), nodes);
38
40
 
39
41
  case 3:
40
- links = _context.sent;
42
+ networkLinks = _context.sent;
43
+ otherLinks = links.filter(function (link) {
44
+ return !!link.ciType;
45
+ });
41
46
  return _context.abrupt("return", {
42
- links: links,
47
+ links: [].concat(networkLinks, otherLinks),
43
48
  linkGroups: []
44
49
  });
45
50
 
46
- case 5:
51
+ case 6:
47
52
  case "end":
48
53
  return _context.stop();
49
54
  }
@@ -72,7 +77,7 @@ export function buildData(_x3) {
72
77
 
73
78
  function _buildData() {
74
79
  _buildData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
75
- var newData, nodes, _yield$Promise$all, nodeCis, linkData;
80
+ var newData, nodes, _yield$Promise$all, linkData;
76
81
 
77
82
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
78
83
  while (1) {
@@ -89,34 +94,18 @@ function _buildData() {
89
94
  });
90
95
  });
91
96
  _context2.next = 4;
92
- return Promise.all([// 查询节点属性
93
- queryCisByIds(nodes.map(function (node) {
94
- return node.id;
95
- })), addLinkData(data.links || [], nodes)]);
97
+ return Promise.all([addLinkData(data.links || [], nodes)]);
96
98
 
97
99
  case 4:
98
100
  _yield$Promise$all = _context2.sent;
99
- nodeCis = _yield$Promise$all[0];
100
- linkData = _yield$Promise$all[1];
101
- nodes = nodes.map(function (node) {
102
- var _node$attributes$find;
103
-
104
- return _extends({}, node, {
105
- ipAddress: Array.isArray(node.attributes) ? (_node$attributes$find = node.attributes.find(function (item) {
106
- return item.code === 'ipAddress';
107
- })) === null || _node$attributes$find === void 0 ? void 0 : _node$attributes$find.value : null,
108
- attributes: nodeCis.find(function (ci) {
109
- return ci.id === node.id;
110
- }).attributes
111
- });
112
- });
101
+ linkData = _yield$Promise$all[0];
113
102
  newData = _extends({}, newData, {
114
103
  nodes: nodes
115
104
  }, linkData);
116
105
  newData = addTopoDataResourcePermission(newData);
117
106
  return _context2.abrupt("return", newData);
118
107
 
119
- case 11:
108
+ case 9:
120
109
  case "end":
121
110
  return _context2.stop();
122
111
  }
@@ -4,7 +4,6 @@ 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";
8
7
  import linkService from "../../services/link";
9
8
  import { getLinkPermission } from "../../utils/resourcePermissionUtil";
10
9
  /**
@@ -49,8 +48,7 @@ export default (function (_ref) {
49
48
  switch (_context.prev = _context.next) {
50
49
  case 0:
51
50
  id = link.id;
52
- isGroup = false; // isAggLink(link);
53
-
51
+ isGroup = false;
54
52
  _context.next = 4;
55
53
  return linkService.deleteLink(id);
56
54
 
@@ -57,7 +57,7 @@ function getButtons(isNetworkTopo) {
57
57
  _Divider["default"], _NodeImageButton["default"], // 替换图片
58
58
  _NodeSizeButton["default"], // 图片尺寸
59
59
  _Divider["default"], _Layout["default"], // 布局方式
60
- _NodeAlignWidget["default"] // 对齐方式
61
- // SearchWidget, // 搜索
60
+ _NodeAlignWidget["default"], // 对齐方式
61
+ _SearchWidget["default"] // 搜索
62
62
  ]);
63
63
  }
@@ -13,20 +13,26 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
13
13
 
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
15
 
16
- var _fontStyleUtil = _interopRequireDefault(require("../../../../../../settings/common/text/fontStyleUtil"));
17
-
18
16
  var _colorUtil = require("../colorUtil");
19
17
 
20
18
  var _excluded = ["color", "background", "opacity", "bold", "italic"];
21
19
 
22
20
  function getTextStyle(element) {
21
+ var opacity = element.a('edge.tag.opacity');
22
+
23
+ if (opacity === null || opacity === undefined) {
24
+ opacity = 1;
25
+ }
26
+
23
27
  return (0, _extends2["default"])({
24
28
  color: (0, _colorUtil.parseColor)(element.a('edge.tag.color')),
25
29
  fontFamily: element.a('edge.tag.fontFamily') || '微软雅黑',
26
30
  fontSize: element.a('edge.tag.fontSize'),
27
31
  bold: !!element.a('edge.tag.fontBold'),
28
32
  italic: !!element.a('edge.tag.fontItalic')
29
- }, (0, _colorUtil.parseBackground)(element.a('edge.tag.background')));
33
+ }, (0, _colorUtil.parseBackground)(element.a('edge.tag.background')), {
34
+ opacity: opacity
35
+ });
30
36
  }
31
37
 
32
38
  function setTextStyle(element, style, topo) {
@@ -102,6 +102,11 @@ function getTextStyle(htSelection, styleNames) {
102
102
 
103
103
  var val = fieldValueList[0];
104
104
  var different = fieldValueList.filter(function (item) {
105
+ // 如果是颜色,特殊处理
106
+ if (item && val && item.rgb) {
107
+ return item.rgb.r + "," + item.rgb.g + "," + item.rgb.b + "," + item.rgb.a !== val.rgb.r + "," + val.rgb.g + "," + val.rgb.b + "," + val.rgb.a;
108
+ }
109
+
105
110
  return item !== val;
106
111
  });
107
112
 
@@ -26,12 +26,7 @@ var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-ut
26
26
  var usePolling = function usePolling(props) {
27
27
  var topo = props.topo;
28
28
  var store = topo.store;
29
- var topoState = store.useModelState('topoMod');
30
-
31
- var _store$useModel = store.useModel('topoBizMod'),
32
- bizState = _store$useModel[0],
33
- bizDispatchers = _store$useModel[1];
34
-
29
+ var bizState = store.useModelState('topoBizMod');
35
30
  var resAndMetrics = bizState.resAndMetrics,
36
31
  pollingSwitch = bizState.pollingSwitch;
37
32
  var displayConfig = topo.store.useModelState('displayConfig');
@@ -75,8 +75,10 @@ var useTopoEdit = function useTopoEdit(params) {
75
75
  setComboResData = _useState2[1];
76
76
 
77
77
  var reset = function reset() {
78
+ var _topo$historyManager;
79
+
78
80
  topoEditDispatchers.reset();
79
- topo.historyManager.destroy();
81
+ (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.destroy();
80
82
  };
81
83
  /**
82
84
  * 增加资源到视图
@@ -237,23 +237,11 @@ var Alarm = /*#__PURE__*/function () {
237
237
 
238
238
  _proto.hmGetTopoAlarm = /*#__PURE__*/function () {
239
239
  var _hmGetTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id) {
240
- var _this$topo$store$getS, data, resAndMetrics, topoData, _this$getState2, alarmIsOpened, alarmOpening, nodeIdsList, linkIdsList, resIdsList, mainCiIdList, endTime, startTime, parms, result;
241
-
240
+ var mainCiIdList, endTime, startTime, parms, result;
242
241
  return _regenerator["default"].wrap(function _callee3$(_context3) {
243
242
  while (1) {
244
243
  switch (_context3.prev = _context3.next) {
245
244
  case 0:
246
- _this$topo$store$getS = this.topo.store.getState().topoMod, data = _this$topo$store$getS.data, resAndMetrics = _this$topo$store$getS.resAndMetrics, topoData = _this$topo$store$getS.topoData;
247
- _this$getState2 = this.getState(), alarmIsOpened = _this$getState2.alarmIsOpened, alarmOpening = _this$getState2.alarmOpening; // const { nodes, links } = data;
248
-
249
- nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList, resIdsList = resAndMetrics.resIdsList; // rlog.debug(
250
- // "获取告警列表--resAndMetrics,topoData,data",
251
- // this.topo,
252
- // resAndMetrics,
253
- // topoData,
254
- // data
255
- // );
256
-
257
245
  mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
258
246
  return !!ci.operation;
259
247
  }) // 过滤掉权限
@@ -262,7 +250,7 @@ var Alarm = /*#__PURE__*/function () {
262
250
  });
263
251
 
264
252
  if (!(mainCiIdList.length === 0)) {
265
- _context3.next = 7;
253
+ _context3.next = 4;
266
254
  break;
267
255
  }
268
256
 
@@ -272,7 +260,7 @@ var Alarm = /*#__PURE__*/function () {
272
260
  });
273
261
  return _context3.abrupt("return");
274
262
 
275
- case 7:
263
+ case 4:
276
264
  //rlog.debug("获取告警列表", mainCiIdList);
277
265
  endTime = null; // new Date().valueOf();
278
266
 
@@ -297,10 +285,10 @@ var Alarm = /*#__PURE__*/function () {
297
285
  endTime: endTime
298
286
  }
299
287
  };
300
- _context3.next = 12;
288
+ _context3.next = 9;
301
289
  return _topo["default"].getAlarmByIds(parms);
302
290
 
303
- case 12:
291
+ case 9:
304
292
  result = _context3.sent;
305
293
 
306
294
  _rlog["default"].debug("getAlarmById-result", result); // if (alarmIsOpened) {
@@ -313,7 +301,7 @@ var Alarm = /*#__PURE__*/function () {
313
301
  // });
314
302
 
315
303
 
316
- case 14:
304
+ case 11:
317
305
  case "end":
318
306
  return _context3.stop();
319
307
  }
@@ -408,14 +396,14 @@ var Alarm = /*#__PURE__*/function () {
408
396
  var _openTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
409
397
  var _this2 = this;
410
398
 
411
- var _this$getState3, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
399
+ var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
412
400
 
413
401
  return _regenerator["default"].wrap(function _callee6$(_context6) {
414
402
  while (1) {
415
403
  switch (_context6.prev = _context6.next) {
416
404
  case 0:
417
405
  // 如果当前拓扑图开启中或已开启则退出
418
- _this$getState3 = this.getState(), alarmOpening = _this$getState3.alarmOpening, topoAlarmIsOpen = _this$getState3.topoAlarmIsOpen;
406
+ _this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
419
407
 
420
408
  if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
421
409
  _context6.next = 3;
@@ -477,14 +465,14 @@ var Alarm = /*#__PURE__*/function () {
477
465
  /*#__PURE__*/
478
466
  function () {
479
467
  var _closeTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
480
- var _this$getState4, alarmIsOpened, alarmOpening;
468
+ var _this$getState3, alarmIsOpened, alarmOpening;
481
469
 
482
470
  return _regenerator["default"].wrap(function _callee7$(_context7) {
483
471
  while (1) {
484
472
  switch (_context7.prev = _context7.next) {
485
473
  case 0:
486
474
  // 如果未开启则退出
487
- _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened, alarmOpening = _this$getState4.alarmOpening;
475
+ _this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
488
476
 
489
477
  if (!(!alarmIsOpened && !alarmOpening)) {
490
478
  _context7.next = 3;
@@ -574,13 +562,13 @@ var Alarm = /*#__PURE__*/function () {
574
562
  /*#__PURE__*/
575
563
  function () {
576
564
  var _handleAlarmEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(alertData) {
577
- var _this$getState5, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
565
+ var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
578
566
 
579
567
  return _regenerator["default"].wrap(function _callee9$(_context9) {
580
568
  while (1) {
581
569
  switch (_context9.prev = _context9.next) {
582
570
  case 0:
583
- _this$getState5 = this.getState(), alarmIsOpened = _this$getState5.alarmIsOpened;
571
+ _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
584
572
  resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
585
573
  resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
586
574
  alarmDispatchers = this.topo.store.getModelDispatchers("topoAlarm"); // 添加事件
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
54
54
  var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
55
55
 
56
56
  // eslint-disable-next-line no-undef
57
- var version = typeof "7.0.0-dev.12" === 'string' ? "7.0.0-dev.12" : null;
57
+ var version = typeof "7.0.0-dev.14" === 'string' ? "7.0.0-dev.14" : null;
58
58
  console.info("\u62D3\u6251\u7248\u672C: " + version);
59
59
  /**
60
60
  * 拓扑显示和编辑