@riil-frontend/component-topology 9.0.10 → 9.0.12

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.
@@ -1,4 +1,3 @@
1
- import _Checkbox from "@alifd/next/es/checkbox";
2
1
  import _Field from "@alifd/next/es/field";
3
2
  import _Select from "@alifd/next/es/select";
4
3
  import _Form from "@alifd/next/es/form";
@@ -149,13 +148,8 @@ function EdgeType(props) {
149
148
  inline: true,
150
149
  labelAlign: "top"
151
150
  }, /*#__PURE__*/React.createElement(FormItem, null, /*#__PURE__*/React.createElement(LineType, {
152
- name: "lineButton",
153
- disable: !!field.getValue('baseAgreement')
154
- })), /*#__PURE__*/React.createElement(FormItem, null, /*#__PURE__*/React.createElement(_Checkbox, {
155
- name: "baseAgreement",
156
- onChange: _onChange,
157
- disabled: disable
158
- }, "\u81EA\u52A8\u8C03\u6574")), /*#__PURE__*/React.createElement(FormItem, {
151
+ name: "lineButton"
152
+ })), /*#__PURE__*/React.createElement(FormItem, {
159
153
  label: "\u8D77\u70B9"
160
154
  }, /*#__PURE__*/React.createElement(_Select, {
161
155
  name: "startPoint",
@@ -14,11 +14,11 @@
14
14
  margin-top: 7px;
15
15
  margin-bottom: 7px;
16
16
  }
17
- .#{$css-prefix}form-item:nth-child(2){
18
- display: block !important;
19
- margin-top: 7px;
20
- margin-bottom: 0px;
21
- }
17
+ // .#{$css-prefix}form-item:nth-child(2){
18
+ // display: block !important;
19
+ // margin-top: 7px;
20
+ // margin-bottom: 0px;
21
+ // }
22
22
  .#{$css-prefix}form.#{$css-prefix}inline .#{$css-prefix}form-item:not(:last-child) {
23
23
  margin-right: 8px;
24
24
  .#{$css-prefix}select-trigger {
@@ -28,11 +28,12 @@ var LINE_TYPE_OPTIONS = [{
28
28
  value: 'doublearc',
29
29
  label: '双弧线',
30
30
  icon: 'topo_linear_icon_arcline'
31
- }, {
32
- value: 'points',
33
- label: '自由线形',
34
- icon: 'topo_linear_icon_pointsline'
35
- }];
31
+ } // {
32
+ // value: 'points',
33
+ // label: '自由线形',
34
+ // icon: 'topo_linear_icon_pointsline',
35
+ // },
36
+ ];
36
37
  var LineType = /*#__PURE__*/React.forwardRef(function (props, ref) {
37
38
  var value = props.value,
38
39
  onChange = props.onChange,
@@ -7,7 +7,8 @@
7
7
  border: none !important;
8
8
  color: #4D6277;
9
9
  padding: 0;
10
- margin-right: 10px;
10
+ // margin-right: 10px;
11
+ margin-right: 17px;
11
12
  text-align: center;
12
13
  }
13
14
  .redioBtn {
@@ -17,7 +18,7 @@
17
18
  border: none !important;
18
19
  color: #4D6277;
19
20
  padding: 0;
20
- margin-right: 10px;
21
+ margin-right: 17px;
21
22
  text-align: center;
22
23
 
23
24
  .iconImg {
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
26
26
 
27
- var version = typeof "9.0.10" === 'string' ? "9.0.10" : null;
27
+ var version = typeof "9.0.12" === 'string' ? "9.0.12" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -0,0 +1,39 @@
1
+ /**
2
+ * v1.4.0 升级历史保存的拓扑图图标大小为48。
3
+ * 序列化中节点(除自定义上传图片节点)未设置大小时,设置成48
4
+ * @param {*} serializeStr
5
+ * @returns
6
+ */
7
+ function v140UpgradeSerializeNodeImageSize(serializeStr) {
8
+ var serialize = parseSerialize(serializeStr);
9
+
10
+ if (!serialize) {
11
+ return serialize;
12
+ }
13
+
14
+ serialize.d.filter(function (item) {
15
+ return ['ht.Group', 'ht.Node'].includes(item.c);
16
+ }).filter(function (item) {
17
+ return ['point', 'container'].includes(item.p.layer);
18
+ }).filter(function (item) {
19
+ return !!item.p.image;
20
+ }).filter(function (item) {
21
+ return item.p.image === 'editor.icon.cloud.medium' || item.p.image.startsWith('ciType.');
22
+ }).filter(function (item) {
23
+ return item.p.width === undefined;
24
+ }).forEach(function (node) {
25
+ node.p.width = 48;
26
+ node.p.height = 48;
27
+ });
28
+ return serialize;
29
+ }
30
+
31
+ function parseSerialize(serialize) {
32
+ if (serialize && typeof serialize === 'string') {
33
+ return JSON.parse(serialize);
34
+ }
35
+
36
+ return serialize;
37
+ }
38
+
39
+ export default v140UpgradeSerializeNodeImageSize;
@@ -10,6 +10,7 @@ import { getEditorIcons } from "../core/common/icons/icon";
10
10
  import { getBackgroundImageUrl } from "../core/utils/backgroundUtil";
11
11
  import { isClusterHtElement, processCluster } from "./clusterUtil";
12
12
  import { isGroup } from "./htElementUtils";
13
+ import v140UpgradeSerializeNodeImageSize from "../core/upgrade/v140UpgradeSerializeNodeImageSize";
13
14
  /**
14
15
  * 查找数组中对应key的值为value的元素并返回,只查找第一个符合的元素
15
16
  * @param {Array} arr 数组
@@ -278,7 +279,7 @@ export var combTopoData = function combTopoData(_ref3) {
278
279
  nodes: nodes,
279
280
  linkGroups: linkGroups,
280
281
  links: links,
281
- serialize: result.serialize
282
+ serialize: v140UpgradeSerializeNodeImageSize(result.serialize)
282
283
  }; // 所有资源
283
284
 
284
285
  var allCis = [].concat(data.nodes, data.links, data.linkGroups);
@@ -5,8 +5,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports["default"] = void 0;
7
7
 
8
- var _checkbox = _interopRequireDefault(require("@alifd/next/lib/checkbox"));
9
-
10
8
  var _field = _interopRequireDefault(require("@alifd/next/lib/field"));
11
9
 
12
10
  var _select = _interopRequireDefault(require("@alifd/next/lib/select"));
@@ -168,13 +166,8 @@ function EdgeType(props) {
168
166
  inline: true,
169
167
  labelAlign: "top"
170
168
  }, /*#__PURE__*/_react["default"].createElement(FormItem, null, /*#__PURE__*/_react["default"].createElement(_LineType["default"], {
171
- name: "lineButton",
172
- disable: !!field.getValue('baseAgreement')
173
- })), /*#__PURE__*/_react["default"].createElement(FormItem, null, /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
174
- name: "baseAgreement",
175
- onChange: _onChange,
176
- disabled: disable
177
- }, "\u81EA\u52A8\u8C03\u6574")), /*#__PURE__*/_react["default"].createElement(FormItem, {
169
+ name: "lineButton"
170
+ })), /*#__PURE__*/_react["default"].createElement(FormItem, {
178
171
  label: "\u8D77\u70B9"
179
172
  }, /*#__PURE__*/_react["default"].createElement(_select["default"], {
180
173
  name: "startPoint",
@@ -14,11 +14,11 @@
14
14
  margin-top: 7px;
15
15
  margin-bottom: 7px;
16
16
  }
17
- .#{$css-prefix}form-item:nth-child(2){
18
- display: block !important;
19
- margin-top: 7px;
20
- margin-bottom: 0px;
21
- }
17
+ // .#{$css-prefix}form-item:nth-child(2){
18
+ // display: block !important;
19
+ // margin-top: 7px;
20
+ // margin-bottom: 0px;
21
+ // }
22
22
  .#{$css-prefix}form.#{$css-prefix}inline .#{$css-prefix}form-item:not(:last-child) {
23
23
  margin-right: 8px;
24
24
  .#{$css-prefix}select-trigger {
@@ -44,11 +44,12 @@ var LINE_TYPE_OPTIONS = [{
44
44
  value: 'doublearc',
45
45
  label: '双弧线',
46
46
  icon: 'topo_linear_icon_arcline'
47
- }, {
48
- value: 'points',
49
- label: '自由线形',
50
- icon: 'topo_linear_icon_pointsline'
51
- }];
47
+ } // {
48
+ // value: 'points',
49
+ // label: '自由线形',
50
+ // icon: 'topo_linear_icon_pointsline',
51
+ // },
52
+ ];
52
53
 
53
54
  var LineType = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
54
55
  var value = props.value,
@@ -7,7 +7,8 @@
7
7
  border: none !important;
8
8
  color: #4D6277;
9
9
  padding: 0;
10
- margin-right: 10px;
10
+ // margin-right: 10px;
11
+ margin-right: 17px;
11
12
  text-align: center;
12
13
  }
13
14
  .redioBtn {
@@ -17,7 +18,7 @@
17
18
  border: none !important;
18
19
  color: #4D6277;
19
20
  padding: 0;
20
- margin-right: 10px;
21
+ margin-right: 17px;
21
22
  text-align: center;
22
23
 
23
24
  .iconImg {
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
56
56
  var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
57
57
 
58
58
  // eslint-disable-next-line no-undef
59
- var version = typeof "9.0.10" === 'string' ? "9.0.10" : null;
59
+ var version = typeof "9.0.12" === 'string' ? "9.0.12" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports["default"] = void 0;
5
+
6
+ /**
7
+ * v1.4.0 升级历史保存的拓扑图图标大小为48。
8
+ * 序列化中节点(除自定义上传图片节点)未设置大小时,设置成48
9
+ * @param {*} serializeStr
10
+ * @returns
11
+ */
12
+ function v140UpgradeSerializeNodeImageSize(serializeStr) {
13
+ var serialize = parseSerialize(serializeStr);
14
+
15
+ if (!serialize) {
16
+ return serialize;
17
+ }
18
+
19
+ serialize.d.filter(function (item) {
20
+ return ['ht.Group', 'ht.Node'].includes(item.c);
21
+ }).filter(function (item) {
22
+ return ['point', 'container'].includes(item.p.layer);
23
+ }).filter(function (item) {
24
+ return !!item.p.image;
25
+ }).filter(function (item) {
26
+ return item.p.image === 'editor.icon.cloud.medium' || item.p.image.startsWith('ciType.');
27
+ }).filter(function (item) {
28
+ return item.p.width === undefined;
29
+ }).forEach(function (node) {
30
+ node.p.width = 48;
31
+ node.p.height = 48;
32
+ });
33
+ return serialize;
34
+ }
35
+
36
+ function parseSerialize(serialize) {
37
+ if (serialize && typeof serialize === 'string') {
38
+ return JSON.parse(serialize);
39
+ }
40
+
41
+ return serialize;
42
+ }
43
+
44
+ var _default = v140UpgradeSerializeNodeImageSize;
45
+ exports["default"] = _default;
@@ -38,6 +38,8 @@ var _clusterUtil = require("./clusterUtil");
38
38
 
39
39
  var _htElementUtils = require("./htElementUtils");
40
40
 
41
+ var _v140UpgradeSerializeNodeImageSize = _interopRequireDefault(require("../core/upgrade/v140UpgradeSerializeNodeImageSize"));
42
+
41
43
  var _excluded = ["extraConfig"];
42
44
 
43
45
  /**
@@ -319,7 +321,7 @@ var combTopoData = function combTopoData(_ref3) {
319
321
  nodes: nodes,
320
322
  linkGroups: linkGroups,
321
323
  links: links,
322
- serialize: result.serialize
324
+ serialize: (0, _v140UpgradeSerializeNodeImageSize["default"])(result.serialize)
323
325
  }; // 所有资源
324
326
 
325
327
  var allCis = [].concat(data.nodes, data.links, data.linkGroups);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "9.0.10",
3
+ "version": "9.0.12",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.10/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.12/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }