@riil-frontend/component-topology 2.15.44 → 2.15.47

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 (139) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +25 -25
  5. package/es/components/Drawer/index.js +8 -2
  6. package/es/components/TagImageSelect/index.js +3 -1
  7. package/es/components/TagSelect/index.js +3 -3
  8. package/es/components/TemplateButton/index.module.scss +1 -0
  9. package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
  10. package/es/core/common/icons/icon.js +1 -1
  11. package/es/core/common/icons/useIcons.js +1 -1
  12. package/es/core/components/TopoView/topoView.js +8 -18
  13. package/es/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
  14. package/es/core/editor/components/BackgroundView/index.module.scss +1 -0
  15. package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
  16. package/es/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
  17. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +16 -2
  18. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
  19. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
  20. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
  21. package/es/core/editor/components/CustomIconPlugin/index.js +2 -0
  22. package/es/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
  23. package/es/core/editor/components/EditorPlugin.js +2 -2
  24. package/es/core/editor/components/settings/common/LayoutSettings.js +11 -19
  25. package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -4
  26. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +13 -8
  27. package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
  28. package/es/core/models/TopoApp.js +9 -5
  29. package/es/core/store/coreModels.js +32 -26
  30. package/es/core/store/createStore.js +1 -1
  31. package/es/core/test/Test.js +3 -1
  32. package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +22 -21
  33. package/es/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
  34. package/es/createTopo.js +1 -1
  35. package/es/hooks/useAlarm.js +3 -6
  36. package/es/hooks/useResourceConfig.js +1 -1
  37. package/es/hooks/useTopoEdit.js +4 -8
  38. package/es/models/{iconManage.js → customIcon.js} +1 -1
  39. package/es/models/topoBizMod.js +22 -52
  40. package/es/models/{topoCreateMod.js → topoConfig.js} +8 -4
  41. package/es/models/topoMod.js +32 -69
  42. package/es/{components → topoCenter/components}/Link/form.js +0 -0
  43. package/es/{components → topoCenter/components}/Link/hook.js +0 -0
  44. package/es/{components → topoCenter/components}/Link/index copy.js +1 -1
  45. package/es/{components → topoCenter/components}/Link/index.js +1 -1
  46. package/es/{components → topoCenter/components}/Link/index.module.scss +0 -0
  47. package/es/{components → topoCenter/components}/Link/setting.js +0 -0
  48. package/es/topoCenter/components/TopoView.js +16 -3
  49. package/es/topoCenter/components/Topology.js +0 -5
  50. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
  51. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
  52. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
  53. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
  54. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
  55. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
  56. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
  57. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
  58. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
  59. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
  60. package/es/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -1
  61. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +3 -3
  62. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
  63. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
  64. package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +1 -1
  65. package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
  66. package/es/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
  67. package/es/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
  68. package/es/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
  69. package/es/{models → topoCenter/store}/linkManager.js +0 -0
  70. package/lib/components/Drawer/index.js +7 -2
  71. package/lib/components/TagImageSelect/index.js +3 -1
  72. package/lib/components/TagSelect/index.js +3 -3
  73. package/lib/components/TemplateButton/index.module.scss +1 -0
  74. package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
  75. package/lib/core/common/icons/icon.js +1 -1
  76. package/lib/core/common/icons/useIcons.js +1 -1
  77. package/lib/core/components/TopoView/topoView.js +9 -20
  78. package/lib/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
  79. package/lib/core/editor/components/BackgroundView/index.module.scss +1 -0
  80. package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
  81. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
  82. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +17 -2
  83. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
  84. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
  85. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
  86. package/lib/core/editor/components/CustomIconPlugin/index.js +11 -0
  87. package/lib/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
  88. package/lib/core/editor/components/EditorPlugin.js +2 -2
  89. package/lib/core/editor/components/settings/common/LayoutSettings.js +10 -18
  90. package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +2 -4
  91. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +12 -7
  92. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
  93. package/lib/core/models/TopoApp.js +9 -5
  94. package/lib/core/store/coreModels.js +35 -26
  95. package/lib/core/store/createStore.js +2 -2
  96. package/lib/core/test/Test.js +3 -1
  97. package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +22 -21
  98. package/lib/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
  99. package/lib/createTopo.js +1 -1
  100. package/lib/hooks/useAlarm.js +3 -6
  101. package/lib/hooks/useResourceConfig.js +1 -1
  102. package/lib/hooks/useTopoEdit.js +4 -8
  103. package/lib/models/{iconManage.js → customIcon.js} +1 -1
  104. package/lib/models/topoBizMod.js +22 -52
  105. package/lib/models/{topoCreateMod.js → topoConfig.js} +7 -4
  106. package/lib/models/topoMod.js +32 -69
  107. package/lib/{components → topoCenter/components}/Link/form.js +0 -0
  108. package/lib/{components → topoCenter/components}/Link/hook.js +0 -0
  109. package/lib/{components → topoCenter/components}/Link/index copy.js +1 -1
  110. package/lib/{components → topoCenter/components}/Link/index.js +1 -1
  111. package/lib/{components → topoCenter/components}/Link/index.module.scss +0 -0
  112. package/lib/{components → topoCenter/components}/Link/setting.js +0 -0
  113. package/lib/topoCenter/components/TopoView.js +19 -3
  114. package/lib/topoCenter/components/Topology.js +0 -7
  115. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
  116. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
  117. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
  118. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
  119. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
  120. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
  121. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
  122. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
  123. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
  124. package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
  125. package/lib/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -2
  126. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -8
  127. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
  128. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
  129. package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +4 -4
  130. package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
  131. package/lib/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
  132. package/lib/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
  133. package/lib/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
  134. package/lib/{models → topoCenter/store}/linkManager.js +0 -0
  135. package/package.json +2 -2
  136. package/es/core/editor/LinkDynamicStyleConfig.js +0 -16
  137. package/es/core/store/getStoreModels.js +0 -40
  138. package/lib/core/editor/LinkDynamicStyleConfig.js +0 -21
  139. 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, {
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
- var _excluded = ["dataSource", "onChange", "size", "boxProps", "tagProps", "itemProps", "ItemComponent"];
3
+ var _excluded = ["dataSource", "onChange", "size", "boxProps", "tagProps", "itemProps", "ItemComponent", "value"];
4
4
  import React from "react";
5
5
  import TemplateButton from "../TemplateButton";
6
6
  import TagSelect from "../TagSelect";
@@ -14,12 +14,14 @@ var TagImageSelect = function TagImageSelect(props) {
14
14
  tagProps = props.tagProps,
15
15
  itemProps = props.itemProps,
16
16
  ItemComponent = props.ItemComponent,
17
+ value = props.value,
17
18
  otherProps = _objectWithoutPropertiesLoose(props, _excluded);
18
19
 
19
20
  var Item = ItemComponent || TemplateButton;
20
21
  return /*#__PURE__*/React.createElement(TagSelect, _extends({}, otherProps, {
21
22
  onChange: onChange,
22
23
  className: styles.tagSelect,
24
+ value: value,
23
25
  dataSource: dataSource.map(function (item) {
24
26
  return {
25
27
  key: item.id,
@@ -20,9 +20,9 @@ var TagSelect = function TagSelect(props) {
20
20
  setCurrent = _useState[1];
21
21
 
22
22
  useEffect(function () {
23
- if (value) {
24
- setCurrent(value);
25
- }
23
+ // if (value) {
24
+ // }
25
+ setCurrent(value);
26
26
  }, [value]);
27
27
  return /*#__PURE__*/React.createElement("div", {
28
28
  className: "tag-select-wrap"
@@ -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,
@@ -1,6 +1,6 @@
1
1
  import _Form from "@alifd/next/es/form";
2
2
  import _Radio from "@alifd/next/es/radio";
3
- import React, { useState } from "react";
3
+ import React, { useState, useEffect } from "react";
4
4
  import TemplateGroup from "../../../../../components/TagImageSelect";
5
5
  import styles from "./LayoutSettings.module.scss";
6
6
  var LAYOUTS = {
@@ -21,33 +21,25 @@ var LayoutSettings = function LayoutSettings(props) {
21
21
  var _props$layout = props.layout,
22
22
  layout = _props$layout === void 0 ? {} : _props$layout,
23
23
  onChange = props.onChange,
24
+ regionId = props.regionId,
24
25
  size = props.size;
25
26
  var layoutId = layout.id,
26
- layoutOptions = layout.options;
27
-
28
- var _useState = useState(layout || {}),
29
- value = _useState[0],
30
- setValue = _useState[1];
27
+ layoutOptions = layout.options; // const [value, setValue] = useState();
31
28
 
32
29
  var handleChange = function handleChange(data) {
33
- console.log("handleChange", data);
34
- onChange && onChange(data); // setValue({
35
- // id: data,
36
- // options: {
37
- // value: "east",
38
- // label: "横向",
39
- // },
40
- // });
30
+ onChange && onChange(data);
41
31
  };
42
32
 
43
33
  var onLayoutSelect = function onLayoutSelect(id) {
34
+ // console.log("onLayoutSelect", id, layout, value);
44
35
  var options;
45
36
 
46
37
  if (id === "toward") {
47
38
  options = {
48
39
  subId: TREE_LAYOUT_OPTIONS[0].value
49
40
  };
50
- }
41
+ } // setValue(id);
42
+
51
43
 
52
44
  handleChange({
53
45
  id: id,
@@ -60,14 +52,14 @@ var LayoutSettings = function LayoutSettings(props) {
60
52
  id: id,
61
53
  name: LAYOUTS[id],
62
54
  icon: "layout_" + id,
63
- selected: layoutId === id,
64
- onSelect: onLayoutSelect
55
+ selected: layoutId === id
65
56
  };
66
57
  });
67
58
  return /*#__PURE__*/React.createElement("div", {
68
59
  className: styles["layout-setting-template-group"]
69
60
  }, /*#__PURE__*/React.createElement(TemplateGroup, {
70
61
  dataSource: layoutGroup,
62
+ value: layoutId,
71
63
  size: size,
72
64
  onChange: onLayoutSelect,
73
65
  boxProps: {
@@ -86,7 +78,7 @@ var LayoutSettings = function LayoutSettings(props) {
86
78
  iconClassName: styles.icon,
87
79
  textClassName: styles.text
88
80
  }
89
- }), layoutId === "toward" && /*#__PURE__*/React.createElement(_Form.Item, {
81
+ }), layoutId === "toward" ? /*#__PURE__*/React.createElement(_Form.Item, {
90
82
  label: "\u5E03\u5C40\u65B9\u5411"
91
83
  }, /*#__PURE__*/React.createElement(_Radio.Group, {
92
84
  dataSource: TREE_LAYOUT_OPTIONS,
@@ -99,7 +91,7 @@ var LayoutSettings = function LayoutSettings(props) {
99
91
  }
100
92
  });
101
93
  }
102
- })));
94
+ })) : null);
103
95
  };
104
96
 
105
97
  export default LayoutSettings;
@@ -2,11 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import { useState } from "react";
3
3
  import rlog from "@riil-frontend/component-topology-utils/es/rlog";
4
4
  import { iconFactory } from "@riil-frontend/component-topology-graph";
5
- import sortBy from 'lodash/sortBy';
5
+ import sortBy from "lodash/sortBy";
6
6
  import { getGroupChildrenNodes, getNodeData } from "../../../../../../../../utils/htElementUtils";
7
7
 
8
8
  function sortResourcesByName(resources) {
9
- return sortBy(resources, 'name');
9
+ return sortBy(resources, "name");
10
10
  }
11
11
 
12
12
  export default function useGroupRelateResource(props) {
@@ -33,7 +33,7 @@ export default function useGroupRelateResource(props) {
33
33
  data: item,
34
34
  node: item.node
35
35
  };
36
- });
37
- rlog.info('useGroupRelateResource', data);
36
+ }); // rlog.info('useGroupRelateResource', data);
37
+
38
38
  return data;
39
39
  }
@@ -1,6 +1,6 @@
1
1
  import _Form from "@alifd/next/es/form";
2
2
  import _Collapse from "@alifd/next/es/collapse";
3
- import React, { useState, useEffect, useRef, useCallback } from 'react';
3
+ import React, { useState, useEffect, useRef, useCallback } from "react";
4
4
  import GroupExpandStatus from "./GroupExpandStatus";
5
5
  import AlignSetting from "../../../common/AlignSetting";
6
6
  import LayoutSettings from "../../../common/LayoutSettings"; // import NodeIconSelect from '../../node/NodeIconSelect';
@@ -12,6 +12,7 @@ export default function GroupExpandSetting(props) {
12
12
  group = props.group,
13
13
  expanded = props.expanded,
14
14
  onChange = props.onChange,
15
+ id = props.id,
15
16
  settingRuntimeState = props.settingRuntimeState;
16
17
 
17
18
  var _useState = useState(),
@@ -19,22 +20,26 @@ export default function GroupExpandSetting(props) {
19
20
  setLayout = _useState[1];
20
21
 
21
22
  var alignOnChange = function alignOnChange(v) {
22
- console.log('setAlignmentBySelectionNodes', v); // topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
23
-
24
- onChange('groupAlign', v); // topoEditApi.setAlignmentBySelectionNodes(v);
23
+ // console.log("setAlignmentBySelectionNodes", v);
24
+ // topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
25
+ onChange("groupAlign", v); // topoEditApi.setAlignmentBySelectionNodes(v);
25
26
  };
26
27
 
27
28
  var layoutOnChange = function layoutOnChange(v) {
28
- console.log('layoutOnChange', v);
29
+ // console.log("layoutOnChange", v);
29
30
  setLayout(v); // topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
30
31
 
31
- onChange('layout', v); // topoEditApi.setAlignmentBySelectionNodes(v);
32
+ onChange("layout", v); // topoEditApi.setAlignmentBySelectionNodes(v);
32
33
  };
33
34
 
35
+ useEffect(function () {
36
+ // console.log("GroupExpandSetting-id-layout", id, layout);
37
+ setLayout({}); // onChange("layout", {});
38
+ }, [id]);
34
39
  return /*#__PURE__*/React.createElement(_Collapse, {
35
- defaultExpandedKeys: ['布局', '显示设置', '对齐方式'],
40
+ defaultExpandedKeys: ["布局", "显示设置", "对齐方式"],
36
41
  style: {
37
- border: 'none'
42
+ border: "none"
38
43
  }
39
44
  }, /*#__PURE__*/React.createElement(CollapsePanel, {
40
45
  key: "\u5E03\u5C40",
@@ -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.47" === 'string' ? "2.15.47" : 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
  }