@riil-frontend/component-topology 11.0.28 → 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 (33) hide show
  1. package/README.md +2 -1
  2. package/build/index.js +1 -1
  3. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +3 -5
  4. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +0 -1
  5. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +2 -2
  6. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +1 -2
  7. package/es/core/hooks/usePolling.js +8 -8
  8. package/es/core/models/TopoApp.js +1 -1
  9. package/es/core/test/Test.js +4 -5
  10. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +3 -5
  11. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +0 -1
  12. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +2 -2
  13. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +1 -2
  14. package/lib/core/hooks/usePolling.js +8 -8
  15. package/lib/core/models/TopoApp.js +1 -1
  16. package/lib/core/test/Test.js +4 -5
  17. package/package.json +2 -2
  18. package/es/components/IndexSettingDrawer/CiList.js +0 -26
  19. package/es/components/IndexSettingDrawer/CiListItem.js +0 -37
  20. package/es/components/IndexSettingDrawer/IndexList.js +0 -62
  21. package/es/components/IndexSettingDrawer/index.js +0 -60
  22. package/es/components/IndexSettingDrawer/index.module.scss +0 -44
  23. package/es/networkTopo/store/linkDynamicStyle.js +0 -259
  24. package/es/networkTopo/store/linkDynamicStyleConfig.js +0 -180
  25. package/es/networkTopo/store/linkManager.js +0 -38
  26. package/lib/components/IndexSettingDrawer/CiList.js +0 -32
  27. package/lib/components/IndexSettingDrawer/CiListItem.js +0 -43
  28. package/lib/components/IndexSettingDrawer/IndexList.js +0 -70
  29. package/lib/components/IndexSettingDrawer/index.js +0 -68
  30. package/lib/components/IndexSettingDrawer/index.module.scss +0 -44
  31. package/lib/networkTopo/store/linkDynamicStyle.js +0 -263
  32. package/lib/networkTopo/store/linkDynamicStyleConfig.js +0 -186
  33. package/lib/networkTopo/store/linkManager.js +0 -42
@@ -76,17 +76,15 @@ function getValuesByEdges(topo) {
76
76
  })[0] || 'nil';
77
77
  }
78
78
  function getEdgesValues(edges) {
79
- var edgeValues = [];
80
- edges.forEach(function (edge) {
81
- edgeValues.push({
79
+ return edges.map(function (edge) {
80
+ return {
82
81
  baseAgreement: false,
83
82
  lineButton: edge.a('edge.type.name') || edge.s('edge.type'),
84
83
  startPoint: getStartPoint(edge),
85
84
  endPoint: getEndPoint(edge),
86
85
  lineMold: edge.a('lineMode') || 'solidLine'
87
- });
86
+ };
88
87
  });
89
- return edgeValues;
90
88
  }
91
89
  var selectionEdges = getEdgesBySelection(topo);
92
90
  var edgeValues = getEdgesValues(selectionEdges);
@@ -9,7 +9,6 @@ export function getTextStyle(element) {
9
9
  }, fontStyleUtil.toMap(element.a('rectFont')), parseBackground(element.a('topLeftColor')));
10
10
  }
11
11
  export function setTextStyle(element, style, topo) {
12
- if ('underline' in style) {}
13
12
  if ('color' in style) {
14
13
  element.a('topLeftTextColor', style.color.hex);
15
14
  }
@@ -66,8 +66,8 @@ export function getTextStyle(htSelection, styleNames) {
66
66
  // 查询该字段多元素的值列表,排除元素禁用的字段值
67
67
  var fieldValueList = elementValues.reduce(function (result, item) {
68
68
  // 元素字段是否禁用
69
- var disabled = !elementEnabledFieldsMap[item.id].includes(styleName);
70
- if (!item.values || disabled) {
69
+ var fieldDisabled = !elementEnabledFieldsMap[item.id].includes(styleName);
70
+ if (!item.values || fieldDisabled) {
71
71
  return result;
72
72
  }
73
73
  return [].concat(result, [item.values[styleName]]);
@@ -10,8 +10,7 @@ var defaultStyle = {
10
10
  };
11
11
  export function useValues(topo) {
12
12
  var displayConfigState = topo.store.useModelState('displayConfig');
13
- var nodeLabelStyle = displayConfigState.nodeLabelStyle,
14
- defaultEdgeLabelStyle = displayConfigState.defaultEdgeLabelStyle;
13
+ var nodeLabelStyle = displayConfigState.nodeLabelStyle;
15
14
  return _extends({
16
15
  color: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.color) || defaultStyle.color,
17
16
  fontFamily: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontFamily) || defaultStyle.fontFamily,
@@ -41,7 +41,7 @@ var usePolling = function usePolling(props) {
41
41
  */
42
42
  function _fetchData() {
43
43
  _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
44
- var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricResult, mergeData, transformLinkData, adapterIpv6;
44
+ var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricsResult, mergeData, transformLinkData, adapterIpv6;
45
45
  return _regeneratorRuntime().wrap(function _callee$(_context) {
46
46
  while (1) switch (_context.prev = _context.next) {
47
47
  case 0:
@@ -70,7 +70,7 @@ var usePolling = function usePolling(props) {
70
70
  attributeMap: link.attributes || {}
71
71
  });
72
72
  };
73
- mergeData = function _mergeData(metricResult) {
73
+ mergeData = function _mergeData(ciMetricsResult) {
74
74
  // 合并属性、指标
75
75
  var _topo$dataModel$getDa = topo.dataModel.getData(),
76
76
  nodes = _topo$dataModel$getDa.nodes,
@@ -85,11 +85,11 @@ var usePolling = function usePolling(props) {
85
85
  resultData = adapterIpv6(resultData);
86
86
  return resultData;
87
87
  }).map(function (ciData) {
88
- var _metricResult$find;
88
+ var ciMetricResult = ciMetricsResult.find(function (item) {
89
+ return item.id === (ciData.ciId || ciData.id);
90
+ });
89
91
  return _extends({}, ciData, {
90
- metrics: ((_metricResult$find = metricResult.find(function (item) {
91
- return item.id === ciData.ciId || ciData.id;
92
- })) === null || _metricResult$find === void 0 ? void 0 : _metricResult$find.metrics) || {}
92
+ metrics: (ciMetricResult === null || ciMetricResult === void 0 ? void 0 : ciMetricResult.metrics) || {}
93
93
  });
94
94
  });
95
95
  };
@@ -127,8 +127,8 @@ var usePolling = function usePolling(props) {
127
127
  return _context.t0.all.call(_context.t0, _context.t3);
128
128
  case 16:
129
129
  _yield$Promise$all = _context.sent;
130
- ciMetricResult = _yield$Promise$all[0];
131
- return _context.abrupt("return", mergeData(ciMetricResult));
130
+ ciMetricsResult = _yield$Promise$all[0];
131
+ return _context.abrupt("return", mergeData(ciMetricsResult));
132
132
  case 19:
133
133
  case "end":
134
134
  return _context.stop();
@@ -25,7 +25,7 @@ import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache";
26
26
 
27
27
  // eslint-disable-next-line no-undef
28
- var version = typeof "11.0.28" === 'string' ? "11.0.28" : null;
28
+ var version = typeof "11.0.29" === 'string' ? "11.0.29" : null;
29
29
  console.info("\u62D3\u6251\u7248\u672C: " + version);
30
30
 
31
31
  /**
@@ -14,13 +14,12 @@ var Test = /*#__PURE__*/function () {
14
14
  });
15
15
  }
16
16
  };
17
- };
18
- _proto.onReady = function onReady() {
19
- // TODO 待移除测试代码
20
- // this.iconManage.openUpload()
21
- // this.topo.store.getModelDispatchers('linkDynamicStyleConfig').open({type: 'networkLink'});
22
17
  }
23
18
 
19
+ // eslint-disable-next-line class-methods-use-this
20
+ ;
21
+ _proto.onReady = function onReady() {}
22
+
24
23
  /**
25
24
  * 关联IP示例代码
26
25
  */;
@@ -83,17 +83,15 @@ function getValuesByEdges(topo) {
83
83
  })[0] || 'nil';
84
84
  }
85
85
  function getEdgesValues(edges) {
86
- var edgeValues = [];
87
- edges.forEach(function (edge) {
88
- edgeValues.push({
86
+ return edges.map(function (edge) {
87
+ return {
89
88
  baseAgreement: false,
90
89
  lineButton: edge.a('edge.type.name') || edge.s('edge.type'),
91
90
  startPoint: getStartPoint(edge),
92
91
  endPoint: getEndPoint(edge),
93
92
  lineMold: edge.a('lineMode') || 'solidLine'
94
- });
93
+ };
95
94
  });
96
- return edgeValues;
97
95
  }
98
96
  var selectionEdges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
99
97
  var edgeValues = getEdgesValues(selectionEdges);
@@ -17,7 +17,6 @@ function getTextStyle(element) {
17
17
  }, _fontStyleUtil["default"].toMap(element.a('rectFont')), (0, _colorUtil.parseBackground)(element.a('topLeftColor')));
18
18
  }
19
19
  function setTextStyle(element, style, topo) {
20
- if ('underline' in style) {}
21
20
  if ('color' in style) {
22
21
  element.a('topLeftTextColor', style.color.hex);
23
22
  }
@@ -75,8 +75,8 @@ function getTextStyle(htSelection, styleNames) {
75
75
  // 查询该字段多元素的值列表,排除元素禁用的字段值
76
76
  var fieldValueList = elementValues.reduce(function (result, item) {
77
77
  // 元素字段是否禁用
78
- var disabled = !elementEnabledFieldsMap[item.id].includes(styleName);
79
- if (!item.values || disabled) {
78
+ var fieldDisabled = !elementEnabledFieldsMap[item.id].includes(styleName);
79
+ if (!item.values || fieldDisabled) {
80
80
  return result;
81
81
  }
82
82
  return [].concat(result, [item.values[styleName]]);
@@ -17,8 +17,7 @@ var defaultStyle = {
17
17
  };
18
18
  function useValues(topo) {
19
19
  var displayConfigState = topo.store.useModelState('displayConfig');
20
- var nodeLabelStyle = displayConfigState.nodeLabelStyle,
21
- defaultEdgeLabelStyle = displayConfigState.defaultEdgeLabelStyle;
20
+ var nodeLabelStyle = displayConfigState.nodeLabelStyle;
22
21
  return (0, _extends2["default"])({
23
22
  color: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.color) || defaultStyle.color,
24
23
  fontFamily: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontFamily) || defaultStyle.fontFamily,
@@ -45,7 +45,7 @@ var usePolling = function usePolling(props) {
45
45
  */
46
46
  function _fetchData() {
47
47
  _fetchData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
48
- var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricResult, mergeData, transformLinkData, adapterIpv6;
48
+ var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricsResult, mergeData, transformLinkData, adapterIpv6;
49
49
  return _regeneratorRuntime().wrap(function _callee$(_context) {
50
50
  while (1) switch (_context.prev = _context.next) {
51
51
  case 0:
@@ -74,7 +74,7 @@ var usePolling = function usePolling(props) {
74
74
  attributeMap: link.attributes || {}
75
75
  });
76
76
  };
77
- mergeData = function _mergeData(metricResult) {
77
+ mergeData = function _mergeData(ciMetricsResult) {
78
78
  // 合并属性、指标
79
79
  var _topo$dataModel$getDa = topo.dataModel.getData(),
80
80
  nodes = _topo$dataModel$getDa.nodes,
@@ -89,11 +89,11 @@ var usePolling = function usePolling(props) {
89
89
  resultData = adapterIpv6(resultData);
90
90
  return resultData;
91
91
  }).map(function (ciData) {
92
- var _metricResult$find;
92
+ var ciMetricResult = ciMetricsResult.find(function (item) {
93
+ return item.id === (ciData.ciId || ciData.id);
94
+ });
93
95
  return (0, _extends2["default"])({}, ciData, {
94
- metrics: ((_metricResult$find = metricResult.find(function (item) {
95
- return item.id === ciData.ciId || ciData.id;
96
- })) === null || _metricResult$find === void 0 ? void 0 : _metricResult$find.metrics) || {}
96
+ metrics: (ciMetricResult === null || ciMetricResult === void 0 ? void 0 : ciMetricResult.metrics) || {}
97
97
  });
98
98
  });
99
99
  };
@@ -131,8 +131,8 @@ var usePolling = function usePolling(props) {
131
131
  return _context.t0.all.call(_context.t0, _context.t3);
132
132
  case 16:
133
133
  _yield$Promise$all = _context.sent;
134
- ciMetricResult = _yield$Promise$all[0];
135
- return _context.abrupt("return", mergeData(ciMetricResult));
134
+ ciMetricsResult = _yield$Promise$all[0];
135
+ return _context.abrupt("return", mergeData(ciMetricsResult));
136
136
  case 19:
137
137
  case "end":
138
138
  return _context.stop();
@@ -29,7 +29,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
29
29
  var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
30
30
  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; }
31
31
  // eslint-disable-next-line no-undef
32
- var version = typeof "11.0.28" === 'string' ? "11.0.28" : null;
32
+ var version = typeof "11.0.29" === 'string' ? "11.0.29" : null;
33
33
  console.info("\u62D3\u6251\u7248\u672C: " + version);
34
34
 
35
35
  /**
@@ -18,13 +18,12 @@ var Test = /*#__PURE__*/function () {
18
18
  });
19
19
  }
20
20
  };
21
- };
22
- _proto.onReady = function onReady() {
23
- // TODO 待移除测试代码
24
- // this.iconManage.openUpload()
25
- // this.topo.store.getModelDispatchers('linkDynamicStyleConfig').open({type: 'networkLink'});
26
21
  }
27
22
 
23
+ // eslint-disable-next-line class-methods-use-this
24
+ ;
25
+ _proto.onReady = function onReady() {}
26
+
28
27
  /**
29
28
  * 关联IP示例代码
30
29
  */;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "11.0.28",
3
+ "version": "11.0.29",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -118,6 +118,6 @@
118
118
  "access": "public"
119
119
  },
120
120
  "license": "MIT",
121
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.28/build/index.html",
121
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.29/build/index.html",
122
122
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
123
123
  }
@@ -1,26 +0,0 @@
1
- import _List from "@alifd/next/es/list";
2
- import React from 'react';
3
- import ListItem from "./CiListItem";
4
- import styles from "./index.module.scss";
5
- var CiList = function CiList(props) {
6
- var data = props.data,
7
- onSelect = props.onSelect,
8
- selected = props.selected,
9
- loading = props.loading;
10
- var renderItem = function renderItem(item) {
11
- return /*#__PURE__*/React.createElement(ListItem, {
12
- key: item.value,
13
- data: item,
14
- onSelect: onSelect,
15
- selected: item.value === selected
16
- });
17
- };
18
- return /*#__PURE__*/React.createElement(_List, {
19
- className: styles.cilist,
20
- size: "small",
21
- loading: loading,
22
- dataSource: data,
23
- renderItem: renderItem
24
- });
25
- };
26
- export default CiList;
@@ -1,37 +0,0 @@
1
- import _Icon from "@alifd/next/es/icon";
2
- import React from 'react';
3
- import styles from "./index.module.scss";
4
- var getIcon = function getIcon(icon) {
5
- return "/img/model/" + icon + ".svg";
6
- };
7
- var onIconError = function onIconError(e) {
8
- var image = e.target;
9
- if (!image.isLoaded) {
10
- image.isLoaded = true;
11
- image.src = getIcon('backupOnError');
12
- }
13
- };
14
- var CiListItem = function CiListItem(props) {
15
- var data = props.data,
16
- onSelect = props.onSelect,
17
- selected = props.selected;
18
- var onClick = function onClick() {
19
- return onSelect(data);
20
- };
21
- var isCustom = data.icon === 'custom';
22
- var className = selected ? styles.ciitem + " " + styles.selected : styles.ciitem;
23
- return /*#__PURE__*/React.createElement("div", {
24
- className: className,
25
- onClick: onClick
26
- }, isCustom ? /*#__PURE__*/React.createElement(_Icon, {
27
- className: styles.icon,
28
- size: "xs",
29
- type: data.icon
30
- }) : /*#__PURE__*/React.createElement("img", {
31
- className: styles.icon,
32
- src: getIcon(data.icon),
33
- alt: data.icon,
34
- onError: onIconError
35
- }), /*#__PURE__*/React.createElement("span", null, data.label));
36
- };
37
- export default CiListItem;
@@ -1,62 +0,0 @@
1
- import _Table from "@alifd/next/es/table";
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import React, { useMemo, useState } from 'react';
4
- import NoDataPage from '@riil-frontend/component-topology-common/es/components/NoDataPage';
5
- import { getTitleCell } from '@riil-frontend/component-topology-common/es/utils/table';
6
- // import styles from './index.module.scss';
7
-
8
- var TYPES_NAME = {
9
- attributes: '属性',
10
- metrics: '指标'
11
- };
12
- var IndexList = function IndexList(props) {
13
- var _props$data = props.data,
14
- data = _props$data === void 0 ? [] : _props$data,
15
- initialValue = props.initialValue,
16
- onChange = props.onChange,
17
- loading = props.loading;
18
- var _useState = useState(initialValue || []),
19
- selectedRowKeys = _useState[0],
20
- setSelectedRowKeys = _useState[1];
21
- var onSelectionChange = function onSelectionChange(selectedRowKeys, records) {
22
- setSelectedRowKeys(selectedRowKeys);
23
- if (onChange) {
24
- onChange(selectedRowKeys);
25
- }
26
- };
27
- var rowSelection = {
28
- onChange: onSelectionChange,
29
- selectedRowKeys: selectedRowKeys
30
- };
31
- var columns = [{
32
- title: '属性/指标',
33
- dataIndex: 'name',
34
- cell: getTitleCell
35
- }, {
36
- title: '类型',
37
- dataIndex: 'type',
38
- cell: function cell(type) {
39
- return getTitleCell(TYPES_NAME[type]);
40
- }
41
- }];
42
- return /*#__PURE__*/React.createElement(_Table, {
43
- dataSource: data,
44
- primaryKey: "code",
45
- rowSelection: rowSelection,
46
- size: "small",
47
- tableLayout: "auto",
48
- maxBodyHeight: "100vh",
49
- tableWidth: 300,
50
- fixedHeader: true,
51
- hasBorder: false,
52
- loading: loading,
53
- emptyContent: /*#__PURE__*/React.createElement(NoDataPage, {
54
- type: "table"
55
- })
56
- }, columns.map(function (column) {
57
- return /*#__PURE__*/React.createElement(_Table.Column, _extends({}, column, {
58
- key: column.dataIndex
59
- }));
60
- }));
61
- };
62
- export default IndexList;
@@ -1,60 +0,0 @@
1
- import _Divider from "@alifd/next/es/divider";
2
- import React, { useEffect, useRef } from 'react';
3
- import { store as pageStore } from 'ice/TopoCenter';
4
- import { isAvailableArray } from '@riil-frontend/utils';
5
- import Drawer from "../Drawer";
6
- import CiList from "./CiList";
7
- import IndexList from "./IndexList";
8
- import styles from "./index.module.scss";
9
- var IndexSettingDrawer = function IndexSettingDrawer(props) {
10
- var visible = props.visible,
11
- initialData = props.initialData,
12
- onSave = props.onSave,
13
- onClose = props.onClose;
14
- var effectsState = pageStore.useModelEffectsState('ciModel');
15
- var ciLoading = effectsState.getTypeDicts.isLoading;
16
- var metaLoading = effectsState.getCiMeta.isLoading;
17
- var _pageStore$useModel = pageStore.useModel('ciModel'),
18
- pageState = _pageStore$useModel[0],
19
- pageDispatchers = _pageStore$useModel[1];
20
- useEffect(function () {
21
- pageDispatchers.getTypeDicts();
22
- }, []);
23
- var typeDicts = pageState.typeDicts,
24
- _pageState$currentCi = pageState.currentCi,
25
- _pageState$currentCi2 = _pageState$currentCi === void 0 ? {} : _pageState$currentCi,
26
- code = _pageState$currentCi2.code,
27
- _pageState$currentCi3 = _pageState$currentCi2.meta,
28
- meta = _pageState$currentCi3 === void 0 ? [] : _pageState$currentCi3;
29
- var onDrawerSave = function onDrawerSave() {
30
- // onSave(data[0]);
31
- onClose();
32
- };
33
- var onCiSelect = function onCiSelect(ci) {
34
- pageDispatchers.getCiMeta(ci.value);
35
- };
36
- var onMetaChange = function onMetaChange(values) {
37
- // console.log(values);
38
- };
39
- return /*#__PURE__*/React.createElement(Drawer, {
40
- title: "\u9009\u62E9\u6570\u636E",
41
- visible: visible,
42
- onSave: onDrawerSave,
43
- onClose: onClose
44
- }, /*#__PURE__*/React.createElement("div", {
45
- className: styles.container
46
- }, /*#__PURE__*/React.createElement(CiList, {
47
- data: typeDicts,
48
- loading: ciLoading,
49
- onSelect: onCiSelect,
50
- selected: code
51
- }), /*#__PURE__*/React.createElement(_Divider, {
52
- className: styles.separator,
53
- direction: "ver"
54
- }), code && /*#__PURE__*/React.createElement(IndexList, {
55
- data: meta,
56
- loading: metaLoading,
57
- onChange: onMetaChange
58
- })));
59
- };
60
- export default IndexSettingDrawer;
@@ -1,44 +0,0 @@
1
- @import "@alifd/next/variables";
2
-
3
- .container {
4
- display: flex;
5
- align-items: stretch;
6
- align-content: stretch;
7
- }
8
-
9
- .cilist {
10
- width: calc(100% - 317px);
11
- }
12
-
13
- .ciitem {
14
- display: flex;
15
- align-items: center;
16
- cursor: pointer;
17
- margin: 0 4px;
18
- padding: 4px;
19
- border-radius: 2px;
20
- color: #333;
21
- background-color: #FFF;
22
- height: 20px;
23
- line-height: 20px;
24
- font-size: 12px;
25
-
26
- &:hover {
27
- background-color: #F2F3F7;
28
- }
29
-
30
- .icon {
31
- width: 16px;
32
- height: 16px;
33
- margin-right: 8px;
34
- }
35
-
36
- &.selected {
37
- background-color: #F2F3F7;
38
- color: $color-brand1-6;
39
- }
40
- }
41
-
42
- .separator {
43
- height: 100vh;
44
- }