@riil-frontend/component-topology 2.4.1 → 2.4.2
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 +7 -7
- package/es/core/components/titlebar/TitleBar.module.scss +7 -1
- package/es/core/editor/components/settings/Settings.module.scss +2 -1
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +2 -1
- package/es/topoCenter/store/topoTreeMod.d.ts +0 -1
- package/es/topoCenter/store/topoTreeMod.js +30 -107
- package/lib/core/components/titlebar/TitleBar.module.scss +7 -1
- package/lib/core/editor/components/settings/Settings.module.scss +2 -1
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +3 -1
- package/lib/topoCenter/store/topoTreeMod.d.ts +0 -1
- package/lib/topoCenter/store/topoTreeMod.js +30 -108
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.titlebar {
|
|
2
2
|
display: flex;
|
|
3
|
-
padding: 12px
|
|
3
|
+
padding: 12px 16px;
|
|
4
4
|
|
|
5
5
|
.left {
|
|
6
6
|
flex: 1;
|
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
&.titlebarEditMode {
|
|
15
|
+
padding: 10px 16px;
|
|
16
|
+
box-shadow: 0px -1px 0px 0px #EBE8E8;
|
|
17
|
+
border-bottom: 1px solid #E6E7EB;
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
.title {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import _Button from "@alifd/next/lib/button";
|
|
2
2
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
3
4
|
import TitleWidget from "../../../components/titlebar/widgets/TitleWidget";
|
|
4
5
|
import styles from "../../../components/titlebar/TitleBar.module.scss";
|
|
5
6
|
export default function TopoEditorTitleBar(props) {
|
|
6
7
|
var topo = props.topo,
|
|
7
8
|
topoEditApi = props.topoEditApi;
|
|
8
9
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
className: styles.titlebar
|
|
10
|
+
className: classnames(styles.titlebar, styles.titlebarEditMode)
|
|
10
11
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11
12
|
className: styles.left
|
|
12
13
|
}, /*#__PURE__*/React.createElement(TitleWidget, {
|
|
@@ -55,7 +55,6 @@ export default function _default(topoApp: any): {
|
|
|
55
55
|
fetchTopoTree(payload: any, rootState: any): Promise<void>;
|
|
56
56
|
getSelectedTopoId(payload: any, rootState: any): any;
|
|
57
57
|
refreshTree(payload: any, rootState: any): Promise<void>;
|
|
58
|
-
addNewTopo(params: {}, state: any): Promise<void>;
|
|
59
58
|
editTopoOnTree(conditions: {}, state: any): Promise<void>;
|
|
60
59
|
/**
|
|
61
60
|
* 节指定的点和子节点是否包含指定的拓扑
|
|
@@ -128,102 +128,25 @@ export default function (topoApp) {
|
|
|
128
128
|
}, _callee2);
|
|
129
129
|
}))();
|
|
130
130
|
},
|
|
131
|
-
|
|
131
|
+
editTopoOnTree: function editTopoOnTree(conditions, state) {
|
|
132
132
|
var _this3 = this;
|
|
133
133
|
|
|
134
134
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
135
|
-
var resTreeData,
|
|
135
|
+
var resTreeData, treeData;
|
|
136
136
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
137
137
|
while (1) {
|
|
138
138
|
switch (_context3.prev = _context3.next) {
|
|
139
|
-
case 0:
|
|
140
|
-
if (params === void 0) {
|
|
141
|
-
params = {};
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
_context3.next = 3;
|
|
145
|
-
return topoServer.addNewTopo(params);
|
|
146
|
-
|
|
147
|
-
case 3:
|
|
148
|
-
resTreeData = _context3.sent;
|
|
149
|
-
|
|
150
|
-
if (resTreeData) {
|
|
151
|
-
_context3.next = 6;
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return _context3.abrupt("return");
|
|
156
|
-
|
|
157
|
-
case 6:
|
|
158
|
-
node = {
|
|
159
|
-
id: "" + resTreeData,
|
|
160
|
-
label: params.name,
|
|
161
|
-
parentId: params.parentId,
|
|
162
|
-
icon: iconImg[params.type],
|
|
163
|
-
showDefault: false,
|
|
164
|
-
type: params.type,
|
|
165
|
-
permission: 'write'
|
|
166
|
-
};
|
|
167
|
-
treeDataClone = clone(state.topoTreeMod.treeData);
|
|
168
|
-
|
|
169
|
-
if (params.parentId === -1) {
|
|
170
|
-
treeDataClone.push(node);
|
|
171
|
-
} else {
|
|
172
|
-
loopTree(treeDataClone, params.parentId, function (parent, index, arr) {
|
|
173
|
-
parent.children = [].concat(parent.children || [], [_extends({}, node)]);
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
updateData = _extends({
|
|
178
|
-
treeData: treeNodeCount(treeDataClone),
|
|
179
|
-
selectedNode: ["" + resTreeData]
|
|
180
|
-
}, params.type === 1 ? {
|
|
181
|
-
expandedKeys: [].concat(state.topoTreeMod.expandedKeys || [], ["" + params.parentId])
|
|
182
|
-
} : {});
|
|
183
|
-
rlog.debug('addNewTopo', {
|
|
184
|
-
updateData: updateData,
|
|
185
|
-
state: state
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
_this3.update(updateData);
|
|
189
|
-
|
|
190
|
-
if (params.type === 1) {
|
|
191
|
-
newNode = {
|
|
192
|
-
id: "" + resTreeData,
|
|
193
|
-
name: params.name
|
|
194
|
-
};
|
|
195
|
-
dispatch.topoCenter.openCreateTopoPage(newNode);
|
|
196
|
-
|
|
197
|
-
_this3.refreshTree();
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
case 13:
|
|
201
|
-
case "end":
|
|
202
|
-
return _context3.stop();
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}, _callee3);
|
|
206
|
-
}))();
|
|
207
|
-
},
|
|
208
|
-
editTopoOnTree: function editTopoOnTree(conditions, state) {
|
|
209
|
-
var _this4 = this;
|
|
210
|
-
|
|
211
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
212
|
-
var resTreeData, treeData;
|
|
213
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
214
|
-
while (1) {
|
|
215
|
-
switch (_context4.prev = _context4.next) {
|
|
216
139
|
case 0:
|
|
217
140
|
if (conditions === void 0) {
|
|
218
141
|
conditions = {};
|
|
219
142
|
}
|
|
220
143
|
|
|
221
144
|
rlog.debug('editTopoOnTree', conditions);
|
|
222
|
-
|
|
145
|
+
_context3.next = 4;
|
|
223
146
|
return topoServer.editTopoonTree(parseInt(conditions.id, 10), conditions.name, conditions.type);
|
|
224
147
|
|
|
225
148
|
case 4:
|
|
226
|
-
resTreeData =
|
|
149
|
+
resTreeData = _context3.sent;
|
|
227
150
|
treeData = clone(state.topoTreeMod.treeData);
|
|
228
151
|
|
|
229
152
|
if (resTreeData) {
|
|
@@ -231,7 +154,7 @@ export default function (topoApp) {
|
|
|
231
154
|
arr[index].label = conditions.name;
|
|
232
155
|
});
|
|
233
156
|
|
|
234
|
-
|
|
157
|
+
_this3.update({
|
|
235
158
|
treeData: treeData
|
|
236
159
|
});
|
|
237
160
|
|
|
@@ -245,10 +168,10 @@ export default function (topoApp) {
|
|
|
245
168
|
|
|
246
169
|
case 7:
|
|
247
170
|
case "end":
|
|
248
|
-
return
|
|
171
|
+
return _context3.stop();
|
|
249
172
|
}
|
|
250
173
|
}
|
|
251
|
-
},
|
|
174
|
+
}, _callee3);
|
|
252
175
|
}))();
|
|
253
176
|
},
|
|
254
177
|
|
|
@@ -280,34 +203,34 @@ export default function (topoApp) {
|
|
|
280
203
|
* @param {*} state
|
|
281
204
|
*/
|
|
282
205
|
deleteTopoOnTree: function deleteTopoOnTree(conditions, state) {
|
|
283
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
206
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
284
207
|
var currentTopoId, isDeleteCurrentP;
|
|
285
|
-
return _regeneratorRuntime.wrap(function
|
|
208
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
286
209
|
while (1) {
|
|
287
|
-
switch (
|
|
210
|
+
switch (_context4.prev = _context4.next) {
|
|
288
211
|
case 0:
|
|
289
212
|
rlog.debug('deleteTopoOnTree', conditions, state, dispatch.topoMod);
|
|
290
213
|
currentTopoId = state.topoMod.topoId;
|
|
291
214
|
|
|
292
215
|
if (!("" + conditions === "" + currentTopoId)) {
|
|
293
|
-
|
|
216
|
+
_context4.next = 13;
|
|
294
217
|
break;
|
|
295
218
|
}
|
|
296
219
|
|
|
297
220
|
rlog.debug('deleteTopo-currentTopo', conditions);
|
|
298
|
-
|
|
221
|
+
_context4.next = 6;
|
|
299
222
|
return dispatch.topoMod.updateDelId("" + conditions);
|
|
300
223
|
|
|
301
224
|
case 6:
|
|
302
|
-
|
|
225
|
+
_context4.next = 8;
|
|
303
226
|
return topoApp.alarm.close();
|
|
304
227
|
|
|
305
228
|
case 8:
|
|
306
|
-
|
|
229
|
+
_context4.next = 10;
|
|
307
230
|
return topoServer.deleteTopoonTree(parseInt(conditions, 10));
|
|
308
231
|
|
|
309
232
|
case 10:
|
|
310
|
-
return
|
|
233
|
+
return _context4.abrupt("return", _context4.sent);
|
|
311
234
|
|
|
312
235
|
case 13:
|
|
313
236
|
// 判断删除的拓扑或文件,是否包含当前拓扑,如果包含就先关闭告警
|
|
@@ -319,49 +242,49 @@ export default function (topoApp) {
|
|
|
319
242
|
});
|
|
320
243
|
|
|
321
244
|
if (!isDeleteCurrentP) {
|
|
322
|
-
|
|
245
|
+
_context4.next = 18;
|
|
323
246
|
break;
|
|
324
247
|
}
|
|
325
248
|
|
|
326
|
-
|
|
249
|
+
_context4.next = 18;
|
|
327
250
|
return topoApp.alarm.close();
|
|
328
251
|
|
|
329
252
|
case 18:
|
|
330
|
-
|
|
253
|
+
_context4.next = 20;
|
|
331
254
|
return topoServer.deleteTopoonTree(parseInt(conditions, 10));
|
|
332
255
|
|
|
333
256
|
case 20:
|
|
334
|
-
return
|
|
257
|
+
return _context4.abrupt("return", _context4.sent);
|
|
335
258
|
|
|
336
259
|
case 21:
|
|
337
260
|
case "end":
|
|
338
|
-
return
|
|
261
|
+
return _context4.stop();
|
|
339
262
|
}
|
|
340
263
|
}
|
|
341
|
-
},
|
|
264
|
+
}, _callee4);
|
|
342
265
|
}))();
|
|
343
266
|
},
|
|
344
267
|
setDefTopoOnTree: function setDefTopoOnTree(conditions, state) {
|
|
345
|
-
var
|
|
268
|
+
var _this4 = this;
|
|
346
269
|
|
|
347
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
270
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
348
271
|
var resTreeData;
|
|
349
|
-
return _regeneratorRuntime.wrap(function
|
|
272
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
350
273
|
while (1) {
|
|
351
|
-
switch (
|
|
274
|
+
switch (_context5.prev = _context5.next) {
|
|
352
275
|
case 0:
|
|
353
276
|
if (conditions === void 0) {
|
|
354
277
|
conditions = {};
|
|
355
278
|
}
|
|
356
279
|
|
|
357
280
|
rlog.debug('setDefTopoOnTree', conditions);
|
|
358
|
-
|
|
281
|
+
_context5.next = 4;
|
|
359
282
|
return topoServer.setDefTopo(parseInt(conditions, 10));
|
|
360
283
|
|
|
361
284
|
case 4:
|
|
362
|
-
resTreeData =
|
|
285
|
+
resTreeData = _context5.sent;
|
|
363
286
|
|
|
364
|
-
|
|
287
|
+
_this4.refreshTree(); // let treeData = clone(state.topoTreeMod.treeData);
|
|
365
288
|
// loopTree(
|
|
366
289
|
// treeData,
|
|
367
290
|
// conditions,
|
|
@@ -380,10 +303,10 @@ export default function (topoApp) {
|
|
|
380
303
|
|
|
381
304
|
case 6:
|
|
382
305
|
case "end":
|
|
383
|
-
return
|
|
306
|
+
return _context5.stop();
|
|
384
307
|
}
|
|
385
308
|
}
|
|
386
|
-
},
|
|
309
|
+
}, _callee5);
|
|
387
310
|
}))();
|
|
388
311
|
},
|
|
389
312
|
setDefaultTopoId: function setDefaultTopoId(defaultTopoId) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.titlebar {
|
|
2
2
|
display: flex;
|
|
3
|
-
padding: 12px
|
|
3
|
+
padding: 12px 16px;
|
|
4
4
|
|
|
5
5
|
.left {
|
|
6
6
|
flex: 1;
|
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
&.titlebarEditMode {
|
|
15
|
+
padding: 10px 16px;
|
|
16
|
+
box-shadow: 0px -1px 0px 0px #EBE8E8;
|
|
17
|
+
border-bottom: 1px solid #E6E7EB;
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
.title {
|
|
@@ -11,6 +11,8 @@ var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
14
16
|
var _TitleWidget = _interopRequireDefault(require("../../../components/titlebar/widgets/TitleWidget"));
|
|
15
17
|
|
|
16
18
|
var _TitleBarModule = _interopRequireDefault(require("../../../components/titlebar/TitleBar.module.scss"));
|
|
@@ -19,7 +21,7 @@ function TopoEditorTitleBar(props) {
|
|
|
19
21
|
var topo = props.topo,
|
|
20
22
|
topoEditApi = props.topoEditApi;
|
|
21
23
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
22
|
-
className: _TitleBarModule["default"].titlebar
|
|
24
|
+
className: (0, _classnames["default"])(_TitleBarModule["default"].titlebar, _TitleBarModule["default"].titlebarEditMode)
|
|
23
25
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
24
26
|
className: _TitleBarModule["default"].left
|
|
25
27
|
}, /*#__PURE__*/_react["default"].createElement(_TitleWidget["default"], {
|
|
@@ -55,7 +55,6 @@ export default function _default(topoApp: any): {
|
|
|
55
55
|
fetchTopoTree(payload: any, rootState: any): Promise<void>;
|
|
56
56
|
getSelectedTopoId(payload: any, rootState: any): any;
|
|
57
57
|
refreshTree(payload: any, rootState: any): Promise<void>;
|
|
58
|
-
addNewTopo(params: {}, state: any): Promise<void>;
|
|
59
58
|
editTopoOnTree(conditions: {}, state: any): Promise<void>;
|
|
60
59
|
/**
|
|
61
60
|
* 节指定的点和子节点是否包含指定的拓扑
|
|
@@ -141,92 +141,14 @@ function _default(topoApp) {
|
|
|
141
141
|
}, _callee2);
|
|
142
142
|
}))();
|
|
143
143
|
},
|
|
144
|
-
|
|
144
|
+
editTopoOnTree: function editTopoOnTree(conditions, state) {
|
|
145
145
|
var _this3 = this;
|
|
146
146
|
|
|
147
147
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
148
|
-
var resTreeData,
|
|
148
|
+
var resTreeData, treeData;
|
|
149
149
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
150
150
|
while (1) {
|
|
151
151
|
switch (_context3.prev = _context3.next) {
|
|
152
|
-
case 0:
|
|
153
|
-
if (params === void 0) {
|
|
154
|
-
params = {};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
_context3.next = 3;
|
|
158
|
-
return _topo["default"].addNewTopo(params);
|
|
159
|
-
|
|
160
|
-
case 3:
|
|
161
|
-
resTreeData = _context3.sent;
|
|
162
|
-
|
|
163
|
-
if (resTreeData) {
|
|
164
|
-
_context3.next = 6;
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return _context3.abrupt("return");
|
|
169
|
-
|
|
170
|
-
case 6:
|
|
171
|
-
node = {
|
|
172
|
-
id: "" + resTreeData,
|
|
173
|
-
label: params.name,
|
|
174
|
-
parentId: params.parentId,
|
|
175
|
-
icon: _tree.iconImg[params.type],
|
|
176
|
-
showDefault: false,
|
|
177
|
-
type: params.type,
|
|
178
|
-
permission: 'write'
|
|
179
|
-
};
|
|
180
|
-
treeDataClone = clone(state.topoTreeMod.treeData);
|
|
181
|
-
|
|
182
|
-
if (params.parentId === -1) {
|
|
183
|
-
treeDataClone.push(node);
|
|
184
|
-
} else {
|
|
185
|
-
(0, _tree.loopTree)(treeDataClone, params.parentId, function (parent, index, arr) {
|
|
186
|
-
parent.children = [].concat(parent.children || [], [(0, _extends2["default"])({}, node)]);
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
updateData = (0, _extends2["default"])({
|
|
191
|
-
treeData: (0, _tree.treeNodeCount)(treeDataClone),
|
|
192
|
-
selectedNode: ["" + resTreeData]
|
|
193
|
-
}, params.type === 1 ? {
|
|
194
|
-
expandedKeys: [].concat(state.topoTreeMod.expandedKeys || [], ["" + params.parentId])
|
|
195
|
-
} : {});
|
|
196
|
-
|
|
197
|
-
_rlog["default"].debug('addNewTopo', {
|
|
198
|
-
updateData: updateData,
|
|
199
|
-
state: state
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
_this3.update(updateData);
|
|
203
|
-
|
|
204
|
-
if (params.type === 1) {
|
|
205
|
-
newNode = {
|
|
206
|
-
id: "" + resTreeData,
|
|
207
|
-
name: params.name
|
|
208
|
-
};
|
|
209
|
-
dispatch.topoCenter.openCreateTopoPage(newNode);
|
|
210
|
-
|
|
211
|
-
_this3.refreshTree();
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
case 13:
|
|
215
|
-
case "end":
|
|
216
|
-
return _context3.stop();
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}, _callee3);
|
|
220
|
-
}))();
|
|
221
|
-
},
|
|
222
|
-
editTopoOnTree: function editTopoOnTree(conditions, state) {
|
|
223
|
-
var _this4 = this;
|
|
224
|
-
|
|
225
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
226
|
-
var resTreeData, treeData;
|
|
227
|
-
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
228
|
-
while (1) {
|
|
229
|
-
switch (_context4.prev = _context4.next) {
|
|
230
152
|
case 0:
|
|
231
153
|
if (conditions === void 0) {
|
|
232
154
|
conditions = {};
|
|
@@ -234,11 +156,11 @@ function _default(topoApp) {
|
|
|
234
156
|
|
|
235
157
|
_rlog["default"].debug('editTopoOnTree', conditions);
|
|
236
158
|
|
|
237
|
-
|
|
159
|
+
_context3.next = 4;
|
|
238
160
|
return _topo["default"].editTopoonTree(parseInt(conditions.id, 10), conditions.name, conditions.type);
|
|
239
161
|
|
|
240
162
|
case 4:
|
|
241
|
-
resTreeData =
|
|
163
|
+
resTreeData = _context3.sent;
|
|
242
164
|
treeData = clone(state.topoTreeMod.treeData);
|
|
243
165
|
|
|
244
166
|
if (resTreeData) {
|
|
@@ -246,7 +168,7 @@ function _default(topoApp) {
|
|
|
246
168
|
arr[index].label = conditions.name;
|
|
247
169
|
});
|
|
248
170
|
|
|
249
|
-
|
|
171
|
+
_this3.update({
|
|
250
172
|
treeData: treeData
|
|
251
173
|
});
|
|
252
174
|
|
|
@@ -260,10 +182,10 @@ function _default(topoApp) {
|
|
|
260
182
|
|
|
261
183
|
case 7:
|
|
262
184
|
case "end":
|
|
263
|
-
return
|
|
185
|
+
return _context3.stop();
|
|
264
186
|
}
|
|
265
187
|
}
|
|
266
|
-
},
|
|
188
|
+
}, _callee3);
|
|
267
189
|
}))();
|
|
268
190
|
},
|
|
269
191
|
|
|
@@ -295,36 +217,36 @@ function _default(topoApp) {
|
|
|
295
217
|
* @param {*} state
|
|
296
218
|
*/
|
|
297
219
|
deleteTopoOnTree: function deleteTopoOnTree(conditions, state) {
|
|
298
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
220
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
299
221
|
var currentTopoId, isDeleteCurrentP;
|
|
300
|
-
return _regenerator["default"].wrap(function
|
|
222
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
301
223
|
while (1) {
|
|
302
|
-
switch (
|
|
224
|
+
switch (_context4.prev = _context4.next) {
|
|
303
225
|
case 0:
|
|
304
226
|
_rlog["default"].debug('deleteTopoOnTree', conditions, state, dispatch.topoMod);
|
|
305
227
|
|
|
306
228
|
currentTopoId = state.topoMod.topoId;
|
|
307
229
|
|
|
308
230
|
if (!("" + conditions === "" + currentTopoId)) {
|
|
309
|
-
|
|
231
|
+
_context4.next = 13;
|
|
310
232
|
break;
|
|
311
233
|
}
|
|
312
234
|
|
|
313
235
|
_rlog["default"].debug('deleteTopo-currentTopo', conditions);
|
|
314
236
|
|
|
315
|
-
|
|
237
|
+
_context4.next = 6;
|
|
316
238
|
return dispatch.topoMod.updateDelId("" + conditions);
|
|
317
239
|
|
|
318
240
|
case 6:
|
|
319
|
-
|
|
241
|
+
_context4.next = 8;
|
|
320
242
|
return topoApp.alarm.close();
|
|
321
243
|
|
|
322
244
|
case 8:
|
|
323
|
-
|
|
245
|
+
_context4.next = 10;
|
|
324
246
|
return _topo["default"].deleteTopoonTree(parseInt(conditions, 10));
|
|
325
247
|
|
|
326
248
|
case 10:
|
|
327
|
-
return
|
|
249
|
+
return _context4.abrupt("return", _context4.sent);
|
|
328
250
|
|
|
329
251
|
case 13:
|
|
330
252
|
// 判断删除的拓扑或文件,是否包含当前拓扑,如果包含就先关闭告警
|
|
@@ -336,36 +258,36 @@ function _default(topoApp) {
|
|
|
336
258
|
});
|
|
337
259
|
|
|
338
260
|
if (!isDeleteCurrentP) {
|
|
339
|
-
|
|
261
|
+
_context4.next = 18;
|
|
340
262
|
break;
|
|
341
263
|
}
|
|
342
264
|
|
|
343
|
-
|
|
265
|
+
_context4.next = 18;
|
|
344
266
|
return topoApp.alarm.close();
|
|
345
267
|
|
|
346
268
|
case 18:
|
|
347
|
-
|
|
269
|
+
_context4.next = 20;
|
|
348
270
|
return _topo["default"].deleteTopoonTree(parseInt(conditions, 10));
|
|
349
271
|
|
|
350
272
|
case 20:
|
|
351
|
-
return
|
|
273
|
+
return _context4.abrupt("return", _context4.sent);
|
|
352
274
|
|
|
353
275
|
case 21:
|
|
354
276
|
case "end":
|
|
355
|
-
return
|
|
277
|
+
return _context4.stop();
|
|
356
278
|
}
|
|
357
279
|
}
|
|
358
|
-
},
|
|
280
|
+
}, _callee4);
|
|
359
281
|
}))();
|
|
360
282
|
},
|
|
361
283
|
setDefTopoOnTree: function setDefTopoOnTree(conditions, state) {
|
|
362
|
-
var
|
|
284
|
+
var _this4 = this;
|
|
363
285
|
|
|
364
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
286
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
365
287
|
var resTreeData;
|
|
366
|
-
return _regenerator["default"].wrap(function
|
|
288
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
367
289
|
while (1) {
|
|
368
|
-
switch (
|
|
290
|
+
switch (_context5.prev = _context5.next) {
|
|
369
291
|
case 0:
|
|
370
292
|
if (conditions === void 0) {
|
|
371
293
|
conditions = {};
|
|
@@ -373,13 +295,13 @@ function _default(topoApp) {
|
|
|
373
295
|
|
|
374
296
|
_rlog["default"].debug('setDefTopoOnTree', conditions);
|
|
375
297
|
|
|
376
|
-
|
|
298
|
+
_context5.next = 4;
|
|
377
299
|
return _topo["default"].setDefTopo(parseInt(conditions, 10));
|
|
378
300
|
|
|
379
301
|
case 4:
|
|
380
|
-
resTreeData =
|
|
302
|
+
resTreeData = _context5.sent;
|
|
381
303
|
|
|
382
|
-
|
|
304
|
+
_this4.refreshTree(); // let treeData = clone(state.topoTreeMod.treeData);
|
|
383
305
|
// loopTree(
|
|
384
306
|
// treeData,
|
|
385
307
|
// conditions,
|
|
@@ -398,10 +320,10 @@ function _default(topoApp) {
|
|
|
398
320
|
|
|
399
321
|
case 6:
|
|
400
322
|
case "end":
|
|
401
|
-
return
|
|
323
|
+
return _context5.stop();
|
|
402
324
|
}
|
|
403
325
|
}
|
|
404
|
-
},
|
|
326
|
+
}, _callee5);
|
|
405
327
|
}))();
|
|
406
328
|
},
|
|
407
329
|
setDefaultTopoId: function setDefaultTopoId(defaultTopoId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"files": [
|
|
6
6
|
"demo/",
|
|
@@ -99,6 +99,6 @@
|
|
|
99
99
|
"access": "public"
|
|
100
100
|
},
|
|
101
101
|
"license": "MIT",
|
|
102
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.4.
|
|
102
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.4.2/build/index.html",
|
|
103
103
|
"gitHead": "4c30a81dfb48bf8ebfd910e644605ce85604fcb7"
|
|
104
104
|
}
|