@riil-frontend/component-topology 3.5.0-a.9 → 3.5.2

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 (106) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.css +1 -1
  3. package/build/index.js +12 -12
  4. package/es/components/index.module.scss +3 -114
  5. package/es/core/components/AlarmListPanel/index.js +7 -12
  6. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +8 -5
  7. package/es/core/components/DisplaySettingDrawer/NodeTag.js +10 -5
  8. package/es/core/components/DisplaySettingDrawer/NodeTip.js +10 -5
  9. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +3 -21
  10. package/es/core/components/TopoView/topoView.js +1 -0
  11. package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -140
  12. package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +1 -1
  13. package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +1 -1
  14. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +18 -17
  15. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +62 -18
  16. package/es/core/models/Alarm.js +206 -120
  17. package/es/core/models/DataModel.js +15 -1
  18. package/es/core/models/TopoApp.js +4 -6
  19. package/es/core/models/cache/CiTyeCache.js +4 -0
  20. package/es/core/models/utils/linkUtils.js +87 -42
  21. package/es/core/services/index.js +28 -0
  22. package/es/core/utils/saveSerialize.js +34 -0
  23. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +0 -37
  24. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +31 -28
  25. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +44 -43
  26. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +39 -26
  27. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useCiData.js +0 -0
  28. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +143 -0
  29. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +37 -0
  30. package/es/core/viewer/components/titlebar/BasicTools.js +11 -1
  31. package/es/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +21 -13
  32. package/es/hooks/useGraphAlarmDisplay.js +3 -4
  33. package/es/hooks/useManageStatus.js +1 -1
  34. package/es/hooks/useTopoEdit.js +200 -144
  35. package/es/hooks/useTopoEventListener.js +13 -6
  36. package/es/index.js +3 -2
  37. package/es/models/topoConfig.js +0 -1
  38. package/es/models/topoMod.js +15 -10
  39. package/es/topoCenter/components/Topo404.js +3 -1
  40. package/es/topoCenter/components/TopoNoPermission.js +3 -1
  41. package/es/topoCenter/components/TopoView.js +77 -32
  42. package/es/topoCenter/components/Topology.js +2 -0
  43. package/es/topoCenter/components/editor/propertyViews/edge/EdgePropertyView.js +10 -0
  44. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +5 -20
  45. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +12 -6
  46. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +84 -43
  47. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +60 -34
  48. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +9 -0
  49. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/server.js +62 -19
  50. package/es/topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +157 -0
  51. package/es/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +1 -2
  52. package/es/topoCenter/hooks/editor/useDeleteEdges.js +2 -3
  53. package/es/topoCenter/utils/resourcePermissionUtil.js +18 -12
  54. package/es/utils/topoData.js +15 -13
  55. package/lib/components/index.module.scss +3 -114
  56. package/lib/core/components/AlarmListPanel/index.js +7 -12
  57. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +9 -5
  58. package/lib/core/components/DisplaySettingDrawer/NodeTag.js +11 -5
  59. package/lib/core/components/DisplaySettingDrawer/NodeTip.js +12 -5
  60. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +3 -21
  61. package/lib/core/components/TopoView/topoView.js +1 -0
  62. package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -151
  63. package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +2 -2
  64. package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +1 -1
  65. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -16
  66. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +66 -20
  67. package/lib/core/models/Alarm.js +206 -121
  68. package/lib/core/models/DataModel.js +15 -1
  69. package/lib/core/models/TopoApp.js +4 -6
  70. package/lib/core/models/cache/CiTyeCache.js +4 -0
  71. package/lib/core/models/utils/linkUtils.js +92 -43
  72. package/lib/core/services/index.js +29 -0
  73. package/lib/core/utils/saveSerialize.js +43 -0
  74. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +0 -37
  75. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +29 -26
  76. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +45 -43
  77. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +38 -24
  78. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useCiData.js +1 -0
  79. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +155 -0
  80. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +47 -0
  81. package/lib/core/viewer/components/titlebar/BasicTools.js +11 -1
  82. package/lib/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +22 -15
  83. package/lib/hooks/useGraphAlarmDisplay.js +3 -5
  84. package/lib/hooks/useManageStatus.js +1 -1
  85. package/lib/hooks/useTopoEdit.js +197 -141
  86. package/lib/hooks/useTopoEventListener.js +13 -6
  87. package/lib/index.js +5 -0
  88. package/lib/models/topoConfig.js +0 -1
  89. package/lib/models/topoMod.js +15 -10
  90. package/lib/topoCenter/components/Topo404.js +4 -1
  91. package/lib/topoCenter/components/TopoNoPermission.js +4 -1
  92. package/lib/topoCenter/components/TopoView.js +78 -33
  93. package/lib/topoCenter/components/Topology.js +3 -0
  94. package/lib/topoCenter/components/editor/propertyViews/edge/EdgePropertyView.js +22 -0
  95. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +5 -21
  96. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +13 -8
  97. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +87 -42
  98. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +61 -37
  99. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +9 -0
  100. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/server.js +62 -18
  101. package/lib/topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +183 -0
  102. package/lib/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +1 -2
  103. package/lib/topoCenter/hooks/editor/useDeleteEdges.js +2 -3
  104. package/lib/topoCenter/utils/resourcePermissionUtil.js +20 -12
  105. package/lib/utils/topoData.js +15 -13
  106. package/package.json +5 -5
@@ -1,15 +1,59 @@
1
1
  import _Box from "@alifd/next/es/box";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _Dialog from "@alifd/next/es/dialog";
4
3
  import _Button from "@alifd/next/es/button";
4
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  import React from "react";
7
7
  import classnames from "classnames";
8
8
  import TitleWidget from "../../../components/titlebar/widgets/TitleWidget";
9
9
  import styles from "../../../components/titlebar/TitleBar.module.scss";
10
+ import { useState } from "react";
11
+ import { useEffect } from "react";
10
12
  export default function TopoEditorTitleBar(props) {
11
13
  var topo = props.topo,
12
14
  topoEditApi = props.topoEditApi;
15
+ var store = topo.store;
16
+
17
+ var _store$useModel = store.useModel("topoEdit"),
18
+ topoEditState = _store$useModel[0],
19
+ topoEditDispatchers = _store$useModel[1];
20
+
21
+ var saving = topoEditState.saving;
22
+
23
+ var _useState = useState(false),
24
+ exitFlag = _useState[0],
25
+ setExitFlag = _useState[1];
26
+
27
+ var saveAndExit = /*#__PURE__*/function () {
28
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
29
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
30
+ while (1) {
31
+ switch (_context.prev = _context.next) {
32
+ case 0:
33
+ _context.next = 2;
34
+ return topo.save();
35
+
36
+ case 2:
37
+ setExitFlag(true);
38
+
39
+ case 3:
40
+ case "end":
41
+ return _context.stop();
42
+ }
43
+ }
44
+ }, _callee);
45
+ }));
46
+
47
+ return function saveAndExit() {
48
+ return _ref.apply(this, arguments);
49
+ };
50
+ }();
51
+
52
+ useEffect(function () {
53
+ if (!saving && exitFlag) {
54
+ topo.exitEditMode();
55
+ }
56
+ }, [exitFlag, saving]);
13
57
  return /*#__PURE__*/React.createElement("div", {
14
58
  className: classnames(styles.titlebar, styles.titlebarEditMode)
15
59
  }, /*#__PURE__*/React.createElement("div", {
@@ -30,6 +74,7 @@ export default function TopoEditorTitleBar(props) {
30
74
  }, "\u6DFB\u52A0\u8D44\u6E90"), /*#__PURE__*/React.createElement(_Button, {
31
75
  className: styles.button,
32
76
  onClick: function onClick() {
77
+ setExitFlag(false);
33
78
  topo.save();
34
79
  }
35
80
  }, "\u4FDD\u5B58"), /*#__PURE__*/React.createElement(_Button, {
@@ -39,19 +84,19 @@ export default function TopoEditorTitleBar(props) {
39
84
  title: "提示",
40
85
  content: "若直接退出,图上修改的内容将不会保存!",
41
86
  onOk: function () {
42
- var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
43
- return _regeneratorRuntime.wrap(function _callee$(_context) {
87
+ var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
88
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
44
89
  while (1) {
45
- switch (_context.prev = _context.next) {
90
+ switch (_context2.prev = _context2.next) {
46
91
  case 0:
47
- topo.exitEditMode();
92
+ saveAndExit();
48
93
 
49
94
  case 1:
50
95
  case "end":
51
- return _context.stop();
96
+ return _context2.stop();
52
97
  }
53
98
  }
54
- }, _callee);
99
+ }, _callee2);
55
100
  }));
56
101
 
57
102
  function onOk() {
@@ -61,23 +106,19 @@ export default function TopoEditorTitleBar(props) {
61
106
  return onOk;
62
107
  }(),
63
108
  onCancel: function () {
64
- var _onCancel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
65
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
109
+ var _onCancel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
110
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
66
111
  while (1) {
67
- switch (_context2.prev = _context2.next) {
112
+ switch (_context3.prev = _context3.next) {
68
113
  case 0:
69
- _context2.next = 2;
70
- return topo.save();
71
-
72
- case 2:
73
114
  topo.exitEditMode();
74
115
 
75
- case 3:
116
+ case 1:
76
117
  case "end":
77
- return _context2.stop();
118
+ return _context3.stop();
78
119
  }
79
120
  }
80
- }, _callee2);
121
+ }, _callee3);
81
122
  }));
82
123
 
83
124
  function onCancel() {
@@ -87,7 +128,10 @@ export default function TopoEditorTitleBar(props) {
87
128
  return onCancel;
88
129
  }(),
89
130
  cancelProps: {
90
- children: '保存'
131
+ children: "退出"
132
+ },
133
+ okProps: {
134
+ children: "保存并退出"
91
135
  }
92
136
  });
93
137
  }