@riil-frontend/component-topology 10.0.2 → 10.0.3

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.
@@ -286,7 +286,7 @@ export default function BackgroundView(props) {
286
286
  return /*#__PURE__*/React.createElement("div", {
287
287
  className: styles['background-view']
288
288
  }, /*#__PURE__*/React.createElement("div", {
289
- className: styles.option
289
+ className: styles.header
290
290
  }, /*#__PURE__*/React.createElement(_Button, {
291
291
  title: "\u6062\u590D\u9ED8\u8BA4",
292
292
  onClick: resetDefault
@@ -299,6 +299,8 @@ export default function BackgroundView(props) {
299
299
  }, /*#__PURE__*/React.createElement(_Icon, {
300
300
  type: "topo_button_icon_export"
301
301
  })))), /*#__PURE__*/React.createElement("div", {
302
+ className: styles.content
303
+ }, /*#__PURE__*/React.createElement("div", {
302
304
  className: styles.list
303
305
  }, /*#__PURE__*/React.createElement(List, {
304
306
  selected: (current === null || current === void 0 ? void 0 : current.id) || '',
@@ -328,7 +330,7 @@ export default function BackgroundView(props) {
328
330
  setUploadDialogVisible(false);
329
331
  getBackground();
330
332
  }
331
- }), /*#__PURE__*/React.createElement(_Loading, {
333
+ })), /*#__PURE__*/React.createElement(_Loading, {
332
334
  visible: loadingBackground,
333
335
  fullScreen: true
334
336
  }));
@@ -2,18 +2,27 @@
2
2
 
3
3
  .background-view {
4
4
  width: 260px;
5
- padding: 16px;
6
5
  background: #fff;
7
6
  height: 100%;
8
7
  overflow: auto;
9
- .option {
8
+ display: flex;
9
+ flex-direction: column;
10
+
11
+ .header {
12
+ padding: 16px 16px 12px 16px;
10
13
  text-align: right;
11
14
  button {
12
15
  margin-left: 8px;
13
16
  }
14
17
  }
18
+
19
+ .content {
20
+ flex: 1;
21
+ overflow: auto;
22
+ padding: 0 16px 16px 16px;
23
+ }
24
+
15
25
  .list {
16
- margin-top: 8px;
17
26
  .tag {
18
27
  width: 100%;
19
28
  height: 129px;
@@ -28,7 +28,7 @@ var panes = [{
28
28
  icon: '/img/topo/editor/sidebar/icon/背景.svg',
29
29
  content: BackgroundPanel
30
30
  }, {
31
- title: '画布',
31
+ title: '主题',
32
32
  key: 'canvas',
33
33
  titleTootip: '拓扑图画布底图',
34
34
  icon: '/img/topo/editor/sidebar/icon/画布.svg',
@@ -40,7 +40,7 @@ function FontSizeWidget(props) {
40
40
  useEffect(function () {}, [selection]);
41
41
  return /*#__PURE__*/React.createElement(WidgetBox, {
42
42
  label: "\u5B57\u53F7",
43
- tooltip: "\u9009\u53D6\u6587\u5B57\u7684\u65B0\u5B57\u4F53",
43
+ tooltip: "\u66F4\u6539\u6587\u5B57\u5927\u5C0F",
44
44
  showLabel: showLabel,
45
45
  disabled: disabled
46
46
  }, /*#__PURE__*/React.createElement(FontSizeSelect, {
@@ -74,7 +74,7 @@ function NodeSizeButton(props) {
74
74
  return /*#__PURE__*/React.createElement(WidgetBox, {
75
75
  label: "\u56FE\u7247\u5C3A\u5BF8",
76
76
  disabled: disabled,
77
- tooltip: "\u56FE\u7247\u5C3A\u5BF8",
77
+ tooltip: "\u5C3A\u5BF8\u8BBE\u7F6E",
78
78
  showLabel: showLabel
79
79
  }, /*#__PURE__*/React.createElement("div", {
80
80
  className: styles.toolbarNodeSizeSetting
@@ -612,12 +612,11 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
612
612
  ;
613
613
 
614
614
  _proto.buildTagsTips = function buildTagsTips() {
615
- var _this6 = this;
616
-
617
615
  var data = this.getData(); // 获取标注、悬浮框配置
618
616
 
619
617
  var ciConfigs = this.getResourceTagTipConfig(); // console.log("buildTagsTips---ciConfigs", ciConfigs);
620
618
 
619
+ var formatter = new AttributeFormatter(this.topo);
621
620
  var ciTagsAndTips = ciConfigs.map(function (ciConfig) {
622
621
  var ciDataItem = findItem(data, "id", ciConfig.id); // console.log("buildTagsTips-ciDataItem", ciDataItem);
623
622
 
@@ -630,13 +629,17 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
630
629
  } // 获取ci数据
631
630
 
632
631
 
633
- var ciData = _extends({}, findItem(data, "id", ciConfig.id), {
632
+ var ciData = _extends({}, ciDataItem, {
634
633
  ciType: ciConfig.ciType
635
- });
634
+ }); // console.log("AttributeFormatter-----", ciData, ciConfig);
636
635
 
637
- var formatter = new AttributeFormatter(_this6.topo); // console.log("AttributeFormatter-----", ciData, ciConfig);
638
636
 
639
- var tags = formatter.formatAttrs(ciConfig.tags, ciData); // 链路标注箭头
637
+ var tags = formatter.formatAttrs(ciConfig.tags, ciData) // 展示的所有标注不带对应的名字(包括属性和指标)
638
+ .map(function (item) {
639
+ return _extends({}, item, {
640
+ name: ''
641
+ });
642
+ }); // 链路标注箭头
640
643
 
641
644
  if (ciConfig.type === "edge") {
642
645
  tags = {
@@ -653,8 +656,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
653
656
  };
654
657
  }); // console.log("ciTagsAndTips", ciTagsAndTips);
655
658
 
656
- var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []);
657
- console.log("ciTagsAndTips", elementTagsAndTips); // 刷新标注、浮层
659
+ var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []); // 刷新标注、浮层
658
660
  // rlog.debug('AttributeMetricDisplay.buildTagsTips', {tagsAndTips: elementTagsAndTips, ciConfigs});
659
661
 
660
662
  return elementTagsAndTips;
@@ -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 "10.0.2" === 'string' ? "10.0.2" : null;
27
+ var version = typeof "10.0.3" === 'string' ? "10.0.3" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -570,8 +570,11 @@ var Topo = /*#__PURE__*/function () {
570
570
  return this.options.onSwitchToEditMode(this);
571
571
 
572
572
  case 13:
573
- // 更新节点名称显示隐藏
574
- this.attributeMetricDisplay.updateNodesNameVisible(); // 加载自定义上传的图标
573
+ if (this.getDataModel()) {
574
+ // 更新节点名称显示隐藏
575
+ this.attributeMetricDisplay.updateNodesNameVisible();
576
+ } // 加载自定义上传的图标
577
+
575
578
 
576
579
  iconManageDispatchers = this.store.getModelDispatchers('customIcon');
577
580
  iconManageDispatchers.loadEditorIcons();
@@ -315,7 +315,7 @@ function BackgroundView(props) {
315
315
  return /*#__PURE__*/_react["default"].createElement("div", {
316
316
  className: _indexModule["default"]['background-view']
317
317
  }, /*#__PURE__*/_react["default"].createElement("div", {
318
- className: _indexModule["default"].option
318
+ className: _indexModule["default"].header
319
319
  }, /*#__PURE__*/_react["default"].createElement(_button["default"], {
320
320
  title: "\u6062\u590D\u9ED8\u8BA4",
321
321
  onClick: resetDefault
@@ -328,6 +328,8 @@ function BackgroundView(props) {
328
328
  }, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
329
329
  type: "topo_button_icon_export"
330
330
  })))), /*#__PURE__*/_react["default"].createElement("div", {
331
+ className: _indexModule["default"].content
332
+ }, /*#__PURE__*/_react["default"].createElement("div", {
331
333
  className: _indexModule["default"].list
332
334
  }, /*#__PURE__*/_react["default"].createElement(List, {
333
335
  selected: (current === null || current === void 0 ? void 0 : current.id) || '',
@@ -357,7 +359,7 @@ function BackgroundView(props) {
357
359
  setUploadDialogVisible(false);
358
360
  getBackground();
359
361
  }
360
- }), /*#__PURE__*/_react["default"].createElement(_loading["default"], {
362
+ })), /*#__PURE__*/_react["default"].createElement(_loading["default"], {
361
363
  visible: loadingBackground,
362
364
  fullScreen: true
363
365
  }));
@@ -2,18 +2,27 @@
2
2
 
3
3
  .background-view {
4
4
  width: 260px;
5
- padding: 16px;
6
5
  background: #fff;
7
6
  height: 100%;
8
7
  overflow: auto;
9
- .option {
8
+ display: flex;
9
+ flex-direction: column;
10
+
11
+ .header {
12
+ padding: 16px 16px 12px 16px;
10
13
  text-align: right;
11
14
  button {
12
15
  margin-left: 8px;
13
16
  }
14
17
  }
18
+
19
+ .content {
20
+ flex: 1;
21
+ overflow: auto;
22
+ padding: 0 16px 16px 16px;
23
+ }
24
+
15
25
  .list {
16
- margin-top: 8px;
17
26
  .tag {
18
27
  width: 100%;
19
28
  height: 129px;
@@ -40,7 +40,7 @@ var panes = [{
40
40
  icon: '/img/topo/editor/sidebar/icon/背景.svg',
41
41
  content: _BackgroundPanel["default"]
42
42
  }, {
43
- title: '画布',
43
+ title: '主题',
44
44
  key: 'canvas',
45
45
  titleTootip: '拓扑图画布底图',
46
46
  icon: '/img/topo/editor/sidebar/icon/画布.svg',
@@ -54,7 +54,7 @@ function FontSizeWidget(props) {
54
54
  (0, _react.useEffect)(function () {}, [selection]);
55
55
  return /*#__PURE__*/_react["default"].createElement(_WidgetBox["default"], {
56
56
  label: "\u5B57\u53F7",
57
- tooltip: "\u9009\u53D6\u6587\u5B57\u7684\u65B0\u5B57\u4F53",
57
+ tooltip: "\u66F4\u6539\u6587\u5B57\u5927\u5C0F",
58
58
  showLabel: showLabel,
59
59
  disabled: disabled
60
60
  }, /*#__PURE__*/_react["default"].createElement(FontSizeSelect, {
@@ -92,7 +92,7 @@ function NodeSizeButton(props) {
92
92
  return /*#__PURE__*/_react["default"].createElement(_WidgetBox["default"], {
93
93
  label: "\u56FE\u7247\u5C3A\u5BF8",
94
94
  disabled: disabled,
95
- tooltip: "\u56FE\u7247\u5C3A\u5BF8",
95
+ tooltip: "\u5C3A\u5BF8\u8BBE\u7F6E",
96
96
  showLabel: showLabel
97
97
  }, /*#__PURE__*/_react["default"].createElement("div", {
98
98
  className: _NodeSizeButtonModule["default"].toolbarNodeSizeSetting
@@ -628,12 +628,11 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
628
628
  ;
629
629
 
630
630
  _proto.buildTagsTips = function buildTagsTips() {
631
- var _this6 = this;
632
-
633
631
  var data = this.getData(); // 获取标注、悬浮框配置
634
632
 
635
633
  var ciConfigs = this.getResourceTagTipConfig(); // console.log("buildTagsTips---ciConfigs", ciConfigs);
636
634
 
635
+ var formatter = new _attributeFormatter["default"](this.topo);
637
636
  var ciTagsAndTips = ciConfigs.map(function (ciConfig) {
638
637
  var ciDataItem = (0, _topoData.findItem)(data, "id", ciConfig.id); // console.log("buildTagsTips-ciDataItem", ciDataItem);
639
638
 
@@ -646,12 +645,16 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
646
645
  } // 获取ci数据
647
646
 
648
647
 
649
- var ciData = (0, _extends2["default"])({}, (0, _topoData.findItem)(data, "id", ciConfig.id), {
648
+ var ciData = (0, _extends2["default"])({}, ciDataItem, {
650
649
  ciType: ciConfig.ciType
651
- });
652
- var formatter = new _attributeFormatter["default"](_this6.topo); // console.log("AttributeFormatter-----", ciData, ciConfig);
650
+ }); // console.log("AttributeFormatter-----", ciData, ciConfig);
653
651
 
654
- var tags = formatter.formatAttrs(ciConfig.tags, ciData); // 链路标注箭头
652
+ var tags = formatter.formatAttrs(ciConfig.tags, ciData) // 展示的所有标注不带对应的名字(包括属性和指标)
653
+ .map(function (item) {
654
+ return (0, _extends2["default"])({}, item, {
655
+ name: ''
656
+ });
657
+ }); // 链路标注箭头
655
658
 
656
659
  if (ciConfig.type === "edge") {
657
660
  tags = {
@@ -668,8 +671,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
668
671
  };
669
672
  }); // console.log("ciTagsAndTips", ciTagsAndTips);
670
673
 
671
- var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []);
672
- console.log("ciTagsAndTips", elementTagsAndTips); // 刷新标注、浮层
674
+ var elementTagsAndTips = [].concat(ciTagsAndTips, this.extElementTagTipBuilder ? this.extElementTagTipBuilder.getExtElementTagsAndTips() : []); // 刷新标注、浮层
673
675
  // rlog.debug('AttributeMetricDisplay.buildTagsTips', {tagsAndTips: elementTagsAndTips, ciConfigs});
674
676
 
675
677
  return elementTagsAndTips;
@@ -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 "10.0.2" === 'string' ? "10.0.2" : null;
59
+ var version = typeof "10.0.3" === 'string' ? "10.0.3" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑
@@ -602,8 +602,11 @@ var Topo = /*#__PURE__*/function () {
602
602
  return this.options.onSwitchToEditMode(this);
603
603
 
604
604
  case 13:
605
- // 更新节点名称显示隐藏
606
- this.attributeMetricDisplay.updateNodesNameVisible(); // 加载自定义上传的图标
605
+ if (this.getDataModel()) {
606
+ // 更新节点名称显示隐藏
607
+ this.attributeMetricDisplay.updateNodesNameVisible();
608
+ } // 加载自定义上传的图标
609
+
607
610
 
608
611
  iconManageDispatchers = this.store.getModelDispatchers('customIcon');
609
612
  iconManageDispatchers.loadEditorIcons();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "10.0.2",
3
+ "version": "10.0.3",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@10.0.2/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@10.0.3/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }