@riil-frontend/component-topology 4.0.21 → 4.0.23

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.
@@ -7,7 +7,7 @@ import React, { useEffect, useState, useRef } from "react";
7
7
  import styles from "./ResourceDisplay/CommonCheckboxGroup.module.scss";
8
8
  import { plurals } from "../../models/utils/linkUtils";
9
9
  var LineExpandAllRadioGroup = /*#__PURE__*/React.forwardRef(function LineExpandAllRadioGroup(props, ref) {
10
- var _plurals$value;
10
+ var _plurals;
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$value = plurals[value]) !== null && _plurals$value !== void 0 ? _plurals$value : []),
21
+ var _useState2 = useState((_plurals = plurals[value !== null && value !== void 0 ? value : 2]) !== null && _plurals !== void 0 ? _plurals : []),
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 "4.0.21" === 'string' ? "4.0.21" : null;
24
+ var version = typeof "4.0.23" === 'string' ? "4.0.23" : null;
25
25
  console.info("\u62D3\u6251\u7248\u672C: " + version);
26
26
  /**
27
27
  * 拓扑显示和编辑
@@ -169,11 +169,14 @@ export var plurals = {
169
169
  4: ["phy", "agg"]
170
170
  };
171
171
  export var showLinkByConfig = function showLinkByConfig(props) {
172
- console.log("showLinkByConfig-----------------------------", props);
172
+ var _plurals$showType;
173
+
173
174
  var topo = props.topo,
174
- showType = props.showType; //const displayConfig = topo.store.getModelState("displayConfig");
175
+ _props$showType = props.showType,
176
+ showType = _props$showType === void 0 ? 1 : _props$showType;
177
+ console.log("showLinkByConfig-----------------------------", props, showType); //const displayConfig = topo.store.getModelState("displayConfig");
175
178
 
176
- var types = plurals[showType]; // 查询所有连线
179
+ var types = (_plurals$showType = plurals[showType]) !== null && _plurals$showType !== void 0 ? _plurals$showType : []; // 查询所有连线
177
180
 
178
181
  var gv = topo.getGraphView();
179
182
  var dm = gv.getDataModel();
@@ -181,28 +184,21 @@ export var showLinkByConfig = function showLinkByConfig(props) {
181
184
 
182
185
  var showPhy = types.indexOf("phy") >= 0;
183
186
  var showAgg = types.indexOf("agg") >= 0;
187
+ console.log("edges----types", showType, types, showAgg);
184
188
 
185
189
  if (Array.isArray(edges) && edges.length > 0) {
186
190
  edges.map(function (edge) {
187
- if (showType === 1) {
191
+ if (showType === 1 || showType === true) {
188
192
  // 单链路全部显示
189
193
  edge.s("2d.visible", true);
190
194
  } else {
191
- var d = topo.dataModel.getDataById(edge.getTag()); //console.log("edge", edge, d);
192
- // 判断是否聚合链路
193
-
194
- if (d.destination_type === "network.agg_interface" && d.source_type === "network.agg_interface") {
195
- if (showAgg) {
196
- edge.s("2d.visible", true);
197
- } else {
198
- edge.s("2d.visible", false);
199
- }
195
+ var d = topo.dataModel.getDataById(edge.getTag());
196
+ console.log("edge", edge, d); // 判断是否聚合链路
197
+
198
+ if (d.attributes.destination_type === "network.agg_interface" && d.attributes.source_type === "network.agg_interface") {
199
+ edge.s("2d.visible", showAgg);
200
200
  } else {
201
- if (showPhy) {
202
- edge.s("2d.visible", true);
203
- } else {
204
- edge.s("2d.visible", false);
205
- }
201
+ edge.s("2d.visible", showPhy);
206
202
  }
207
203
  }
208
204
  });
@@ -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$value;
29
+ var _plurals;
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$value = _linkUtils.plurals[value]) !== null && _plurals$value !== void 0 ? _plurals$value : []),
40
+ var _useState2 = (0, _react.useState)((_plurals = _linkUtils.plurals[value !== null && value !== void 0 ? value : 2]) !== null && _plurals !== void 0 ? _plurals : []),
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 "4.0.21" === 'string' ? "4.0.21" : null;
53
+ var version = typeof "4.0.23" === 'string' ? "4.0.23" : null;
54
54
  console.info("\u62D3\u6251\u7248\u672C: " + version);
55
55
  /**
56
56
  * 拓扑显示和编辑
@@ -195,11 +195,14 @@ var plurals = {
195
195
  exports.plurals = plurals;
196
196
 
197
197
  var showLinkByConfig = function showLinkByConfig(props) {
198
- console.log("showLinkByConfig-----------------------------", props);
198
+ var _plurals$showType;
199
+
199
200
  var topo = props.topo,
200
- showType = props.showType; //const displayConfig = topo.store.getModelState("displayConfig");
201
+ _props$showType = props.showType,
202
+ showType = _props$showType === void 0 ? 1 : _props$showType;
203
+ console.log("showLinkByConfig-----------------------------", props, showType); //const displayConfig = topo.store.getModelState("displayConfig");
201
204
 
202
- var types = plurals[showType]; // 查询所有连线
205
+ var types = (_plurals$showType = plurals[showType]) !== null && _plurals$showType !== void 0 ? _plurals$showType : []; // 查询所有连线
203
206
 
204
207
  var gv = topo.getGraphView();
205
208
  var dm = gv.getDataModel();
@@ -207,28 +210,21 @@ var showLinkByConfig = function showLinkByConfig(props) {
207
210
 
208
211
  var showPhy = types.indexOf("phy") >= 0;
209
212
  var showAgg = types.indexOf("agg") >= 0;
213
+ console.log("edges----types", showType, types, showAgg);
210
214
 
211
215
  if (Array.isArray(edges) && edges.length > 0) {
212
216
  edges.map(function (edge) {
213
- if (showType === 1) {
217
+ if (showType === 1 || showType === true) {
214
218
  // 单链路全部显示
215
219
  edge.s("2d.visible", true);
216
220
  } else {
217
- var d = topo.dataModel.getDataById(edge.getTag()); //console.log("edge", edge, d);
218
- // 判断是否聚合链路
219
-
220
- if (d.destination_type === "network.agg_interface" && d.source_type === "network.agg_interface") {
221
- if (showAgg) {
222
- edge.s("2d.visible", true);
223
- } else {
224
- edge.s("2d.visible", false);
225
- }
221
+ var d = topo.dataModel.getDataById(edge.getTag());
222
+ console.log("edge", edge, d); // 判断是否聚合链路
223
+
224
+ if (d.attributes.destination_type === "network.agg_interface" && d.attributes.source_type === "network.agg_interface") {
225
+ edge.s("2d.visible", showAgg);
226
226
  } else {
227
- if (showPhy) {
228
- edge.s("2d.visible", true);
229
- } else {
230
- edge.s("2d.visible", false);
231
- }
227
+ edge.s("2d.visible", showPhy);
232
228
  }
233
229
  }
234
230
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "4.0.21",
3
+ "version": "4.0.23",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -114,6 +114,6 @@
114
114
  "access": "public"
115
115
  },
116
116
  "license": "MIT",
117
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@4.0.21/build/index.html",
117
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@4.0.23/build/index.html",
118
118
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
119
119
  }