@riil-frontend/component-topology 11.0.17 → 11.0.18

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.
@@ -9,7 +9,7 @@ function PlatformDisplay(props) {
9
9
  return '';
10
10
  }
11
11
 
12
- return data.isSubResource ? data.attributes.platform : '本级平台';
12
+ return data.level === '0' ? data.sourceName : '本级平台';
13
13
  }
14
14
 
15
15
  export default PlatformDisplay;
@@ -5,7 +5,6 @@ import { useEffect } from 'react';
5
5
  import { useRequest } from 'ahooks';
6
6
  import _ from 'lodash';
7
7
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
8
- import topoServer from '@riil-frontend/component-topology-common/es/services/topo';
9
8
  import { useCbbEventListener } from '@riil-frontend/component-riil-event-emitter';
10
9
  import DictCache from "../models/cache/DictCache";
11
10
  import useCiAttributeChange from "./useCiAttributeChange";
@@ -94,7 +93,7 @@ var usePolling = function usePolling(props) {
94
93
  };
95
94
  _context.t0 = Promise;
96
95
  _context.t1 = // 查询指标值
97
- topoServer.ciInfo.batchQueryCiInfo(param);
96
+ topo.serverApi.ciInfo.batchQueryCiInfo(param);
98
97
  _context.next = 10;
99
98
  return DictCache.init();
100
99
 
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
26
26
 
27
- var version = typeof "11.0.17" === 'string' ? "11.0.17" : null;
27
+ var version = typeof "11.0.18" === 'string' ? "11.0.18" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -1,27 +1,4 @@
1
- import { metricValueFormat } from '@riil-frontend/utils';
2
- import DictCache from "../../cache/DictCache";
3
- /**
4
- * 格式化指标
5
- * @param {*} val
6
- * @param {*} metricInfo
7
- * @returns
8
- */
9
-
10
- export function formatMetric(val, metricInfo) {
11
- // rlog.debug('formatMetric', item, metricInfo);
12
- if (metricInfo) {
13
- var result = metricValueFormat({
14
- value: val,
15
- dataType: metricInfo.dataType,
16
- dict: DictCache.getDictObject(),
17
- unit: metricInfo.unit,
18
- code: metricInfo.code
19
- });
20
- return result.value + " " + (result.value === '-' ? '' : result.unit);
21
- } else {
22
- return "" + val;
23
- }
24
- }
1
+ import { formatMetric } from "../../../utils/metricUtil";
25
2
  export default function commonTransform(options) {
26
3
  var item = options.item,
27
4
  ciData = options.ciData,
@@ -0,0 +1,23 @@
1
+ import { metricValueFormat } from '@riil-frontend/utils';
2
+ import DictCache from "../models/cache/DictCache";
3
+ /**
4
+ * 格式化指标
5
+ * @param {*} val
6
+ * @param {*} metricModel
7
+ * @returns
8
+ */
9
+
10
+ export function formatMetric(val, metricModel) {
11
+ if (metricModel) {
12
+ var result = metricValueFormat({
13
+ value: val,
14
+ dataType: metricModel.dataType,
15
+ dict: DictCache.getDictObject(),
16
+ unit: metricModel.unit,
17
+ code: metricModel.code
18
+ });
19
+ return result.value + " " + (result.value === '-' ? '' : result.unit);
20
+ } else {
21
+ return "" + val;
22
+ }
23
+ }
@@ -13,8 +13,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
13
13
  import _regeneratorRuntime from "@babel/runtime/regenerator";
14
14
  import moment from 'moment';
15
15
  import React, { useEffect, useMemo, useState } from 'react';
16
- import { rlog } from '@riil-frontend/component-topology-utils/lib/rlog'; // import { Link } from 'react-router-dom';
17
-
16
+ import { rlog } from '@riil-frontend/component-topology-utils/lib/rlog';
18
17
  import Link from "../../../../../../../components/Link";
19
18
  import { queryCisByIds, commonQueryCiData } from "../../../../../../services";
20
19
  import service from "../../../../../../services/overview";
@@ -26,10 +25,10 @@ import styles from "./index.module.scss";
26
25
  import ResourceOverviewMetric from "./ResourceOverviewMetric";
27
26
  import useCiAttrAndMetricData from "./useCiAttrAndMetricData";
28
27
  import Configurator from "./components/Configurator";
29
- import { formatMetric } from "../../../../../../models/attributeFormatter";
30
28
  import LinkTopoCard from "./components/LinkTopo/LinkTopoCard";
31
29
  import EventsCard from "./EventsCard";
32
- import NetworkBaseInfo from "./NetworkBaseInfo"; // url 处理,UICBB 的地址需截取前缀
30
+ import NetworkBaseInfo from "./NetworkBaseInfo";
31
+ import { formatMetric } from "../../../../../../utils/metricUtil"; // url 处理,UICBB 的地址需截取前缀
33
32
 
34
33
  function formatUrl(url) {
35
34
  var _window, _window$location;
@@ -16,7 +16,7 @@ function PlatformDisplay(props) {
16
16
  return '';
17
17
  }
18
18
 
19
- return data.isSubResource ? data.attributes.platform : '本级平台';
19
+ return data.level === '0' ? data.sourceName : '本级平台';
20
20
  }
21
21
 
22
22
  var _default = PlatformDisplay;
@@ -19,8 +19,6 @@ var _lodash = _interopRequireDefault(require("lodash"));
19
19
 
20
20
  var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
21
21
 
22
- var _topo = _interopRequireDefault(require("@riil-frontend/component-topology-common/es/services/topo"));
23
-
24
22
  var _componentRiilEventEmitter = require("@riil-frontend/component-riil-event-emitter");
25
23
 
26
24
  var _DictCache = _interopRequireDefault(require("../models/cache/DictCache"));
@@ -112,7 +110,7 @@ var usePolling = function usePolling(props) {
112
110
  };
113
111
  _context.t0 = Promise;
114
112
  _context.t1 = // 查询指标值
115
- _topo["default"].ciInfo.batchQueryCiInfo(param);
113
+ topo.serverApi.ciInfo.batchQueryCiInfo(param);
116
114
  _context.next = 10;
117
115
  return _DictCache["default"].init();
118
116
 
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
56
56
  var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
57
57
 
58
58
  // eslint-disable-next-line no-undef
59
- var version = typeof "11.0.17" === 'string' ? "11.0.17" : null;
59
+ var version = typeof "11.0.18" === 'string' ? "11.0.18" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑
@@ -1,36 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  exports.__esModule = true;
6
4
  exports["default"] = commonTransform;
7
- exports.formatMetric = formatMetric;
8
-
9
- var _utils = require("@riil-frontend/utils");
10
5
 
11
- var _DictCache = _interopRequireDefault(require("../../cache/DictCache"));
12
-
13
- /**
14
- * 格式化指标
15
- * @param {*} val
16
- * @param {*} metricInfo
17
- * @returns
18
- */
19
- function formatMetric(val, metricInfo) {
20
- // rlog.debug('formatMetric', item, metricInfo);
21
- if (metricInfo) {
22
- var result = (0, _utils.metricValueFormat)({
23
- value: val,
24
- dataType: metricInfo.dataType,
25
- dict: _DictCache["default"].getDictObject(),
26
- unit: metricInfo.unit,
27
- code: metricInfo.code
28
- });
29
- return result.value + " " + (result.value === '-' ? '' : result.unit);
30
- } else {
31
- return "" + val;
32
- }
33
- }
6
+ var _metricUtil = require("../../../utils/metricUtil");
34
7
 
35
8
  function commonTransform(options) {
36
9
  var item = options.item,
@@ -54,7 +27,7 @@ function commonTransform(options) {
54
27
  // 属性code
55
28
  name: (fieldMeta === null || fieldMeta === void 0 ? void 0 : fieldMeta.name) || '',
56
29
  // 属性名称
57
- value: formatMetric(fieldValue, fieldMeta),
30
+ value: (0, _metricUtil.formatMetric)(fieldValue, fieldMeta),
58
31
  // 属性值
59
32
  originValue: fieldValue
60
33
  };
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports.formatMetric = formatMetric;
7
+
8
+ var _utils = require("@riil-frontend/utils");
9
+
10
+ var _DictCache = _interopRequireDefault(require("../models/cache/DictCache"));
11
+
12
+ /**
13
+ * 格式化指标
14
+ * @param {*} val
15
+ * @param {*} metricModel
16
+ * @returns
17
+ */
18
+ function formatMetric(val, metricModel) {
19
+ if (metricModel) {
20
+ var result = (0, _utils.metricValueFormat)({
21
+ value: val,
22
+ dataType: metricModel.dataType,
23
+ dict: _DictCache["default"].getDictObject(),
24
+ unit: metricModel.unit,
25
+ code: metricModel.code
26
+ });
27
+ return result.value + " " + (result.value === '-' ? '' : result.unit);
28
+ } else {
29
+ return "" + val;
30
+ }
31
+ }
@@ -45,14 +45,14 @@ var _useCiAttrAndMetricData = _interopRequireDefault(require("./useCiAttrAndMetr
45
45
 
46
46
  var _Configurator = _interopRequireDefault(require("./components/Configurator"));
47
47
 
48
- var _attributeFormatter = require("../../../../../../models/attributeFormatter");
49
-
50
48
  var _LinkTopoCard = _interopRequireDefault(require("./components/LinkTopo/LinkTopoCard"));
51
49
 
52
50
  var _EventsCard = _interopRequireDefault(require("./EventsCard"));
53
51
 
54
52
  var _NetworkBaseInfo = _interopRequireDefault(require("./NetworkBaseInfo"));
55
53
 
54
+ var _metricUtil = require("../../../../../../utils/metricUtil");
55
+
56
56
  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); }
57
57
 
58
58
  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; }
@@ -513,7 +513,7 @@ function ResourceOverview(props) {
513
513
  }
514
514
 
515
515
  item = _step.value;
516
- value = (0, _attributeFormatter.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
516
+ value = (0, _metricUtil.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
517
517
  contentTitle = value;
518
518
  return _context6.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
519
519
  var link, address, owned_computer_room, owned_cabinet, roomLink, node;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "11.0.17",
3
+ "version": "11.0.18",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -75,7 +75,7 @@
75
75
  "@riil-frontend/component-table-filter-tags": "latest",
76
76
  "@riil-frontend/component-table-layout": "^2.0.2",
77
77
  "@riil-frontend/component-topology-common": "^1.1.2",
78
- "@riil-frontend/component-topology-graph": "^2.8.2",
78
+ "@riil-frontend/component-topology-graph": "^4.0.6",
79
79
  "@riil-frontend/css": "^2.0.2",
80
80
  "@riil-frontend/hooks": "latest",
81
81
  "@riil-frontend/next-collapse": "^1.0.1-a.0",
@@ -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.17/build/index.html",
121
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.18/build/index.html",
122
122
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
123
123
  }