@riil-frontend/component-topology 2.12.2 → 2.12.5-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) 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 +21 -21
  5. package/es/components/Link/index.js +1 -1
  6. package/es/components/Link/index.module.scss +2 -2
  7. package/es/components/MultiResourceDrawer/index.js +3 -2
  8. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -0
  9. package/es/components/ResourceSelectDrawer/ResourceSelectList.js +6 -1
  10. package/es/components/SingleResourceDrawer/SelectDrawer.js +54 -0
  11. package/es/components/SingleResourceDrawer/index.js +3 -3
  12. package/es/core/common/icons/defaultIcons.js +9 -2
  13. package/es/core/components/TopoView/topoView.js +3 -2
  14. package/es/core/editor/components/LinkDynamicStyleSettingDrawer/rule/ColorPicker.module.scss +1 -1
  15. package/es/core/editor/components/ResourceViewAttributeSetting/ResourceViewAttributeSettingPlugin.js +1 -1
  16. package/es/core/editor/components/ResourceViewAttributeSetting/Setting.js +1 -1
  17. package/es/core/editor/components/settings/Settings.js +5 -29
  18. package/es/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.js +0 -0
  19. package/es/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.module.scss +0 -0
  20. package/es/core/editor/components/settings/{group → common}/GroupNodeList/ResourceSelectButton.js +12 -14
  21. package/es/core/editor/components/settings/{group → common}/GroupNodeList/icon.js +0 -0
  22. package/es/core/editor/components/settings/common/text/FontStyleCheckbox.module.scss +1 -1
  23. package/es/core/editor/components/settings/group/DataTab/GroupNodeList.js +19 -0
  24. package/es/core/editor/components/settings/group/DataTab/RelateData.js +45 -0
  25. package/es/core/editor/components/settings/group/GroupPropertyView.js +44 -0
  26. package/es/core/editor/components/settings/group/GroupPropertyView.module.scss +3 -0
  27. package/es/core/editor/components/settings/group/SettingTab/GroupExpandSetting.js +27 -0
  28. package/es/core/editor/components/settings/group/SettingTab/NodeIconSelect.js +32 -0
  29. package/es/core/editor/components/settings/group/SettingTab/Setting.js +86 -0
  30. package/es/core/editor/components/settings/group/hooks/useGroup.js +9 -0
  31. package/es/core/editor/components/settings/group/hooks/useGroupExpand.js +20 -0
  32. package/es/core/editor/components/settings/layer/LayerSettingsForm.js +2 -2
  33. package/es/core/editor/components/settings/{group/GroupNodeList/GroupNodeList.js → layer/NodeList.js} +3 -3
  34. package/es/core/editor/components/settings/link/LinkPropertyView.js +3 -3
  35. package/es/core/editor/components/settings/node/NodeIconSelect.js +1 -1
  36. package/es/core/editor/components/settings/propertyViews.js +23 -0
  37. package/es/core/models/TopoApp.js +28 -16
  38. package/es/hooks/useContainerLinkTopo.js +1 -1
  39. package/es/hooks/usePolling.js +1 -1
  40. package/es/hooks/useTopoEdit.js +139 -103
  41. package/es/style.js +3 -4
  42. package/es/topoCenter/models/TopoCenter.js +40 -12
  43. package/es/utils/htElementUtils.js +36 -7
  44. package/lib/components/Link/index.js +6 -6
  45. package/lib/components/Link/index.module.scss +2 -2
  46. package/lib/components/MultiResourceDrawer/index.js +3 -2
  47. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -0
  48. package/lib/components/ResourceSelectDrawer/ResourceSelectList.js +6 -1
  49. package/lib/components/SingleResourceDrawer/SelectDrawer.js +68 -0
  50. package/lib/components/SingleResourceDrawer/index.js +3 -3
  51. package/lib/core/common/icons/defaultIcons.js +11 -2
  52. package/lib/core/components/TopoView/topoView.js +15 -13
  53. package/lib/core/editor/components/LinkDynamicStyleSettingDrawer/rule/ColorPicker.module.scss +1 -1
  54. package/lib/core/editor/components/ResourceViewAttributeSetting/ResourceViewAttributeSettingPlugin.js +3 -3
  55. package/lib/core/editor/components/ResourceViewAttributeSetting/Setting.js +2 -2
  56. package/lib/core/editor/components/settings/Settings.js +5 -34
  57. package/lib/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.js +0 -0
  58. package/lib/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.module.scss +0 -0
  59. package/lib/core/editor/components/settings/{group → common}/GroupNodeList/ResourceSelectButton.js +13 -14
  60. package/lib/core/editor/components/settings/{group → common}/GroupNodeList/icon.js +0 -0
  61. package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.module.scss +1 -1
  62. package/lib/core/editor/components/settings/group/DataTab/GroupNodeList.js +33 -0
  63. package/lib/core/editor/components/settings/group/DataTab/RelateData.js +57 -0
  64. package/lib/core/editor/components/settings/group/GroupPropertyView.js +58 -0
  65. package/lib/core/editor/components/settings/group/GroupPropertyView.module.scss +3 -0
  66. package/lib/core/editor/components/settings/group/SettingTab/GroupExpandSetting.js +37 -0
  67. package/lib/core/editor/components/settings/group/SettingTab/NodeIconSelect.js +45 -0
  68. package/lib/core/editor/components/settings/group/SettingTab/Setting.js +106 -0
  69. package/lib/core/editor/components/settings/group/hooks/useGroup.js +15 -0
  70. package/lib/core/editor/components/settings/group/hooks/useGroupExpand.js +26 -0
  71. package/lib/core/editor/components/settings/layer/LayerSettingsForm.js +3 -3
  72. package/lib/core/editor/components/settings/{group/GroupNodeList/GroupNodeList.js → layer/NodeList.js} +3 -3
  73. package/lib/core/editor/components/settings/link/LinkPropertyView.js +3 -3
  74. package/lib/core/editor/components/settings/node/NodeIconSelect.js +1 -1
  75. package/lib/core/editor/components/settings/propertyViews.js +38 -0
  76. package/lib/core/models/TopoApp.js +29 -17
  77. package/lib/hooks/useContainerLinkTopo.js +2 -2
  78. package/lib/hooks/usePolling.js +3 -3
  79. package/lib/hooks/useTopoEdit.js +149 -112
  80. package/lib/style.js +3 -4
  81. package/lib/topoCenter/models/TopoCenter.js +40 -12
  82. package/lib/utils/htElementUtils.js +44 -7
  83. package/package.json +10 -10
@@ -9,9 +9,9 @@ import _Grid from "@alifd/next/lib/grid";
9
9
  import _Form from "@alifd/next/lib/form";
10
10
  import React, { useState, useEffect } from 'react';
11
11
  import ColorPicker from "../../LinkDynamicStyleSettingDrawer/rule/ColorPicker";
12
- import GroupNodeList from "../group/GroupNodeList/GroupNodeList";
13
- import ResourceSelectButton from "../group/GroupNodeList/ResourceSelectButton";
14
- import { getIconMap } from "../group/GroupNodeList/icon";
12
+ import GroupNodeList from "../group/DataTab/GroupNodeList";
13
+ import ResourceSelectButton from "../common/GroupNodeList/ResourceSelectButton";
14
+ import { getIconMap } from "../common/GroupNodeList/icon";
15
15
  import LineType from "../common/LineType";
16
16
  var FormItem = _Form.Item;
17
17
  var Row = _Grid.Row,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { getIconGroups } from "../group/GroupNodeList/icon";
2
+ import { getIconGroups } from "../common/GroupNodeList/icon";
3
3
  import IconSelect from '@riil-frontend/component-topo-icon-select';
4
4
  export default function NodeIconSelect(props) {
5
5
  var value = props.value,
@@ -0,0 +1,23 @@
1
+ import SettingsForm from "./SettingsForm";
2
+ import NodePropertyView from "./node/NodePropertyView";
3
+ import LayerSettingsForm from "./layer/LayerSettingsForm";
4
+ import TextPropertyView from "./text/TextPropertyView";
5
+ import LinkPropertyView from "./link/LinkPropertyView";
6
+ import ViewPropertyView from "./view/ViewPropertyView";
7
+ import GroupPropertyView from "./group/GroupPropertyView";
8
+ var propertyPanelMap = {
9
+ // view: SettingsForm,
10
+ node: NodePropertyView,
11
+ layer: LayerSettingsForm,
12
+ text: TextPropertyView,
13
+ group: GroupPropertyView
14
+ };
15
+
16
+ if (localStorage.getItem('topo.debug') === 'true') {
17
+ Object.assign(propertyPanelMap, {
18
+ line: LinkPropertyView,
19
+ view: ViewPropertyView
20
+ });
21
+ }
22
+
23
+ export default propertyPanelMap;
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import topoService from '@riil-frontend/component-topology-common/es/services/topo';
5
- import { setRequest } from '@riil-frontend/component-topology-common';
5
+ import { setRequest } from '@riil-frontend/component-topology-common/es/index';
6
6
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
7
7
  import CiTyeCache from "./cache/CiTyeCache";
8
8
  import Alarm from "./common/Alarm";
@@ -478,42 +478,54 @@ var TopoApp = /*#__PURE__*/function () {
478
478
  /*#__PURE__*/
479
479
  function () {
480
480
  var _enterEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
481
- var topoDispatchers, editDispatchers, ciSetDoc, linkDynamicStyleDispatcher, iconManageDispatchers, topoTreeData;
481
+ var topoDispatchers, editDispatchers, iconManageDispatchers, ciSetDoc, linkDynamicStyleDispatcher;
482
482
  return _regeneratorRuntime.wrap(function _callee11$(_context11) {
483
483
  while (1) {
484
484
  switch (_context11.prev = _context11.next) {
485
485
  case 0:
486
- _context11.next = 2;
487
- return this.view.switchToEditMode();
488
-
489
- case 2:
490
486
  topoDispatchers = this.store.getModelDispatchers('topoMod');
491
487
  topoDispatchers.update({
492
488
  viewState: 'edit'
493
489
  });
490
+
491
+ if (!this.options.beforeSwitchToEditMode) {
492
+ _context11.next = 5;
493
+ break;
494
+ }
495
+
496
+ _context11.next = 5;
497
+ return this.options.beforeSwitchToEditMode();
498
+
499
+ case 5:
500
+ _context11.next = 7;
501
+ return this.view.switchToEditMode();
502
+
503
+ case 7:
494
504
  editDispatchers = this.store.getModelDispatchers('topoCreateMod');
495
505
  editDispatchers.switchToEditMode();
496
506
 
497
507
  if (this.options.onSwitchToEditMode) {
498
508
  this.options.onSwitchToEditMode();
499
- } // 每个节点的属性指标显示配置 TODO 每个节点都传了属性指标列表,待优化
509
+ } // 加载自定义图标
500
510
 
501
511
 
512
+ iconManageDispatchers = this.store.getModelDispatchers('iconManage');
513
+ iconManageDispatchers.loadIcons(); // 每个节点的属性指标显示配置 TODO 每个节点都传了属性指标列表,待优化
514
+
502
515
  ciSetDoc = this.store.getModelState('topoBizMod').ciSetDoc;
503
516
  this.view.topoClient.saveMarkSetting({
504
517
  tagAndTipSet: ciSetDoc
505
518
  }); // 刷新链路动态样式
506
519
 
507
520
  linkDynamicStyleDispatcher = this.store.getModelDispatchers('linkDynamicStyle');
508
- linkDynamicStyleDispatcher.execute(); // 加载自定义图标
509
-
510
- iconManageDispatchers = this.store.getModelDispatchers('iconManage');
511
- iconManageDispatchers.loadIcons(); // 加载关联拓扑图数据 FIXME 关联拓扑图时动态获取
512
-
513
- topoTreeData = formatTreeDataSelect(this.store.getModelState('topoTreeMod').treeData, this.id);
514
- this.view.topoClient.setTopoTreeData(topoTreeData);
515
-
516
- case 15:
521
+ linkDynamicStyleDispatcher.execute(); // 加载关联拓扑图数据 FIXME 关联拓扑图时动态获取
522
+ // const topoTreeData = formatTreeDataSelect(
523
+ // this.store.getModelState('topoTreeMod').treeData,
524
+ // this.id
525
+ // );
526
+ // this.view.topoClient.setTopoTreeData(topoTreeData);
527
+
528
+ case 16:
517
529
  case "end":
518
530
  return _context11.stop();
519
531
  }
@@ -1,4 +1,4 @@
1
- import { TopoEvent } from '@riil-frontend/component-topology-graph';
1
+ import TopoEvent from '@riil-frontend/component-topology-graph/es/event';
2
2
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
3
  import { loopTreeFun } from "../utils/tree";
4
4
  /**
@@ -4,7 +4,7 @@ import { useState, useEffect, useMemo } from 'react';
4
4
  import { useRequest } from 'ahooks';
5
5
  import _ from 'lodash';
6
6
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
7
- import { TopoEvent } from '@riil-frontend/component-topology-graph';
7
+ import TopoEvent from '@riil-frontend/component-topology-graph/es/event';
8
8
  import { metricValueFormat } from '@riil-frontend/utils';
9
9
  import { findItem } from "../utils/topoData";
10
10
  import DictCache from "../core/models/cache/DictCache";