@riil-frontend/component-topology 2.4.2 → 2.4.6

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 (61) 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/{plugins → common/plugins}/useSelectionPlugin.d.ts +0 -0
  6. package/es/{plugins → common/plugins}/useSelectionPlugin.js +0 -0
  7. package/es/components/ResourceList/ResourceSelect.js +1 -1
  8. package/es/core/components/TopoView/TopoView.module.scss +4 -0
  9. package/es/core/components/TopoView/topoView.js +3 -2
  10. package/es/core/components/titlebar/TitleBar.module.scss +1 -11
  11. package/es/core/editor/components/settings/Settings.module.scss +1 -0
  12. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.d.ts +12 -1
  13. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +80 -22
  14. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.module.scss +5 -0
  15. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeNumberPicker.d.ts +7 -0
  16. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeNumberPicker.js +73 -0
  17. package/es/core/editor/components/settings/common/text/TextStyle.js +1 -1
  18. package/es/core/editor/components/settings/group/GroupNodeList/icon.d.ts +10 -2
  19. package/es/core/editor/components/settings/group/GroupNodeList/icon.js +14 -2
  20. package/es/core/editor/components/settings/node/NodeIconSelect.js +6 -21
  21. package/es/core/editor/components/settings/node/NodeIconSelectTest.d.ts +1 -0
  22. package/es/core/editor/components/settings/node/NodeIconSelectTest.js +31 -0
  23. package/es/core/editor/components/settings/node/NodePropertyView.js +1 -10
  24. package/es/core/editor/components/settings/text/TextPropertyView.js +1 -5
  25. package/es/core/editor/components/settings/view/BatchSetNodeSize.d.ts +1 -0
  26. package/es/core/editor/components/settings/view/BatchSetNodeSize.js +8 -0
  27. package/es/core/editor/components/settings/view/ViewPropertyView.js +5 -17
  28. package/es/core/models/TopoApp.js +21 -7
  29. package/es/models/topoMod.d.ts +1 -0
  30. package/es/models/topoMod.js +9 -3
  31. package/es/style.js +1 -1
  32. package/es/topoCenter/store/topoCenter.js +15 -2
  33. package/lib/{plugins → common/plugins}/useSelectionPlugin.d.ts +0 -0
  34. package/lib/{plugins → common/plugins}/useSelectionPlugin.js +0 -0
  35. package/lib/components/ResourceList/ResourceSelect.js +1 -1
  36. package/lib/core/components/TopoView/TopoView.module.scss +4 -0
  37. package/lib/core/components/TopoView/topoView.js +4 -2
  38. package/lib/core/components/titlebar/TitleBar.module.scss +1 -11
  39. package/lib/core/editor/components/settings/Settings.module.scss +1 -0
  40. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.d.ts +12 -1
  41. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +81 -22
  42. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.module.scss +5 -0
  43. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeNumberPicker.d.ts +7 -0
  44. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeNumberPicker.js +87 -0
  45. package/lib/core/editor/components/settings/common/text/TextStyle.js +1 -1
  46. package/lib/core/editor/components/settings/group/GroupNodeList/icon.d.ts +10 -2
  47. package/lib/core/editor/components/settings/group/GroupNodeList/icon.js +18 -2
  48. package/lib/core/editor/components/settings/node/NodeIconSelect.js +5 -24
  49. package/lib/core/editor/components/settings/node/NodeIconSelectTest.d.ts +1 -0
  50. package/lib/core/editor/components/settings/node/NodeIconSelectTest.js +43 -0
  51. package/lib/core/editor/components/settings/node/NodePropertyView.js +2 -16
  52. package/lib/core/editor/components/settings/text/TextPropertyView.js +1 -5
  53. package/lib/core/editor/components/settings/view/BatchSetNodeSize.d.ts +1 -0
  54. package/lib/core/editor/components/settings/view/BatchSetNodeSize.js +20 -0
  55. package/lib/core/editor/components/settings/view/ViewPropertyView.js +5 -24
  56. package/lib/core/models/TopoApp.js +21 -7
  57. package/lib/models/topoMod.d.ts +1 -0
  58. package/lib/models/topoMod.js +9 -3
  59. package/lib/style.js +1 -1
  60. package/lib/topoCenter/store/topoCenter.js +15 -2
  61. package/package.json +6 -5
@@ -5,7 +5,7 @@ import _ from 'lodash';
5
5
  import useNextFormTable from '@ahooksjs/next-form-table';
6
6
  import useFilterPlugin from '@ahooksjs/use-filter-plugin';
7
7
  import useSortablePlugin from '@ahooksjs/use-sortable-plugin';
8
- import useSelectionPlugin from "../../plugins/useSelectionPlugin";
8
+ import useSelectionPlugin from "../../common/plugins/useSelectionPlugin";
9
9
  import { fetchCommonQuery } from '@riil-frontend/component-topology-utils/es/services/cmdb';
10
10
  import { getTitleCell } from '@riil-frontend/component-topology-utils/es/utils/table';
11
11
  import { DICT } from '@riil-frontend/component-topology-utils/es/utils/storage';
@@ -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
  }
@@ -37,6 +37,7 @@
37
37
  background: none;
38
38
  font-size: 12px;
39
39
  padding-bottom: 0;
40
+ padding-left: 32px;
40
41
  }
41
42
  .next-collapse-panel-content {
42
43
  padding-left: 32px;
@@ -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,112 @@
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";
6
8
  var FormItem = _Form.Item;
7
9
  var Row = _Grid.Row,
8
10
  Col = _Grid.Col;
9
- export default function NodeSizeInput(props) {
11
+ /**
12
+ * 节点大小组件
13
+ *
14
+ * 文本框失去焦点、按enter键、点击加减按钮时节点大小变化
15
+ */
16
+
17
+ function NodeSizeInput(props) {
10
18
  var value = props.value,
11
- _onChange = props.onChange;
19
+ onChange = props.onChange;
20
+
21
+ var _useState = useState(false),
22
+ lock = _useState[0],
23
+ setLock = _useState[1];
24
+
25
+ var handleValue = function handleValue(val) {
26
+ if (!val || val < 1) {
27
+ return 1;
28
+ }
12
29
 
13
- var field = _Field.useField({
14
- autoUnmount: false,
15
- values: value,
16
- onChange: function onChange(name, value) {
17
- _onChange(field.getValues());
30
+ if (val > 2000) {
31
+ return 2000;
18
32
  }
19
- });
20
33
 
21
- useEffect(function () {
22
- field.setValues(value);
23
- }, [value]);
34
+ return parseInt(val);
35
+ };
36
+
37
+ var handleChange = function handleChange(name, attrValue) {
38
+ var _extends2;
39
+
40
+ var newSize = _extends({}, value, (_extends2 = {}, _extends2[name] = attrValue, _extends2));
41
+
42
+ if (lock) {
43
+ if (name === 'width') {
44
+ newSize.height = handleValue(value.height / value.width * attrValue);
45
+ } else {
46
+ newSize.width = handleValue(value.width / value.height * attrValue);
47
+ }
48
+ }
49
+
50
+ onChange(newSize);
51
+ };
52
+
53
+ function parseValue(val) {
54
+ return val ? parseInt(val) : val;
55
+ }
56
+
24
57
  return /*#__PURE__*/React.createElement(_Form, {
25
- field: field,
26
58
  labelAlign: "top",
27
59
  component: "div"
28
60
  }, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(Row, {
29
- gutter: "16"
61
+ gutter: "0"
30
62
  }, /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(FormItem, {
31
63
  required: true,
32
64
  requiredTrigger: "onBlur"
33
- }, /*#__PURE__*/React.createElement(_NumberPicker, {
34
- name: "width",
65
+ }, /*#__PURE__*/React.createElement(NodeSizeNumberPicker, {
66
+ value: parseValue(value.width),
67
+ label: "\u5BBD:",
35
68
  min: 1,
36
69
  max: 2000,
37
70
  placeholder: "\u8BF7\u8F93\u5165",
38
71
  style: {
39
72
  width: '100%'
73
+ },
74
+ onChange: function onChange(val) {
75
+ return handleChange('width', val);
76
+ }
77
+ }))), /*#__PURE__*/React.createElement("div", {
78
+ className: styles.lockBtn,
79
+ onClick: function onClick() {
80
+ setLock(!lock);
40
81
  }
41
- }))), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(FormItem, {
82
+ }, lock ? /*#__PURE__*/React.createElement("img", {
83
+ src: require("./img/icon_\u89E3\u9501.svg"),
84
+ title: "\u89E3\u9501",
85
+ alt: ""
86
+ }) : /*#__PURE__*/React.createElement("img", {
87
+ src: require("./img/icon_\u9501.svg"),
88
+ title: "\u9501\u5B9A",
89
+ alt: ""
90
+ })), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(FormItem, {
42
91
  required: true,
43
92
  requiredTrigger: "onBlur"
44
- }, /*#__PURE__*/React.createElement(_NumberPicker, {
45
- name: "height",
93
+ }, /*#__PURE__*/React.createElement(NodeSizeNumberPicker, {
94
+ value: parseValue(value.height),
95
+ label: "\u9AD8:",
46
96
  min: 1,
47
97
  max: 2000,
48
98
  placeholder: "\u8BF7\u8F93\u5165",
49
99
  style: {
50
100
  width: '100%'
101
+ },
102
+ onChange: function onChange(val) {
103
+ return handleChange('height', val);
51
104
  }
52
105
  }))))));
53
106
  }
54
- ;
107
+
108
+ ;
109
+ NodeSizeInput.propTypes = {
110
+ value: PropTypes.object
111
+ };
112
+ 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
@@ -70,10 +70,18 @@ export function getIconMap(topo: any): {
70
70
  *
71
71
  * @param topo
72
72
  * @param type {'node' | 'container'}
73
- * @return {{label: string, icons: *[]}[]}
73
+ * @return {{name: string, icons: *[]}[]}
74
74
  */
75
75
  export function getIconGroups(topo: any, type: 'node' | 'container'): {
76
- label: string;
76
+ name: string;
77
+ icons: any[];
78
+ }[];
79
+ export function getNodeIconGroups(topo: any, type: any): {
80
+ name: string;
81
+ icons: any[];
82
+ }[];
83
+ export function getGroupIconGroups(topo: any, type: any): {
84
+ name: string;
77
85
  icons: any[];
78
86
  }[];
79
87
  export function getIconById(id: any, topo: any): any;
@@ -18,12 +18,24 @@ export function getIconMap(topo) {
18
18
  *
19
19
  * @param topo
20
20
  * @param type {'node' | 'container'}
21
- * @return {{label: string, icons: *[]}[]}
21
+ * @return {{name: string, icons: *[]}[]}
22
22
  */
23
23
 
24
24
  export function getIconGroups(topo, type) {
25
25
  return [{
26
- label: '默认',
26
+ name: '默认',
27
+ icons: [].concat(DEFAULT_NODE_ICONS, topo.options.icons || [])
28
+ }];
29
+ }
30
+ export function getNodeIconGroups(topo, type) {
31
+ return [{
32
+ name: '默认',
33
+ icons: [].concat(DEFAULT_NODE_ICONS, topo.options.icons || [])
34
+ }];
35
+ }
36
+ export function getGroupIconGroups(topo, type) {
37
+ return [{
38
+ name: '默认',
27
39
  icons: [].concat(DEFAULT_NODE_ICONS, topo.options.icons || [])
28
40
  }];
29
41
  }
@@ -1,8 +1,6 @@
1
- import _Avatar from "@alifd/next/lib/avatar";
2
- import _Select from "@alifd/next/lib/select";
3
- import React, { useState, useEffect, useRef, useCallback } from 'react';
4
- import { getIconGroups, getIconMap } from "../group/GroupNodeList/icon";
5
- var Option = _Select.Option;
1
+ import React from 'react';
2
+ import { getIconGroups } from "../group/GroupNodeList/icon";
3
+ import IconSelect from '@riil-frontend/component-topo-icon-select';
6
4
  export default function NodeIconSelect(props) {
7
5
  var value = props.value,
8
6
  onChange = props.onChange,
@@ -17,26 +15,13 @@ export default function NodeIconSelect(props) {
17
15
  newId = a[0].id;
18
16
  }
19
17
 
20
- return /*#__PURE__*/React.createElement(_Select, {
18
+ return /*#__PURE__*/React.createElement(IconSelect, {
21
19
  value: newId,
20
+ iconList: iconGroups,
22
21
  onChange: onChange,
23
22
  style: {
24
23
  width: '100%'
25
24
  }
26
- }, iconGroups.map(function (group) {
27
- return /*#__PURE__*/React.createElement(_Select.OptionGroup, {
28
- label: group.label,
29
- key: group.label
30
- }, group.icons.map(function (icon) {
31
- return /*#__PURE__*/React.createElement(Option, {
32
- key: icon.id,
33
- value: icon.id
34
- }, /*#__PURE__*/React.createElement(_Avatar, {
35
- src: icon.url,
36
- shape: "square",
37
- size: "small"
38
- }), "\xA0", icon.name);
39
- }));
40
- }));
25
+ });
41
26
  }
42
27
  ;
@@ -0,0 +1 @@
1
+ export default function NodeIconSelect(props: any): JSX.Element;
@@ -0,0 +1,31 @@
1
+ import _Avatar from "@alifd/next/lib/avatar";
2
+ import _Select from "@alifd/next/lib/select";
3
+ import React from 'react';
4
+ var Option = _Select.Option;
5
+ export default function NodeIconSelect(props) {
6
+ var value = props.value,
7
+ onChange = props.onChange,
8
+ iconList = props.iconList;
9
+ return /*#__PURE__*/React.createElement(_Select, {
10
+ value: value,
11
+ onChange: onChange,
12
+ style: {
13
+ width: '100%'
14
+ }
15
+ }, iconList.map(function (group) {
16
+ return /*#__PURE__*/React.createElement(_Select.OptionGroup, {
17
+ label: group.name,
18
+ key: group.name
19
+ }, group.icons.map(function (icon) {
20
+ return /*#__PURE__*/React.createElement(Option, {
21
+ key: icon.id,
22
+ value: icon.id
23
+ }, /*#__PURE__*/React.createElement(_Avatar, {
24
+ src: icon.url,
25
+ shape: "square",
26
+ size: "small"
27
+ }), "\xA0", icon.name);
28
+ }));
29
+ }));
30
+ }
31
+ ;
@@ -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);
@@ -52,11 +52,7 @@ export default function TextPropertyView(props) {
52
52
  useEffect(function () {
53
53
  field.setValues(parseValues(values));
54
54
  }, [values]);
55
- return /*#__PURE__*/React.createElement("div", {
56
- style: {
57
- paddingTop: 8
58
- }
59
- }, /*#__PURE__*/React.createElement(_Form, {
55
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Form, {
60
56
  field: field,
61
57
  labelAlign: "top"
62
58
  }, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
@@ -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
  }
@@ -599,17 +599,31 @@ var TopoApp = /*#__PURE__*/function () {
599
599
  }
600
600
 
601
601
  return save;
602
- }();
602
+ }()
603
+ /**
604
+ * 导出为图片
605
+ *
606
+ * @param name {string?} 文件名称,不传使用默认
607
+ */
608
+ ;
603
609
 
604
- _proto.exportImage = /*#__PURE__*/function () {
605
- var _exportImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
610
+ _proto.exportImage =
611
+ /*#__PURE__*/
612
+ function () {
613
+ var _exportImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(name) {
614
+ var fileName;
606
615
  return _regeneratorRuntime.wrap(function _callee15$(_context15) {
607
616
  while (1) {
608
617
  switch (_context15.prev = _context15.next) {
609
618
  case 0:
610
- this.view.topoClient.exportImage();
619
+ fileName = name;
611
620
 
612
- case 1:
621
+ if (!name) {// TODO 获取拓扑名称,避免改名重绘拓扑图
622
+ }
623
+
624
+ this.view.topoClient.exportImage(fileName);
625
+
626
+ case 3:
613
627
  case "end":
614
628
  return _context15.stop();
615
629
  }
@@ -617,7 +631,7 @@ var TopoApp = /*#__PURE__*/function () {
617
631
  }, _callee15, this);
618
632
  }));
619
633
 
620
- function exportImage() {
634
+ function exportImage(_x9) {
621
635
  return _exportImage.apply(this, arguments);
622
636
  }
623
637
 
@@ -652,7 +666,7 @@ var TopoApp = /*#__PURE__*/function () {
652
666
  }, _callee16, this);
653
667
  }));
654
668
 
655
- function loadAttrsAndMetrics(_x9) {
669
+ function loadAttrsAndMetrics(_x10) {
656
670
  return _loadAttrsAndMetrics.apply(this, arguments);
657
671
  }
658
672
 
@@ -49,6 +49,7 @@ export default function _default(topoApp: any): {
49
49
  mode: string | null;
50
50
  viewState: string | null;
51
51
  }, rootState: any): Promise<void>;
52
+ clearData(): void;
52
53
  switchToViewMode(playload: any, rootState: any): void;
53
54
  enterEditMode(playload: any, rootState: any): void;
54
55
  openDefaultTopoPage(conditions: {}, rootState: any): Promise<void>;
@@ -141,10 +141,7 @@ export default function (topoApp) {
141
141
  id = playload.id, data = playload.data, linkTo = playload.linkTo;
142
142
  viewState = playload.mode || playload.viewState || 'view';
143
143
  topoId = id || data.config.id;
144
- _context2.next = 5;
145
- return topoApp.open(topoId);
146
144
 
147
- case 5:
148
145
  _this2.update({
149
146
  viewState: viewState,
150
147
  currentTopo: playload,
@@ -152,6 +149,10 @@ export default function (topoApp) {
152
149
  topoPermission: undefined
153
150
  });
154
151
 
152
+ _context2.next = 6;
153
+ return topoApp.open(topoId);
154
+
155
+ case 6:
155
156
  _context2.next = 8;
156
157
  return _this2.initTopoData({
157
158
  topoId: topoId,
@@ -173,6 +174,11 @@ export default function (topoApp) {
173
174
  }, _callee2);
174
175
  }))();
175
176
  },
177
+ clearData: function clearData() {
178
+ this.update({
179
+ topoData: null
180
+ });
181
+ },
176
182
  switchToViewMode: function switchToViewMode(playload, rootState) {
177
183
  this.update({
178
184
  viewState: 'view'
package/es/style.js CHANGED
@@ -26,6 +26,6 @@ import '@alifd/next/lib/radio/style';
26
26
  import '@alifd/next/lib/collapse/style';
27
27
  import '@alifd/next/lib/list/style';
28
28
  import '@alifd/next/lib/tree-select/style';
29
- import '@alifd/next/lib/avatar/style';
29
+
30
30
 
31
31
  import './index.scss';