@riil-frontend/component-topology 2.15.43 → 2.15.46
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/components/Drawer/index.js +8 -2
- package/es/components/TagImageSelect/index.js +3 -1
- package/es/components/TagSelect/index.js +3 -3
- package/es/components/TemplateButton/index.module.scss +1 -0
- package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
- package/es/core/common/icons/icon.js +1 -1
- package/es/core/common/icons/useIcons.js +1 -1
- package/es/core/components/TopoView/topoView.js +8 -18
- package/es/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
- package/es/core/editor/components/BackgroundView/index.js +80 -44
- package/es/core/editor/components/BackgroundView/index.module.scss +1 -0
- package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +16 -2
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
- package/es/core/editor/components/CustomIconPlugin/index.js +2 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
- package/es/core/editor/components/EditorPlugin.js +2 -2
- package/es/core/editor/components/settings/common/LayoutSettings.js +11 -19
- package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -4
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +13 -8
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
- package/es/core/models/TopoApp.js +9 -5
- package/es/core/services/background.js +26 -1
- package/es/core/store/coreModels.js +32 -26
- package/es/core/store/createStore.js +1 -1
- package/es/core/test/Test.js +3 -1
- package/es/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
- package/es/createTopo.js +1 -1
- package/es/hooks/useAlarm.js +3 -6
- package/es/hooks/useResourceConfig.js +1 -1
- package/es/hooks/useTopoEdit.js +4 -8
- package/es/models/{iconManage.js → customIcon.js} +1 -1
- package/es/models/topoBizMod.js +22 -52
- package/es/models/{topoCreateMod.js → topoConfig.js} +8 -4
- package/es/models/topoMod.js +32 -69
- package/es/{components → topoCenter/components}/Link/form.js +0 -0
- package/es/{components → topoCenter/components}/Link/hook.js +0 -0
- package/es/{components → topoCenter/components}/Link/index copy.js +1 -1
- package/es/{components → topoCenter/components}/Link/index.js +1 -1
- package/es/{components → topoCenter/components}/Link/index.module.scss +0 -0
- package/es/{components → topoCenter/components}/Link/setting.js +0 -0
- package/es/topoCenter/components/TopoView.js +16 -3
- package/es/topoCenter/components/Topology.js +0 -5
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
- package/es/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +3 -3
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
- package/es/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
- package/es/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
- package/es/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
- package/es/{models → topoCenter/store}/linkManager.js +0 -0
- package/lib/components/Drawer/index.js +7 -2
- package/lib/components/TagImageSelect/index.js +3 -1
- package/lib/components/TagSelect/index.js +3 -3
- package/lib/components/TemplateButton/index.module.scss +1 -0
- package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
- package/lib/core/common/icons/icon.js +1 -1
- package/lib/core/common/icons/useIcons.js +1 -1
- package/lib/core/components/TopoView/topoView.js +9 -20
- package/lib/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
- package/lib/core/editor/components/BackgroundView/index.js +80 -44
- package/lib/core/editor/components/BackgroundView/index.module.scss +1 -0
- package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +17 -2
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
- package/lib/core/editor/components/CustomIconPlugin/index.js +11 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
- package/lib/core/editor/components/EditorPlugin.js +2 -2
- package/lib/core/editor/components/settings/common/LayoutSettings.js +10 -18
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +2 -4
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +12 -7
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
- package/lib/core/models/TopoApp.js +9 -5
- package/lib/core/services/background.js +26 -1
- package/lib/core/store/coreModels.js +35 -26
- package/lib/core/store/createStore.js +2 -2
- package/lib/core/test/Test.js +3 -1
- package/lib/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
- package/lib/createTopo.js +1 -1
- package/lib/hooks/useAlarm.js +3 -6
- package/lib/hooks/useResourceConfig.js +1 -1
- package/lib/hooks/useTopoEdit.js +4 -8
- package/lib/models/{iconManage.js → customIcon.js} +1 -1
- package/lib/models/topoBizMod.js +22 -52
- package/lib/models/{topoCreateMod.js → topoConfig.js} +7 -4
- package/lib/models/topoMod.js +32 -69
- package/lib/{components → topoCenter/components}/Link/form.js +0 -0
- package/lib/{components → topoCenter/components}/Link/hook.js +0 -0
- package/lib/{components → topoCenter/components}/Link/index copy.js +1 -1
- package/lib/{components → topoCenter/components}/Link/index.js +1 -1
- package/lib/{components → topoCenter/components}/Link/index.module.scss +0 -0
- package/lib/{components → topoCenter/components}/Link/setting.js +0 -0
- package/lib/topoCenter/components/TopoView.js +19 -3
- package/lib/topoCenter/components/Topology.js +0 -7
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -2
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -8
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +4 -4
- package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
- package/lib/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
- package/lib/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
- package/lib/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
- package/lib/{models → topoCenter/store}/linkManager.js +0 -0
- package/package.json +2 -2
- package/es/core/editor/LinkDynamicStyleConfig.js +0 -16
- package/es/core/store/getStoreModels.js +0 -40
- package/lib/core/editor/LinkDynamicStyleConfig.js +0 -21
- package/lib/core/store/getStoreModels.js +0 -67
|
@@ -23,8 +23,6 @@ var _useTopoEdit = _interopRequireDefault(require("../../../hooks/useTopoEdit"))
|
|
|
23
23
|
|
|
24
24
|
var _useSelection2 = _interopRequireDefault(require("../../../hooks/useSelection"));
|
|
25
25
|
|
|
26
|
-
var _useRelateTopo = _interopRequireDefault(require("../../../hooks/useRelateTopo"));
|
|
27
|
-
|
|
28
26
|
var _showMessage = _interopRequireDefault(require("../../utils/showMessage"));
|
|
29
27
|
|
|
30
28
|
var _EditorPlugin = _interopRequireDefault(require("../../editor/components/EditorPlugin"));
|
|
@@ -39,15 +37,15 @@ var _PropertyView = _interopRequireDefault(require("../../editor/components/sett
|
|
|
39
37
|
|
|
40
38
|
var _BackgroundView = _interopRequireDefault(require("../../editor/components/BackgroundView"));
|
|
41
39
|
|
|
42
|
-
var _TopoViewModule = _interopRequireDefault(require("./TopoView.module.scss"));
|
|
43
|
-
|
|
44
40
|
var _edgeUtil = require("../../utils/edgeUtil");
|
|
45
41
|
|
|
42
|
+
var _TopoViewModule = _interopRequireDefault(require("./TopoView.module.scss"));
|
|
43
|
+
|
|
46
44
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
47
45
|
|
|
48
46
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
49
47
|
|
|
50
|
-
var
|
|
48
|
+
var Topology = function Topology(props) {
|
|
51
49
|
var _classnames, _graphViewProps$creat;
|
|
52
50
|
|
|
53
51
|
var topo = props.topo,
|
|
@@ -63,6 +61,7 @@ var TopoView = function TopoView(props) {
|
|
|
63
61
|
nodeDeleteable = props.nodeDeleteable,
|
|
64
62
|
onNodeDelete = props.onNodeDelete,
|
|
65
63
|
onLineDelete = props.onLineDelete,
|
|
64
|
+
onEvent = props.onEvent,
|
|
66
65
|
_props$graphViewProps = props.graphViewProps,
|
|
67
66
|
graphViewProps = _props$graphViewProps === void 0 ? {} : _props$graphViewProps,
|
|
68
67
|
viewerProps = props.viewerProps,
|
|
@@ -109,10 +108,7 @@ var TopoView = function TopoView(props) {
|
|
|
109
108
|
var onExitEdit = topoEdit.onExitEdit,
|
|
110
109
|
onBindData = topoEdit.onBindData,
|
|
111
110
|
onDeleteElement = topoEdit.onDeleteElement,
|
|
112
|
-
onSaveTopo = topoEdit.onSaveTopo;
|
|
113
|
-
var relateTopo = (0, _useRelateTopo["default"])({
|
|
114
|
-
topo: topo
|
|
115
|
-
}); // useAlarm({
|
|
111
|
+
onSaveTopo = topoEdit.onSaveTopo; // useAlarm({
|
|
116
112
|
// topo,
|
|
117
113
|
// });
|
|
118
114
|
|
|
@@ -141,13 +137,6 @@ var TopoView = function TopoView(props) {
|
|
|
141
137
|
(0, _react.useEffect)(function () {
|
|
142
138
|
// rlog.debug("TopoView.useEffect topoData", topoData);
|
|
143
139
|
setTData(buildLoadOptions ? buildLoadOptions(topoData) : topoData);
|
|
144
|
-
|
|
145
|
-
if (topoData) {
|
|
146
|
-
// TODO 移到模型中
|
|
147
|
-
topoDispatchers.update({
|
|
148
|
-
currentTopo: topoData.config
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
140
|
}, [topoData]);
|
|
152
141
|
(0, _react.useEffect)(function () {
|
|
153
142
|
return function () {
|
|
@@ -207,7 +196,7 @@ var TopoView = function TopoView(props) {
|
|
|
207
196
|
var handleEvent = function handleEvent(event) {
|
|
208
197
|
_rlog["default"].debug("TopoView:onEvent", event);
|
|
209
198
|
|
|
210
|
-
|
|
199
|
+
onEvent(event);
|
|
211
200
|
topoEdit.onEvent(event);
|
|
212
201
|
|
|
213
202
|
switch (event.name) {
|
|
@@ -310,7 +299,7 @@ var TopoView = function TopoView(props) {
|
|
|
310
299
|
}));
|
|
311
300
|
};
|
|
312
301
|
|
|
313
|
-
|
|
302
|
+
Topology.propTypes = {
|
|
314
303
|
// 拓扑模型
|
|
315
304
|
topo: _propTypes["default"].any.isRequired,
|
|
316
305
|
defaultEnterEditMode: _propTypes["default"].bool,
|
|
@@ -330,11 +319,11 @@ TopoView.propTypes = {
|
|
|
330
319
|
*/
|
|
331
320
|
titleBar: _propTypes["default"].oneOf([_react["default"].ReactNode, false])
|
|
332
321
|
};
|
|
333
|
-
|
|
322
|
+
Topology.defaultProps = {
|
|
334
323
|
defaultEnterEditMode: false,
|
|
335
324
|
viewerProps: {},
|
|
336
325
|
editorProps: {} // titleBar: false,
|
|
337
326
|
|
|
338
327
|
};
|
|
339
|
-
var _default =
|
|
328
|
+
var _default = Topology;
|
|
340
329
|
exports["default"] = _default;
|
|
@@ -8,7 +8,7 @@ exports.createTopology = void 0;
|
|
|
8
8
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
|
|
11
|
-
var _TopoApp = _interopRequireDefault(require("./TopoApp"));
|
|
11
|
+
var _TopoApp = _interopRequireDefault(require("./models/TopoApp"));
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
@@ -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
|
}();
|
package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports["default"] =
|
|
6
|
+
exports["default"] = CustomIconPlugin;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -15,10 +15,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
|
|
18
|
-
function
|
|
18
|
+
function CustomIconPlugin(props) {
|
|
19
19
|
var topo = props.topo;
|
|
20
20
|
var store = topo.store;
|
|
21
|
-
var dispatchers = store.getModelDispatchers('
|
|
21
|
+
var dispatchers = store.getModelDispatchers('customIcon'); // 初始化时注册事件
|
|
22
22
|
|
|
23
23
|
(0, _react.useEffect)(function () {
|
|
24
24
|
var notifier = topo.view.topoClient.notifier; // 测试代码
|
|
@@ -31,7 +31,7 @@ function RenameDialog(props) {
|
|
|
31
31
|
var topo = props.topo;
|
|
32
32
|
var store = topo.store;
|
|
33
33
|
|
|
34
|
-
var _store$useModel = store.useModel('
|
|
34
|
+
var _store$useModel = store.useModel('customIcon'),
|
|
35
35
|
state = _store$useModel[0],
|
|
36
36
|
dispatchers = _store$useModel[1];
|
|
37
37
|
|
|
@@ -35,6 +35,8 @@ var _UploadIconDialogModule = _interopRequireDefault(require("./UploadIconDialog
|
|
|
35
35
|
|
|
36
36
|
require("./UploadIconDialog.scss");
|
|
37
37
|
|
|
38
|
+
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
|
39
|
+
|
|
38
40
|
var config = _configProvider["default"].config;
|
|
39
41
|
|
|
40
42
|
function getFileName(file) {
|
|
@@ -120,7 +122,18 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
120
122
|
|
|
121
123
|
_this.setState({
|
|
122
124
|
files: validFiles
|
|
123
|
-
});
|
|
125
|
+
}); // 上传接口报错后只会通知该回调,移除上传loading
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
if (_this.state.uploading && files.filter(function (file) {
|
|
129
|
+
return file.state === 'error';
|
|
130
|
+
}).length && !files.filter(function (file) {
|
|
131
|
+
return file.state === 'uploading';
|
|
132
|
+
}).length) {
|
|
133
|
+
_this.setState({
|
|
134
|
+
uploading: false
|
|
135
|
+
});
|
|
136
|
+
}
|
|
124
137
|
};
|
|
125
138
|
|
|
126
139
|
_this.submit = function () {
|
|
@@ -220,7 +233,9 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
220
233
|
});
|
|
221
234
|
};
|
|
222
235
|
|
|
223
|
-
_this.handleUploadError = function () {
|
|
236
|
+
_this.handleUploadError = function () {
|
|
237
|
+
_rlog["default"].error('上传失败');
|
|
238
|
+
};
|
|
224
239
|
|
|
225
240
|
_this.onClose = function () {
|
|
226
241
|
var dispatchers = _this.props.dispatchers;
|
package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss
RENAMED
|
File without changes
|
|
File without changes
|
package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js
RENAMED
|
@@ -17,7 +17,7 @@ function UploadIconDialogWrapper(props) {
|
|
|
17
17
|
var topo = props.topo;
|
|
18
18
|
var store = topo.store;
|
|
19
19
|
|
|
20
|
-
var _store$useModel = store.useModel('
|
|
20
|
+
var _store$useModel = store.useModel('customIcon'),
|
|
21
21
|
state = _store$useModel[0],
|
|
22
22
|
dispatchers = _store$useModel[1];
|
|
23
23
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _CustomIconPlugin = _interopRequireDefault(require("./CustomIconPlugin"));
|
|
9
|
+
|
|
10
|
+
var _default = _CustomIconPlugin["default"];
|
|
11
|
+
exports["default"] = _default;
|
|
File without changes
|
|
@@ -9,7 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _CustomIconPlugin = _interopRequireDefault(require("./CustomIconPlugin"));
|
|
13
13
|
|
|
14
14
|
var _SaveLoading = _interopRequireDefault(require("./plugins/SaveLoading"));
|
|
15
15
|
|
|
@@ -23,7 +23,7 @@ function TopoEditorPlugin(props) {
|
|
|
23
23
|
topoEdit = props.topoEdit,
|
|
24
24
|
editorProps = props.editorProps;
|
|
25
25
|
var store = topo.store;
|
|
26
|
-
var plugins = [_SaveLoading["default"], _GroupAddResourceDrawerPlugin["default"], _MultipleResourceSelectPlugin["default"],
|
|
26
|
+
var plugins = [_SaveLoading["default"], _GroupAddResourceDrawerPlugin["default"], _MultipleResourceSelectPlugin["default"], _CustomIconPlugin["default"]].concat((editorProps === null || editorProps === void 0 ? void 0 : editorProps.plugins) || []);
|
|
27
27
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, plugins.map(function (Plugin, index) {
|
|
28
28
|
return /*#__PURE__*/_react["default"].createElement(Plugin, (0, _extends2["default"])({
|
|
29
29
|
key: index,
|
|
@@ -37,33 +37,25 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
37
37
|
var _props$layout = props.layout,
|
|
38
38
|
layout = _props$layout === void 0 ? {} : _props$layout,
|
|
39
39
|
onChange = props.onChange,
|
|
40
|
+
regionId = props.regionId,
|
|
40
41
|
size = props.size;
|
|
41
42
|
var layoutId = layout.id,
|
|
42
|
-
layoutOptions = layout.options;
|
|
43
|
-
|
|
44
|
-
var _useState = (0, _react.useState)(layout || {}),
|
|
45
|
-
value = _useState[0],
|
|
46
|
-
setValue = _useState[1];
|
|
43
|
+
layoutOptions = layout.options; // const [value, setValue] = useState();
|
|
47
44
|
|
|
48
45
|
var handleChange = function handleChange(data) {
|
|
49
|
-
|
|
50
|
-
onChange && onChange(data); // setValue({
|
|
51
|
-
// id: data,
|
|
52
|
-
// options: {
|
|
53
|
-
// value: "east",
|
|
54
|
-
// label: "横向",
|
|
55
|
-
// },
|
|
56
|
-
// });
|
|
46
|
+
onChange && onChange(data);
|
|
57
47
|
};
|
|
58
48
|
|
|
59
49
|
var onLayoutSelect = function onLayoutSelect(id) {
|
|
50
|
+
// console.log("onLayoutSelect", id, layout, value);
|
|
60
51
|
var options;
|
|
61
52
|
|
|
62
53
|
if (id === "toward") {
|
|
63
54
|
options = {
|
|
64
55
|
subId: TREE_LAYOUT_OPTIONS[0].value
|
|
65
56
|
};
|
|
66
|
-
}
|
|
57
|
+
} // setValue(id);
|
|
58
|
+
|
|
67
59
|
|
|
68
60
|
handleChange({
|
|
69
61
|
id: id,
|
|
@@ -76,14 +68,14 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
76
68
|
id: id,
|
|
77
69
|
name: LAYOUTS[id],
|
|
78
70
|
icon: "layout_" + id,
|
|
79
|
-
selected: layoutId === id
|
|
80
|
-
onSelect: onLayoutSelect
|
|
71
|
+
selected: layoutId === id
|
|
81
72
|
};
|
|
82
73
|
});
|
|
83
74
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
84
75
|
className: _LayoutSettingsModule["default"]["layout-setting-template-group"]
|
|
85
76
|
}, /*#__PURE__*/_react["default"].createElement(_TagImageSelect["default"], {
|
|
86
77
|
dataSource: layoutGroup,
|
|
78
|
+
value: layoutId,
|
|
87
79
|
size: size,
|
|
88
80
|
onChange: onLayoutSelect,
|
|
89
81
|
boxProps: {
|
|
@@ -102,7 +94,7 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
102
94
|
iconClassName: _LayoutSettingsModule["default"].icon,
|
|
103
95
|
textClassName: _LayoutSettingsModule["default"].text
|
|
104
96
|
}
|
|
105
|
-
}), layoutId === "toward"
|
|
97
|
+
}), layoutId === "toward" ? /*#__PURE__*/_react["default"].createElement(_form["default"].Item, {
|
|
106
98
|
label: "\u5E03\u5C40\u65B9\u5411"
|
|
107
99
|
}, /*#__PURE__*/_react["default"].createElement(_radio["default"].Group, {
|
|
108
100
|
dataSource: TREE_LAYOUT_OPTIONS,
|
|
@@ -115,7 +107,7 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
115
107
|
}
|
|
116
108
|
});
|
|
117
109
|
}
|
|
118
|
-
})));
|
|
110
|
+
})) : null);
|
|
119
111
|
};
|
|
120
112
|
|
|
121
113
|
var _default = LayoutSettings;
|
|
@@ -18,7 +18,7 @@ var _sortBy = _interopRequireDefault(require("lodash/sortBy"));
|
|
|
18
18
|
var _htElementUtils = require("../../../../../../../../utils/htElementUtils");
|
|
19
19
|
|
|
20
20
|
function sortResourcesByName(resources) {
|
|
21
|
-
return (0, _sortBy["default"])(resources,
|
|
21
|
+
return (0, _sortBy["default"])(resources, "name");
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function useGroupRelateResource(props) {
|
|
@@ -45,9 +45,7 @@ function useGroupRelateResource(props) {
|
|
|
45
45
|
data: item,
|
|
46
46
|
node: item.node
|
|
47
47
|
};
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
_rlog["default"].info('useGroupRelateResource', data);
|
|
48
|
+
}); // rlog.info('useGroupRelateResource', data);
|
|
51
49
|
|
|
52
50
|
return data;
|
|
53
51
|
}
|
package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js
CHANGED
|
@@ -30,6 +30,7 @@ function GroupExpandSetting(props) {
|
|
|
30
30
|
group = props.group,
|
|
31
31
|
expanded = props.expanded,
|
|
32
32
|
onChange = props.onChange,
|
|
33
|
+
id = props.id,
|
|
33
34
|
settingRuntimeState = props.settingRuntimeState;
|
|
34
35
|
|
|
35
36
|
var _useState = (0, _react.useState)(),
|
|
@@ -37,22 +38,26 @@ function GroupExpandSetting(props) {
|
|
|
37
38
|
setLayout = _useState[1];
|
|
38
39
|
|
|
39
40
|
var alignOnChange = function alignOnChange(v) {
|
|
40
|
-
console.log(
|
|
41
|
-
|
|
42
|
-
onChange(
|
|
41
|
+
// console.log("setAlignmentBySelectionNodes", v);
|
|
42
|
+
// topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
|
|
43
|
+
onChange("groupAlign", v); // topoEditApi.setAlignmentBySelectionNodes(v);
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
var layoutOnChange = function layoutOnChange(v) {
|
|
46
|
-
console.log(
|
|
47
|
+
// console.log("layoutOnChange", v);
|
|
47
48
|
setLayout(v); // topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
|
|
48
49
|
|
|
49
|
-
onChange(
|
|
50
|
+
onChange("layout", v); // topoEditApi.setAlignmentBySelectionNodes(v);
|
|
50
51
|
};
|
|
51
52
|
|
|
53
|
+
(0, _react.useEffect)(function () {
|
|
54
|
+
// console.log("GroupExpandSetting-id-layout", id, layout);
|
|
55
|
+
setLayout({}); // onChange("layout", {});
|
|
56
|
+
}, [id]);
|
|
52
57
|
return /*#__PURE__*/_react["default"].createElement(_collapse["default"], {
|
|
53
|
-
defaultExpandedKeys: [
|
|
58
|
+
defaultExpandedKeys: ["布局", "显示设置", "对齐方式"],
|
|
54
59
|
style: {
|
|
55
|
-
border:
|
|
60
|
+
border: "none"
|
|
56
61
|
}
|
|
57
62
|
}, /*#__PURE__*/_react["default"].createElement(CollapsePanel, {
|
|
58
63
|
key: "\u5E03\u5C40",
|
|
@@ -42,6 +42,7 @@ function GroupSetting(props) {
|
|
|
42
42
|
editorProps = props.editorProps,
|
|
43
43
|
group = props.group;
|
|
44
44
|
var expanded = values.expanded;
|
|
45
|
+
var id = values.id;
|
|
45
46
|
|
|
46
47
|
var field = _field["default"].useField({
|
|
47
48
|
autoUnmount: false,
|
|
@@ -116,6 +117,7 @@ function GroupSetting(props) {
|
|
|
116
117
|
maxLength: 30,
|
|
117
118
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
118
119
|
})), expanded ? /*#__PURE__*/_react["default"].createElement(_GroupExpandSetting["default"], {
|
|
120
|
+
id: id,
|
|
119
121
|
group: group,
|
|
120
122
|
expanded: expanded,
|
|
121
123
|
topo: topo,
|