@riil-frontend/component-topology 5.0.12 → 5.0.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.
@@ -5,9 +5,9 @@ import _Box from "@alifd/next/es/box";
5
5
  import _Radio from "@alifd/next/es/radio";
6
6
  import React, { useEffect, useState, useRef } from 'react';
7
7
  import styles from "./ResourceDisplay/CommonCheckboxGroup.module.scss";
8
- import { plurals } from "../../models/utils/linkUtils";
8
+ import { plurals, compatibleWith } from "../../models/utils/linkUtils";
9
9
  var LineExpandAllRadioGroup = /*#__PURE__*/React.forwardRef(function LineExpandAllRadioGroup(props, ref) {
10
- var _plurals;
10
+ var _plurals$compatibleWi;
11
11
 
12
12
  var value = props.value,
13
13
  onChange = props.onChange,
@@ -18,7 +18,7 @@ var LineExpandAllRadioGroup = /*#__PURE__*/React.forwardRef(function LineExpandA
18
18
  showType = _useState[0],
19
19
  setShowType = _useState[1];
20
20
 
21
- var _useState2 = useState((_plurals = plurals[value === false ? 2 : value]) !== null && _plurals !== void 0 ? _plurals : []),
21
+ var _useState2 = useState((_plurals$compatibleWi = plurals[compatibleWith(value)]) !== null && _plurals$compatibleWi !== void 0 ? _plurals$compatibleWi : []),
22
22
  pluralType = _useState2[0],
23
23
  setPluralType = _useState2[1];
24
24
 
@@ -21,7 +21,7 @@ import PluginManager from "./PluginManager";
21
21
  import topoFactory from "./topoFactory";
22
22
  import ElementTagTipConfig from "./tagstips/ElementTagTipConfig"; // eslint-disable-next-line no-undef
23
23
 
24
- var version = typeof "5.0.12" === 'string' ? "5.0.12" : null;
24
+ var version = typeof "5.0.14" === 'string' ? "5.0.14" : null;
25
25
  console.info("\u62D3\u6251\u7248\u672C: " + version);
26
26
  /**
27
27
  * 拓扑显示和编辑
@@ -175,6 +175,15 @@ function _getLinksDetail() {
175
175
  }
176
176
 
177
177
  export function buildTopoLinkData() {}
178
+ export var compatibleWith = function compatibleWith(value) {
179
+ var pluralType = value !== null && value !== void 0 ? value : 2;
180
+
181
+ if (value === false) {
182
+ pluralType = 2;
183
+ }
184
+
185
+ return pluralType;
186
+ };
178
187
  /**
179
188
  * 链路显示模式
180
189
  */
@@ -187,14 +196,13 @@ export var plurals = {
187
196
  4: ["phy", "agg"]
188
197
  };
189
198
  export var showLinkByConfig = function showLinkByConfig(props) {
190
- var _plurals;
199
+ var _plurals$compatibleWi;
191
200
 
192
201
  var topo = props.topo,
193
- _props$showType = props.showType,
194
- showType = _props$showType === void 0 ? 2 : _props$showType;
202
+ showType = props.showType;
195
203
  console.log("showLinkByConfig-----------------------------", props, showType); //const displayConfig = topo.store.getModelState("displayConfig");
196
204
 
197
- var types = (_plurals = plurals[showType === false ? 2 : showType]) !== null && _plurals !== void 0 ? _plurals : []; // 查询所有连线
205
+ var types = (_plurals$compatibleWi = plurals[compatibleWith(showType)]) !== null && _plurals$compatibleWi !== void 0 ? _plurals$compatibleWi : []; // 查询所有连线
198
206
 
199
207
  var gv = topo.getGraphView();
200
208
  var dm = gv.getDataModel();
@@ -208,13 +216,13 @@ export var showLinkByConfig = function showLinkByConfig(props) {
208
216
  edges.map(function (edge) {
209
217
  if (showType === 1 || showType === true) {
210
218
  // 单链路全部显示
211
- console.log("单链路全部显示", edge);
219
+ // console.log("单链路全部显示", edge);
212
220
  edge.s("2d.visible", true);
213
221
  } else {
214
222
  var _d$attributes, _d$attributes2;
215
223
 
216
- var d = topo.dataModel.getDataById(edge.getTag());
217
- console.log("edge", edge, d); // 判断是否聚合链路
224
+ var d = topo.dataModel.getDataById(edge.getTag()); // console.log("edge", edge, d);
225
+ // 判断是否聚合链路
218
226
 
219
227
  if ((d === null || d === void 0 ? void 0 : (_d$attributes = d.attributes) === null || _d$attributes === void 0 ? void 0 : _d$attributes.destination_type) === "network.agg_interface" && (d === null || d === void 0 ? void 0 : (_d$attributes2 = d.attributes) === null || _d$attributes2 === void 0 ? void 0 : _d$attributes2.source_type) === "network.agg_interface") {
220
228
  edge.s("2d.visible", showAgg);
@@ -26,7 +26,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
26
26
  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; }
27
27
 
28
28
  var LineExpandAllRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function LineExpandAllRadioGroup(props, ref) {
29
- var _plurals;
29
+ var _plurals$compatibleWi;
30
30
 
31
31
  var value = props.value,
32
32
  onChange = props.onChange,
@@ -37,7 +37,7 @@ var LineExpandAllRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function
37
37
  showType = _useState[0],
38
38
  setShowType = _useState[1];
39
39
 
40
- var _useState2 = (0, _react.useState)((_plurals = _linkUtils.plurals[value === false ? 2 : value]) !== null && _plurals !== void 0 ? _plurals : []),
40
+ var _useState2 = (0, _react.useState)((_plurals$compatibleWi = _linkUtils.plurals[(0, _linkUtils.compatibleWith)(value)]) !== null && _plurals$compatibleWi !== void 0 ? _plurals$compatibleWi : []),
41
41
  pluralType = _useState2[0],
42
42
  setPluralType = _useState2[1];
43
43
 
@@ -50,7 +50,7 @@ var _topoFactory = _interopRequireDefault(require("./topoFactory"));
50
50
  var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTagTipConfig"));
51
51
 
52
52
  // eslint-disable-next-line no-undef
53
- var version = typeof "5.0.12" === 'string' ? "5.0.12" : null;
53
+ var version = typeof "5.0.14" === 'string' ? "5.0.14" : null;
54
54
  console.info("\u62D3\u6251\u7248\u672C: " + version);
55
55
  /**
56
56
  * 拓扑显示和编辑
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
 
5
5
  exports.__esModule = true;
6
6
  exports.buildTopoLinkData = buildTopoLinkData;
7
- exports.getInterfaceObject = void 0;
7
+ exports.getInterfaceObject = exports.compatibleWith = void 0;
8
8
  exports.getLinksDetail = getLinksDetail;
9
9
  exports.isAggLink = isAggLink;
10
10
  exports.isCrucialLink = isCrucialLink;
@@ -202,11 +202,22 @@ function _getLinksDetail() {
202
202
  }
203
203
 
204
204
  function buildTopoLinkData() {}
205
+
206
+ var compatibleWith = function compatibleWith(value) {
207
+ var pluralType = value !== null && value !== void 0 ? value : 2;
208
+
209
+ if (value === false) {
210
+ pluralType = 2;
211
+ }
212
+
213
+ return pluralType;
214
+ };
205
215
  /**
206
216
  * 链路显示模式
207
217
  */
208
218
 
209
219
 
220
+ exports.compatibleWith = compatibleWith;
210
221
  var plurals = {
211
222
  0: [],
212
223
  1: [],
@@ -217,14 +228,13 @@ var plurals = {
217
228
  exports.plurals = plurals;
218
229
 
219
230
  var showLinkByConfig = function showLinkByConfig(props) {
220
- var _plurals;
231
+ var _plurals$compatibleWi;
221
232
 
222
233
  var topo = props.topo,
223
- _props$showType = props.showType,
224
- showType = _props$showType === void 0 ? 2 : _props$showType;
234
+ showType = props.showType;
225
235
  console.log("showLinkByConfig-----------------------------", props, showType); //const displayConfig = topo.store.getModelState("displayConfig");
226
236
 
227
- var types = (_plurals = plurals[showType === false ? 2 : showType]) !== null && _plurals !== void 0 ? _plurals : []; // 查询所有连线
237
+ var types = (_plurals$compatibleWi = plurals[compatibleWith(showType)]) !== null && _plurals$compatibleWi !== void 0 ? _plurals$compatibleWi : []; // 查询所有连线
228
238
 
229
239
  var gv = topo.getGraphView();
230
240
  var dm = gv.getDataModel();
@@ -238,13 +248,13 @@ var showLinkByConfig = function showLinkByConfig(props) {
238
248
  edges.map(function (edge) {
239
249
  if (showType === 1 || showType === true) {
240
250
  // 单链路全部显示
241
- console.log("单链路全部显示", edge);
251
+ // console.log("单链路全部显示", edge);
242
252
  edge.s("2d.visible", true);
243
253
  } else {
244
254
  var _d$attributes, _d$attributes2;
245
255
 
246
- var d = topo.dataModel.getDataById(edge.getTag());
247
- console.log("edge", edge, d); // 判断是否聚合链路
256
+ var d = topo.dataModel.getDataById(edge.getTag()); // console.log("edge", edge, d);
257
+ // 判断是否聚合链路
248
258
 
249
259
  if ((d === null || d === void 0 ? void 0 : (_d$attributes = d.attributes) === null || _d$attributes === void 0 ? void 0 : _d$attributes.destination_type) === "network.agg_interface" && (d === null || d === void 0 ? void 0 : (_d$attributes2 = d.attributes) === null || _d$attributes2 === void 0 ? void 0 : _d$attributes2.source_type) === "network.agg_interface") {
250
260
  edge.s("2d.visible", showAgg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "5.0.12",
3
+ "version": "5.0.14",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -115,6 +115,6 @@
115
115
  "access": "public"
116
116
  },
117
117
  "license": "MIT",
118
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@5.0.12/build/index.html",
118
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@5.0.14/build/index.html",
119
119
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
120
120
  }