@riil-frontend/component-topology 2.15.41 → 2.15.44
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/index.css +1 -1
- package/build/index.js +22 -22
- package/es/common/components/ColorPicker/ColorPicker.js +5 -2
- package/es/core/editor/components/BackgroundView/index.js +80 -44
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +4 -3
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/services/background.js +26 -1
- package/lib/common/components/ColorPicker/ColorPicker.js +5 -2
- package/lib/core/editor/components/BackgroundView/index.js +80 -44
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +3 -2
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/services/background.js +26 -1
- package/package.json +2 -2
|
@@ -21,9 +21,11 @@ var ColorPicker = /*#__PURE__*/function (_Component) {
|
|
|
21
21
|
var _this$props = _this.props,
|
|
22
22
|
prevValue = _this$props.value,
|
|
23
23
|
onChange = _this$props.onChange;
|
|
24
|
+
var value = color.hex; // const rgb = color.rgb;
|
|
25
|
+
// const rgba = `rgba(${rgb.r},${rgb.g},${rgb.b},${rgb.a})`
|
|
24
26
|
|
|
25
|
-
if (
|
|
26
|
-
onChange(
|
|
27
|
+
if (value !== prevValue) {
|
|
28
|
+
onChange(value);
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
31
|
|
|
@@ -58,6 +60,7 @@ var ColorPicker = /*#__PURE__*/function (_Component) {
|
|
|
58
60
|
}, /*#__PURE__*/React.createElement(SketchPicker, {
|
|
59
61
|
color: value // width={230}
|
|
60
62
|
,
|
|
63
|
+
disableAlpha: true,
|
|
61
64
|
styles: {
|
|
62
65
|
'default': {
|
|
63
66
|
picker: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _Message from "@alifd/next/es/message";
|
|
2
2
|
import _Loading from "@alifd/next/es/loading";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
-
import
|
|
4
|
+
import _Dialog from "@alifd/next/es/dialog";
|
|
5
5
|
import _Tag from "@alifd/next/es/tag";
|
|
6
6
|
import _Button from "@alifd/next/es/button";
|
|
7
7
|
import _Icon from "@alifd/next/es/icon";
|
|
8
|
-
import
|
|
8
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
import React, { useEffect, useState } from 'react';
|
|
11
11
|
import styles from "./index.module.scss";
|
|
@@ -21,20 +21,56 @@ function List(props) {
|
|
|
21
21
|
dataSource = props.dataSource,
|
|
22
22
|
onRemove = props.onRemove;
|
|
23
23
|
|
|
24
|
-
function remove(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
function remove(_x, _x2) {
|
|
25
|
+
return _remove.apply(this, arguments);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _remove() {
|
|
29
|
+
_remove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(e, id) {
|
|
30
|
+
var canDelete;
|
|
31
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
32
|
+
while (1) {
|
|
33
|
+
switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
_context.next = 3;
|
|
37
|
+
return api.canDeleteBackground(id);
|
|
38
|
+
|
|
39
|
+
case 3:
|
|
40
|
+
canDelete = _context.sent;
|
|
41
|
+
console.log('canDelete', canDelete);
|
|
42
|
+
|
|
43
|
+
if (canDelete) {
|
|
44
|
+
_Dialog.confirm({
|
|
45
|
+
title: '删除',
|
|
46
|
+
messageProps: {
|
|
47
|
+
type: 'warning'
|
|
48
|
+
},
|
|
49
|
+
content: '若执行相关操作,此背景将会从背景库删除,确定删除吗?',
|
|
50
|
+
onOk: function onOk() {
|
|
51
|
+
return onRemove(id);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
_Dialog.confirm({
|
|
56
|
+
title: '提示',
|
|
57
|
+
messageProps: {
|
|
58
|
+
type: 'warning'
|
|
59
|
+
},
|
|
60
|
+
content: '此背景被占用,不能删除。',
|
|
61
|
+
footerActions: ['ok'],
|
|
62
|
+
onOk: function onOk() {}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
case 6:
|
|
67
|
+
case "end":
|
|
68
|
+
return _context.stop();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}, _callee);
|
|
72
|
+
}));
|
|
73
|
+
return _remove.apply(this, arguments);
|
|
38
74
|
}
|
|
39
75
|
|
|
40
76
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -95,46 +131,46 @@ export default function BackgroundView(props) {
|
|
|
95
131
|
}
|
|
96
132
|
|
|
97
133
|
function _getBackground() {
|
|
98
|
-
_getBackground = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
134
|
+
_getBackground = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
99
135
|
var res;
|
|
100
|
-
return _regeneratorRuntime.wrap(function
|
|
136
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
101
137
|
while (1) {
|
|
102
|
-
switch (
|
|
138
|
+
switch (_context3.prev = _context3.next) {
|
|
103
139
|
case 0:
|
|
104
|
-
|
|
140
|
+
_context3.next = 2;
|
|
105
141
|
return api.getBackgroundList();
|
|
106
142
|
|
|
107
143
|
case 2:
|
|
108
|
-
res =
|
|
144
|
+
res = _context3.sent;
|
|
109
145
|
setBgList(res);
|
|
110
146
|
|
|
111
147
|
case 4:
|
|
112
148
|
case "end":
|
|
113
|
-
return
|
|
149
|
+
return _context3.stop();
|
|
114
150
|
}
|
|
115
151
|
}
|
|
116
|
-
},
|
|
152
|
+
}, _callee3);
|
|
117
153
|
}));
|
|
118
154
|
return _getBackground.apply(this, arguments);
|
|
119
155
|
}
|
|
120
156
|
|
|
121
|
-
function removeBg(
|
|
157
|
+
function removeBg(_x3) {
|
|
122
158
|
return _removeBg.apply(this, arguments);
|
|
123
159
|
} // 同步拓扑图展示
|
|
124
160
|
|
|
125
161
|
|
|
126
162
|
function _removeBg() {
|
|
127
|
-
_removeBg = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
163
|
+
_removeBg = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(id) {
|
|
128
164
|
var res;
|
|
129
|
-
return _regeneratorRuntime.wrap(function
|
|
165
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
130
166
|
while (1) {
|
|
131
|
-
switch (
|
|
167
|
+
switch (_context4.prev = _context4.next) {
|
|
132
168
|
case 0:
|
|
133
|
-
|
|
169
|
+
_context4.next = 2;
|
|
134
170
|
return api.deleteBackground(id);
|
|
135
171
|
|
|
136
172
|
case 2:
|
|
137
|
-
res =
|
|
173
|
+
res = _context4.sent;
|
|
138
174
|
|
|
139
175
|
// 删除当前选中
|
|
140
176
|
if (id === (current === null || current === void 0 ? void 0 : current.id)) {
|
|
@@ -148,10 +184,10 @@ export default function BackgroundView(props) {
|
|
|
148
184
|
|
|
149
185
|
case 6:
|
|
150
186
|
case "end":
|
|
151
|
-
return
|
|
187
|
+
return _context4.stop();
|
|
152
188
|
}
|
|
153
189
|
}
|
|
154
|
-
},
|
|
190
|
+
}, _callee4);
|
|
155
191
|
}));
|
|
156
192
|
return _removeBg.apply(this, arguments);
|
|
157
193
|
}
|
|
@@ -161,46 +197,46 @@ export default function BackgroundView(props) {
|
|
|
161
197
|
}
|
|
162
198
|
|
|
163
199
|
var handleSelect = /*#__PURE__*/function () {
|
|
164
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
200
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(currentBg) {
|
|
165
201
|
var imgUrl, size;
|
|
166
|
-
return _regeneratorRuntime.wrap(function
|
|
202
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
167
203
|
while (1) {
|
|
168
|
-
switch (
|
|
204
|
+
switch (_context2.prev = _context2.next) {
|
|
169
205
|
case 0:
|
|
170
206
|
if (!(currentBg !== null && currentBg !== void 0 && currentBg.id && currentBg.id !== (current === null || current === void 0 ? void 0 : current.id))) {
|
|
171
|
-
|
|
207
|
+
_context2.next = 16;
|
|
172
208
|
break;
|
|
173
209
|
}
|
|
174
210
|
|
|
175
211
|
setLoadingBackground(true);
|
|
176
212
|
imgUrl = getBackgroundImageUrl(currentBg);
|
|
177
|
-
|
|
178
|
-
|
|
213
|
+
_context2.prev = 3;
|
|
214
|
+
_context2.next = 6;
|
|
179
215
|
return getImageSize(imgUrl);
|
|
180
216
|
|
|
181
217
|
case 6:
|
|
182
|
-
size =
|
|
218
|
+
size = _context2.sent;
|
|
183
219
|
rlog.debug('获取图片大小', size);
|
|
184
220
|
setBackground(_extends({}, currentBg, size));
|
|
185
221
|
topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
|
|
186
222
|
setLoadingBackground(false);
|
|
187
|
-
|
|
223
|
+
_context2.next = 16;
|
|
188
224
|
break;
|
|
189
225
|
|
|
190
226
|
case 13:
|
|
191
|
-
|
|
192
|
-
|
|
227
|
+
_context2.prev = 13;
|
|
228
|
+
_context2.t0 = _context2["catch"](3);
|
|
193
229
|
setLoadingBackground(false);
|
|
194
230
|
|
|
195
231
|
case 16:
|
|
196
232
|
case "end":
|
|
197
|
-
return
|
|
233
|
+
return _context2.stop();
|
|
198
234
|
}
|
|
199
235
|
}
|
|
200
|
-
},
|
|
236
|
+
}, _callee2, null, [[3, 13]]);
|
|
201
237
|
}));
|
|
202
238
|
|
|
203
|
-
return function handleSelect(
|
|
239
|
+
return function handleSelect(_x4) {
|
|
204
240
|
return _ref.apply(this, arguments);
|
|
205
241
|
};
|
|
206
242
|
}();
|
|
@@ -5,7 +5,7 @@ import _Field from "@alifd/next/es/field";
|
|
|
5
5
|
import _extends from "@babel/runtime/helpers/extends";
|
|
6
6
|
import _Collapse from "@alifd/next/es/collapse";
|
|
7
7
|
import _Select from "@alifd/next/es/select";
|
|
8
|
-
import React, {
|
|
8
|
+
import React, { useEffect } from 'react';
|
|
9
9
|
import NodeSizeInput from "../../common/NodeSizeInput/NodeSizeInput";
|
|
10
10
|
import textStyles from "../../../../../common/text.module.scss";
|
|
11
11
|
import NodeIconSelect from "./NodeIconSelect";
|
|
@@ -73,8 +73,9 @@ export default function NodePropertyView(props) {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
var handleBindTopoChange = function handleBindTopoChange(value, data) {
|
|
76
|
-
//
|
|
77
|
-
node.a('name', data.label);
|
|
76
|
+
// 设置名称为拓扑名称,清空自定义名称
|
|
77
|
+
node.a('name', data.label);
|
|
78
|
+
node.a('customName', null);
|
|
78
79
|
};
|
|
79
80
|
|
|
80
81
|
var renderData = function renderData() {
|
|
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
|
20
20
|
import PluginManager from "./PluginManager";
|
|
21
21
|
import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
|
|
22
22
|
|
|
23
|
-
var version = typeof "2.15.
|
|
23
|
+
var version = typeof "2.15.44" === 'string' ? "2.15.44" : null;
|
|
24
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
25
25
|
/**
|
|
26
26
|
* 拓扑显示和编辑
|
|
@@ -107,5 +107,30 @@ export default {
|
|
|
107
107
|
/**
|
|
108
108
|
* 背景图导出
|
|
109
109
|
*/
|
|
110
|
-
EXPORT_BG_ZIP: EXPORT_BG_ZIP
|
|
110
|
+
EXPORT_BG_ZIP: EXPORT_BG_ZIP,
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 校验背景图是否被占用
|
|
114
|
+
* @param {*} params id
|
|
115
|
+
*/
|
|
116
|
+
canDeleteBackground: function canDeleteBackground(id) {
|
|
117
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
118
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
119
|
+
while (1) {
|
|
120
|
+
switch (_context4.prev = _context4.next) {
|
|
121
|
+
case 0:
|
|
122
|
+
_context4.next = 2;
|
|
123
|
+
return getRequest()("/topo/v1/api/background/" + id);
|
|
124
|
+
|
|
125
|
+
case 2:
|
|
126
|
+
return _context4.abrupt("return", _context4.sent);
|
|
127
|
+
|
|
128
|
+
case 3:
|
|
129
|
+
case "end":
|
|
130
|
+
return _context4.stop();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}, _callee4);
|
|
134
|
+
}))();
|
|
135
|
+
}
|
|
111
136
|
};
|
|
@@ -37,9 +37,11 @@ var ColorPicker = /*#__PURE__*/function (_Component) {
|
|
|
37
37
|
var _this$props = _this.props,
|
|
38
38
|
prevValue = _this$props.value,
|
|
39
39
|
onChange = _this$props.onChange;
|
|
40
|
+
var value = color.hex; // const rgb = color.rgb;
|
|
41
|
+
// const rgba = `rgba(${rgb.r},${rgb.g},${rgb.b},${rgb.a})`
|
|
40
42
|
|
|
41
|
-
if (
|
|
42
|
-
onChange(
|
|
43
|
+
if (value !== prevValue) {
|
|
44
|
+
onChange(value);
|
|
43
45
|
}
|
|
44
46
|
};
|
|
45
47
|
|
|
@@ -76,6 +78,7 @@ var ColorPicker = /*#__PURE__*/function (_Component) {
|
|
|
76
78
|
}, /*#__PURE__*/_react["default"].createElement(_reactColor.SketchPicker, {
|
|
77
79
|
color: value // width={230}
|
|
78
80
|
,
|
|
81
|
+
disableAlpha: true,
|
|
79
82
|
styles: {
|
|
80
83
|
'default': {
|
|
81
84
|
picker: {
|
|
@@ -13,7 +13,7 @@ var _loading = _interopRequireDefault(require("@alifd/next/lib/loading"));
|
|
|
13
13
|
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _dialog = _interopRequireDefault(require("@alifd/next/lib/dialog"));
|
|
17
17
|
|
|
18
18
|
var _tag = _interopRequireDefault(require("@alifd/next/lib/tag"));
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
|
|
21
21
|
|
|
22
22
|
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
25
25
|
|
|
26
26
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
27
|
|
|
@@ -47,20 +47,56 @@ function List(props) {
|
|
|
47
47
|
dataSource = props.dataSource,
|
|
48
48
|
onRemove = props.onRemove;
|
|
49
49
|
|
|
50
|
-
function remove(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
function remove(_x, _x2) {
|
|
51
|
+
return _remove.apply(this, arguments);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function _remove() {
|
|
55
|
+
_remove = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(e, id) {
|
|
56
|
+
var canDelete;
|
|
57
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
58
|
+
while (1) {
|
|
59
|
+
switch (_context.prev = _context.next) {
|
|
60
|
+
case 0:
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
_context.next = 3;
|
|
63
|
+
return _background["default"].canDeleteBackground(id);
|
|
64
|
+
|
|
65
|
+
case 3:
|
|
66
|
+
canDelete = _context.sent;
|
|
67
|
+
console.log('canDelete', canDelete);
|
|
68
|
+
|
|
69
|
+
if (canDelete) {
|
|
70
|
+
_dialog["default"].confirm({
|
|
71
|
+
title: '删除',
|
|
72
|
+
messageProps: {
|
|
73
|
+
type: 'warning'
|
|
74
|
+
},
|
|
75
|
+
content: '若执行相关操作,此背景将会从背景库删除,确定删除吗?',
|
|
76
|
+
onOk: function onOk() {
|
|
77
|
+
return onRemove(id);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
_dialog["default"].confirm({
|
|
82
|
+
title: '提示',
|
|
83
|
+
messageProps: {
|
|
84
|
+
type: 'warning'
|
|
85
|
+
},
|
|
86
|
+
content: '此背景被占用,不能删除。',
|
|
87
|
+
footerActions: ['ok'],
|
|
88
|
+
onOk: function onOk() {}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
case 6:
|
|
93
|
+
case "end":
|
|
94
|
+
return _context.stop();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}, _callee);
|
|
98
|
+
}));
|
|
99
|
+
return _remove.apply(this, arguments);
|
|
64
100
|
}
|
|
65
101
|
|
|
66
102
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -121,46 +157,46 @@ function BackgroundView(props) {
|
|
|
121
157
|
}
|
|
122
158
|
|
|
123
159
|
function _getBackground() {
|
|
124
|
-
_getBackground = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
160
|
+
_getBackground = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
125
161
|
var res;
|
|
126
|
-
return _regenerator["default"].wrap(function
|
|
162
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
127
163
|
while (1) {
|
|
128
|
-
switch (
|
|
164
|
+
switch (_context3.prev = _context3.next) {
|
|
129
165
|
case 0:
|
|
130
|
-
|
|
166
|
+
_context3.next = 2;
|
|
131
167
|
return _background["default"].getBackgroundList();
|
|
132
168
|
|
|
133
169
|
case 2:
|
|
134
|
-
res =
|
|
170
|
+
res = _context3.sent;
|
|
135
171
|
setBgList(res);
|
|
136
172
|
|
|
137
173
|
case 4:
|
|
138
174
|
case "end":
|
|
139
|
-
return
|
|
175
|
+
return _context3.stop();
|
|
140
176
|
}
|
|
141
177
|
}
|
|
142
|
-
},
|
|
178
|
+
}, _callee3);
|
|
143
179
|
}));
|
|
144
180
|
return _getBackground.apply(this, arguments);
|
|
145
181
|
}
|
|
146
182
|
|
|
147
|
-
function removeBg(
|
|
183
|
+
function removeBg(_x3) {
|
|
148
184
|
return _removeBg.apply(this, arguments);
|
|
149
185
|
} // 同步拓扑图展示
|
|
150
186
|
|
|
151
187
|
|
|
152
188
|
function _removeBg() {
|
|
153
|
-
_removeBg = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
189
|
+
_removeBg = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(id) {
|
|
154
190
|
var res;
|
|
155
|
-
return _regenerator["default"].wrap(function
|
|
191
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
156
192
|
while (1) {
|
|
157
|
-
switch (
|
|
193
|
+
switch (_context4.prev = _context4.next) {
|
|
158
194
|
case 0:
|
|
159
|
-
|
|
195
|
+
_context4.next = 2;
|
|
160
196
|
return _background["default"].deleteBackground(id);
|
|
161
197
|
|
|
162
198
|
case 2:
|
|
163
|
-
res =
|
|
199
|
+
res = _context4.sent;
|
|
164
200
|
|
|
165
201
|
// 删除当前选中
|
|
166
202
|
if (id === (current === null || current === void 0 ? void 0 : current.id)) {
|
|
@@ -174,10 +210,10 @@ function BackgroundView(props) {
|
|
|
174
210
|
|
|
175
211
|
case 6:
|
|
176
212
|
case "end":
|
|
177
|
-
return
|
|
213
|
+
return _context4.stop();
|
|
178
214
|
}
|
|
179
215
|
}
|
|
180
|
-
},
|
|
216
|
+
}, _callee4);
|
|
181
217
|
}));
|
|
182
218
|
return _removeBg.apply(this, arguments);
|
|
183
219
|
}
|
|
@@ -187,48 +223,48 @@ function BackgroundView(props) {
|
|
|
187
223
|
}
|
|
188
224
|
|
|
189
225
|
var handleSelect = /*#__PURE__*/function () {
|
|
190
|
-
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
226
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(currentBg) {
|
|
191
227
|
var imgUrl, size;
|
|
192
|
-
return _regenerator["default"].wrap(function
|
|
228
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
193
229
|
while (1) {
|
|
194
|
-
switch (
|
|
230
|
+
switch (_context2.prev = _context2.next) {
|
|
195
231
|
case 0:
|
|
196
232
|
if (!(currentBg !== null && currentBg !== void 0 && currentBg.id && currentBg.id !== (current === null || current === void 0 ? void 0 : current.id))) {
|
|
197
|
-
|
|
233
|
+
_context2.next = 16;
|
|
198
234
|
break;
|
|
199
235
|
}
|
|
200
236
|
|
|
201
237
|
setLoadingBackground(true);
|
|
202
238
|
imgUrl = (0, _backgroundUtil.getBackgroundImageUrl)(currentBg);
|
|
203
|
-
|
|
204
|
-
|
|
239
|
+
_context2.prev = 3;
|
|
240
|
+
_context2.next = 6;
|
|
205
241
|
return (0, _imageUtil.getImageSize)(imgUrl);
|
|
206
242
|
|
|
207
243
|
case 6:
|
|
208
|
-
size =
|
|
244
|
+
size = _context2.sent;
|
|
209
245
|
|
|
210
246
|
_rlog["default"].debug('获取图片大小', size);
|
|
211
247
|
|
|
212
248
|
setBackground((0, _extends2["default"])({}, currentBg, size));
|
|
213
249
|
topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
|
|
214
250
|
setLoadingBackground(false);
|
|
215
|
-
|
|
251
|
+
_context2.next = 16;
|
|
216
252
|
break;
|
|
217
253
|
|
|
218
254
|
case 13:
|
|
219
|
-
|
|
220
|
-
|
|
255
|
+
_context2.prev = 13;
|
|
256
|
+
_context2.t0 = _context2["catch"](3);
|
|
221
257
|
setLoadingBackground(false);
|
|
222
258
|
|
|
223
259
|
case 16:
|
|
224
260
|
case "end":
|
|
225
|
-
return
|
|
261
|
+
return _context2.stop();
|
|
226
262
|
}
|
|
227
263
|
}
|
|
228
|
-
},
|
|
264
|
+
}, _callee2, null, [[3, 13]]);
|
|
229
265
|
}));
|
|
230
266
|
|
|
231
|
-
return function handleSelect(
|
|
267
|
+
return function handleSelect(_x4) {
|
|
232
268
|
return _ref.apply(this, arguments);
|
|
233
269
|
};
|
|
234
270
|
}();
|
|
@@ -99,8 +99,9 @@ function NodePropertyView(props) {
|
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
var handleBindTopoChange = function handleBindTopoChange(value, data) {
|
|
102
|
-
//
|
|
103
|
-
node.a('name', data.label);
|
|
102
|
+
// 设置名称为拓扑名称,清空自定义名称
|
|
103
|
+
node.a('name', data.label);
|
|
104
|
+
node.a('customName', null);
|
|
104
105
|
};
|
|
105
106
|
|
|
106
107
|
var renderData = function renderData() {
|
|
@@ -48,7 +48,7 @@ var _PluginManager = _interopRequireDefault(require("./PluginManager"));
|
|
|
48
48
|
var _topoFactory = _interopRequireDefault(require("./topoFactory"));
|
|
49
49
|
|
|
50
50
|
// eslint-disable-next-line no-undef
|
|
51
|
-
var version = typeof "2.15.
|
|
51
|
+
var version = typeof "2.15.44" === 'string' ? "2.15.44" : null;
|
|
52
52
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
53
53
|
/**
|
|
54
54
|
* 拓扑显示和编辑
|
|
@@ -117,6 +117,31 @@ var _default = {
|
|
|
117
117
|
/**
|
|
118
118
|
* 背景图导出
|
|
119
119
|
*/
|
|
120
|
-
EXPORT_BG_ZIP: EXPORT_BG_ZIP
|
|
120
|
+
EXPORT_BG_ZIP: EXPORT_BG_ZIP,
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 校验背景图是否被占用
|
|
124
|
+
* @param {*} params id
|
|
125
|
+
*/
|
|
126
|
+
canDeleteBackground: function canDeleteBackground(id) {
|
|
127
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
128
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
129
|
+
while (1) {
|
|
130
|
+
switch (_context4.prev = _context4.next) {
|
|
131
|
+
case 0:
|
|
132
|
+
_context4.next = 2;
|
|
133
|
+
return (0, _request.getRequest)()("/topo/v1/api/background/" + id);
|
|
134
|
+
|
|
135
|
+
case 2:
|
|
136
|
+
return _context4.abrupt("return", _context4.sent);
|
|
137
|
+
|
|
138
|
+
case 3:
|
|
139
|
+
case "end":
|
|
140
|
+
return _context4.stop();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, _callee4);
|
|
144
|
+
}))();
|
|
145
|
+
}
|
|
121
146
|
};
|
|
122
147
|
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.44",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -110,6 +110,6 @@
|
|
|
110
110
|
"access": "public"
|
|
111
111
|
},
|
|
112
112
|
"license": "MIT",
|
|
113
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.
|
|
113
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.44/build/index.html",
|
|
114
114
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
115
115
|
}
|