@riil-frontend/component-topology 2.4.3 → 2.4.8

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 (43) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/build/1.js +2 -2
  3. package/build/2.js +1 -1
  4. package/build/index.css +1 -1
  5. package/build/index.html +1 -1
  6. package/build/index.js +19 -19
  7. package/es/core/components/TopoView/TopoView.module.scss +4 -0
  8. package/es/core/components/TopoView/topoView.js +3 -2
  9. package/es/core/components/titlebar/TitleBar.module.scss +1 -11
  10. package/es/core/editor/components/settings/Settings.js +4 -1
  11. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.d.ts +12 -1
  12. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +125 -24
  13. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.module.scss +5 -0
  14. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeNumberPicker.d.ts +7 -0
  15. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeNumberPicker.js +73 -0
  16. package/es/core/editor/components/settings/common/text/TextStyle.js +1 -1
  17. package/es/core/editor/components/settings/node/NodePropertyView.js +5 -12
  18. package/es/core/editor/components/settings/useSettingRuntimeState.d.ts +5 -0
  19. package/es/core/editor/components/settings/useSettingRuntimeState.js +23 -0
  20. package/es/core/editor/components/settings/view/BatchSetNodeSize.d.ts +1 -0
  21. package/es/core/editor/components/settings/view/BatchSetNodeSize.js +8 -0
  22. package/es/core/editor/components/settings/view/ViewPropertyView.js +5 -17
  23. package/es/models/topoMod.js +6 -18
  24. package/es/topoCenter/store/topoCenter.js +15 -2
  25. package/lib/core/components/TopoView/TopoView.module.scss +4 -0
  26. package/lib/core/components/TopoView/topoView.js +4 -2
  27. package/lib/core/components/titlebar/TitleBar.module.scss +1 -11
  28. package/lib/core/editor/components/settings/Settings.js +5 -1
  29. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.d.ts +12 -1
  30. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +132 -24
  31. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.module.scss +5 -0
  32. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeNumberPicker.d.ts +7 -0
  33. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeNumberPicker.js +87 -0
  34. package/lib/core/editor/components/settings/common/text/TextStyle.js +1 -1
  35. package/lib/core/editor/components/settings/node/NodePropertyView.js +6 -18
  36. package/lib/core/editor/components/settings/useSettingRuntimeState.d.ts +5 -0
  37. package/lib/core/editor/components/settings/useSettingRuntimeState.js +32 -0
  38. package/lib/core/editor/components/settings/view/BatchSetNodeSize.d.ts +1 -0
  39. package/lib/core/editor/components/settings/view/BatchSetNodeSize.js +20 -0
  40. package/lib/core/editor/components/settings/view/ViewPropertyView.js +5 -24
  41. package/lib/models/topoMod.js +6 -18
  42. package/lib/topoCenter/store/topoCenter.js +15 -2
  43. package/package.json +13 -13
@@ -10,6 +10,10 @@
10
10
  flex: 1;
11
11
  overflow: hidden;
12
12
  position: relative;
13
+
14
+ &.viewPanelEditMode {
15
+ border-top: 1px solid #E6E7EB;
16
+ }
13
17
  }
14
18
 
15
19
  // 解决拓扑图容器绝对定位z-index>0时浮层和右键菜单不显示问题
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useEffect, useRef, useCallback } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import classnames from 'classnames';
3
4
  import TopoContainer, { TopoEvent } from '@riil-frontend/component-topology-graph';
4
5
  import rlog from '@riil-frontend/component-topology-utils/es/utils/rlog';
5
6
  import useTopoEdit from "../../../hooks/useTopoEdit";
@@ -17,7 +18,7 @@ import styles from "./TopoView.module.scss";
17
18
  import Settings from "../../editor/components/settings/Settings";
18
19
 
19
20
  var TopoView = function TopoView(props) {
20
- var _topoApp$options$edit;
21
+ var _classnames, _topoApp$options$edit;
21
22
 
22
23
  var engine = props.engine,
23
24
  topo = props.topo,
@@ -209,7 +210,7 @@ var TopoView = function TopoView(props) {
209
210
  topoEditApi: topoEditApi,
210
211
  onEnterEdit: onEnterEdit
211
212
  })), /*#__PURE__*/React.createElement("div", {
212
- className: styles.viewPanel
213
+ className: classnames(styles.viewPanel, (_classnames = {}, _classnames[styles.viewPanelEditMode] = isEditMode, _classnames))
213
214
  }, /*#__PURE__*/React.createElement(TopoContainer, {
214
215
  debugId: topoApp.debugId,
215
216
  data: tData,
@@ -1,6 +1,6 @@
1
1
  .titlebar {
2
2
  display: flex;
3
- padding: 12px 16px;
3
+ padding: 16px;
4
4
 
5
5
  .left {
6
6
  flex: 1;
@@ -13,8 +13,6 @@
13
13
 
14
14
  &.titlebarEditMode {
15
15
  padding: 10px 16px;
16
- box-shadow: 0px -1px 0px 0px #EBE8E8;
17
- border-bottom: 1px solid #E6E7EB;
18
16
  }
19
17
 
20
18
  }
@@ -34,12 +32,4 @@
34
32
 
35
33
  .moreMenuButton {
36
34
  margin-left: 8px;
37
- width: 28px;
38
- height: 28px;
39
-
40
- :global {
41
- .next-menu-btn-arrow {
42
- display: none;
43
- }
44
- }
45
35
  }
@@ -8,6 +8,7 @@ import TextPropertyView from "./text/TextPropertyView";
8
8
  import NodePropertyView from "./node/NodePropertyView";
9
9
  import ViewPropertyView from "./view/ViewPropertyView";
10
10
  import LinkPropertyView from "./link/LinkPropertyView";
11
+ import useSettingRuntimeState from "./useSettingRuntimeState";
11
12
 
12
13
  function getElementType(selection) {
13
14
  var selectionElement = selection[0];
@@ -37,6 +38,7 @@ export default function Settings(props) {
37
38
  topoEditApi = props.topoEditApi,
38
39
  selection = props.selection,
39
40
  editorProps = props.editorProps;
41
+ var settingRuntimeState = useSettingRuntimeState();
40
42
  var selectionSize = selection.length;
41
43
  var selectionIds = selection.map(function (item) {
42
44
  return item.id;
@@ -112,7 +114,8 @@ export default function Settings(props) {
112
114
  selection: selection,
113
115
  values: values,
114
116
  onChange: updateElementProperty,
115
- editorProps: editorProps
117
+ editorProps: editorProps,
118
+ settingRuntimeState: settingRuntimeState
116
119
  })));
117
120
  }
118
121
  ;
@@ -1 +1,12 @@
1
- export default function NodeSizeInput(props: any): JSX.Element;
1
+ export default NodeSizeInput;
2
+ /**
3
+ * 节点大小组件
4
+ *
5
+ * 文本框失去焦点、按enter键、点击加减按钮时节点大小变化
6
+ */
7
+ declare function NodeSizeInput(props: any): JSX.Element;
8
+ declare namespace NodeSizeInput {
9
+ export namespace propTypes {
10
+ export const value: any;
11
+ }
12
+ }
@@ -1,54 +1,155 @@
1
- import _NumberPicker from "@alifd/next/lib/number-picker";
2
- import _Field from "@alifd/next/lib/field";
1
+ import _extends from "@babel/runtime/helpers/extends";
3
2
  import _Grid from "@alifd/next/lib/grid";
4
3
  import _Form from "@alifd/next/lib/form";
5
- import React, { useState, useEffect, useRef, useCallback } from 'react';
4
+ import React, { useState } from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import NodeSizeNumberPicker from "./NodeSizeNumberPicker";
7
+ import styles from "./NodeSizeInput.module.scss";
8
+ import rlog from "@riil-frontend/component-topology-utils/es/utils/rlog";
6
9
  var FormItem = _Form.Item;
7
10
  var Row = _Grid.Row,
8
11
  Col = _Grid.Col;
9
- export default function NodeSizeInput(props) {
10
- var value = props.value,
11
- _onChange = props.onChange;
12
-
13
- var field = _Field.useField({
14
- autoUnmount: false,
15
- values: value,
16
- onChange: function onChange(name, value) {
17
- _onChange(field.getValues());
12
+ var NODE_SIZE_LOCK = 'NODE_SIZE_LOCK';
13
+ /**
14
+ * 节点大小组件
15
+ *
16
+ * 文本框失去焦点、按enter键、点击加减按钮时节点大小变化
17
+ */
18
+
19
+ function NodeSizeInput(props) {
20
+ var node = props.node,
21
+ value = props.value,
22
+ onChange = props.onChange,
23
+ settingRuntimeState = props.settingRuntimeState;
24
+ var lock = settingRuntimeState.getAttr(NODE_SIZE_LOCK) !== false;
25
+ var RUNTIME_STATE_NAME_NODE_SIZE_INFO = "NODE_SIZE_INFO." + node.id;
26
+
27
+ var handleValue = function handleValue(val) {
28
+ if (!val || val < 1) {
29
+ return 1;
30
+ }
31
+
32
+ if (val > 2000) {
33
+ return 2000;
18
34
  }
19
- });
20
35
 
21
- useEffect(function () {
22
- field.setValues(value);
23
- }, [value]);
36
+ return parseInt(val);
37
+ };
38
+
39
+ function initSizeRatio() {
40
+ var ratioInfo = {
41
+ ratio: value.width / value.height,
42
+ size: value
43
+ };
44
+ updateSizeRatioCurrentSize(ratioInfo);
45
+ rlog.debug('initSizeRatio', ratioInfo);
46
+ return ratioInfo;
47
+ }
48
+
49
+ function updateSizeRatioCurrentSize(ratioInfo) {
50
+ settingRuntimeState.setAttr(RUNTIME_STATE_NAME_NODE_SIZE_INFO, ratioInfo);
51
+ return ratioInfo;
52
+ }
53
+
54
+ function getSizeRatio() {
55
+ return settingRuntimeState.getAttr(RUNTIME_STATE_NAME_NODE_SIZE_INFO);
56
+ }
57
+
58
+ var handleChange = function handleChange(name, attrValue) {
59
+ var _extends2;
60
+
61
+ var newSize = _extends({}, value, (_extends2 = {}, _extends2[name] = attrValue, _extends2));
62
+
63
+ if (lock) {
64
+ var ratioInfo = getSizeRatio();
65
+
66
+ if (!ratioInfo) {
67
+ // 首次没有比例时,初始化当前节点比例
68
+ ratioInfo = initSizeRatio();
69
+ rlog.debug('首次没有比例时,初始化当前节点比例', ratioInfo);
70
+ } else {
71
+ // 修改后,非锁定方式调整比例(画图调整节点大小,未开启锁定修改),重新初始化比例
72
+ var prevSize = ratioInfo.size;
73
+
74
+ if (value.width !== prevSize.width || value.height !== prevSize.height) {
75
+ ratioInfo = initSizeRatio();
76
+ rlog.debug('修改后,重新初始化比例', ratioInfo);
77
+ }
78
+ }
79
+
80
+ var ratio = ratioInfo.ratio;
81
+
82
+ if (name === 'width') {
83
+ newSize.height = handleValue(attrValue / ratio);
84
+ } else {
85
+ newSize.width = handleValue(attrValue * ratio);
86
+ }
87
+
88
+ updateSizeRatioCurrentSize({
89
+ ratio: ratio,
90
+ size: newSize
91
+ });
92
+ rlog.debug('按比例更新', name, attrValue, ratio, value, newSize, ratioInfo);
93
+ }
94
+
95
+ onChange(newSize);
96
+ };
97
+
98
+ var switchLock = function switchLock() {
99
+ var isLock = !lock;
100
+ settingRuntimeState.setAttr(NODE_SIZE_LOCK, isLock);
101
+ };
102
+
103
+ function parseValue(val) {
104
+ return val ? parseInt(val) : val;
105
+ }
106
+
24
107
  return /*#__PURE__*/React.createElement(_Form, {
25
- field: field,
26
108
  labelAlign: "top",
27
109
  component: "div"
28
110
  }, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(Row, {
29
- gutter: "16"
111
+ gutter: "0"
30
112
  }, /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(FormItem, {
31
113
  required: true,
32
114
  requiredTrigger: "onBlur"
33
- }, /*#__PURE__*/React.createElement(_NumberPicker, {
34
- name: "width",
115
+ }, /*#__PURE__*/React.createElement(NodeSizeNumberPicker, {
116
+ value: parseValue(value.width),
117
+ label: "\u5BBD:",
35
118
  min: 1,
36
119
  max: 2000,
37
120
  placeholder: "\u8BF7\u8F93\u5165",
38
121
  style: {
39
122
  width: '100%'
123
+ },
124
+ onChange: function onChange(val) {
125
+ return handleChange('width', val);
40
126
  }
41
- }))), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(FormItem, {
127
+ }))), /*#__PURE__*/React.createElement("div", {
128
+ className: styles.lockBtn,
129
+ onClick: switchLock
130
+ }, /*#__PURE__*/React.createElement("img", {
131
+ src: require(lock ? './img/icon_锁.svg' : './img/icon_解锁.svg'),
132
+ alt: ""
133
+ })), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(FormItem, {
42
134
  required: true,
43
135
  requiredTrigger: "onBlur"
44
- }, /*#__PURE__*/React.createElement(_NumberPicker, {
45
- name: "height",
136
+ }, /*#__PURE__*/React.createElement(NodeSizeNumberPicker, {
137
+ value: parseValue(value.height),
138
+ label: "\u9AD8:",
46
139
  min: 1,
47
140
  max: 2000,
48
141
  placeholder: "\u8BF7\u8F93\u5165",
49
142
  style: {
50
143
  width: '100%'
144
+ },
145
+ onChange: function onChange(val) {
146
+ return handleChange('height', val);
51
147
  }
52
148
  }))))));
53
149
  }
54
- ;
150
+
151
+ ;
152
+ NodeSizeInput.propTypes = {
153
+ value: PropTypes.object
154
+ };
155
+ export default NodeSizeInput;
@@ -0,0 +1,5 @@
1
+ .lockBtn {
2
+ height: 28px;
3
+ margin: 6px 10px 0 10px;
4
+ cursor: pointer;
5
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 节点大小组件
3
+ *
4
+ * 文本框失去焦点、按enter键、点击加减按钮时节点大小变化
5
+ * 最大最小值限制
6
+ */
7
+ export default function NodeSizeNumberPicker(props: any): JSX.Element;
@@ -0,0 +1,73 @@
1
+ import _NumberPicker from "@alifd/next/lib/number-picker";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
4
+ var _excluded = ["value", "onChange", "min", "onBlur", "onKeyDown"];
5
+ import React, { useState, useEffect } from 'react';
6
+
7
+ /**
8
+ * 节点大小组件
9
+ *
10
+ * 文本框失去焦点、按enter键、点击加减按钮时节点大小变化
11
+ * 最大最小值限制
12
+ */
13
+ export default function NodeSizeNumberPicker(props) {
14
+ var value = props.value,
15
+ onChange = props.onChange,
16
+ min = props.min,
17
+ onBlur = props.onBlur,
18
+ onKeyDown = props.onKeyDown,
19
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
20
+
21
+ var _useState = useState(value),
22
+ inputValue = _useState[0],
23
+ setInputValue = _useState[1];
24
+
25
+ useEffect(function () {
26
+ setInputValue(value);
27
+ }, [value]);
28
+
29
+ var handleBlur = function handleBlur(e) {
30
+ if (inputValue !== value) {
31
+ onChange(inputValue);
32
+ }
33
+
34
+ onBlur && onBlur(e);
35
+ };
36
+
37
+ var handleKeyDown = function handleKeyDown(e) {
38
+ if (e.keyCode === 13 || e.keyCode === 27) {
39
+ if (inputValue !== value) {
40
+ onChange(inputValue);
41
+ }
42
+ }
43
+
44
+ if (onKeyDown) {
45
+ onKeyDown(e);
46
+ }
47
+ };
48
+
49
+ var handleChange = function handleChange(value, e) {
50
+ // 失去焦点最大最小值
51
+ if (e.type === 'blur') {
52
+ onChange(!value ? min : value);
53
+ return;
54
+ } // 加减号立即变更
55
+
56
+
57
+ if (e.triggerType === 'up' || e.triggerType === 'down') {
58
+ onChange(value);
59
+ return;
60
+ }
61
+
62
+ setInputValue(value);
63
+ };
64
+
65
+ return /*#__PURE__*/React.createElement(_NumberPicker, _extends({}, otherProps, {
66
+ value: inputValue,
67
+ min: min,
68
+ onChange: handleChange,
69
+ onBlur: handleBlur,
70
+ onKeyDown: handleKeyDown
71
+ }));
72
+ }
73
+ ;
@@ -100,7 +100,7 @@ export default function TextStyle(props) {
100
100
  }, /*#__PURE__*/React.createElement(_NumberPicker, {
101
101
  name: "fontSize",
102
102
  min: 8,
103
- max: 36,
103
+ max: 100,
104
104
  style: {
105
105
  width: '100%',
106
106
  marginRight: 8
@@ -1,27 +1,18 @@
1
1
  import _Tab from "@alifd/next/lib/tab";
2
2
  import _Input from "@alifd/next/lib/input";
3
+ import _Form from "@alifd/next/lib/form";
3
4
  import _Field from "@alifd/next/lib/field";
4
5
  import _extends from "@babel/runtime/helpers/extends";
5
- import _Radio from "@alifd/next/lib/radio";
6
6
  import _Collapse from "@alifd/next/lib/collapse";
7
7
  import _Select from "@alifd/next/lib/select";
8
- import _Grid from "@alifd/next/lib/grid";
9
- import _Form from "@alifd/next/lib/form";
10
8
  import React, { useState, useEffect } from 'react';
11
- import ColorPicker from "../../LinkDynamicStyleSettingDrawer/rule/ColorPicker";
12
- import ResourceSelectButton from "../group/GroupNodeList/ResourceSelectButton";
13
- import { getIconMap } from "../group/GroupNodeList/icon";
14
9
  import NodeSizeInput from "../common/NodeSizeInput/NodeSizeInput";
15
10
  import textStyles from "../../../../common/text.module.scss";
16
11
  import TopoTreeSelect from "./TopoTreeSelect";
17
12
  import NodeIconSelect from "./NodeIconSelect";
18
13
  import NodeRelateResourceButton from "./NodeRelateResourceButton";
19
- var FormItem = _Form.Item;
20
- var Row = _Grid.Row,
21
- Col = _Grid.Col;
22
14
  var Option = _Select.Option;
23
15
  var CollapsePanel = _Collapse.Panel;
24
- var RadioGroup = _Radio.Group;
25
16
 
26
17
  function parseValues(values) {
27
18
  return _extends({}, values);
@@ -46,7 +37,7 @@ export default function NodePropertyView(props) {
46
37
  topoEditApi = props.topoEditApi,
47
38
  values = props.values,
48
39
  _onChange = props.onChange,
49
- editorProps = props.editorProps;
40
+ settingRuntimeState = props.settingRuntimeState;
50
41
  var bindType = getBindType(values);
51
42
 
52
43
  var field = _Field.useField({
@@ -144,6 +135,7 @@ export default function NodePropertyView(props) {
144
135
  })), /*#__PURE__*/React.createElement(_Form.Item, {
145
136
  label: "\u56FE\u7247\u5C3A\u5BF8"
146
137
  }, /*#__PURE__*/React.createElement(NodeSizeInput, {
138
+ node: values,
147
139
  value: {
148
140
  width: values.width,
149
141
  height: values.height
@@ -152,7 +144,8 @@ export default function NodePropertyView(props) {
152
144
  _onChange('width', size.width);
153
145
 
154
146
  _onChange('height', size.height);
155
- }
147
+ },
148
+ settingRuntimeState: settingRuntimeState
156
149
  }))))));
157
150
  }; // 未绑定资源的节点,根据参数控制是否可关联资源
158
151
 
@@ -0,0 +1,5 @@
1
+ export default function _default(): {
2
+ state: {};
3
+ getAttr: (name: any) => any;
4
+ setAttr: (name: any, value: any) => void;
5
+ };
@@ -0,0 +1,23 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import { useState } from "react";
3
+ export default function () {
4
+ var _useState = useState({}),
5
+ state = _useState[0],
6
+ setState = _useState[1];
7
+
8
+ function setAttr(name, value) {
9
+ var _extends2;
10
+
11
+ setState(_extends({}, state, (_extends2 = {}, _extends2[name] = value, _extends2)));
12
+ }
13
+
14
+ function getAttr(name) {
15
+ return state[name];
16
+ }
17
+
18
+ return {
19
+ state: state,
20
+ getAttr: getAttr,
21
+ setAttr: setAttr
22
+ };
23
+ }
@@ -0,0 +1 @@
1
+ export default function BatchSetNodeSize(props: any): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React, { useState, useEffect, useRef, useCallback } from 'react';
2
+ import NodeSizeInput from "../common/NodeSizeInput/NodeSizeInput";
3
+ export default function BatchSetNodeSize(props) {
4
+ return /*#__PURE__*/React.createElement(NodeSizeInput, {
5
+ value: {}
6
+ });
7
+ }
8
+ ;
@@ -1,25 +1,13 @@
1
+ import _Form from "@alifd/next/lib/form";
1
2
  import _Field from "@alifd/next/lib/field";
2
3
  import _extends from "@babel/runtime/helpers/extends";
3
- import _Radio from "@alifd/next/lib/radio";
4
4
  import _Collapse from "@alifd/next/lib/collapse";
5
- import _Select from "@alifd/next/lib/select";
6
- import _Grid from "@alifd/next/lib/grid";
7
- import _Form from "@alifd/next/lib/form";
8
- import React, { useState, useEffect } from 'react';
9
- import ColorPicker from "../../LinkDynamicStyleSettingDrawer/rule/ColorPicker";
10
- import GroupNodeList from "../group/GroupNodeList/GroupNodeList";
11
- import ResourceSelectButton from "../group/GroupNodeList/ResourceSelectButton";
12
- import { getIconMap } from "../group/GroupNodeList/icon";
5
+ import React, { useEffect } from 'react';
13
6
  import LayoutSettings from "../common/LayoutSettings";
14
7
  import LineType from "../common/LineType";
15
8
  import NodeAlignType from "../common/NodeAlignType";
16
- import NodeSizeInput from "../common/NodeSizeInput/NodeSizeInput";
17
- var FormItem = _Form.Item;
18
- var Row = _Grid.Row,
19
- Col = _Grid.Col;
20
- var Option = _Select.Option;
21
- var CollapsePanel = _Collapse.Panel;
22
- var RadioGroup = _Radio.Group; // 字体样式格式 label.font: bold italic 12px 黑体 / 12px 黑体
9
+ import BatchSetNodeSize from "./BatchSetNodeSize";
10
+ var CollapsePanel = _Collapse.Panel; // 字体样式格式 label.font: bold italic 12px 黑体 / 12px 黑体
23
11
 
24
12
  var fontStyleUtil = {
25
13
  toMap: function toMap(font, prefix) {
@@ -113,5 +101,5 @@ export default function ViewPropertyView(props) {
113
101
  title: "\u56FE\u7247"
114
102
  }, /*#__PURE__*/React.createElement(_Form.Item, {
115
103
  label: "\u56FE\u7247\u5C3A\u5BF8"
116
- }, /*#__PURE__*/React.createElement(NodeSizeInput, null)))))));
104
+ }, /*#__PURE__*/React.createElement(BatchSetNodeSize, null)))))));
117
105
  }
@@ -133,8 +133,6 @@ export default function (topoApp) {
133
133
  var _this2 = this;
134
134
 
135
135
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
136
- var _data$config;
137
-
138
136
  var id, data, linkTo, viewState, topoId;
139
137
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
140
138
  while (1) {
@@ -142,7 +140,7 @@ export default function (topoApp) {
142
140
  case 0:
143
141
  id = playload.id, data = playload.data, linkTo = playload.linkTo;
144
142
  viewState = playload.mode || playload.viewState || 'view';
145
- topoId = id || (data === null || data === void 0 ? void 0 : (_data$config = data.config) === null || _data$config === void 0 ? void 0 : _data$config.id);
143
+ topoId = id || data.config.id;
146
144
 
147
145
  _this2.update({
148
146
  viewState: viewState,
@@ -151,34 +149,24 @@ export default function (topoApp) {
151
149
  topoPermission: undefined
152
150
  });
153
151
 
154
- if (id) {
155
- _context2.next = 7;
156
- break;
157
- }
158
-
159
- _this2.clearData();
160
-
161
- return _context2.abrupt("return");
162
-
163
- case 7:
164
- _context2.next = 9;
152
+ _context2.next = 6;
165
153
  return topoApp.open(topoId);
166
154
 
167
- case 9:
168
- _context2.next = 11;
155
+ case 6:
156
+ _context2.next = 8;
169
157
  return _this2.initTopoData({
170
158
  topoId: topoId,
171
159
  data: data,
172
160
  linkTo: linkTo
173
161
  });
174
162
 
175
- case 11:
163
+ case 8:
176
164
  if (viewState === 'edit') {
177
165
  // TODO 待优化进入编辑模式方式
178
166
  _this2.enterEditMode();
179
167
  }
180
168
 
181
- case 12:
169
+ case 9:
182
170
  case "end":
183
171
  return _context2.stop();
184
172
  }
@@ -189,10 +189,23 @@ export default {
189
189
  viewState: viewState || 'view'
190
190
  });
191
191
 
192
- _context4.next = 5;
192
+ if (!id) {
193
+ _context4.next = 8;
194
+ break;
195
+ }
196
+
197
+ _context4.next = 6;
193
198
  return dispatch.topoMod.openTopoPage(playload);
194
199
 
195
- case 5:
200
+ case 6:
201
+ _context4.next = 10;
202
+ break;
203
+
204
+ case 8:
205
+ _context4.next = 10;
206
+ return dispatch.topoMod.clearData();
207
+
208
+ case 10:
196
209
  case "end":
197
210
  return _context4.stop();
198
211
  }
@@ -10,6 +10,10 @@
10
10
  flex: 1;
11
11
  overflow: hidden;
12
12
  position: relative;
13
+
14
+ &.viewPanelEditMode {
15
+ border-top: 1px solid #E6E7EB;
16
+ }
13
17
  }
14
18
 
15
19
  // 解决拓扑图容器绝对定位z-index>0时浮层和右键菜单不显示问题
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
+ var _classnames2 = _interopRequireDefault(require("classnames"));
15
+
14
16
  var _componentTopologyGraph = _interopRequireWildcard(require("@riil-frontend/component-topology-graph"));
15
17
 
16
18
  var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/utils/rlog"));
@@ -42,7 +44,7 @@ var _TopoViewModule = _interopRequireDefault(require("./TopoView.module.scss"));
42
44
  var _Settings = _interopRequireDefault(require("../../editor/components/settings/Settings"));
43
45
 
44
46
  var TopoView = function TopoView(props) {
45
- var _topoApp$options$edit;
47
+ var _classnames, _topoApp$options$edit;
46
48
 
47
49
  var engine = props.engine,
48
50
  topo = props.topo,
@@ -243,7 +245,7 @@ var TopoView = function TopoView(props) {
243
245
  topoEditApi: topoEditApi,
244
246
  onEnterEdit: onEnterEdit
245
247
  })), /*#__PURE__*/_react["default"].createElement("div", {
246
- className: _TopoViewModule["default"].viewPanel
248
+ className: (0, _classnames2["default"])(_TopoViewModule["default"].viewPanel, (_classnames = {}, _classnames[_TopoViewModule["default"].viewPanelEditMode] = isEditMode, _classnames))
247
249
  }, /*#__PURE__*/_react["default"].createElement(_componentTopologyGraph["default"], {
248
250
  debugId: topoApp.debugId,
249
251
  data: tData,
@@ -1,6 +1,6 @@
1
1
  .titlebar {
2
2
  display: flex;
3
- padding: 12px 16px;
3
+ padding: 16px;
4
4
 
5
5
  .left {
6
6
  flex: 1;
@@ -13,8 +13,6 @@
13
13
 
14
14
  &.titlebarEditMode {
15
15
  padding: 10px 16px;
16
- box-shadow: 0px -1px 0px 0px #EBE8E8;
17
- border-bottom: 1px solid #E6E7EB;
18
16
  }
19
17
 
20
18
  }
@@ -34,12 +32,4 @@
34
32
 
35
33
  .moreMenuButton {
36
34
  margin-left: 8px;
37
- width: 28px;
38
- height: 28px;
39
-
40
- :global {
41
- .next-menu-btn-arrow {
42
- display: none;
43
- }
44
- }
45
35
  }