@riil-frontend/component-topology 2.15.43 → 2.15.46

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/index.css +1 -1
  2. package/build/index.js +22 -22
  3. package/es/components/Drawer/index.js +8 -2
  4. package/es/components/TagImageSelect/index.js +3 -1
  5. package/es/components/TagSelect/index.js +3 -3
  6. package/es/components/TemplateButton/index.module.scss +1 -0
  7. package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
  8. package/es/core/common/icons/icon.js +1 -1
  9. package/es/core/common/icons/useIcons.js +1 -1
  10. package/es/core/components/TopoView/topoView.js +8 -18
  11. package/es/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
  12. package/es/core/editor/components/BackgroundView/index.js +80 -44
  13. package/es/core/editor/components/BackgroundView/index.module.scss +1 -0
  14. package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
  15. package/es/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
  16. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +16 -2
  17. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
  18. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
  19. package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
  20. package/es/core/editor/components/CustomIconPlugin/index.js +2 -0
  21. package/es/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
  22. package/es/core/editor/components/EditorPlugin.js +2 -2
  23. package/es/core/editor/components/settings/common/LayoutSettings.js +11 -19
  24. package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -4
  25. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +13 -8
  26. package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
  27. package/es/core/models/TopoApp.js +9 -5
  28. package/es/core/services/background.js +26 -1
  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/contextmenu/buildNodeContextmenu.js +65 -64
  33. package/es/createTopo.js +1 -1
  34. package/es/hooks/useAlarm.js +3 -6
  35. package/es/hooks/useResourceConfig.js +1 -1
  36. package/es/hooks/useTopoEdit.js +4 -8
  37. package/es/models/{iconManage.js → customIcon.js} +1 -1
  38. package/es/models/topoBizMod.js +22 -52
  39. package/es/models/{topoCreateMod.js → topoConfig.js} +8 -4
  40. package/es/models/topoMod.js +32 -69
  41. package/es/{components → topoCenter/components}/Link/form.js +0 -0
  42. package/es/{components → topoCenter/components}/Link/hook.js +0 -0
  43. package/es/{components → topoCenter/components}/Link/index copy.js +1 -1
  44. package/es/{components → topoCenter/components}/Link/index.js +1 -1
  45. package/es/{components → topoCenter/components}/Link/index.module.scss +0 -0
  46. package/es/{components → topoCenter/components}/Link/setting.js +0 -0
  47. package/es/topoCenter/components/TopoView.js +16 -3
  48. package/es/topoCenter/components/Topology.js +0 -5
  49. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
  50. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
  51. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
  52. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
  53. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
  54. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
  55. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
  56. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
  57. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
  58. package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
  59. package/es/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -1
  60. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +3 -3
  61. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
  62. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
  63. package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +1 -1
  64. package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
  65. package/es/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
  66. package/es/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
  67. package/es/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
  68. package/es/{models → topoCenter/store}/linkManager.js +0 -0
  69. package/lib/components/Drawer/index.js +7 -2
  70. package/lib/components/TagImageSelect/index.js +3 -1
  71. package/lib/components/TagSelect/index.js +3 -3
  72. package/lib/components/TemplateButton/index.module.scss +1 -0
  73. package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
  74. package/lib/core/common/icons/icon.js +1 -1
  75. package/lib/core/common/icons/useIcons.js +1 -1
  76. package/lib/core/components/TopoView/topoView.js +9 -20
  77. package/lib/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
  78. package/lib/core/editor/components/BackgroundView/index.js +80 -44
  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/services/background.js +26 -1
  95. package/lib/core/store/coreModels.js +35 -26
  96. package/lib/core/store/createStore.js +2 -2
  97. package/lib/core/test/Test.js +3 -1
  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,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.43" === 'string' ? "2.15.43" : null;
23
+ var version = typeof "2.15.46" === 'string' ? "2.15.46" : 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) {
@@ -107,5 +107,30 @@ export default {
107
107
  /**
108
108
  * 背景图导出
109
109
  */
110
- EXPORT_BG_ZIP: EXPORT_BG_ZIP
110
+ EXPORT_BG_ZIP: EXPORT_BG_ZIP,
111
+
112
+ /**
113
+ * 校验背景图是否被占用
114
+ * @param {*} params id
115
+ */
116
+ canDeleteBackground: function canDeleteBackground(id) {
117
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
118
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
119
+ while (1) {
120
+ switch (_context4.prev = _context4.next) {
121
+ case 0:
122
+ _context4.next = 2;
123
+ return getRequest()("/topo/v1/api/background/" + id);
124
+
125
+ case 2:
126
+ return _context4.abrupt("return", _context4.sent);
127
+
128
+ case 3:
129
+ case "end":
130
+ return _context4.stop();
131
+ }
132
+ }
133
+ }, _callee4);
134
+ }))();
135
+ }
111
136
  };
@@ -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() {
@@ -39,7 +39,7 @@ var useTopoEdit = function useTopoEdit(params) {
39
39
  topoEditState = _store$useModel[0],
40
40
  topoEditDispatchers = _store$useModel[1];
41
41
 
42
- var _store$useModel2 = store.useModel('topoCreateMod'),
42
+ var _store$useModel2 = store.useModel('topoConfig'),
43
43
  editState = _store$useModel2[0],
44
44
  editDispatchers = _store$useModel2[1];
45
45
 
@@ -105,9 +105,7 @@ var useTopoEdit = function useTopoEdit(params) {
105
105
  }); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
106
106
 
107
107
  if (!isLayerTopo && config.layers.length) {
108
- topoDispatchers.update({
109
- type: TPL_TREE
110
- });
108
+ topoDispatchers.setTopoType(TPL_TREE);
111
109
  } // 更新配置
112
110
 
113
111
 
@@ -125,9 +123,7 @@ var useTopoEdit = function useTopoEdit(params) {
125
123
  }); // 如果没有分层,将拓扑类型切换为空白模板
126
124
 
127
125
  if (!config.layers.length) {
128
- topoDispatchers.update({
129
- type: TPL_BLANK
130
- });
126
+ topoDispatchers.setTopoType(TPL_BLANK);
131
127
  } // 更新配置
132
128
 
133
129
 
@@ -921,7 +917,7 @@ var useTopoEdit = function useTopoEdit(params) {
921
917
  }
922
918
  };
923
919
 
924
- var effectsState = store.useModelEffectsState('topoCreateMod');
920
+ var effectsState = store.useModelEffectsState('topoConfig');
925
921
  var topoLoading = effectsState.getTopoByConditions.isLoading;
926
922
  return {
927
923
  resourceConfig: resourceConfig,
@@ -163,7 +163,7 @@ export default function (engine) {
163
163
  _this3.update({
164
164
  visible: false,
165
165
  icons: {
166
- node: [].concat(rootState.iconManage.icons.node, data.map(addIconUrlData)),
166
+ node: [].concat(rootState.customIcon.icons.node, data.map(addIconUrlData)),
167
167
  container: []
168
168
  }
169
169
  });
@@ -67,105 +67,75 @@ export default function (engine) {
67
67
  }, _callee);
68
68
  }))();
69
69
  },
70
- getCiInfo: function getCiInfo(conditions, state) {
71
- var _this2 = this;
72
-
73
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
74
- var result;
75
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
76
- while (1) {
77
- switch (_context2.prev = _context2.next) {
78
- case 0:
79
- _context2.next = 2;
80
- return getCiMeta(conditions);
81
-
82
- case 2:
83
- result = _context2.sent;
84
-
85
- // rlog.debug('getCiInfo', result);
86
- _this2.update({
87
- // alarmList: result.datas,
88
- currentCiInfo: result // drawerAlarmPageInfo,
89
-
90
- });
91
-
92
- case 4:
93
- case "end":
94
- return _context2.stop();
95
- }
96
- }
97
- }, _callee2);
98
- }))();
99
- },
100
70
  // 根据ci的id获取属性的值
101
71
  getCiArrByIds: function getCiArrByIds(conditions, state) {
102
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
72
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
103
73
  var resIdsList, result;
104
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
74
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
105
75
  while (1) {
106
- switch (_context3.prev = _context3.next) {
76
+ switch (_context2.prev = _context2.next) {
107
77
  case 0:
108
78
  resIdsList = state.topoBizMod.resAndMetrics.resIdsList; // rlog.debug('根据ci的id获取属性的值-getCiArrByIds', resIdsList);
109
79
  // const ciIds = encodeURIComponent(resIdsList);
110
80
 
111
- _context3.prev = 1;
112
- _context3.next = 4;
81
+ _context2.prev = 1;
82
+ _context2.next = 4;
113
83
  return topoServer.getBatchCiArr({
114
84
  ids: resIdsList
115
85
  });
116
86
 
117
87
  case 4:
118
- result = _context3.sent;
119
- return _context3.abrupt("return", result.content);
88
+ result = _context2.sent;
89
+ return _context2.abrupt("return", result.content);
120
90
 
121
91
  case 8:
122
- _context3.prev = 8;
123
- _context3.t0 = _context3["catch"](1);
124
- return _context3.abrupt("return", null);
92
+ _context2.prev = 8;
93
+ _context2.t0 = _context2["catch"](1);
94
+ return _context2.abrupt("return", null);
125
95
 
126
96
  case 11:
127
97
  case "end":
128
- return _context3.stop();
98
+ return _context2.stop();
129
99
  }
130
100
  }
131
- }, _callee3, null, [[1, 8]]);
101
+ }, _callee2, null, [[1, 8]]);
132
102
  }))();
133
103
  },
134
104
  // 初始化,统一获取指标和属性
135
105
  getCiBizByIds: function getCiBizByIds(conditions, state) {
136
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
106
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
137
107
  var _conditions$ciIds, _conditions$codes;
138
108
 
139
109
  var _state$topoBizMod$res, resIdsList, metrics, ciIds, codes, metricResult, arrResult;
140
110
 
141
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
111
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
142
112
  while (1) {
143
- switch (_context4.prev = _context4.next) {
113
+ switch (_context3.prev = _context3.next) {
144
114
  case 0:
145
115
  _state$topoBizMod$res = state.topoBizMod.resAndMetrics, resIdsList = _state$topoBizMod$res.resIdsList, metrics = _state$topoBizMod$res.metrics;
146
116
  ciIds = encodeURIComponent((_conditions$ciIds = conditions === null || conditions === void 0 ? void 0 : conditions.ciIds) !== null && _conditions$ciIds !== void 0 ? _conditions$ciIds : resIdsList);
147
117
  codes = encodeURIComponent((_conditions$codes = conditions === null || conditions === void 0 ? void 0 : conditions.codes) !== null && _conditions$codes !== void 0 ? _conditions$codes : metrics);
148
- _context4.next = 5;
118
+ _context3.next = 5;
149
119
  return getLatestMetrics(ciIds, codes);
150
120
 
151
121
  case 5:
152
- metricResult = _context4.sent;
153
- _context4.next = 8;
122
+ metricResult = _context3.sent;
123
+ _context3.next = 8;
154
124
  return topoServer.getBatchCiArr(ciIds);
155
125
 
156
126
  case 8:
157
- arrResult = _context4.sent;
158
- return _context4.abrupt("return", {
127
+ arrResult = _context3.sent;
128
+ return _context3.abrupt("return", {
159
129
  metricResult: metricResult,
160
130
  arrResult: arrResult
161
131
  });
162
132
 
163
133
  case 10:
164
134
  case "end":
165
- return _context4.stop();
135
+ return _context3.stop();
166
136
  }
167
137
  }
168
- }, _callee4);
138
+ }, _callee3);
169
139
  }))();
170
140
  },
171
141