@riil-frontend/component-topology 11.0.27 → 11.0.29

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 (102) hide show
  1. package/README.md +2 -1
  2. package/build/1.js +2 -2
  3. package/build/2.js +1 -1
  4. package/build/index.css +1 -1
  5. package/build/index.js +20 -20
  6. package/es/components/BatchAttrMetric/index.js +9 -19
  7. package/es/components/BatchAttrMetric/setting.js +64 -30
  8. package/es/components/BatchAttrMetric/utils.js +14 -199
  9. package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +1 -1
  10. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +6 -7
  11. package/es/core/components/ResourceViewAttributeSetting/Setting.js +30 -58
  12. package/es/core/components/TopoView/topoView.js +0 -1
  13. package/es/core/components/titlebar/TitleBar.module.scss +0 -9
  14. package/es/core/components/titlebar/widgets/TitleWidget.js +2 -5
  15. package/es/core/editor/components/BottomFloatTool/HelpIcon.js +1 -4
  16. package/es/core/editor/components/BottomFloatTool/HelpIcon.module.scss +10 -8
  17. package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
  18. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -4
  19. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -4
  20. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +3 -6
  21. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -5
  22. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +1 -4
  23. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -4
  24. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +1 -4
  25. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +0 -1
  26. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +2 -2
  27. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +1 -2
  28. package/es/core/hooks/usePolling.js +8 -8
  29. package/es/core/models/TopoApp.js +1 -1
  30. package/es/core/models/topoData.js +2 -2
  31. package/es/core/store/models/topoConfig.js +3 -4
  32. package/es/core/test/Test.js +4 -5
  33. package/es/utils/topoData.js +0 -142
  34. package/lib/components/BatchAttrMetric/index.js +9 -19
  35. package/lib/components/BatchAttrMetric/setting.js +58 -24
  36. package/lib/components/BatchAttrMetric/utils.js +16 -206
  37. package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +1 -1
  38. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +5 -6
  39. package/lib/core/components/ResourceViewAttributeSetting/Setting.js +28 -56
  40. package/lib/core/components/TopoView/topoView.js +0 -1
  41. package/lib/core/components/titlebar/TitleBar.module.scss +0 -9
  42. package/lib/core/components/titlebar/widgets/TitleWidget.js +2 -7
  43. package/lib/core/editor/components/BottomFloatTool/HelpIcon.js +1 -4
  44. package/lib/core/editor/components/BottomFloatTool/HelpIcon.module.scss +10 -8
  45. package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
  46. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -4
  47. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -4
  48. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +3 -6
  49. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -4
  50. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +1 -4
  51. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -4
  52. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +3 -4
  53. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +0 -1
  54. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +2 -2
  55. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +1 -2
  56. package/lib/core/hooks/usePolling.js +8 -8
  57. package/lib/core/models/TopoApp.js +1 -1
  58. package/lib/core/models/topoData.js +2 -2
  59. package/lib/core/store/models/topoConfig.js +3 -6
  60. package/lib/core/test/Test.js +4 -5
  61. package/lib/utils/topoData.js +0 -145
  62. package/package.json +2 -2
  63. package/es/components/BatchAttrMetric2/SelectTable.js +0 -21
  64. package/es/components/BatchAttrMetric2/constant.js +0 -30
  65. package/es/components/BatchAttrMetric2/index.js +0 -68
  66. package/es/components/BatchAttrMetric2/index.module.scss +0 -76
  67. package/es/components/BatchAttrMetric2/setting.js +0 -181
  68. package/es/components/BatchAttrMetric2/utils.js +0 -42
  69. package/es/components/IndexSettingDrawer/CiList.js +0 -26
  70. package/es/components/IndexSettingDrawer/CiListItem.js +0 -37
  71. package/es/components/IndexSettingDrawer/IndexList.js +0 -62
  72. package/es/components/IndexSettingDrawer/index.js +0 -60
  73. package/es/components/IndexSettingDrawer/index.module.scss +0 -44
  74. package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelect.js +0 -5
  75. package/es/core/components/TopoApp.js +0 -7
  76. package/es/core/components/TopoAppView.js +0 -24
  77. package/es/core/editor/components/Toolbar/widgets/Dropdown.js +0 -12
  78. package/es/core/editor/components/settings/propertyViews/view/GlobalTootipSetting.js +0 -28
  79. package/es/networkTopo/components/Link/index copy.js +0 -213
  80. package/es/networkTopo/store/linkDynamicStyle.js +0 -259
  81. package/es/networkTopo/store/linkDynamicStyleConfig.js +0 -180
  82. package/es/networkTopo/store/linkManager.js +0 -38
  83. package/lib/components/BatchAttrMetric2/SelectTable.js +0 -26
  84. package/lib/components/BatchAttrMetric2/constant.js +0 -36
  85. package/lib/components/BatchAttrMetric2/index.js +0 -75
  86. package/lib/components/BatchAttrMetric2/index.module.scss +0 -76
  87. package/lib/components/BatchAttrMetric2/setting.js +0 -189
  88. package/lib/components/BatchAttrMetric2/utils.js +0 -48
  89. package/lib/components/IndexSettingDrawer/CiList.js +0 -32
  90. package/lib/components/IndexSettingDrawer/CiListItem.js +0 -43
  91. package/lib/components/IndexSettingDrawer/IndexList.js +0 -70
  92. package/lib/components/IndexSettingDrawer/index.js +0 -68
  93. package/lib/components/IndexSettingDrawer/index.module.scss +0 -44
  94. package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelect.js +0 -11
  95. package/lib/core/components/TopoApp.js +0 -13
  96. package/lib/core/components/TopoAppView.js +0 -32
  97. package/lib/core/editor/components/Toolbar/widgets/Dropdown.js +0 -18
  98. package/lib/core/editor/components/settings/propertyViews/view/GlobalTootipSetting.js +0 -34
  99. package/lib/networkTopo/components/Link/index copy.js +0 -220
  100. package/lib/networkTopo/store/linkDynamicStyle.js +0 -263
  101. package/lib/networkTopo/store/linkDynamicStyleConfig.js +0 -186
  102. package/lib/networkTopo/store/linkManager.js +0 -42
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- exports.__esModule = true;
5
- exports["default"] = GlobalTootipSetting;
6
- var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
7
- var _react = _interopRequireWildcard(require("react"));
8
- require("@riil-frontend/css/lib/index.scss");
9
- var _Setting = _interopRequireDefault(require("../../../../../components/ResourceViewAttributeSetting/Setting"));
10
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
- /**
13
- * 显示属性、指标配置
14
- *
15
- * 已废弃
16
- */
17
- function GlobalTootipSetting(props) {
18
- var topo = props.topo;
19
- var tootipSettingRef = (0, _react.useRef)();
20
-
21
- // 打开指标抽屉
22
- var openSetting = function openSetting() {
23
- tootipSettingRef.current.openGlobalTootipSetting();
24
- };
25
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_button["default"], {
26
- type: "primary",
27
- text: true,
28
- onClick: openSetting
29
- }, "Tootip\u5C5E\u6027/\u6307\u6807\u914D\u7F6E"), /*#__PURE__*/_react["default"].createElement(_Setting["default"], {
30
- ref: tootipSettingRef,
31
- topo: topo
32
- }));
33
- }
34
- ;
@@ -1,220 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- exports.__esModule = true;
5
- exports["default"] = void 0;
6
- var _drawer = _interopRequireDefault(require("@alifd/next/lib/drawer"));
7
- var _loading = _interopRequireDefault(require("@alifd/next/lib/loading"));
8
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _ahooks = require("ahooks");
11
- var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
12
- var _componentTopologyGraph = require("@riil-frontend/component-topology-graph");
13
- var _indexModule = _interopRequireDefault(require("./index.module.scss"));
14
- var _setting = _interopRequireDefault(require("./setting"));
15
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
18
- /**
19
- * 添加/编辑链路抽屉
20
- * 通过ref调用show方法来打开,编辑场景传入link对象
21
- */
22
- var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
23
- var topoContext = props.topoContext,
24
- topo = props.topo;
25
- var store = topo.store;
26
- var _store$useModel = store.useModel('topoConfig'),
27
- editState = _store$useModel[0],
28
- editDispatchers = _store$useModel[1];
29
- var _useBoolean = (0, _ahooks.useBoolean)(false),
30
- visible = _useBoolean[0],
31
- _useBoolean$ = _useBoolean[1],
32
- setTrue = _useBoolean$.setTrue,
33
- setFalse = _useBoolean$.setFalse;
34
- var _useState = (0, _react.useState)(),
35
- link = _useState[0],
36
- setLink = _useState[1];
37
- // 保存后更新拓扑图状态
38
- var _useState2 = (0, _react.useState)(false),
39
- updateTopoState = _useState2[0],
40
- setUpdateTopoState = _useState2[1];
41
- var isAddMode = !link;
42
- var topoData = editState.topo;
43
- var _ref = topoContext || {},
44
- _ref$urlParams = _ref.urlParams,
45
- urlParams = _ref$urlParams === void 0 ? {} : _ref$urlParams;
46
- var api = {
47
- show: function show(selectedLink) {
48
- setLink(selectedLink);
49
- setTrue();
50
- }
51
- };
52
- (0, _react.useImperativeHandle)(ref, function () {
53
- return api;
54
- });
55
-
56
- // 注册事件
57
- (0, _react.useEffect)(function () {
58
- var notifier = topo.view.topoClient.notifier;
59
- var handleEvent = function handleEvent(e) {
60
- var type = e.type,
61
- data = e.data;
62
- if (type === _componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_LINK) {
63
- api.show(data);
64
- }
65
- };
66
- notifier.on(_componentTopologyGraph.TopoEvent.EVENT_DATA_PICK, handleEvent);
67
- return function () {
68
- // 取消注册事件
69
- notifier.off(_componentTopologyGraph.TopoEvent.EVENT_DATA_PICK, handleEvent);
70
- };
71
- }, []);
72
-
73
- // 从url打开
74
- (0, _react.useEffect)(function () {
75
- if (!visible) {
76
- if (urlParams.showAddLink) {
77
- setTrue();
78
- }
79
- }
80
- }, [urlParams.showAddLink]);
81
-
82
- // 链路更新,通过资源重新获取链路信息通知HT来更新
83
- var refreshLink = /*#__PURE__*/function () {
84
- var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
85
- var data;
86
- return _regeneratorRuntime().wrap(function _callee$(_context) {
87
- while (1) switch (_context.prev = _context.next) {
88
- case 0:
89
- _rlog["default"].debug('useTopoEdit.refreshLink');
90
- _context.next = 3;
91
- return editDispatchers.fetchData();
92
- case 3:
93
- data = _context.sent;
94
- topo.view.topoClient.emitEvent(_componentTopologyGraph.TopoEvent.EVENT_DATA_RESULT, {
95
- type: _componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO,
96
- data: data
97
- });
98
- case 5:
99
- case "end":
100
- return _context.stop();
101
- }
102
- }, _callee);
103
- }));
104
- return function refreshLink() {
105
- return _ref2.apply(this, arguments);
106
- };
107
- }();
108
- var getLink = /*#__PURE__*/function () {
109
- var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(id) {
110
- var data;
111
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
112
- while (1) switch (_context2.prev = _context2.next) {
113
- case 0:
114
- _context2.next = 2;
115
- return editDispatchers.fetchData();
116
- case 2:
117
- data = _context2.sent;
118
- return _context2.abrupt("return", data.filter(function (item) {
119
- return item.id === id;
120
- })[0]);
121
- case 4:
122
- case "end":
123
- return _context2.stop();
124
- }
125
- }, _callee2);
126
- }));
127
- return function getLink(_x) {
128
- return _ref3.apply(this, arguments);
129
- };
130
- }();
131
- var updateTopo = (0, _react.useCallback)( /*#__PURE__*/function () {
132
- var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
133
- var changed, isAdd, _data$result$, oldId, id, linkData;
134
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
135
- while (1) switch (_context3.prev = _context3.next) {
136
- case 0:
137
- changed = data.changed, isAdd = data.isAddMode;
138
- if (!(changed === false)) {
139
- _context3.next = 3;
140
- break;
141
- }
142
- return _context3.abrupt("return");
143
- case 3:
144
- if (!isAdd) {
145
- _context3.next = 8;
146
- break;
147
- }
148
- _context3.next = 6;
149
- return refreshLink();
150
- case 6:
151
- _context3.next = 13;
152
- break;
153
- case 8:
154
- _data$result$ = data.result[0], oldId = _data$result$.oldId, id = _data$result$.id;
155
- _context3.next = 11;
156
- return getLink(id);
157
- case 11:
158
- linkData = _context3.sent;
159
- topo.view.topoClient.emitEvent('topo_link_update', {
160
- id: oldId,
161
- link: linkData
162
- });
163
- case 13:
164
- case "end":
165
- return _context3.stop();
166
- }
167
- }, _callee3);
168
- }));
169
- return function (_x2) {
170
- return _ref4.apply(this, arguments);
171
- };
172
- }(), []);
173
- var handleSaved = (0, _react.useCallback)( /*#__PURE__*/function () {
174
- var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {
175
- var errorItems;
176
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
177
- while (1) switch (_context4.prev = _context4.next) {
178
- case 0:
179
- errorItems = data.errorItems;
180
- if (errorItems.length) {
181
- _context4.next = 7;
182
- break;
183
- }
184
- setFalse();
185
- setUpdateTopoState(true);
186
- _context4.next = 6;
187
- return updateTopo(data);
188
- case 6:
189
- setUpdateTopoState(false);
190
- case 7:
191
- case "end":
192
- return _context4.stop();
193
- }
194
- }, _callee4);
195
- }));
196
- return function (_x3) {
197
- return _ref5.apply(this, arguments);
198
- };
199
- }(), []);
200
- return /*#__PURE__*/_react["default"].createElement(_drawer["default"], {
201
- closeMode: ['close', 'esc'],
202
- visible: visible,
203
- onClose: setFalse,
204
- title: link ? '编辑链路' : '添加链路',
205
- className: _indexModule["default"].drawer,
206
- width: "calc(8/24 * 100%)"
207
- }, /*#__PURE__*/_react["default"].createElement(_loading["default"], {
208
- visible: updateTopoState,
209
- fullScreen: true
210
- }), visible && /*#__PURE__*/_react["default"].createElement(_setting["default"], {
211
- isAddMode: isAddMode,
212
- link: link,
213
- topoElements: topoData,
214
- topo: topo,
215
- saveCb: handleSaved,
216
- cancelCb: setFalse
217
- }));
218
- });
219
- var _default = LinkDrawer;
220
- exports["default"] = _default;
@@ -1,263 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- exports.__esModule = true;
5
- exports["default"] = _default;
6
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
7
- var _extends3 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
- var _lodash = _interopRequireDefault(require("lodash"));
9
- var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
10
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } /**
11
- * 动态设置链路样式 Model。-- 功能已废弃
12
- */
13
- var defaultConfig = {
14
- networkLink: {
15
- // 网络链路
16
- rules: []
17
- },
18
- networkAggLink: {
19
- // 聚合链路
20
- rules: []
21
- }
22
- };
23
-
24
- /**
25
- * 计算条件。当前仅处理属性
26
- *
27
- * @param condition {{relation: string, children: object[]}}
28
- * @param attributes {{code,value}[]}
29
- * @return boolean
30
- */
31
- function executeCondition(condition, attributes) {
32
- var relation = condition.relation,
33
- children = condition.children;
34
- var result = true;
35
- for (var i = 0; i < children.length; i++) {
36
- var _$find;
37
- var _children$i = children[i],
38
- field = _children$i.field,
39
- operator = _children$i.operator,
40
- value = _children$i.value;
41
- var fieldValue = (_$find = _lodash["default"].find(attributes, {
42
- code: field
43
- })) === null || _$find === void 0 ? void 0 : _$find.value;
44
- var ruleResult = void 0;
45
- if (fieldValue === undefined || fieldValue === null) {
46
- ruleResult = false;
47
- } else {
48
- var expression = fieldValue + " " + operator + " " + value;
49
- try {
50
- // eslint-disable-next-line no-eval
51
- ruleResult = eval(expression);
52
- } catch (e) {
53
- // 属性不存在时会执行失败
54
- result = false;
55
- // console.error(`执行表达式失败: ${expression}`, {rule: children[i], attributes}, e);
56
- break;
57
- }
58
- }
59
- if (relation === 'and') {
60
- if (!ruleResult) {
61
- result = false;
62
- break;
63
- }
64
- } else {
65
- result = ruleResult;
66
- if (ruleResult) {
67
- result = true;
68
- break;
69
- }
70
- }
71
- }
72
- return result;
73
- }
74
- function _default(engine) {
75
- return {
76
- // 定义 model 的初始 state
77
- state: {
78
- /**
79
- * 格式见 https://shimo.im/docs/VKt3HCKHYgJ9kvGP#anchor-75ld
80
- * @type {{networkLink: {}, networkAggLink: {}}}
81
- */
82
- config: null
83
- },
84
- // 定义改变该模型状态的纯函数
85
- reducers: {
86
- setConfig: function setConfig(prevState, payload) {
87
- var config = payload || defaultConfig;
88
- return (0, _extends3["default"])({}, prevState, {
89
- config: config
90
- });
91
- },
92
- update: function update(prevState, payload) {
93
- return (0, _extends3["default"])({}, prevState, payload);
94
- },
95
- /**
96
- * 更新链路的配置
97
- *
98
- * @param prevState
99
- * @param payload {{type: string, config: object}}
100
- */
101
- updateLinkConfig: function updateLinkConfig(prevState, payload) {
102
- var _extends2;
103
- var type = payload.type,
104
- linkConfig = payload.config;
105
- return (0, _extends3["default"])({}, prevState, {
106
- config: (0, _extends3["default"])({}, prevState.config, (_extends2 = {}, _extends2[type] = linkConfig, _extends2))
107
- });
108
- }
109
- },
110
- // 定义处理该模型副作用的函数
111
- effects: function effects(dispatch) {
112
- return {
113
- getConfig: function getConfig(payload, rootState) {
114
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
115
- return _regeneratorRuntime().wrap(function _callee$(_context) {
116
- while (1) switch (_context.prev = _context.next) {
117
- case 0:
118
- return _context.abrupt("return", rootState.linkDynamicStyle.config);
119
- case 1:
120
- case "end":
121
- return _context.stop();
122
- }
123
- }, _callee);
124
- }))();
125
- },
126
- /**
127
- * 获取链路需要查询的属性/指标
128
- *
129
- * @return {Promise<*>}
130
- */
131
- getFields: function getFields(payload, rootState) {
132
- var _this = this;
133
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
134
- var config, fields;
135
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
136
- while (1) switch (_context2.prev = _context2.next) {
137
- case 0:
138
- _context2.next = 2;
139
- return _this.getConfig();
140
- case 2:
141
- config = _context2.sent;
142
- fields = {
143
- networkLink: {
144
- attribute: [],
145
- metric: []
146
- },
147
- networkAggLink: {
148
- attribute: [],
149
- metric: []
150
- }
151
- };
152
- ['networkLink', 'networkAggLink'].forEach(function (ciType) {
153
- config[ciType].rules.forEach(function (rule) {
154
- rule.condition[0].children.forEach(function (conditionRow) {
155
- fields[ciType][conditionRow.type].push(conditionRow.field);
156
- });
157
- });
158
- });
159
- return _context2.abrupt("return", fields);
160
- case 6:
161
- case "end":
162
- return _context2.stop();
163
- }
164
- }, _callee2);
165
- }))();
166
- },
167
- /**
168
- * 执行动态样式显示.
169
- *
170
- * 样式优先级:告警>开启自定义>动态(如果命中)>默认(未命中动态)。
171
- * 不包含有告警的链路。
172
- * 链路开启动态未命中规则时,使用默认样式。值为null,ht设置为默认
173
- *
174
- * @param payload
175
- * @param rootState
176
- * @returns {Promise<void>}
177
- */
178
- execute: function execute(payload, rootState) {
179
- var _this2 = this;
180
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
181
- var styleConfig, isEdit, links, allLinkAttributes, alarmMap, linkStyleMap;
182
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
183
- while (1) switch (_context3.prev = _context3.next) {
184
- case 0:
185
- return _context3.abrupt("return");
186
- case 3:
187
- styleConfig = _context3.sent;
188
- isEdit = rootState.topoMod.viewState !== 'view'; // 获取链路
189
- links = [];
190
- if (!(isEdit && rootState.topoConfig.topoData.links.length)) {
191
- _context3.next = 10;
192
- break;
193
- }
194
- links = rootState.topoConfig.topoData.links;
195
- _context3.next = 13;
196
- break;
197
- case 10:
198
- if (rootState.topoMod.topoData) {
199
- _context3.next = 12;
200
- break;
201
- }
202
- return _context3.abrupt("return");
203
- case 12:
204
- links = rootState.topoMod.topoData.links;
205
- case 13:
206
- // 获取属性。无权限的属性为 []
207
- allLinkAttributes = rootState.topoBizMod.attrsAndMetrics; // 告警
208
- alarmMap = rootState.topoAlarm.alarmDoc; // 如果是显示模式,过滤有告警的链路
209
- if (!isEdit) {
210
- links = links.filter(function (link) {
211
- return !(alarmMap[link.id] || []).length;
212
- });
213
- }
214
-
215
- // 遍历链路,根据规则计算样式
216
- linkStyleMap = {};
217
- links.forEach(function (link) {
218
- var ciType = link.ciType;
219
- var config = styleConfig[ciType];
220
- if (config) {
221
- var _$find2;
222
- var rules = config.rules;
223
- var attributes = ((_$find2 = _lodash["default"].find(allLinkAttributes, {
224
- id: link.id
225
- })) === null || _$find2 === void 0 ? void 0 : _$find2.attributes) || [];
226
- var style = null;
227
- for (var i = 0; i < rules.length; i++) {
228
- var rule = rules[i];
229
- // 如果命中规则则中止
230
- if (executeCondition(rule.condition[0], attributes)) {
231
- style = rule.style;
232
- break;
233
- }
234
- }
235
- linkStyleMap[link.id] = style;
236
- }
237
- });
238
- _rlog["default"].debug('链路动态样式 linkDynamicStyle.execute', {
239
- linksStyle: linkStyleMap,
240
- params: {
241
- links: links,
242
- allLinkAttributes: allLinkAttributes,
243
- styleConfig: styleConfig,
244
- alarmMap: alarmMap
245
- }
246
- });
247
-
248
- // 通知ht更新
249
- if (links.length) {
250
- engine.view.topoClient.batchSetLineStyle(linkStyleMap);
251
- }
252
- case 20:
253
- case "end":
254
- return _context3.stop();
255
- }
256
- }, _callee3);
257
- }))();
258
- }
259
- };
260
- }
261
- };
262
- }
263
- ;