@riil-frontend/component-topology 11.0.39 → 11.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +4 -2
  4. package/build/index.js +49 -34
  5. package/es/components/MultiResourceDrawer/index.js +16 -18
  6. package/es/components/ResourceList/ResourceSelect.js +48 -50
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +24 -26
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +18 -20
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -25
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +15 -17
  13. package/es/core/editor/components/BackgroundView/index.js +119 -129
  14. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +20 -22
  15. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +31 -33
  16. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +15 -17
  17. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +7 -9
  18. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
  19. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
  20. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
  21. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +11 -13
  22. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +21 -23
  23. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
  24. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -12
  25. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +21 -27
  26. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  27. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  28. package/es/core/editor/store/background.js +8 -10
  29. package/es/core/editor/store/topoEdit.js +4 -6
  30. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  31. package/es/core/hooks/usePolling.js +117 -121
  32. package/es/core/hooks/useResourceConfig.js +58 -66
  33. package/es/core/hooks/useTopoEdit.js +477 -507
  34. package/es/core/models/Alarm.js +281 -298
  35. package/es/core/models/AttributeMetricDisplay.js +101 -107
  36. package/es/core/models/PluginManager.js +4 -3
  37. package/es/core/models/SelectionModel.js +4 -5
  38. package/es/core/models/TopoApp.js +205 -240
  39. package/es/core/models/TopoGraphView.js +18 -21
  40. package/es/core/models/cache/CiCache.js +28 -27
  41. package/es/core/models/cache/CiTypeCache.js +37 -41
  42. package/es/core/models/cache/DictCache.js +33 -35
  43. package/es/core/models/graph/Background.js +15 -17
  44. package/es/core/models/plugins/resourceWebControllUrl.js +76 -82
  45. package/es/core/models/tagstips/ElementTagTipConfig.js +34 -38
  46. package/es/core/models/topoData.js +68 -70
  47. package/es/core/models/utils/linkUtils.js +41 -43
  48. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  49. package/es/core/services/alarm.js +14 -16
  50. package/es/core/services/background.js +59 -67
  51. package/es/core/services/cmdb/metric.js +9 -11
  52. package/es/core/services/cmdb.js +18 -20
  53. package/es/core/services/index.js +39 -45
  54. package/es/core/services/overview.js +131 -151
  55. package/es/core/services/topo/basic.js +37 -41
  56. package/es/core/services/topo/tagtip.js +10 -12
  57. package/es/core/store/models/ciModel.js +58 -62
  58. package/es/core/store/models/customIcon.js +120 -134
  59. package/es/core/store/models/displayConfig.js +15 -19
  60. package/es/core/store/models/selection.js +4 -6
  61. package/es/core/store/models/topoAlarm.js +162 -145
  62. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  63. package/es/core/store/models/topoBizMod.js +9 -11
  64. package/es/core/store/models/topoConfig.js +215 -231
  65. package/es/core/store/models/topoGraphView.js +4 -6
  66. package/es/core/store/models/topoMod.js +373 -395
  67. package/es/core/utils/imageUtil.js +18 -20
  68. package/es/core/utils/saveSerialize.js +9 -11
  69. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +343 -357
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -43
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +189 -205
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -111
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -37
  78. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
  79. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
  80. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +17 -19
  81. package/es/networkTopo/components/Link/hook.js +73 -77
  82. package/es/networkTopo/components/Link/index.js +86 -94
  83. package/es/networkTopo/components/Link/setting.js +42 -44
  84. package/es/networkTopo/getTopoData.js +63 -69
  85. package/es/networkTopo/hooks/viewer/useRelateTopo.js +30 -32
  86. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  87. package/es/networkTopo/models/TopoCenter.js +18 -22
  88. package/es/networkTopo/services/alert.js +18 -22
  89. package/es/networkTopo/services/authorization.js +45 -55
  90. package/es/networkTopo/services/cmdb.js +422 -470
  91. package/es/networkTopo/services/funcAuth.js +22 -24
  92. package/es/networkTopo/services/link.js +107 -117
  93. package/es/networkTopo/services/mdc.js +18 -24
  94. package/es/networkTopo/services/metric.js +23 -27
  95. package/es/networkTopo/services/model.js +445 -509
  96. package/es/networkTopo/services/risk.js +9 -11
  97. package/es/networkTopo/services/topo/auth.js +27 -33
  98. package/es/networkTopo/services/topo/basic.js +251 -289
  99. package/es/networkTopo/services/topo/blacklist.js +20 -24
  100. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  101. package/es/networkTopo/services/topo/icon.js +49 -59
  102. package/es/networkTopo/services/topo/networkLink.js +32 -36
  103. package/es/networkTopo/services/topo/relation.js +9 -11
  104. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  105. package/es/networkTopo/store/functionAuth.js +31 -37
  106. package/es/networkTopo/store/topoCenter.js +142 -152
  107. package/es/networkTopo/store/topoLinkMod.js +4 -6
  108. package/es/networkTopo/store/topoTreeMod.js +170 -182
  109. package/es/networkTopo/utils/exportData.js +52 -54
  110. package/lib/components/MultiResourceDrawer/index.js +16 -18
  111. package/lib/components/ResourceList/ResourceSelect.js +48 -50
  112. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -29
  113. package/lib/components/SingleResourceDrawer/SelectDrawer.js +18 -20
  114. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +30 -32
  115. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
  116. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
  117. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +15 -17
  118. package/lib/core/editor/components/BackgroundView/index.js +118 -128
  119. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -24
  120. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +31 -33
  121. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +19 -21
  122. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -10
  123. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
  124. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
  125. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
  126. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +12 -14
  127. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +26 -28
  128. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
  129. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -14
  130. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +25 -31
  131. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  132. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  133. package/lib/core/editor/store/background.js +8 -10
  134. package/lib/core/editor/store/topoEdit.js +4 -6
  135. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  136. package/lib/core/hooks/usePolling.js +116 -120
  137. package/lib/core/hooks/useResourceConfig.js +58 -66
  138. package/lib/core/hooks/useTopoEdit.js +469 -499
  139. package/lib/core/models/Alarm.js +275 -292
  140. package/lib/core/models/AttributeMetricDisplay.js +104 -110
  141. package/lib/core/models/PluginManager.js +4 -3
  142. package/lib/core/models/SelectionModel.js +4 -5
  143. package/lib/core/models/TopoApp.js +205 -240
  144. package/lib/core/models/TopoGraphView.js +18 -21
  145. package/lib/core/models/cache/CiCache.js +33 -32
  146. package/lib/core/models/cache/CiTypeCache.js +38 -42
  147. package/lib/core/models/cache/DictCache.js +33 -35
  148. package/lib/core/models/graph/Background.js +16 -18
  149. package/lib/core/models/plugins/resourceWebControllUrl.js +74 -80
  150. package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -38
  151. package/lib/core/models/topoData.js +69 -71
  152. package/lib/core/models/utils/linkUtils.js +41 -43
  153. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  154. package/lib/core/services/alarm.js +18 -20
  155. package/lib/core/services/background.js +70 -78
  156. package/lib/core/services/cmdb/metric.js +10 -12
  157. package/lib/core/services/cmdb.js +20 -22
  158. package/lib/core/services/index.js +45 -51
  159. package/lib/core/services/overview.js +131 -151
  160. package/lib/core/services/topo/basic.js +37 -41
  161. package/lib/core/services/topo/tagtip.js +12 -14
  162. package/lib/core/store/models/ciModel.js +66 -70
  163. package/lib/core/store/models/customIcon.js +120 -134
  164. package/lib/core/store/models/displayConfig.js +15 -19
  165. package/lib/core/store/models/selection.js +4 -6
  166. package/lib/core/store/models/topoAlarm.js +163 -145
  167. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  168. package/lib/core/store/models/topoBizMod.js +9 -11
  169. package/lib/core/store/models/topoConfig.js +222 -238
  170. package/lib/core/store/models/topoGraphView.js +4 -6
  171. package/lib/core/store/models/topoMod.js +375 -397
  172. package/lib/core/utils/imageUtil.js +22 -24
  173. package/lib/core/utils/saveSerialize.js +9 -11
  174. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
  175. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +344 -358
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -43
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +190 -206
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -111
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +29 -33
  183. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
  184. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
  185. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -20
  186. package/lib/networkTopo/components/Link/hook.js +73 -77
  187. package/lib/networkTopo/components/Link/index.js +87 -95
  188. package/lib/networkTopo/components/Link/setting.js +42 -44
  189. package/lib/networkTopo/getTopoData.js +63 -69
  190. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -33
  191. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  192. package/lib/networkTopo/models/TopoCenter.js +18 -22
  193. package/lib/networkTopo/services/alert.js +18 -22
  194. package/lib/networkTopo/services/authorization.js +55 -65
  195. package/lib/networkTopo/services/cmdb.js +422 -470
  196. package/lib/networkTopo/services/funcAuth.js +24 -26
  197. package/lib/networkTopo/services/link.js +108 -118
  198. package/lib/networkTopo/services/mdc.js +21 -27
  199. package/lib/networkTopo/services/metric.js +27 -31
  200. package/lib/networkTopo/services/model.js +445 -509
  201. package/lib/networkTopo/services/risk.js +11 -13
  202. package/lib/networkTopo/services/topo/auth.js +27 -33
  203. package/lib/networkTopo/services/topo/basic.js +252 -290
  204. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  205. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  206. package/lib/networkTopo/services/topo/icon.js +59 -69
  207. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  208. package/lib/networkTopo/services/topo/relation.js +11 -13
  209. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  210. package/lib/networkTopo/store/functionAuth.js +31 -37
  211. package/lib/networkTopo/store/topoCenter.js +142 -152
  212. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  213. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  214. package/lib/networkTopo/utils/exportData.js +59 -61
  215. package/lib/utils/htElementDataUtil.js +4 -2
  216. package/package.json +2 -2
@@ -55,44 +55,42 @@ function List(props) {
55
55
  _remove = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(e, id) {
56
56
  var canDelete;
57
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
-
68
- // console.log('canDelete', canDelete);
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 5:
93
- case "end":
94
- return _context.stop();
95
- }
58
+ while (1) switch (_context.prev = _context.next) {
59
+ case 0:
60
+ e.stopPropagation();
61
+ _context.next = 3;
62
+ return _background["default"].canDeleteBackground(id);
63
+
64
+ case 3:
65
+ canDelete = _context.sent;
66
+
67
+ // console.log('canDelete', canDelete);
68
+ if (canDelete) {
69
+ _dialog["default"].confirm({
70
+ title: '删除',
71
+ messageProps: {
72
+ type: 'warning'
73
+ },
74
+ content: '若执行相关操作,此背景将会从背景库删除,确定删除吗?',
75
+ onOk: function onOk() {
76
+ return onRemove(id);
77
+ }
78
+ });
79
+ } else {
80
+ _dialog["default"].confirm({
81
+ title: '提示',
82
+ messageProps: {
83
+ type: 'warning'
84
+ },
85
+ content: '此背景被占用,不能删除。',
86
+ footerActions: ['ok'],
87
+ onOk: function onOk() {}
88
+ });
89
+ }
90
+
91
+ case 5:
92
+ case "end":
93
+ return _context.stop();
96
94
  }
97
95
  }, _callee);
98
96
  }));
@@ -160,20 +158,18 @@ function BackgroundView(props) {
160
158
  _getBackground = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
161
159
  var res;
162
160
  return _regenerator["default"].wrap(function _callee4$(_context4) {
163
- while (1) {
164
- switch (_context4.prev = _context4.next) {
165
- case 0:
166
- _context4.next = 2;
167
- return _background["default"].getBackgroundList();
168
-
169
- case 2:
170
- res = _context4.sent;
171
- setBgList(res);
172
-
173
- case 4:
174
- case "end":
175
- return _context4.stop();
176
- }
161
+ while (1) switch (_context4.prev = _context4.next) {
162
+ case 0:
163
+ _context4.next = 2;
164
+ return _background["default"].getBackgroundList();
165
+
166
+ case 2:
167
+ res = _context4.sent;
168
+ setBgList(res);
169
+
170
+ case 4:
171
+ case "end":
172
+ return _context4.stop();
177
173
  }
178
174
  }, _callee4);
179
175
  }));
@@ -189,37 +185,35 @@ function BackgroundView(props) {
189
185
  _removeBg = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(id) {
190
186
  var res;
191
187
  return _regenerator["default"].wrap(function _callee5$(_context5) {
192
- while (1) {
193
- switch (_context5.prev = _context5.next) {
194
- case 0:
195
- _context5.next = 2;
196
- return _background["default"].deleteBackground(id);
188
+ while (1) switch (_context5.prev = _context5.next) {
189
+ case 0:
190
+ _context5.next = 2;
191
+ return _background["default"].deleteBackground(id);
197
192
 
198
- case 2:
199
- res = _context5.sent;
193
+ case 2:
194
+ res = _context5.sent;
200
195
 
201
- if (!(id === (current === null || current === void 0 ? void 0 : current.id))) {
202
- _context5.next = 9;
203
- break;
204
- }
196
+ if (!(id === (current === null || current === void 0 ? void 0 : current.id))) {
197
+ _context5.next = 9;
198
+ break;
199
+ }
205
200
 
206
- topo.historyManager.setDisabled(true, '删除背景');
207
- _context5.next = 7;
208
- return reset();
201
+ topo.historyManager.setDisabled(true, '删除背景');
202
+ _context5.next = 7;
203
+ return reset();
209
204
 
210
- case 7:
211
- setHtTopoBackground(null);
212
- topo.historyManager.setDisabled(false, '删除背景');
205
+ case 7:
206
+ setHtTopoBackground(null);
207
+ topo.historyManager.setDisabled(false, '删除背景');
213
208
 
214
- case 9:
215
- getBackground();
209
+ case 9:
210
+ getBackground();
216
211
 
217
- _message["default"].success('删除成功');
212
+ _message["default"].success('删除成功');
218
213
 
219
- case 11:
220
- case "end":
221
- return _context5.stop();
222
- }
214
+ case 11:
215
+ case "end":
216
+ return _context5.stop();
223
217
  }
224
218
  }, _callee5);
225
219
  }));
@@ -234,48 +228,46 @@ function BackgroundView(props) {
234
228
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(currentBg) {
235
229
  var imgUrl, size;
236
230
  return _regenerator["default"].wrap(function _callee2$(_context2) {
237
- while (1) {
238
- switch (_context2.prev = _context2.next) {
239
- case 0:
240
- if (!(currentBg !== null && currentBg !== void 0 && currentBg.id && currentBg.id !== (current === null || current === void 0 ? void 0 : current.id))) {
241
- _context2.next = 19;
242
- break;
243
- }
244
-
245
- setLoadingBackground(true);
246
- topo.historyManager.beginTransaction();
247
- imgUrl = (0, _backgroundUtil.getBackgroundImageUrl)(currentBg);
248
- _context2.prev = 4;
249
- _context2.next = 7;
250
- return (0, _imageUtil.getImageSize)(imgUrl);
251
-
252
- case 7:
253
- size = _context2.sent;
254
-
255
- _rlog["default"].debug('获取图片大小', size);
256
-
257
- _context2.next = 11;
258
- return setBackground((0, _extends2["default"])({}, currentBg, size));
259
-
260
- case 11:
261
- topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
262
- _context2.next = 17;
231
+ while (1) switch (_context2.prev = _context2.next) {
232
+ case 0:
233
+ if (!(currentBg !== null && currentBg !== void 0 && currentBg.id && currentBg.id !== (current === null || current === void 0 ? void 0 : current.id))) {
234
+ _context2.next = 19;
263
235
  break;
236
+ }
237
+
238
+ setLoadingBackground(true);
239
+ topo.historyManager.beginTransaction();
240
+ imgUrl = (0, _backgroundUtil.getBackgroundImageUrl)(currentBg);
241
+ _context2.prev = 4;
242
+ _context2.next = 7;
243
+ return (0, _imageUtil.getImageSize)(imgUrl);
244
+
245
+ case 7:
246
+ size = _context2.sent;
247
+
248
+ _rlog["default"].debug('获取图片大小', size);
249
+
250
+ _context2.next = 11;
251
+ return setBackground((0, _extends2["default"])({}, currentBg, size));
252
+
253
+ case 11:
254
+ topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
255
+ _context2.next = 17;
256
+ break;
264
257
 
265
- case 14:
266
- _context2.prev = 14;
267
- _context2.t0 = _context2["catch"](4);
258
+ case 14:
259
+ _context2.prev = 14;
260
+ _context2.t0 = _context2["catch"](4);
268
261
 
269
- _rlog["default"].error('设置背景失败', _context2.t0);
262
+ _rlog["default"].error('设置背景失败', _context2.t0);
270
263
 
271
- case 17:
272
- topo.historyManager.endTransaction();
273
- setLoadingBackground(false);
264
+ case 17:
265
+ topo.historyManager.endTransaction();
266
+ setLoadingBackground(false);
274
267
 
275
- case 19:
276
- case "end":
277
- return _context2.stop();
278
- }
268
+ case 19:
269
+ case "end":
270
+ return _context2.stop();
279
271
  }
280
272
  }, _callee2, null, [[4, 14]]);
281
273
  }));
@@ -288,21 +280,19 @@ function BackgroundView(props) {
288
280
  var resetDefault = /*#__PURE__*/function () {
289
281
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
290
282
  return _regenerator["default"].wrap(function _callee3$(_context3) {
291
- while (1) {
292
- switch (_context3.prev = _context3.next) {
293
- case 0:
294
- topo.historyManager.beginTransaction();
295
- _context3.next = 3;
296
- return reset();
297
-
298
- case 3:
299
- setHtTopoBackground(null);
300
- topo.historyManager.endTransaction();
301
-
302
- case 5:
303
- case "end":
304
- return _context3.stop();
305
- }
283
+ while (1) switch (_context3.prev = _context3.next) {
284
+ case 0:
285
+ topo.historyManager.beginTransaction();
286
+ _context3.next = 3;
287
+ return reset();
288
+
289
+ case 3:
290
+ setHtTopoBackground(null);
291
+ topo.historyManager.endTransaction();
292
+
293
+ case 5:
294
+ case "end":
295
+ return _context3.stop();
306
296
  }
307
297
  }, _callee3);
308
298
  }));
@@ -63,32 +63,30 @@ function RenameDialog(props) {
63
63
  var _yield$field$validate, errors, values;
64
64
 
65
65
  return _regenerator["default"].wrap(function _callee$(_context) {
66
- while (1) {
67
- switch (_context.prev = _context.next) {
68
- case 0:
69
- _context.next = 2;
70
- return field.validatePromise();
71
-
72
- case 2:
73
- _yield$field$validate = _context.sent;
74
- errors = _yield$field$validate.errors;
75
- values = _yield$field$validate.values;
76
-
77
- if (errors) {
78
- _context.next = 8;
79
- break;
80
- }
66
+ while (1) switch (_context.prev = _context.next) {
67
+ case 0:
68
+ _context.next = 2;
69
+ return field.validatePromise();
81
70
 
71
+ case 2:
72
+ _yield$field$validate = _context.sent;
73
+ errors = _yield$field$validate.errors;
74
+ values = _yield$field$validate.values;
75
+
76
+ if (errors) {
82
77
  _context.next = 8;
83
- return dispatchers.renameIcon({
84
- id: icon.id,
85
- name: values.name
86
- });
87
-
88
- case 8:
89
- case "end":
90
- return _context.stop();
91
- }
78
+ break;
79
+ }
80
+
81
+ _context.next = 8;
82
+ return dispatchers.renameIcon({
83
+ id: icon.id,
84
+ name: values.name
85
+ });
86
+
87
+ case 8:
88
+ case "end":
89
+ return _context.stop();
92
90
  }
93
91
  }, _callee);
94
92
  }));
@@ -203,39 +203,37 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
203
203
  _this.handleSuccess = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
204
204
  var files, dispatchers;
205
205
  return _regenerator["default"].wrap(function _callee$(_context) {
206
- while (1) {
207
- switch (_context.prev = _context.next) {
208
- case 0:
209
- files = _this.state.files;
210
-
211
- _message["default"].show({
212
- type: 'success',
213
- title: '图片上传成功'
214
- });
215
-
216
- _this.setState({
217
- uploading: false
218
- });
219
-
220
- dispatchers = _this.props.dispatchers;
221
- _context.next = 6;
222
- return dispatchers.uploadSuccess({
223
- type: _this.props.type,
224
- data: files.map(function (file) {
225
- return {
226
- id: file.response.result,
227
- name: getFileName(file)
228
- };
229
- })
230
- });
231
-
232
- case 6:
233
- _this.resetState();
234
-
235
- case 7:
236
- case "end":
237
- return _context.stop();
238
- }
206
+ while (1) switch (_context.prev = _context.next) {
207
+ case 0:
208
+ files = _this.state.files;
209
+
210
+ _message["default"].show({
211
+ type: 'success',
212
+ title: '图片上传成功'
213
+ });
214
+
215
+ _this.setState({
216
+ uploading: false
217
+ });
218
+
219
+ dispatchers = _this.props.dispatchers;
220
+ _context.next = 6;
221
+ return dispatchers.uploadSuccess({
222
+ type: _this.props.type,
223
+ data: files.map(function (file) {
224
+ return {
225
+ id: file.response.result,
226
+ name: getFileName(file)
227
+ };
228
+ })
229
+ });
230
+
231
+ case 6:
232
+ _this.resetState();
233
+
234
+ case 7:
235
+ case "end":
236
+ return _context.stop();
239
237
  }
240
238
  }, _callee);
241
239
  }));
@@ -19,27 +19,25 @@ function svgToShape(_x) {
19
19
  function _svgToShape() {
20
20
  _svgToShape = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(file) {
21
21
  return _regenerator["default"].wrap(function _callee$(_context) {
22
- while (1) {
23
- switch (_context.prev = _context.next) {
24
- case 0:
25
- return _context.abrupt("return", new Promise(function (resolve, reject) {
26
- var reader = new FileReader();
27
-
28
- reader.onload = function () {
29
- resolve(ht.Default.svgToShape(this.result).output);
30
- };
31
-
32
- reader.onerror = function () {
33
- reject();
34
- };
35
-
36
- reader.readAsText(file);
37
- }));
38
-
39
- case 1:
40
- case "end":
41
- return _context.stop();
42
- }
22
+ while (1) switch (_context.prev = _context.next) {
23
+ case 0:
24
+ return _context.abrupt("return", new Promise(function (resolve, reject) {
25
+ var reader = new FileReader();
26
+
27
+ reader.onload = function () {
28
+ resolve(ht.Default.svgToShape(this.result).output);
29
+ };
30
+
31
+ reader.onerror = function () {
32
+ reject();
33
+ };
34
+
35
+ reader.readAsText(file);
36
+ }));
37
+
38
+ case 1:
39
+ case "end":
40
+ return _context.stop();
43
41
  }
44
42
  }, _callee);
45
43
  }));
@@ -26,16 +26,14 @@ var GroupAddResourceDrawer = function GroupAddResourceDrawer(props) {
26
26
  var onOk = /*#__PURE__*/function () {
27
27
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(selected) {
28
28
  return _regenerator["default"].wrap(function _callee$(_context) {
29
- while (1) {
30
- switch (_context.prev = _context.next) {
31
- case 0:
32
- _context.next = 2;
33
- return topoEdit.addGroupResources(group, selected);
34
-
35
- case 2:
36
- case "end":
37
- return _context.stop();
38
- }
29
+ while (1) switch (_context.prev = _context.next) {
30
+ case 0:
31
+ _context.next = 2;
32
+ return topoEdit.addGroupResources(group, selected);
33
+
34
+ case 2:
35
+ case "end":
36
+ return _context.stop();
39
37
  }
40
38
  }, _callee);
41
39
  }));
@@ -32,30 +32,28 @@ function useCanvasThemeConfig(props) {
32
32
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(themeName) {
33
33
  var themeConfig;
34
34
  return _regenerator["default"].wrap(function _callee$(_context) {
35
- while (1) {
36
- switch (_context.prev = _context.next) {
37
- case 0:
38
- themeConfig = _themes["default"].find(function (item) {
39
- return item.name === themeName;
40
- });
41
- topo.historyManager.beginTransaction();
42
- _context.next = 4;
43
- return displayConfigDispatchers.update({
44
- canvasTheme: themeName
45
- });
46
-
47
- case 4:
48
- _context.next = 6;
49
- return setGlobalTagTheme(themeConfig);
50
-
51
- case 6:
52
- setElementsTheme(themeConfig);
53
- topo.historyManager.endTransaction();
54
-
55
- case 8:
56
- case "end":
57
- return _context.stop();
58
- }
35
+ while (1) switch (_context.prev = _context.next) {
36
+ case 0:
37
+ themeConfig = _themes["default"].find(function (item) {
38
+ return item.name === themeName;
39
+ });
40
+ topo.historyManager.beginTransaction();
41
+ _context.next = 4;
42
+ return displayConfigDispatchers.update({
43
+ canvasTheme: themeName
44
+ });
45
+
46
+ case 4:
47
+ _context.next = 6;
48
+ return setGlobalTagTheme(themeConfig);
49
+
50
+ case 6:
51
+ setElementsTheme(themeConfig);
52
+ topo.historyManager.endTransaction();
53
+
54
+ case 8:
55
+ case "end":
56
+ return _context.stop();
59
57
  }
60
58
  }, _callee);
61
59
  }));
@@ -75,23 +73,21 @@ function useCanvasThemeConfig(props) {
75
73
  var _topo$store$getModelS, nodeLabelStyle, defaultEdgeLabelStyle;
76
74
 
77
75
  return _regenerator["default"].wrap(function _callee2$(_context2) {
78
- while (1) {
79
- switch (_context2.prev = _context2.next) {
80
- case 0:
81
- topo.getHtTopo().setGlobalNodeLabelStyle(themeConfig.globalNodeLabelStyle);
82
- topo.getHtTopo().setGlobalEdgeTagStyle(themeConfig.globalEdgeTagStyle); // 更新默认配置
83
-
84
- _topo$store$getModelS = topo.store.getModelState('displayConfig'), nodeLabelStyle = _topo$store$getModelS.nodeLabelStyle, defaultEdgeLabelStyle = _topo$store$getModelS.defaultEdgeLabelStyle;
85
- _context2.next = 5;
86
- return displayConfigDispatchers.update({
87
- nodeLabelStyle: (0, _extends2["default"])({}, nodeLabelStyle, themeConfig.globalNodeLabelStyle),
88
- defaultEdgeLabelStyle: (0, _extends2["default"])({}, defaultEdgeLabelStyle, themeConfig.globalEdgeTagStyle)
89
- });
90
-
91
- case 5:
92
- case "end":
93
- return _context2.stop();
94
- }
76
+ while (1) switch (_context2.prev = _context2.next) {
77
+ case 0:
78
+ topo.getHtTopo().setGlobalNodeLabelStyle(themeConfig.globalNodeLabelStyle);
79
+ topo.getHtTopo().setGlobalEdgeTagStyle(themeConfig.globalEdgeTagStyle); // 更新默认配置
80
+
81
+ _topo$store$getModelS = topo.store.getModelState('displayConfig'), nodeLabelStyle = _topo$store$getModelS.nodeLabelStyle, defaultEdgeLabelStyle = _topo$store$getModelS.defaultEdgeLabelStyle;
82
+ _context2.next = 5;
83
+ return displayConfigDispatchers.update({
84
+ nodeLabelStyle: (0, _extends2["default"])({}, nodeLabelStyle, themeConfig.globalNodeLabelStyle),
85
+ defaultEdgeLabelStyle: (0, _extends2["default"])({}, defaultEdgeLabelStyle, themeConfig.globalEdgeTagStyle)
86
+ });
87
+
88
+ case 5:
89
+ case "end":
90
+ return _context2.stop();
95
91
  }
96
92
  }, _callee2);
97
93
  }));