@riil-frontend/component-topology 5.0.0-alpha.9 → 5.0.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.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +20 -20
- package/es/common/components/ColorPicker/ColorPicker.js +5 -3
- package/es/components/BatchAttrMetric/setting.js +3 -5
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -1
- package/es/core/components/DisplaySettingDrawer/LinkTip.js +5 -1
- package/es/core/components/DisplaySettingDrawer/demo/Demo.js +63 -0
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +9 -48
- package/es/core/components/TopoView/TopoView.module.scss +1 -1
- package/es/core/components/TopoView/topoView.js +31 -22
- package/es/core/editor/components/BackgroundView/index.js +74 -35
- package/es/core/editor/components/settings/common/LineType/index.js +7 -1
- package/es/core/editor/components/settings/common/text/FontStyleCheckbox.js +3 -3
- package/es/core/editor/components/settings/common/text/TextStyle.js +21 -6
- package/es/core/editor/components/settings/common/text/fontStyleUtil.js +0 -1
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +12 -1
- package/es/core/editor/components/settings/propertyViews/box/NameInput.js +9 -1
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -1
- package/es/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +2 -0
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -5
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -2
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +12 -1
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +13 -3
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +0 -1
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +2 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +4 -1
- package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +4 -0
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +34 -6
- package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +9 -2
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +30 -1
- package/es/core/editor/components/settings/propertyViews/view/GlobalLayout.js +2 -0
- package/es/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +15 -1
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +0 -1
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +4 -1
- package/es/core/editor/components/titlebar/widgets/DebugTools.js +29 -0
- package/es/core/hooks/useAlarm.js +18 -0
- package/es/core/hooks/useGraphAlarmDisplay.js +25 -3
- package/es/core/hooks/useResourceConfig.js +2 -1
- package/es/core/hooks/useRouterAdapter.js +7 -1
- package/es/core/hooks/useTopoEdit.js +220 -163
- package/es/core/models/AttributeMetricDisplay.js +31 -73
- package/es/core/models/HistoryManager.js +100 -50
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/cache/CiTypeCache.js +10 -44
- package/es/core/models/cache/DictCache.js +2 -1
- package/es/core/models/graph/Background.js +31 -14
- package/es/core/models/tagstips/ElementTagTipConfig.js +46 -12
- package/es/core/models/tagstips/utils.js +1 -1
- package/es/core/models/topoData.js +7 -3
- package/es/core/models/utils/linkUtils.js +18 -0
- package/es/core/store/models/topoAlarm.js +5 -1
- package/es/core/store/models/topoMod.js +6 -31
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +51 -249
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +218 -0
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +0 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +79 -43
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +23 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +11 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +34 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +6 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +62 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +188 -0
- package/es/core/viewer/components/titlebar/BasicTools.js +1 -1
- package/es/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +18 -0
- package/es/core/viewer/components/titlebar/widgets/SettingButton.js +11 -1
- package/es/networkTopo/components/TopoView.js +2 -1
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +164 -225
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +4 -0
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +161 -137
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +104 -0
- package/es/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +17 -7
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +8 -9
- package/es/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +59 -0
- package/es/networkTopo/components/viewer/displaySetting/LinkTagV2.js +10 -4
- package/es/networkTopo/getTopoData.js +11 -14
- package/es/networkTopo/hooks/editor/useDeleteEdges.js +11 -8
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -0
- package/es/networkTopo/models/TopoCenter.js +1 -1
- package/es/networkTopo/services/index.js +6 -4
- package/es/networkTopo/services/link.js +2 -2
- package/es/networkTopo/store/topoCenter.js +5 -2
- package/es/networkTopo/store/topoTreeMod.js +84 -43
- package/es/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +135 -0
- package/es/networkTopo/utils/resourcePermissionUtil.js +10 -6
- package/es/style.js +2 -1
- package/es/utils/ResourceConfigUtil.js +79 -39
- package/es/utils/clusterUtil.js +1 -1
- package/es/utils/htElementUtils.js +0 -1
- package/es/utils/topoData.js +24 -63
- package/es/utils/tree.js +1 -3
- package/lib/common/components/ColorPicker/ColorPicker.js +6 -3
- package/lib/components/BatchAttrMetric/setting.js +3 -6
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +4 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +4 -1
- package/lib/core/components/DisplaySettingDrawer/LinkTip.js +6 -1
- package/lib/core/components/DisplaySettingDrawer/demo/Demo.js +71 -0
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +8 -48
- package/lib/core/components/TopoView/TopoView.module.scss +1 -1
- package/lib/core/components/TopoView/topoView.js +26 -17
- package/lib/core/editor/components/BackgroundView/index.js +75 -35
- package/lib/core/editor/components/settings/common/LineType/index.js +7 -1
- package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.js +5 -4
- package/lib/core/editor/components/settings/common/text/TextStyle.js +23 -7
- package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +0 -1
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +13 -1
- package/lib/core/editor/components/settings/propertyViews/box/NameInput.js +9 -1
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -1
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -5
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -2
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +12 -1
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +17 -3
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +0 -1
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +4 -1
- package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +4 -0
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +36 -6
- package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +9 -2
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +32 -1
- package/lib/core/editor/components/settings/propertyViews/view/GlobalLayout.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +15 -1
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +0 -1
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +5 -1
- package/lib/core/editor/components/titlebar/widgets/DebugTools.js +38 -0
- package/lib/core/hooks/useAlarm.js +19 -0
- package/lib/core/hooks/useGraphAlarmDisplay.js +27 -3
- package/lib/core/hooks/useResourceConfig.js +2 -1
- package/lib/core/hooks/useRouterAdapter.js +8 -1
- package/lib/core/hooks/useTopoEdit.js +219 -162
- package/lib/core/models/AttributeMetricDisplay.js +31 -73
- package/lib/core/models/HistoryManager.js +105 -51
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/cache/CiTypeCache.js +12 -44
- package/lib/core/models/cache/DictCache.js +4 -1
- package/lib/core/models/graph/Background.js +36 -16
- package/lib/core/models/tagstips/ElementTagTipConfig.js +49 -12
- package/lib/core/models/tagstips/utils.js +1 -1
- package/lib/core/models/topoData.js +7 -3
- package/lib/core/models/utils/linkUtils.js +22 -0
- package/lib/core/store/models/topoAlarm.js +5 -1
- package/lib/core/store/models/topoMod.js +7 -32
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +51 -261
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +245 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +0 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +79 -42
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +2 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +36 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +11 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +45 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +11 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +77 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +214 -0
- package/lib/core/viewer/components/titlebar/BasicTools.js +2 -2
- package/lib/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +28 -0
- package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +10 -0
- package/lib/networkTopo/components/TopoView.js +3 -2
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +160 -223
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +12 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +161 -137
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +120 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +19 -7
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +8 -9
- package/lib/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +76 -0
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagV2.js +10 -4
- package/lib/networkTopo/getTopoData.js +10 -13
- package/lib/networkTopo/hooks/editor/useDeleteEdges.js +11 -8
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +2 -1
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -0
- package/lib/networkTopo/models/TopoCenter.js +2 -2
- package/lib/networkTopo/services/index.js +6 -4
- package/lib/networkTopo/services/link.js +2 -2
- package/lib/networkTopo/store/topoCenter.js +5 -2
- package/lib/networkTopo/store/topoTreeMod.js +84 -43
- package/lib/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +137 -0
- package/lib/networkTopo/utils/resourcePermissionUtil.js +11 -6
- package/lib/style.js +2 -1
- package/lib/utils/ResourceConfigUtil.js +78 -37
- package/lib/utils/clusterUtil.js +1 -1
- package/lib/utils/htElementUtils.js +0 -1
- package/lib/utils/topoData.js +25 -64
- package/lib/utils/tree.js +1 -3
- package/package.json +3 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _Balloon from "@alifd/next/es/balloon";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
3
4
|
import React, { Component, useRef } from 'react';
|
|
4
5
|
import { SketchPicker } from 'react-color';
|
|
@@ -37,7 +38,8 @@ var ColorPicker = /*#__PURE__*/function (_Component) {
|
|
|
37
38
|
_proto.render = function render() {
|
|
38
39
|
var _this$props2 = this.props,
|
|
39
40
|
value = _this$props2.value,
|
|
40
|
-
align = _this$props2.align
|
|
41
|
+
align = _this$props2.align,
|
|
42
|
+
balloonProps = _this$props2.balloonProps;
|
|
41
43
|
var defaultTrigger = /*#__PURE__*/React.createElement("div", {
|
|
42
44
|
className: styles.swatch,
|
|
43
45
|
style: {
|
|
@@ -46,7 +48,7 @@ var ColorPicker = /*#__PURE__*/function (_Component) {
|
|
|
46
48
|
});
|
|
47
49
|
return /*#__PURE__*/React.createElement("div", {
|
|
48
50
|
className: "topo-color-picker"
|
|
49
|
-
}, /*#__PURE__*/React.createElement(_Balloon, {
|
|
51
|
+
}, /*#__PURE__*/React.createElement(_Balloon, _extends({
|
|
50
52
|
trigger: defaultTrigger,
|
|
51
53
|
closable: false,
|
|
52
54
|
triggerType: "click",
|
|
@@ -57,7 +59,7 @@ var ColorPicker = /*#__PURE__*/function (_Component) {
|
|
|
57
59
|
style: {
|
|
58
60
|
paddingBottom: 0
|
|
59
61
|
}
|
|
60
|
-
}, /*#__PURE__*/React.createElement(SketchPicker, {
|
|
62
|
+
}, balloonProps), /*#__PURE__*/React.createElement(SketchPicker, {
|
|
61
63
|
color: value // width={230}
|
|
62
64
|
,
|
|
63
65
|
disableAlpha: true,
|
|
@@ -5,7 +5,7 @@ import _Grid from "@alifd/next/es/grid";
|
|
|
5
5
|
import _Message from "@alifd/next/es/message";
|
|
6
6
|
import _extends from "@babel/runtime/helpers/extends";
|
|
7
7
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
8
|
-
var _excluded = ["defaultSet", "showType"];
|
|
8
|
+
var _excluded = ["defaultSet", "allCiSet", "showType"];
|
|
9
9
|
import React, { useState, useMemo } from "react";
|
|
10
10
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
11
11
|
import ActionTree from "@riil-frontend/component-action-tree";
|
|
@@ -17,6 +17,7 @@ import styles from "./index.module.scss";
|
|
|
17
17
|
|
|
18
18
|
var Setting = function Setting(_ref) {
|
|
19
19
|
var defaultSet = _ref.defaultSet,
|
|
20
|
+
allCiSet = _ref.allCiSet,
|
|
20
21
|
showType = _ref.showType,
|
|
21
22
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
23
|
|
|
@@ -31,10 +32,7 @@ var Setting = function Setting(_ref) {
|
|
|
31
32
|
topoDispatchers = _topo$store$useModel[1];
|
|
32
33
|
|
|
33
34
|
var resAndMetrics = topoState.resAndMetrics;
|
|
34
|
-
|
|
35
|
-
allLinkModSet = resAndMetrics.allLinkModSet;
|
|
36
|
-
rlog.debug("Setting-resAndMetrics-allCiSet-elementType", showType, props, resAndMetrics, elementType);
|
|
37
|
-
var allCiSet = elementType === "node" ? allCiModSet : allLinkModSet;
|
|
35
|
+
rlog.debug("Setting-resAndMetrics-allCiSet-elementType", showType, props, elementType);
|
|
38
36
|
rlog.debug("Setting----allCiSet", allCiSet);
|
|
39
37
|
|
|
40
38
|
var _useState = useState(Object.keys(allCiSet)[0]),
|
|
@@ -2,6 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
+
import rlog from '@riil-frontend/component-topology-utils/lib/rlog';
|
|
5
6
|
import Drawer from "../Drawer";
|
|
6
7
|
import ResourceSelectList from "./ResourceSelectList";
|
|
7
8
|
import styles from "./ResourceSelectDrawer.module.scss";
|
|
@@ -64,7 +65,7 @@ function ResourceSelectDrawer(props) {
|
|
|
64
65
|
_context.prev = 9;
|
|
65
66
|
_context.t0 = _context["catch"](1);
|
|
66
67
|
setLoading(false);
|
|
67
|
-
|
|
68
|
+
rlog.error('ResourceSelectDrawer.handleOk', _context.t0);
|
|
68
69
|
|
|
69
70
|
case 13:
|
|
70
71
|
case "end":
|
|
@@ -3,6 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
import React, { useEffect, useRef, useState } from 'react';
|
|
6
|
+
import rlog from '@riil-frontend/component-topology-utils/lib/rlog';
|
|
6
7
|
import Drawer from "../../../components/Drawer";
|
|
7
8
|
import DisplaySetting from "./DisplaySetting";
|
|
8
9
|
import useDisplaySetting from "./hooks/useDisplaySetting";
|
|
@@ -45,7 +46,7 @@ export default function DisplaySettingDrawer(props) {
|
|
|
45
46
|
_context.prev = 9;
|
|
46
47
|
_context.t0 = _context["catch"](1);
|
|
47
48
|
setLoading(false);
|
|
48
|
-
|
|
49
|
+
rlog.error('DisplaySettingDrawer.handleOk', _context.t0);
|
|
49
50
|
|
|
50
51
|
_Message.warn('保存失败');
|
|
51
52
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { DEFAULT_TIP_COMMON_CONFIG } from "../../../constants/ResourceInfoDisplay";
|
|
4
|
+
import LinkAttrCustomSettingDrawer from "../../../networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer";
|
|
4
5
|
import BasicConfig from "./ResourceDisplay/BasicConfig"; // 源端口、目的端口、总流量、带宽利用率
|
|
5
6
|
|
|
6
7
|
var CommonOptions = [{
|
|
@@ -30,7 +31,10 @@ function LinkTip(props, ref) {
|
|
|
30
31
|
elementType: "link",
|
|
31
32
|
showType: "tip",
|
|
32
33
|
commonOptions: CommonOptions,
|
|
33
|
-
defaultCommonConfig: DEFAULT_TIP_COMMON_CONFIG
|
|
34
|
+
defaultCommonConfig: DEFAULT_TIP_COMMON_CONFIG,
|
|
35
|
+
customSettingDrawer: function customSettingDrawer(params) {
|
|
36
|
+
return /*#__PURE__*/React.createElement(LinkAttrCustomSettingDrawer, params);
|
|
37
|
+
}
|
|
34
38
|
}));
|
|
35
39
|
}
|
|
36
40
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function Demo() {
|
|
3
|
+
var dataSource = [{
|
|
4
|
+
id: 'switch',
|
|
5
|
+
label: '交换机',
|
|
6
|
+
icon: '/img/model/switch.svg',
|
|
7
|
+
list: [{
|
|
8
|
+
code: 'graph:name',
|
|
9
|
+
name: '图片名称',
|
|
10
|
+
typeName: null
|
|
11
|
+
}, {
|
|
12
|
+
code: 'ciType:name',
|
|
13
|
+
name: '资源类型',
|
|
14
|
+
typeName: null
|
|
15
|
+
}, {
|
|
16
|
+
code: 'attr:ipv4_address',
|
|
17
|
+
name: 'IPv4地址',
|
|
18
|
+
typeName: '属性'
|
|
19
|
+
}, {
|
|
20
|
+
code: 'metric:ping_status',
|
|
21
|
+
name: 'ping状态',
|
|
22
|
+
typeName: '指标'
|
|
23
|
+
}]
|
|
24
|
+
}, {
|
|
25
|
+
id: 'router',
|
|
26
|
+
label: '路由器',
|
|
27
|
+
icon: '/img/model/switch.svg',
|
|
28
|
+
list: [{
|
|
29
|
+
code: 'graph:name',
|
|
30
|
+
name: '图片名称',
|
|
31
|
+
typeName: null
|
|
32
|
+
}, {
|
|
33
|
+
code: 'ciType:name',
|
|
34
|
+
name: '资源类型',
|
|
35
|
+
typeName: null
|
|
36
|
+
}, {
|
|
37
|
+
code: 'attr:ipv4_address',
|
|
38
|
+
name: 'IPv4地址',
|
|
39
|
+
typeName: '属性'
|
|
40
|
+
}, {
|
|
41
|
+
code: 'metric:ping_status',
|
|
42
|
+
name: 'ping状态',
|
|
43
|
+
typeName: '指标'
|
|
44
|
+
}]
|
|
45
|
+
}];
|
|
46
|
+
return /*#__PURE__*/React.createElement(AttributeSelectDrawer, {
|
|
47
|
+
visible: true,
|
|
48
|
+
value: {} // 示例: {'switch': ['graph:name','ciType:name'], ...}
|
|
49
|
+
,
|
|
50
|
+
dataSource: dataSource // key为监控模板code,value为配置项列表
|
|
51
|
+
,
|
|
52
|
+
limit: 3 // 单个模板最大可选择选项数量
|
|
53
|
+
,
|
|
54
|
+
onChange: function onChange(value) {
|
|
55
|
+
console.log('onChange');
|
|
56
|
+
},
|
|
57
|
+
onCancel: function onCancel() {
|
|
58
|
+
console.log('onCancel');
|
|
59
|
+
},
|
|
60
|
+
showType: "tip" // 数据类型。
|
|
61
|
+
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -12,7 +12,8 @@ var ResourceDiplayInfoSetting = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
12
12
|
elementType = props.elementType,
|
|
13
13
|
showType = props.showType,
|
|
14
14
|
limit = props.limit,
|
|
15
|
-
onChange = props.onChange
|
|
15
|
+
onChange = props.onChange,
|
|
16
|
+
queryData = props.queryData;
|
|
16
17
|
var batchAttrMetric = useRef();
|
|
17
18
|
|
|
18
19
|
var _useState = useState({}),
|
|
@@ -29,38 +30,13 @@ var ResourceDiplayInfoSetting = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
29
30
|
allLinkModSet = resAndMetrics.allLinkModSet;
|
|
30
31
|
|
|
31
32
|
var openMarkSetting = function openMarkSetting(parm) {
|
|
32
|
-
// rlog.debug('openMarkSetting', parm, allCiSet, ciSetDoc, setConfig,allCiModSet,allLinkModSet);
|
|
33
33
|
rlog.debug("openMarkSetting", parm, elementType, showType, allCiModSet, allLinkModSet);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// } else {
|
|
41
|
-
// const setObj = {};
|
|
42
|
-
// if (ciSetDoc?.hasOwnProperty(parm.ciId)) {
|
|
43
|
-
// setObj[parm.ciId] = {
|
|
44
|
-
// ...ciSetDoc[parm.ciId],
|
|
45
|
-
// tag: ((ciSetDoc[parm.ciId] || {}).tag || []).map((t) => {
|
|
46
|
-
// // return t.split('-')[0];
|
|
47
|
-
// return t.code;
|
|
48
|
-
// }),
|
|
49
|
-
// tip: ((ciSetDoc[parm.ciId] || {}).tip || []).map((t) => {
|
|
50
|
-
// return t.code;
|
|
51
|
-
// }),
|
|
52
|
-
// };
|
|
53
|
-
// } else {
|
|
54
|
-
// setObj[parm.ciId] = {
|
|
55
|
-
// code: '',
|
|
56
|
-
// list: [],
|
|
57
|
-
// tag: [],
|
|
58
|
-
// tip: [],
|
|
59
|
-
// };
|
|
60
|
-
// }
|
|
61
|
-
// rlog.debug('setMarkarkData', setObj);
|
|
62
|
-
// setMarkarkData(setObj);
|
|
63
|
-
// }
|
|
34
|
+
|
|
35
|
+
if (queryData) {
|
|
36
|
+
setMarkarkData(queryData());
|
|
37
|
+
} else {
|
|
38
|
+
setMarkarkData(elementType === "node" ? allCiModSet : allLinkModSet);
|
|
39
|
+
}
|
|
64
40
|
|
|
65
41
|
batchAttrMetric.current.show({
|
|
66
42
|
showType: showType
|
|
@@ -83,22 +59,7 @@ var ResourceDiplayInfoSetting = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
83
59
|
isCustom: true,
|
|
84
60
|
data: parm
|
|
85
61
|
});
|
|
86
|
-
}
|
|
87
|
-
// let ciDoc = {};
|
|
88
|
-
// let allCiset = allCiSet;
|
|
89
|
-
// if (selectType === 'single') {
|
|
90
|
-
// const singleResult = updateCiDoc(dataType, parm, doc, allCiSet);
|
|
91
|
-
// ciDoc = singleResult.cidoc;
|
|
92
|
-
// allCiset = singleResult.allciset;
|
|
93
|
-
// } else {
|
|
94
|
-
// const allResult = updateAllCiDoc(dataType, parm, doc, allCiSet);
|
|
95
|
-
// ciDoc = allResult.cidoc;
|
|
96
|
-
// allCiset = allResult.allciset;
|
|
97
|
-
// }
|
|
98
|
-
// rlog.debug('saveMarkSetting', {parm, allCiSet, ciDoc, allCiset});
|
|
99
|
-
// topo.view.topoClient.setTagAndTipConfig(ciDoc);
|
|
100
|
-
// bizDispatchers.update({ ciSetDoc: ciDoc, setConfig: allCiset });
|
|
101
|
-
|
|
62
|
+
}
|
|
102
63
|
};
|
|
103
64
|
|
|
104
65
|
useImperativeHandle(ref, function () {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useState, useEffect, useRef, useCallback } from
|
|
3
|
-
import PropTypes from
|
|
4
|
-
import classnames from
|
|
5
|
-
import TopoGraph, { TopoEvent } from
|
|
6
|
-
import rlog from
|
|
2
|
+
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
import TopoGraph, { TopoEvent } from '@riil-frontend/component-topology-graph';
|
|
6
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
7
7
|
import useTopoEdit from "../../hooks/useTopoEdit";
|
|
8
8
|
import useSelection from "../../hooks/useSelection";
|
|
9
9
|
import showMessage from "../../utils/showMessage";
|
|
@@ -48,16 +48,16 @@ var Topology = function Topology(props) {
|
|
|
48
48
|
topo.viewProps = props;
|
|
49
49
|
var store = topo.store;
|
|
50
50
|
|
|
51
|
-
var _store$useModel = store.useModel(
|
|
51
|
+
var _store$useModel = store.useModel('topoMod'),
|
|
52
52
|
topoState = _store$useModel[0],
|
|
53
53
|
topoDispatchers = _store$useModel[1];
|
|
54
54
|
|
|
55
|
-
var bizDispatchers = store.useModelDispatchers(
|
|
55
|
+
var bizDispatchers = store.useModelDispatchers('topoBizMod');
|
|
56
56
|
var topoId = topoState.topoId,
|
|
57
57
|
viewState = topoState.viewState,
|
|
58
58
|
topoData = topoState.topoData,
|
|
59
59
|
urlParams = topoState.urlParams;
|
|
60
|
-
var isEditMode = viewState ===
|
|
60
|
+
var isEditMode = viewState === 'edit';
|
|
61
61
|
var topoShowType = topoState.type;
|
|
62
62
|
var isLayerTopo = topoShowType === TPL_TREE;
|
|
63
63
|
|
|
@@ -97,7 +97,7 @@ var Topology = function Topology(props) {
|
|
|
97
97
|
topo: topo
|
|
98
98
|
});
|
|
99
99
|
useEffect(function () {
|
|
100
|
-
if (viewState ===
|
|
100
|
+
if (viewState === 'view' && topoId) {
|
|
101
101
|
// TODO 移到模型中
|
|
102
102
|
// rlog.debug('useEffect-viewState', topoId, viewState);
|
|
103
103
|
setTData(null);
|
|
@@ -120,7 +120,7 @@ var Topology = function Topology(props) {
|
|
|
120
120
|
}, []);
|
|
121
121
|
var onGraphCreated = useCallback(function (topoClient) {
|
|
122
122
|
topo.view.onCreatedView(topoClient);
|
|
123
|
-
rlog.info(
|
|
123
|
+
rlog.info('TopoView.onGraphCreated');
|
|
124
124
|
initSelection();
|
|
125
125
|
|
|
126
126
|
if (onReady) {
|
|
@@ -128,22 +128,27 @@ var Topology = function Topology(props) {
|
|
|
128
128
|
}
|
|
129
129
|
}, []);
|
|
130
130
|
var handleGraphDataLoaded = useCallback(function () {
|
|
131
|
-
rlog.info(
|
|
131
|
+
rlog.info('TopoView.handleGraphDataLoaded', topoData, topo.getDataModel().getDatas().toArray());
|
|
132
132
|
upgradeV103GraphClusterNode(topo, topoData);
|
|
133
133
|
fixLink(topo);
|
|
134
134
|
handleClusterNoPermission(topo);
|
|
135
135
|
updateEdgeExpanded(topo);
|
|
136
|
+
var htHistoryManager = topo.getDataModel().getHistoryManager();
|
|
137
|
+
|
|
138
|
+
if (htHistoryManager) {
|
|
139
|
+
topo.historyManager = new HistoryManager(topo, htHistoryManager);
|
|
140
|
+
}
|
|
141
|
+
|
|
136
142
|
topoDispatchers.update({
|
|
137
143
|
graphLoaded2: true
|
|
138
144
|
});
|
|
139
|
-
topo.historyManager = new HistoryManager(topo);
|
|
140
145
|
|
|
141
146
|
if (onLoad) {
|
|
142
147
|
onLoad();
|
|
143
148
|
}
|
|
144
149
|
}, [topoData]);
|
|
145
150
|
var handleGraphLoaded = useCallback(function () {
|
|
146
|
-
rlog.info(
|
|
151
|
+
rlog.info('TopoView.handleGraphLoaded', topoData, topo.getDataModel().getDatas().toArray());
|
|
147
152
|
upgradeV103GraphClusterNode(topo, topoData);
|
|
148
153
|
fixLink(topo);
|
|
149
154
|
handleClusterNoPermission(topo);
|
|
@@ -162,7 +167,7 @@ var Topology = function Topology(props) {
|
|
|
162
167
|
}, [topoData]); // TODO 之后把事件方法都转移出去
|
|
163
168
|
|
|
164
169
|
var rightEventHandle = function rightEventHandle(event) {
|
|
165
|
-
rlog.debug(
|
|
170
|
+
rlog.debug('右键事件', event);
|
|
166
171
|
var contextMenu = topo.view.contextMenu;
|
|
167
172
|
|
|
168
173
|
if (contextMenu.containsCommand(event.data.id)) {
|
|
@@ -171,7 +176,7 @@ var Topology = function Topology(props) {
|
|
|
171
176
|
};
|
|
172
177
|
|
|
173
178
|
var onRefresh = function onRefresh(e) {
|
|
174
|
-
rlog.debug(
|
|
179
|
+
rlog.debug('TopoView:onRefresh', e);
|
|
175
180
|
onRefreshTopo ? onRefreshTopo() : topoDispatchers.refreshTopo();
|
|
176
181
|
};
|
|
177
182
|
/**
|
|
@@ -181,7 +186,7 @@ var Topology = function Topology(props) {
|
|
|
181
186
|
|
|
182
187
|
|
|
183
188
|
var handleEvent = function handleEvent(event) {
|
|
184
|
-
rlog.debug(
|
|
189
|
+
rlog.debug('TopoView:onEvent', event);
|
|
185
190
|
onEvent && onEvent(event);
|
|
186
191
|
topoEdit.onEvent(event);
|
|
187
192
|
|
|
@@ -220,7 +225,7 @@ var Topology = function Topology(props) {
|
|
|
220
225
|
break;
|
|
221
226
|
|
|
222
227
|
case TopoEvent.EVENT_CONTEXT_TOOL:
|
|
223
|
-
rlog.debug(
|
|
228
|
+
rlog.debug('自定义工具栏事件', event);
|
|
224
229
|
break;
|
|
225
230
|
|
|
226
231
|
default:
|
|
@@ -251,7 +256,10 @@ var Topology = function Topology(props) {
|
|
|
251
256
|
onEnterEdit: onEnterEdit,
|
|
252
257
|
topoEditApi: topoEdit
|
|
253
258
|
})), /*#__PURE__*/React.createElement("div", {
|
|
254
|
-
className: classnames(styles.viewPanel, (_classnames = {}, _classnames[styles.viewPanelEditMode] = isEditMode, _classnames))
|
|
259
|
+
className: classnames(styles.viewPanel, (_classnames = {}, _classnames[styles.viewPanelEditMode] = isEditMode, _classnames)),
|
|
260
|
+
onKeyDown: function onKeyDown(e) {
|
|
261
|
+
topo.historyManager && topo.historyManager.handleKeyDown(e);
|
|
262
|
+
}
|
|
255
263
|
}, /*#__PURE__*/React.createElement(TopoGraph, _extends({}, graphViewProps, {
|
|
256
264
|
createHtTopoProps: _extends({}, graphViewProps.createHtTopoProps, {
|
|
257
265
|
editor: _extends({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {})
|
|
@@ -266,10 +274,10 @@ var Topology = function Topology(props) {
|
|
|
266
274
|
onDestroy: onDestroy,
|
|
267
275
|
onEvent: handleEvent,
|
|
268
276
|
style: {
|
|
269
|
-
width:
|
|
270
|
-
height:
|
|
271
|
-
position:
|
|
272
|
-
overflow:
|
|
277
|
+
width: '100%',
|
|
278
|
+
height: '100%',
|
|
279
|
+
position: 'relative',
|
|
280
|
+
overflow: 'hidden'
|
|
273
281
|
},
|
|
274
282
|
debugId: topo.debugId
|
|
275
283
|
}))), !isEditMode && /*#__PURE__*/React.createElement(ViewerPlugin, {
|
|
@@ -316,4 +324,5 @@ Topology.defaultProps = {
|
|
|
316
324
|
topoContext: {} // titleBar: false,
|
|
317
325
|
|
|
318
326
|
};
|
|
327
|
+
Topology.displayName = 'Topology';
|
|
319
328
|
export default Topology;
|
|
@@ -131,25 +131,25 @@ export default function BackgroundView(props) {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
function _getBackground() {
|
|
134
|
-
_getBackground = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
134
|
+
_getBackground = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
135
135
|
var res;
|
|
136
|
-
return _regeneratorRuntime.wrap(function
|
|
136
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
137
137
|
while (1) {
|
|
138
|
-
switch (
|
|
138
|
+
switch (_context4.prev = _context4.next) {
|
|
139
139
|
case 0:
|
|
140
|
-
|
|
140
|
+
_context4.next = 2;
|
|
141
141
|
return api.getBackgroundList();
|
|
142
142
|
|
|
143
143
|
case 2:
|
|
144
|
-
res =
|
|
144
|
+
res = _context4.sent;
|
|
145
145
|
setBgList(res);
|
|
146
146
|
|
|
147
147
|
case 4:
|
|
148
148
|
case "end":
|
|
149
|
-
return
|
|
149
|
+
return _context4.stop();
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
},
|
|
152
|
+
}, _callee4);
|
|
153
153
|
}));
|
|
154
154
|
return _getBackground.apply(this, arguments);
|
|
155
155
|
}
|
|
@@ -160,34 +160,42 @@ export default function BackgroundView(props) {
|
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
function _removeBg() {
|
|
163
|
-
_removeBg = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
163
|
+
_removeBg = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id) {
|
|
164
164
|
var res;
|
|
165
|
-
return _regeneratorRuntime.wrap(function
|
|
165
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
166
166
|
while (1) {
|
|
167
|
-
switch (
|
|
167
|
+
switch (_context5.prev = _context5.next) {
|
|
168
168
|
case 0:
|
|
169
|
-
|
|
169
|
+
_context5.next = 2;
|
|
170
170
|
return api.deleteBackground(id);
|
|
171
171
|
|
|
172
172
|
case 2:
|
|
173
|
-
res =
|
|
173
|
+
res = _context5.sent;
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
setHtTopoBackground(null);
|
|
175
|
+
if (!(id === (current === null || current === void 0 ? void 0 : current.id))) {
|
|
176
|
+
_context5.next = 9;
|
|
177
|
+
break;
|
|
179
178
|
}
|
|
180
179
|
|
|
180
|
+
topo.historyManager.setDisabled(true, '删除背景');
|
|
181
|
+
_context5.next = 7;
|
|
182
|
+
return reset();
|
|
183
|
+
|
|
184
|
+
case 7:
|
|
185
|
+
setHtTopoBackground(null);
|
|
186
|
+
topo.historyManager.setDisabled(false, '删除背景');
|
|
187
|
+
|
|
188
|
+
case 9:
|
|
181
189
|
getBackground();
|
|
182
190
|
|
|
183
191
|
_Message.success('删除成功');
|
|
184
192
|
|
|
185
|
-
case
|
|
193
|
+
case 11:
|
|
186
194
|
case "end":
|
|
187
|
-
return
|
|
195
|
+
return _context5.stop();
|
|
188
196
|
}
|
|
189
197
|
}
|
|
190
|
-
},
|
|
198
|
+
}, _callee5);
|
|
191
199
|
}));
|
|
192
200
|
return _removeBg.apply(this, arguments);
|
|
193
201
|
}
|
|
@@ -204,36 +212,43 @@ export default function BackgroundView(props) {
|
|
|
204
212
|
switch (_context2.prev = _context2.next) {
|
|
205
213
|
case 0:
|
|
206
214
|
if (!(currentBg !== null && currentBg !== void 0 && currentBg.id && currentBg.id !== (current === null || current === void 0 ? void 0 : current.id))) {
|
|
207
|
-
_context2.next =
|
|
215
|
+
_context2.next = 19;
|
|
208
216
|
break;
|
|
209
217
|
}
|
|
210
218
|
|
|
211
219
|
setLoadingBackground(true);
|
|
220
|
+
topo.historyManager.beginTransaction();
|
|
212
221
|
imgUrl = getBackgroundImageUrl(currentBg);
|
|
213
|
-
_context2.prev =
|
|
214
|
-
_context2.next =
|
|
222
|
+
_context2.prev = 4;
|
|
223
|
+
_context2.next = 7;
|
|
215
224
|
return getImageSize(imgUrl);
|
|
216
225
|
|
|
217
|
-
case
|
|
226
|
+
case 7:
|
|
218
227
|
size = _context2.sent;
|
|
219
228
|
rlog.debug('获取图片大小', size);
|
|
220
|
-
|
|
229
|
+
_context2.next = 11;
|
|
230
|
+
return setBackground(_extends({}, currentBg, size));
|
|
231
|
+
|
|
232
|
+
case 11:
|
|
221
233
|
topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
|
|
222
|
-
|
|
223
|
-
_context2.next = 16;
|
|
234
|
+
_context2.next = 17;
|
|
224
235
|
break;
|
|
225
236
|
|
|
226
|
-
case
|
|
227
|
-
_context2.prev =
|
|
228
|
-
_context2.t0 = _context2["catch"](
|
|
237
|
+
case 14:
|
|
238
|
+
_context2.prev = 14;
|
|
239
|
+
_context2.t0 = _context2["catch"](4);
|
|
240
|
+
rlog.error('设置背景失败', _context2.t0);
|
|
241
|
+
|
|
242
|
+
case 17:
|
|
243
|
+
topo.historyManager.endTransaction();
|
|
229
244
|
setLoadingBackground(false);
|
|
230
245
|
|
|
231
|
-
case
|
|
246
|
+
case 19:
|
|
232
247
|
case "end":
|
|
233
248
|
return _context2.stop();
|
|
234
249
|
}
|
|
235
250
|
}
|
|
236
|
-
}, _callee2, null, [[
|
|
251
|
+
}, _callee2, null, [[4, 14]]);
|
|
237
252
|
}));
|
|
238
253
|
|
|
239
254
|
return function handleSelect(_x4) {
|
|
@@ -241,16 +256,40 @@ export default function BackgroundView(props) {
|
|
|
241
256
|
};
|
|
242
257
|
}();
|
|
243
258
|
|
|
259
|
+
var resetDefault = /*#__PURE__*/function () {
|
|
260
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
261
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
262
|
+
while (1) {
|
|
263
|
+
switch (_context3.prev = _context3.next) {
|
|
264
|
+
case 0:
|
|
265
|
+
topo.historyManager.beginTransaction();
|
|
266
|
+
_context3.next = 3;
|
|
267
|
+
return reset();
|
|
268
|
+
|
|
269
|
+
case 3:
|
|
270
|
+
setHtTopoBackground(null);
|
|
271
|
+
topo.historyManager.endTransaction();
|
|
272
|
+
|
|
273
|
+
case 5:
|
|
274
|
+
case "end":
|
|
275
|
+
return _context3.stop();
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}, _callee3);
|
|
279
|
+
}));
|
|
280
|
+
|
|
281
|
+
return function resetDefault() {
|
|
282
|
+
return _ref2.apply(this, arguments);
|
|
283
|
+
};
|
|
284
|
+
}();
|
|
285
|
+
|
|
244
286
|
return /*#__PURE__*/React.createElement("div", {
|
|
245
287
|
className: styles['background-view']
|
|
246
288
|
}, /*#__PURE__*/React.createElement("div", {
|
|
247
289
|
className: styles.option
|
|
248
290
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
249
291
|
title: "\u6062\u590D\u9ED8\u8BA4",
|
|
250
|
-
onClick:
|
|
251
|
-
reset();
|
|
252
|
-
setHtTopoBackground(null);
|
|
253
|
-
}
|
|
292
|
+
onClick: resetDefault
|
|
254
293
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
255
294
|
type: "topo_button_icon_recovery"
|
|
256
295
|
})), /*#__PURE__*/React.createElement("a", {
|
|
@@ -88,9 +88,15 @@ var LineType = function LineType(props) {
|
|
|
88
88
|
|
|
89
89
|
var handleChange = function handleChange(data) {
|
|
90
90
|
console.log("handleChange", data);
|
|
91
|
-
|
|
91
|
+
topo.historyManager.beginTransaction();
|
|
92
|
+
|
|
93
|
+
if (onChange) {
|
|
94
|
+
onChange(data.value);
|
|
95
|
+
}
|
|
96
|
+
|
|
92
97
|
setValue(data.value);
|
|
93
98
|
setLineType(data.value);
|
|
99
|
+
topo.historyManager.endTransaction();
|
|
94
100
|
};
|
|
95
101
|
|
|
96
102
|
return /*#__PURE__*/React.createElement(_Box, {
|
|
@@ -6,7 +6,7 @@ import styles from "./FontStyleCheckbox.module.scss";
|
|
|
6
6
|
import b from "./img/bold.svg";
|
|
7
7
|
import i from "./img/italics.svg";
|
|
8
8
|
import u from "./img/underline.svg";
|
|
9
|
-
|
|
9
|
+
var FontStyleCheckbox = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
10
10
|
var value = props.value,
|
|
11
11
|
onChange = props.onChange;
|
|
12
12
|
var options = [{
|
|
@@ -46,5 +46,5 @@ export default function FontStyleCheckbox(props) {
|
|
|
46
46
|
alt: ""
|
|
47
47
|
}));
|
|
48
48
|
}));
|
|
49
|
-
}
|
|
50
|
-
;
|
|
49
|
+
});
|
|
50
|
+
export default FontStyleCheckbox;
|