@riil-frontend/component-topology 2.15.44 → 2.15.45

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 (125) hide show
  1. package/build/index.css +1 -1
  2. package/build/index.js +2 -2
  3. package/es/components/Drawer/index.js +8 -2
  4. package/es/components/TemplateButton/index.module.scss +1 -0
  5. package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
  6. package/es/core/common/icons/icon.js +1 -1
  7. package/es/core/common/icons/useIcons.js +1 -1
  8. package/es/core/components/TopoView/topoView.js +8 -18
  9. package/es/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
  10. package/es/core/editor/components/BackgroundView/index.module.scss +1 -0
  11. package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
  12. package/es/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
  13. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +16 -2
  14. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
  15. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
  16. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
  17. package/es/core/editor/components/CustomIconPlugin/index.js +2 -0
  18. package/es/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
  19. package/es/core/editor/components/EditorPlugin.js +2 -2
  20. package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
  21. package/es/core/models/TopoApp.js +9 -5
  22. package/es/core/store/coreModels.js +32 -26
  23. package/es/core/store/createStore.js +1 -1
  24. package/es/core/test/Test.js +3 -1
  25. package/es/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
  26. package/es/createTopo.js +1 -1
  27. package/es/hooks/useAlarm.js +3 -6
  28. package/es/hooks/useResourceConfig.js +1 -1
  29. package/es/hooks/useTopoEdit.js +4 -8
  30. package/es/models/{iconManage.js → customIcon.js} +1 -1
  31. package/es/models/topoBizMod.js +22 -52
  32. package/es/models/{topoCreateMod.js → topoConfig.js} +8 -4
  33. package/es/models/topoMod.js +32 -69
  34. package/es/{components → topoCenter/components}/Link/form.js +0 -0
  35. package/es/{components → topoCenter/components}/Link/hook.js +0 -0
  36. package/es/{components → topoCenter/components}/Link/index copy.js +1 -1
  37. package/es/{components → topoCenter/components}/Link/index.js +1 -1
  38. package/es/{components → topoCenter/components}/Link/index.module.scss +0 -0
  39. package/es/{components → topoCenter/components}/Link/setting.js +0 -0
  40. package/es/topoCenter/components/TopoView.js +16 -3
  41. package/es/topoCenter/components/Topology.js +0 -5
  42. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
  43. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
  44. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
  45. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
  46. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
  47. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
  48. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
  49. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
  50. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
  51. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
  52. package/es/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -1
  53. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +3 -3
  54. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
  55. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
  56. package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +1 -1
  57. package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
  58. package/es/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
  59. package/es/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
  60. package/es/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
  61. package/es/{models → topoCenter/store}/linkManager.js +0 -0
  62. package/lib/components/Drawer/index.js +7 -2
  63. package/lib/components/TemplateButton/index.module.scss +1 -0
  64. package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
  65. package/lib/core/common/icons/icon.js +1 -1
  66. package/lib/core/common/icons/useIcons.js +1 -1
  67. package/lib/core/components/TopoView/topoView.js +9 -20
  68. package/lib/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
  69. package/lib/core/editor/components/BackgroundView/index.module.scss +1 -0
  70. package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
  71. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
  72. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +17 -2
  73. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
  74. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
  75. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
  76. package/lib/core/editor/components/CustomIconPlugin/index.js +11 -0
  77. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
  78. package/lib/core/editor/components/EditorPlugin.js +2 -2
  79. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
  80. package/lib/core/models/TopoApp.js +9 -5
  81. package/lib/core/store/coreModels.js +35 -26
  82. package/lib/core/store/createStore.js +2 -2
  83. package/lib/core/test/Test.js +3 -1
  84. package/lib/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
  85. package/lib/createTopo.js +1 -1
  86. package/lib/hooks/useAlarm.js +3 -6
  87. package/lib/hooks/useResourceConfig.js +1 -1
  88. package/lib/hooks/useTopoEdit.js +4 -8
  89. package/lib/models/{iconManage.js → customIcon.js} +1 -1
  90. package/lib/models/topoBizMod.js +22 -52
  91. package/lib/models/{topoCreateMod.js → topoConfig.js} +7 -4
  92. package/lib/models/topoMod.js +32 -69
  93. package/lib/{components → topoCenter/components}/Link/form.js +0 -0
  94. package/lib/{components → topoCenter/components}/Link/hook.js +0 -0
  95. package/lib/{components → topoCenter/components}/Link/index copy.js +1 -1
  96. package/lib/{components → topoCenter/components}/Link/index.js +1 -1
  97. package/lib/{components → topoCenter/components}/Link/index.module.scss +0 -0
  98. package/lib/{components → topoCenter/components}/Link/setting.js +0 -0
  99. package/lib/topoCenter/components/TopoView.js +19 -3
  100. package/lib/topoCenter/components/Topology.js +0 -7
  101. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
  102. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
  103. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
  104. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
  105. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
  106. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
  107. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
  108. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
  109. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
  110. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
  111. package/lib/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -2
  112. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -8
  113. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
  114. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
  115. package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +4 -4
  116. package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
  117. package/lib/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
  118. package/lib/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
  119. package/lib/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
  120. package/lib/{models → topoCenter/store}/linkManager.js +0 -0
  121. package/package.json +2 -2
  122. package/es/core/editor/LinkDynamicStyleConfig.js +0 -16
  123. package/es/core/store/getStoreModels.js +0 -40
  124. package/lib/core/editor/LinkDynamicStyleConfig.js +0 -21
  125. package/lib/core/store/getStoreModels.js +0 -67
@@ -1,6 +1,8 @@
1
1
  import _Drawer from "@alifd/next/es/drawer";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _Button from "@alifd/next/es/button";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
5
+ var _excluded = ["bodyClassName"];
4
6
  import React from 'react';
5
7
  import classnames from 'classnames';
6
8
  import styles from "./index.module.scss";
@@ -24,6 +26,10 @@ var Drawer = function Drawer(props) {
24
26
  onSave = props.onSave,
25
27
  drawerProps = props.drawerProps,
26
28
  children = props.children;
29
+
30
+ var bodyClassName = drawerProps.bodyClassName,
31
+ otherDrawerProps = _objectWithoutPropertiesLoose(drawerProps, _excluded);
32
+
27
33
  return /*#__PURE__*/React.createElement(_Drawer, _extends({
28
34
  title: title,
29
35
  placement: "right",
@@ -31,12 +37,12 @@ var Drawer = function Drawer(props) {
31
37
  headerStyle: headerStyle,
32
38
  bodyStyle: bodyStyle,
33
39
  closeMode: ['close', 'esc']
34
- }, drawerProps, {
40
+ }, otherDrawerProps, {
35
41
  className: classnames(styles.drawer, drawerProps.className),
36
42
  visible: visible,
37
43
  onClose: onClose
38
44
  }), /*#__PURE__*/React.createElement("div", {
39
- className: classnames(styles.content, drawerProps.bodyClassName)
45
+ className: classnames(styles.content, bodyClassName)
40
46
  }, children), footer && /*#__PURE__*/React.createElement("div", {
41
47
  className: styles.footer
42
48
  }, /*#__PURE__*/React.createElement(_Button, {
@@ -14,6 +14,7 @@
14
14
  display: flex;
15
15
  justify-content: center;
16
16
  align-items: center;
17
+ user-select: none;
17
18
  }
18
19
 
19
20
  .icon {
@@ -1,10 +1,19 @@
1
1
  import { useEffect } from 'react';
2
2
  export default (function (topo, fn) {
3
+ var topoModState = topo.store.useModelState('topoMod');
4
+ var graphLoaded = topoModState.graphLoaded;
3
5
  useEffect(function () {
4
- var dataModel = topo.getDataModel();
5
- dataModel.addDataPropertyChangeListener(fn);
6
+ var dataModel;
7
+
8
+ if (graphLoaded) {
9
+ dataModel = topo.getDataModel();
10
+ dataModel.addDataPropertyChangeListener(fn);
11
+ }
12
+
6
13
  return function () {
7
- dataModel.removeDataPropertyChangeListener(fn);
14
+ if (dataModel) {
15
+ dataModel.removeDataPropertyChangeListener(fn);
16
+ }
8
17
  };
9
- }, [fn]);
18
+ }, [topo, graphLoaded, fn]);
10
19
  });
@@ -67,7 +67,7 @@ export function transformCustomIcons2HtIcons(icons) {
67
67
  */
68
68
 
69
69
  export function getUserCustomIcons(topo) {
70
- var uploadIcons = topo.store.getModelState('iconManage').icons;
70
+ var uploadIcons = topo.store.getModelState('customIcon').icons;
71
71
  return [].concat(transformCustomIcons2HtIcons(uploadIcons.node));
72
72
  } // 获得节点图标列表
73
73
 
@@ -1,7 +1,7 @@
1
1
  import { getGroupDefaultIcons, getNodeDefaultIcons, transformCustomIcon2HtIcon } from "./icon";
2
2
 
3
3
  function useCustomIcons(topo) {
4
- var _topo$store$useModelS = topo.store.useModelState('iconManage'),
4
+ var _topo$store$useModelS = topo.store.useModelState('customIcon'),
5
5
  icons = _topo$store$useModelS.icons;
6
6
 
7
7
  var customIcons = icons.node.map(transformCustomIcon2HtIcon);
@@ -7,7 +7,6 @@ import rlog from "@riil-frontend/component-topology-utils/es/rlog";
7
7
  import { useEventListener, useCbbEventListener } from "@riil-frontend/component-riil-event-emitter";
8
8
  import useTopoEdit from "../../../hooks/useTopoEdit";
9
9
  import useSelection from "../../../hooks/useSelection";
10
- import useRelateTopo from "../../../hooks/useRelateTopo";
11
10
  import showMessage from "../../utils/showMessage";
12
11
  import EditorPlugin from "../../editor/components/EditorPlugin";
13
12
  import ViewerPlugin from "../../viewer/components/plugins/ViewerPlugin";
@@ -15,10 +14,10 @@ import TitleBar from "../titlebar/TitleBar";
15
14
  import { TPL_TREE } from "../../../utils/template";
16
15
  import PropertyView from "../../editor/components/settings/PropertyView";
17
16
  import BackgroundView from "../../editor/components/BackgroundView";
18
- import styles from "./TopoView.module.scss";
19
17
  import { updateEdgeExpanded } from "../../utils/edgeUtil";
18
+ import styles from "./TopoView.module.scss";
20
19
 
21
- var TopoView = function TopoView(props) {
20
+ var Topology = function Topology(props) {
22
21
  var _classnames, _graphViewProps$creat;
23
22
 
24
23
  var topo = props.topo,
@@ -34,6 +33,7 @@ var TopoView = function TopoView(props) {
34
33
  nodeDeleteable = props.nodeDeleteable,
35
34
  onNodeDelete = props.onNodeDelete,
36
35
  onLineDelete = props.onLineDelete,
36
+ onEvent = props.onEvent,
37
37
  _props$graphViewProps = props.graphViewProps,
38
38
  graphViewProps = _props$graphViewProps === void 0 ? {} : _props$graphViewProps,
39
39
  viewerProps = props.viewerProps,
@@ -80,10 +80,7 @@ var TopoView = function TopoView(props) {
80
80
  var onExitEdit = topoEdit.onExitEdit,
81
81
  onBindData = topoEdit.onBindData,
82
82
  onDeleteElement = topoEdit.onDeleteElement,
83
- onSaveTopo = topoEdit.onSaveTopo;
84
- var relateTopo = useRelateTopo({
85
- topo: topo
86
- }); // useAlarm({
83
+ onSaveTopo = topoEdit.onSaveTopo; // useAlarm({
87
84
  // topo,
88
85
  // });
89
86
 
@@ -112,13 +109,6 @@ var TopoView = function TopoView(props) {
112
109
  useEffect(function () {
113
110
  // rlog.debug("TopoView.useEffect topoData", topoData);
114
111
  setTData(buildLoadOptions ? buildLoadOptions(topoData) : topoData);
115
-
116
- if (topoData) {
117
- // TODO 移到模型中
118
- topoDispatchers.update({
119
- currentTopo: topoData.config
120
- });
121
- }
122
112
  }, [topoData]);
123
113
  useEffect(function () {
124
114
  return function () {
@@ -172,7 +162,7 @@ var TopoView = function TopoView(props) {
172
162
 
173
163
  var handleEvent = function handleEvent(event) {
174
164
  rlog.debug("TopoView:onEvent", event);
175
- relateTopo.onEvent(event);
165
+ onEvent(event);
176
166
  topoEdit.onEvent(event);
177
167
 
178
168
  switch (event.name) {
@@ -274,7 +264,7 @@ var TopoView = function TopoView(props) {
274
264
  }));
275
265
  };
276
266
 
277
- TopoView.propTypes = {
267
+ Topology.propTypes = {
278
268
  // 拓扑模型
279
269
  topo: PropTypes.any.isRequired,
280
270
  defaultEnterEditMode: PropTypes.bool,
@@ -294,10 +284,10 @@ TopoView.propTypes = {
294
284
  */
295
285
  titleBar: PropTypes.oneOf([React.ReactNode, false])
296
286
  };
297
- TopoView.defaultProps = {
287
+ Topology.defaultProps = {
298
288
  defaultEnterEditMode: false,
299
289
  viewerProps: {},
300
290
  editorProps: {} // titleBar: false,
301
291
 
302
292
  };
303
- export default TopoView;
293
+ export default Topology;
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import TopoApp from "./TopoApp";
2
+ import TopoApp from "./models/TopoApp";
3
3
  /**
4
4
  *
5
5
  * @param options
@@ -25,6 +25,7 @@
25
25
  .box {
26
26
  position: relative;
27
27
  height: 100%;
28
+ user-select: none;
28
29
  .img {
29
30
  max-width: 100%;
30
31
  max-height: 100%;
@@ -1,10 +1,10 @@
1
- import React, { useState, useEffect, useRef, useCallback } from 'react';
1
+ import React, { useEffect } from 'react';
2
2
  import UploadIconDialogWrapper from "./UploadIconDialogWrapper";
3
3
  import RenameDialog from "./RenameDialog";
4
- export default function IconManage(props) {
4
+ export default function CustomIconPlugin(props) {
5
5
  var topo = props.topo;
6
6
  var store = topo.store;
7
- var dispatchers = store.getModelDispatchers('iconManage'); // 初始化时注册事件
7
+ var dispatchers = store.getModelDispatchers('customIcon'); // 初始化时注册事件
8
8
 
9
9
  useEffect(function () {
10
10
  var notifier = topo.view.topoClient.notifier; // 测试代码
@@ -11,7 +11,7 @@ export default function RenameDialog(props) {
11
11
  var topo = props.topo;
12
12
  var store = topo.store;
13
13
 
14
- var _store$useModel = store.useModel('iconManage'),
14
+ var _store$useModel = store.useModel('customIcon'),
15
15
  state = _store$useModel[0],
16
16
  dispatchers = _store$useModel[1];
17
17
 
@@ -13,6 +13,7 @@ import _ from 'lodash';
13
13
  import _svgToShape from "./utils/svgToShape";
14
14
  import styles from "./UploadIconDialog.module.scss";
15
15
  import "./UploadIconDialog.scss";
16
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
16
17
  var config = _ConfigProvider.config;
17
18
 
18
19
  function getFileName(file) {
@@ -98,7 +99,18 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
98
99
 
99
100
  _this.setState({
100
101
  files: validFiles
101
- });
102
+ }); // 上传接口报错后只会通知该回调,移除上传loading
103
+
104
+
105
+ if (_this.state.uploading && files.filter(function (file) {
106
+ return file.state === 'error';
107
+ }).length && !files.filter(function (file) {
108
+ return file.state === 'uploading';
109
+ }).length) {
110
+ _this.setState({
111
+ uploading: false
112
+ });
113
+ }
102
114
  };
103
115
 
104
116
  _this.submit = function () {
@@ -198,7 +210,9 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
198
210
  });
199
211
  };
200
212
 
201
- _this.handleUploadError = function () {};
213
+ _this.handleUploadError = function () {
214
+ rlog.error('上传失败');
215
+ };
202
216
 
203
217
  _this.onClose = function () {
204
218
  var dispatchers = _this.props.dispatchers;
@@ -4,7 +4,7 @@ export default function UploadIconDialogWrapper(props) {
4
4
  var topo = props.topo;
5
5
  var store = topo.store;
6
6
 
7
- var _store$useModel = store.useModel('iconManage'),
7
+ var _store$useModel = store.useModel('customIcon'),
8
8
  state = _store$useModel[0],
9
9
  dispatchers = _store$useModel[1];
10
10
 
@@ -0,0 +1,2 @@
1
+ import IconManage from "./CustomIconPlugin";
2
+ export default IconManage;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from "react";
3
- import IconManage from "./iconManage/IconManage";
3
+ import CustomIconPlugin from "./CustomIconPlugin";
4
4
  import SaveLoading from "./plugins/SaveLoading";
5
5
  import MultipleResourceSelectPlugin from "./plugins/MultipleResourceSelectPlugin";
6
6
  import GroupAddResourceDrawerPlugin from "./GroupAddResourceDrawerPlugin";
@@ -10,7 +10,7 @@ export default function TopoEditorPlugin(props) {
10
10
  topoEdit = props.topoEdit,
11
11
  editorProps = props.editorProps;
12
12
  var store = topo.store;
13
- var plugins = [SaveLoading, GroupAddResourceDrawerPlugin, MultipleResourceSelectPlugin, IconManage].concat((editorProps === null || editorProps === void 0 ? void 0 : editorProps.plugins) || []);
13
+ var plugins = [SaveLoading, GroupAddResourceDrawerPlugin, MultipleResourceSelectPlugin, CustomIconPlugin].concat((editorProps === null || editorProps === void 0 ? void 0 : editorProps.plugins) || []);
14
14
  return /*#__PURE__*/React.createElement(React.Fragment, null, plugins.map(function (Plugin, index) {
15
15
  return /*#__PURE__*/React.createElement(Plugin, _extends({
16
16
  key: index,
@@ -19,6 +19,7 @@ export default function GroupSetting(props) {
19
19
  editorProps = props.editorProps,
20
20
  group = props.group;
21
21
  var expanded = values.expanded;
22
+ var id = values.id;
22
23
 
23
24
  var field = _Field.useField({
24
25
  autoUnmount: false,
@@ -93,6 +94,7 @@ export default function GroupSetting(props) {
93
94
  maxLength: 30,
94
95
  placeholder: "\u8BF7\u8F93\u5165"
95
96
  })), expanded ? /*#__PURE__*/React.createElement(GroupExpandSetting, {
97
+ id: id,
96
98
  group: group,
97
99
  expanded: expanded,
98
100
  topo: topo,
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
20
20
  import PluginManager from "./PluginManager";
21
21
  import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
22
22
 
23
- var version = typeof "2.15.44" === 'string' ? "2.15.44" : null;
23
+ var version = typeof "2.15.45" === 'string' ? "2.15.45" : null;
24
24
  console.info("\u62D3\u6251\u7248\u672C: " + version);
25
25
  /**
26
26
  * 拓扑显示和编辑
@@ -75,6 +75,10 @@ var Topo = /*#__PURE__*/function () {
75
75
 
76
76
  this.test = new Test(this);
77
77
  this.uid = topoFactory.add(options.name, this);
78
+ };
79
+
80
+ _proto.destroy = function destroy() {
81
+ topoFactory.remove(this.uid);
78
82
  }
79
83
  /**
80
84
  * TODO 移除
@@ -95,7 +99,7 @@ var Topo = /*#__PURE__*/function () {
95
99
  return topoDispatchers.exit();
96
100
 
97
101
  case 3:
98
- topoFactory.remove(this.uid);
102
+ this.destroy();
99
103
 
100
104
  case 4:
101
105
  case "end":
@@ -543,7 +547,7 @@ var Topo = /*#__PURE__*/function () {
543
547
 
544
548
  case 7:
545
549
  updateEdgeExpanded(this);
546
- editDispatchers = this.store.getModelDispatchers('topoCreateMod');
550
+ editDispatchers = this.store.getModelDispatchers('topoConfig');
547
551
  editDispatchers.switchToEditMode();
548
552
 
549
553
  if (this.options.onSwitchToEditMode) {
@@ -551,7 +555,7 @@ var Topo = /*#__PURE__*/function () {
551
555
  } // 加载自定义上传的图标
552
556
 
553
557
 
554
- iconManageDispatchers = this.store.getModelDispatchers('iconManage');
558
+ iconManageDispatchers = this.store.getModelDispatchers('customIcon');
555
559
  iconManageDispatchers.loadEditorIcons();
556
560
 
557
561
  case 13:
@@ -580,7 +584,7 @@ var Topo = /*#__PURE__*/function () {
580
584
  return this.view.switchToViewMode();
581
585
 
582
586
  case 2:
583
- editDispatchers = this.store.getModelDispatchers('topoCreateMod');
587
+ editDispatchers = this.store.getModelDispatchers('topoConfig');
584
588
  editDispatchers.switchToViewMode(this.id);
585
589
 
586
590
  if (this.options.onSwitchToViewMode) {
@@ -1,32 +1,38 @@
1
- import topoMod from "./models/topoMod";
2
- import iconManage from "./models/iconManage";
3
- import ciModel from "./models/ciModel";
4
- import functionAuth from "./models/functionAuth";
5
- import linkDynamicStyle from "./models/linkDynamicStyle";
6
- import linkDynamicStyleConfig from "./models/linkDynamicStyleConfig";
7
- import permissionSetting from "./models/permissionSetting";
8
- import resourceWebControllUrlSetting from "./models/resourceWebControllUrlSetting";
9
- import topoBizMod from "./models/topoBizMod";
10
- import topoCenter from "./models/topoCenter";
11
- import topoCreate from "./models/topoCreate";
12
- import topoCreateMod from "./models/topoCreateMod";
13
- import topoEdit from "./models/topoEdit";
14
- import topoTreeMod from "./models/topoTreeMod";
15
- import topoView from "./models/topoView";
1
+ import topoMod from "../../models/topoMod";
2
+ import customIcon from "../../models/customIcon";
3
+ import ciModel from "../../models/ciModel";
4
+ import selection from "../../models/selection";
5
+ import topoBizMod from "../../models/topoBizMod";
6
+ import topoConfig from "../../models/topoConfig";
7
+ import topoEdit from "../../models/topoEdit";
8
+ import topoView from "../../models/topoView";
9
+ import topoAlarm from "../../models/topoAlarm";
10
+ import topoGraphView from "../../models/topoGraphView";
11
+ import background from "../../models/background";
12
+ import displayConfig from "../../models/displayConfig";
13
+ import resourceWebControllUrlSetting from "../../models/resourceWebControllUrlSetting";
14
+ import topoBaseInfoOverview from "../../models/topoBaseInfoOverview";
15
+ import topoCenter from "../../topoCenter/store/topoCenter";
16
+ import functionAuth from "../../topoCenter/store/functionAuth";
17
+ import topoLinkMod from "../../topoCenter/store/topoLinkMod";
18
+ import topoTreeMod from "../../topoCenter/store/topoTreeMod";
16
19
  export default {
17
20
  topoMod: topoMod,
18
- iconManage: iconManage,
19
- ciModel: ciModel,
20
- functionAuth: functionAuth,
21
- linkDynamicStyle: linkDynamicStyle,
22
- linkDynamicStyleConfig: linkDynamicStyleConfig,
23
- permissionSetting: permissionSetting,
21
+ customIcon: customIcon,
22
+ selection: selection,
24
23
  resourceWebControllUrlSetting: resourceWebControllUrlSetting,
25
24
  topoBizMod: topoBizMod,
26
- topoCenter: topoCenter,
27
- topoCreate: topoCreate,
28
- topoCreateMod: topoCreateMod,
25
+ topoConfig: topoConfig,
26
+ topoLinkMod: topoLinkMod,
27
+ topoView: topoView,
28
+ background: background,
29
+ topoGraphView: topoGraphView,
30
+ topoAlarm: topoAlarm,
31
+ displayConfig: displayConfig,
32
+ topoBaseInfoOverview: topoBaseInfoOverview,
33
+ ciModel: ciModel,
34
+ functionAuth: functionAuth,
29
35
  topoEdit: topoEdit,
30
- topoTreeMod: topoTreeMod,
31
- topoView: topoView
36
+ topoCenter: topoCenter,
37
+ topoTreeMod: topoTreeMod
32
38
  };
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import { createStore } from '@ice/store';
3
- import coreModels from "./getStoreModels";
3
+ import coreModels from "./coreModels";
4
4
  export default function (engine, extModels) {
5
5
  if (extModels === void 0) {
6
6
  extModels = {};
@@ -8,9 +8,11 @@ var Test = /*#__PURE__*/function () {
8
8
  var _proto = Test.prototype;
9
9
 
10
10
  _proto.init = function init() {
11
+ var _this = this;
12
+
11
13
  this.iconManage = {
12
14
  openUpload: function openUpload(type) {
13
- topo.store.getModelDispatchers('iconManage').open({
15
+ _this.topo.store.getModelDispatchers('customIcon').open({
14
16
  type: type || 'node'
15
17
  });
16
18
  }
@@ -6,70 +6,71 @@ export default function buildNodeContextmenu(topoApp) {
6
6
  return {
7
7
  enable: true,
8
8
  items: [// {
9
- // label: '概览',
10
- // id: 'Resource.detail',
11
- // icon: '/img/topo/contextmenu/Topology_resources_menu_icon_overview.svg',
12
- // visible: (data) => {
13
- // return isResource(data) && !!data.operation;
14
- // }
15
- // },
16
- {
17
- label: 'Web控制台',
18
- icon: '/img/topo/contextmenu/Topology_resources_menu_icon_webconsole.svg',
19
- visible: function visible(data) {
20
- return isResource(data) && !!data.operation;
21
- },
22
- items: [{
23
- label: '访问',
24
- id: 'Resource.WebConsole.open',
25
- disable: function disable(data) {
26
- var resourceWebControllUrl = topoApp.pluginManager.pluginMap.resourceWebControllUrl;
27
- return !resourceWebControllUrl.getResourceUrl(data.id);
28
- }
29
- }, {
30
- label: '设置',
31
- id: 'Resource.WebConsole.setting'
32
- }]
33
- } // {
34
- // label: '资源操作',
35
- // id: 'Resource.Operate',
36
- // icon: '/img/topo/contextmenu/Topology_resources_menu_icon_operands.svg',
37
- // visible: (data) => {
38
- // if (!isResource(data)) {
39
- // return false;
40
- // }
41
- // const {ciType} = data;
42
- // const ciMeta = topoApp.ciTyeCache.getCiType(ciType);
43
- // if (!ciMeta) {
44
- // return false;
45
- // }
46
- // const {domain} = ciMeta;
47
- // // 是否有该页签,与资源详情保持一致
48
- // const hasTab = domain === 'network' || domain === 'server';
49
- // return !!data.operation && hasTab;
50
- // }
51
- // },
52
- // {
53
- // label: 'Syslog',
54
- // id: 'Resource.Syslog',
55
- // icon: '/img/topo/contextmenu/Topology_resources_menu_icon_syslog.svg',
56
- // visible: (data) => {
57
- // if (!isResource(data)) {
58
- // return false;
59
- // }
60
- // const {ciType} = data;
61
- // const ciMeta = topoApp.ciTyeCache.getCiType(ciType);
62
- // if (!ciMeta) {
63
- // return false;
64
- // }
65
- // const {domain} = ciMeta;
66
- // // 是否有该页签,与资源详情保持一致
67
- // const hasTab = domain === 'network' || domain === 'server';
68
- // return !!data.operation && hasTab;
69
- // }
70
- // },
71
- // { label: '打开属性设置', id: 'openSet' },
72
- // { label: '打开全局属性设置', id: 'openAllSet' },
9
+ // label: '概览',
10
+ // id: 'Resource.detail',
11
+ // icon: '/img/topo/contextmenu/Topology_resources_menu_icon_overview.svg',
12
+ // visible: (data) => {
13
+ // return isResource(data) && !!data.operation;
14
+ // }
15
+ // },
16
+ // {
17
+ // label: 'Web控制台',
18
+ // icon: '/img/topo/contextmenu/Topology_resources_menu_icon_webconsole.svg',
19
+ // visible: (data) => {
20
+ // return isResource(data) && !!data.operation;
21
+ // },
22
+ // items: [
23
+ // {
24
+ // label: '访问',
25
+ // id: 'Resource.WebConsole.open',
26
+ // disable: (data) => {
27
+ // const {resourceWebControllUrl} = topoApp.pluginManager.pluginMap;
28
+ // return !resourceWebControllUrl.getResourceUrl(data.id)
29
+ // },
30
+ // },
31
+ // { label: '设置', id: 'Resource.WebConsole.setting' },
32
+ // ]
33
+ // },
34
+ // {
35
+ // label: '资源操作',
36
+ // id: 'Resource.Operate',
37
+ // icon: '/img/topo/contextmenu/Topology_resources_menu_icon_operands.svg',
38
+ // visible: (data) => {
39
+ // if (!isResource(data)) {
40
+ // return false;
41
+ // }
42
+ // const {ciType} = data;
43
+ // const ciMeta = topoApp.ciTyeCache.getCiType(ciType);
44
+ // if (!ciMeta) {
45
+ // return false;
46
+ // }
47
+ // const {domain} = ciMeta;
48
+ // // 是否有该页签,与资源详情保持一致
49
+ // const hasTab = domain === 'network' || domain === 'server';
50
+ // return !!data.operation && hasTab;
51
+ // }
52
+ // },
53
+ // {
54
+ // label: 'Syslog',
55
+ // id: 'Resource.Syslog',
56
+ // icon: '/img/topo/contextmenu/Topology_resources_menu_icon_syslog.svg',
57
+ // visible: (data) => {
58
+ // if (!isResource(data)) {
59
+ // return false;
60
+ // }
61
+ // const {ciType} = data;
62
+ // const ciMeta = topoApp.ciTyeCache.getCiType(ciType);
63
+ // if (!ciMeta) {
64
+ // return false;
65
+ // }
66
+ // const {domain} = ciMeta;
67
+ // // 是否有该页签,与资源详情保持一致
68
+ // const hasTab = domain === 'network' || domain === 'server';
69
+ // return !!data.operation && hasTab;
70
+ // }
71
+ // },
72
+ // { label: '打开属性设置', id: 'openSet' },
73
+ // { label: '打开全局属性设置', id: 'openAllSet' },
73
74
  ]
74
75
  };
75
76
  }
package/es/createTopo.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import { createTopoApp } from "./core/models/createTopoApp";
2
+ import { createTopoApp } from "./core/createTopoApp";
3
3
  import createMenuCommands from "./contextmenu/createMenuCommands";
4
4
  import getTopoData from "./topoCenter/getTopoData";
5
5
  export function createTopo(options) {
@@ -26,9 +26,7 @@ export default function useAlarm(options) {
26
26
 
27
27
  var _store$useModel2 = store.useModel("topoBizMod"),
28
28
  bizState = _store$useModel2[0],
29
- bizDispatchers = _store$useModel2[1];
30
-
31
- var linkDynamicStyleDispatcher = store.getModel("linkDynamicStyle")[1]; // rlog.debug(
29
+ bizDispatchers = _store$useModel2[1]; // rlog.debug(
32
30
  // "useAlarm.useEffect 获取初始化告警----------init",
33
31
  // topo,
34
32
  // allData,
@@ -63,6 +61,7 @@ export default function useAlarm(options) {
63
61
  // };
64
62
  // }, [alarmIsOpened]);
65
63
 
64
+
66
65
  function getAlarmByEE(_x) {
67
66
  return _getAlarmByEE.apply(this, arguments);
68
67
  }
@@ -110,9 +109,7 @@ export default function useAlarm(options) {
110
109
  rlog.debug("useAlarm.getAlarmByEE 推送告警到ht", alarmList, bizState);
111
110
 
112
111
  if (alarmIsOpened) {
113
- topo.loadAlarm(alarmList); // 告警变化后,刷新链路动态样式
114
-
115
- linkDynamicStyleDispatcher.execute();
112
+ topo.loadAlarm(alarmList);
116
113
  }
117
114
 
118
115
  case 12:
@@ -9,7 +9,7 @@ import { getEdges, getNodes } from "../utils/htElementUtils";
9
9
  export default function (props) {
10
10
  var topo = props.topo;
11
11
  var store = topo.store;
12
- var editDispatchers = store.useModelDispatchers('topoCreateMod');
12
+ var editDispatchers = store.useModelDispatchers('topoConfig');
13
13
 
14
14
  var loadConfig = /*#__PURE__*/function () {
15
15
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {