@riil-frontend/component-topology 11.0.36 → 11.0.39

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 +2 -4
  4. package/build/index.js +34 -49
  5. package/es/components/MultiResourceDrawer/index.js +18 -16
  6. package/es/components/ResourceList/ResourceSelect.js +50 -48
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +26 -24
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +25 -23
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +3 -5
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  13. package/es/core/editor/components/BackgroundView/index.js +129 -119
  14. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -20
  15. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  16. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +17 -15
  17. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +9 -7
  18. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  19. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  20. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  21. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +13 -11
  22. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +23 -21
  23. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  24. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -10
  25. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +27 -21
  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 +10 -8
  29. package/es/core/editor/store/topoEdit.js +6 -4
  30. package/es/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  31. package/es/core/hooks/usePolling.js +121 -117
  32. package/es/core/hooks/useResourceConfig.js +66 -58
  33. package/es/core/hooks/useTopoEdit.js +511 -476
  34. package/es/core/models/Alarm.js +298 -281
  35. package/es/core/models/AttributeMetricDisplay.js +107 -101
  36. package/es/core/models/PluginManager.js +3 -4
  37. package/es/core/models/SelectionModel.js +5 -4
  38. package/es/core/models/TopoApp.js +240 -205
  39. package/es/core/models/TopoGraphView.js +21 -18
  40. package/es/core/models/cache/CiCache.js +27 -28
  41. package/es/core/models/cache/CiTypeCache.js +41 -37
  42. package/es/core/models/cache/DictCache.js +35 -33
  43. package/es/core/models/graph/Background.js +17 -15
  44. package/es/core/models/plugins/resourceWebControllUrl.js +82 -76
  45. package/es/core/models/tagstips/ElementTagTipConfig.js +38 -34
  46. package/es/core/models/topoData.js +70 -68
  47. package/es/core/models/utils/linkUtils.js +43 -41
  48. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  49. package/es/core/services/alarm.js +16 -14
  50. package/es/core/services/background.js +67 -59
  51. package/es/core/services/cmdb/metric.js +11 -9
  52. package/es/core/services/cmdb.js +20 -18
  53. package/es/core/services/index.js +45 -39
  54. package/es/core/services/overview.js +151 -131
  55. package/es/core/services/topo/basic.js +41 -37
  56. package/es/core/services/topo/tagtip.js +12 -10
  57. package/es/core/store/models/ciModel.js +62 -58
  58. package/es/core/store/models/customIcon.js +134 -120
  59. package/es/core/store/models/displayConfig.js +19 -15
  60. package/es/core/store/models/selection.js +6 -4
  61. package/es/core/store/models/topoAlarm.js +145 -162
  62. package/es/core/store/models/topoBaseInfoOverview.js +6 -4
  63. package/es/core/store/models/topoBizMod.js +11 -9
  64. package/es/core/store/models/topoConfig.js +231 -215
  65. package/es/core/store/models/topoGraphView.js +6 -4
  66. package/es/core/store/models/topoMod.js +395 -373
  67. package/es/core/utils/imageUtil.js +20 -18
  68. package/es/core/utils/saveSerialize.js +11 -9
  69. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +29 -28
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +357 -343
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +205 -189
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +111 -107
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +37 -33
  78. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  79. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  80. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +19 -17
  81. package/es/networkTopo/components/Link/hook.js +77 -73
  82. package/es/networkTopo/components/Link/index.js +94 -86
  83. package/es/networkTopo/components/Link/setting.js +44 -42
  84. package/es/networkTopo/getTopoData.js +69 -63
  85. package/es/networkTopo/hooks/viewer/useRelateTopo.js +32 -30
  86. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  87. package/es/networkTopo/models/TopoCenter.js +22 -18
  88. package/es/networkTopo/services/alert.js +22 -18
  89. package/es/networkTopo/services/authorization.js +55 -45
  90. package/es/networkTopo/services/cmdb.js +470 -422
  91. package/es/networkTopo/services/funcAuth.js +24 -22
  92. package/es/networkTopo/services/link.js +117 -107
  93. package/es/networkTopo/services/mdc.js +24 -18
  94. package/es/networkTopo/services/metric.js +27 -23
  95. package/es/networkTopo/services/model.js +509 -445
  96. package/es/networkTopo/services/risk.js +11 -9
  97. package/es/networkTopo/services/topo/auth.js +33 -27
  98. package/es/networkTopo/services/topo/basic.js +289 -251
  99. package/es/networkTopo/services/topo/blacklist.js +24 -20
  100. package/es/networkTopo/services/topo/ciInfo.js +31 -27
  101. package/es/networkTopo/services/topo/icon.js +59 -49
  102. package/es/networkTopo/services/topo/networkLink.js +36 -32
  103. package/es/networkTopo/services/topo/relation.js +11 -9
  104. package/es/networkTopo/services/topo/resourceWebUrl.js +42 -36
  105. package/es/networkTopo/store/functionAuth.js +37 -31
  106. package/es/networkTopo/store/topoCenter.js +152 -142
  107. package/es/networkTopo/store/topoLinkMod.js +6 -4
  108. package/es/networkTopo/store/topoTreeMod.js +182 -170
  109. package/es/networkTopo/utils/exportData.js +54 -52
  110. package/lib/components/MultiResourceDrawer/index.js +18 -16
  111. package/lib/components/ResourceList/ResourceSelect.js +50 -48
  112. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +29 -27
  113. package/lib/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  114. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +32 -30
  115. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  116. package/lib/core/components/titlebar/widgets/TitleWidget.js +3 -5
  117. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  118. package/lib/core/editor/components/BackgroundView/index.js +128 -118
  119. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +24 -22
  120. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  121. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +21 -19
  122. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +10 -8
  123. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  124. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  125. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  126. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +14 -12
  127. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +28 -26
  128. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  129. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +14 -12
  130. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +31 -25
  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 +10 -8
  134. package/lib/core/editor/store/topoEdit.js +6 -4
  135. package/lib/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  136. package/lib/core/hooks/usePolling.js +120 -116
  137. package/lib/core/hooks/useResourceConfig.js +66 -58
  138. package/lib/core/hooks/useTopoEdit.js +503 -468
  139. package/lib/core/models/Alarm.js +292 -275
  140. package/lib/core/models/AttributeMetricDisplay.js +110 -104
  141. package/lib/core/models/PluginManager.js +3 -4
  142. package/lib/core/models/SelectionModel.js +5 -4
  143. package/lib/core/models/TopoApp.js +240 -205
  144. package/lib/core/models/TopoGraphView.js +21 -18
  145. package/lib/core/models/cache/CiCache.js +32 -33
  146. package/lib/core/models/cache/CiTypeCache.js +42 -38
  147. package/lib/core/models/cache/DictCache.js +35 -33
  148. package/lib/core/models/graph/Background.js +18 -16
  149. package/lib/core/models/plugins/resourceWebControllUrl.js +80 -74
  150. package/lib/core/models/tagstips/ElementTagTipConfig.js +38 -34
  151. package/lib/core/models/topoData.js +71 -69
  152. package/lib/core/models/utils/linkUtils.js +43 -41
  153. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  154. package/lib/core/services/alarm.js +20 -18
  155. package/lib/core/services/background.js +78 -70
  156. package/lib/core/services/cmdb/metric.js +12 -10
  157. package/lib/core/services/cmdb.js +22 -20
  158. package/lib/core/services/index.js +51 -45
  159. package/lib/core/services/overview.js +151 -131
  160. package/lib/core/services/topo/basic.js +41 -37
  161. package/lib/core/services/topo/tagtip.js +14 -12
  162. package/lib/core/store/models/ciModel.js +70 -66
  163. package/lib/core/store/models/customIcon.js +134 -120
  164. package/lib/core/store/models/displayConfig.js +19 -15
  165. package/lib/core/store/models/selection.js +6 -4
  166. package/lib/core/store/models/topoAlarm.js +145 -163
  167. package/lib/core/store/models/topoBaseInfoOverview.js +6 -4
  168. package/lib/core/store/models/topoBizMod.js +11 -9
  169. package/lib/core/store/models/topoConfig.js +238 -222
  170. package/lib/core/store/models/topoGraphView.js +6 -4
  171. package/lib/core/store/models/topoMod.js +397 -375
  172. package/lib/core/utils/imageUtil.js +24 -22
  173. package/lib/core/utils/saveSerialize.js +11 -9
  174. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  175. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +29 -28
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +358 -344
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +206 -190
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +111 -107
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -29
  183. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  184. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  185. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +20 -18
  186. package/lib/networkTopo/components/Link/hook.js +77 -73
  187. package/lib/networkTopo/components/Link/index.js +95 -87
  188. package/lib/networkTopo/components/Link/setting.js +44 -42
  189. package/lib/networkTopo/getTopoData.js +69 -63
  190. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +33 -31
  191. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  192. package/lib/networkTopo/models/TopoCenter.js +22 -18
  193. package/lib/networkTopo/services/alert.js +22 -18
  194. package/lib/networkTopo/services/authorization.js +65 -55
  195. package/lib/networkTopo/services/cmdb.js +470 -422
  196. package/lib/networkTopo/services/funcAuth.js +26 -24
  197. package/lib/networkTopo/services/link.js +118 -108
  198. package/lib/networkTopo/services/mdc.js +27 -21
  199. package/lib/networkTopo/services/metric.js +31 -27
  200. package/lib/networkTopo/services/model.js +509 -445
  201. package/lib/networkTopo/services/risk.js +13 -11
  202. package/lib/networkTopo/services/topo/auth.js +33 -27
  203. package/lib/networkTopo/services/topo/basic.js +290 -252
  204. package/lib/networkTopo/services/topo/blacklist.js +24 -20
  205. package/lib/networkTopo/services/topo/ciInfo.js +38 -34
  206. package/lib/networkTopo/services/topo/icon.js +69 -59
  207. package/lib/networkTopo/services/topo/networkLink.js +36 -32
  208. package/lib/networkTopo/services/topo/relation.js +13 -11
  209. package/lib/networkTopo/services/topo/resourceWebUrl.js +50 -44
  210. package/lib/networkTopo/store/functionAuth.js +37 -31
  211. package/lib/networkTopo/store/topoCenter.js +152 -142
  212. package/lib/networkTopo/store/topoLinkMod.js +6 -4
  213. package/lib/networkTopo/store/topoTreeMod.js +178 -166
  214. package/lib/networkTopo/utils/exportData.js +61 -59
  215. package/lib/utils/htElementDataUtil.js +2 -4
  216. package/package.json +3 -3
@@ -55,42 +55,44 @@ 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) 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();
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
+ }
94
96
  }
95
97
  }, _callee);
96
98
  }));
@@ -158,18 +160,20 @@ function BackgroundView(props) {
158
160
  _getBackground = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
159
161
  var res;
160
162
  return _regenerator["default"].wrap(function _callee4$(_context4) {
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();
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
+ }
173
177
  }
174
178
  }, _callee4);
175
179
  }));
@@ -185,35 +189,37 @@ function BackgroundView(props) {
185
189
  _removeBg = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(id) {
186
190
  var res;
187
191
  return _regenerator["default"].wrap(function _callee5$(_context5) {
188
- while (1) switch (_context5.prev = _context5.next) {
189
- case 0:
190
- _context5.next = 2;
191
- return _background["default"].deleteBackground(id);
192
+ while (1) {
193
+ switch (_context5.prev = _context5.next) {
194
+ case 0:
195
+ _context5.next = 2;
196
+ return _background["default"].deleteBackground(id);
192
197
 
193
- case 2:
194
- res = _context5.sent;
198
+ case 2:
199
+ res = _context5.sent;
195
200
 
196
- if (!(id === (current === null || current === void 0 ? void 0 : current.id))) {
197
- _context5.next = 9;
198
- break;
199
- }
201
+ if (!(id === (current === null || current === void 0 ? void 0 : current.id))) {
202
+ _context5.next = 9;
203
+ break;
204
+ }
200
205
 
201
- topo.historyManager.setDisabled(true, '删除背景');
202
- _context5.next = 7;
203
- return reset();
206
+ topo.historyManager.setDisabled(true, '删除背景');
207
+ _context5.next = 7;
208
+ return reset();
204
209
 
205
- case 7:
206
- setHtTopoBackground(null);
207
- topo.historyManager.setDisabled(false, '删除背景');
210
+ case 7:
211
+ setHtTopoBackground(null);
212
+ topo.historyManager.setDisabled(false, '删除背景');
208
213
 
209
- case 9:
210
- getBackground();
214
+ case 9:
215
+ getBackground();
211
216
 
212
- _message["default"].success('删除成功');
217
+ _message["default"].success('删除成功');
213
218
 
214
- case 11:
215
- case "end":
216
- return _context5.stop();
219
+ case 11:
220
+ case "end":
221
+ return _context5.stop();
222
+ }
217
223
  }
218
224
  }, _callee5);
219
225
  }));
@@ -228,46 +234,48 @@ function BackgroundView(props) {
228
234
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(currentBg) {
229
235
  var imgUrl, size;
230
236
  return _regenerator["default"].wrap(function _callee2$(_context2) {
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;
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;
235
263
  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;
257
264
 
258
- case 14:
259
- _context2.prev = 14;
260
- _context2.t0 = _context2["catch"](4);
265
+ case 14:
266
+ _context2.prev = 14;
267
+ _context2.t0 = _context2["catch"](4);
261
268
 
262
- _rlog["default"].error('设置背景失败', _context2.t0);
269
+ _rlog["default"].error('设置背景失败', _context2.t0);
263
270
 
264
- case 17:
265
- topo.historyManager.endTransaction();
266
- setLoadingBackground(false);
271
+ case 17:
272
+ topo.historyManager.endTransaction();
273
+ setLoadingBackground(false);
267
274
 
268
- case 19:
269
- case "end":
270
- return _context2.stop();
275
+ case 19:
276
+ case "end":
277
+ return _context2.stop();
278
+ }
271
279
  }
272
280
  }, _callee2, null, [[4, 14]]);
273
281
  }));
@@ -280,19 +288,21 @@ function BackgroundView(props) {
280
288
  var resetDefault = /*#__PURE__*/function () {
281
289
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
282
290
  return _regenerator["default"].wrap(function _callee3$(_context3) {
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();
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
+ }
296
306
  }
297
307
  }, _callee3);
298
308
  }));
@@ -63,30 +63,32 @@ 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) switch (_context.prev = _context.next) {
67
- case 0:
68
- _context.next = 2;
69
- return field.validatePromise();
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
+ }
70
81
 
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) {
77
82
  _context.next = 8;
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();
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
+ }
90
92
  }
91
93
  }, _callee);
92
94
  }));
@@ -203,37 +203,39 @@ 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) 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();
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
+ }
237
239
  }
238
240
  }, _callee);
239
241
  }));
@@ -19,25 +19,27 @@ 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) 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();
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
+ }
41
43
  }
42
44
  }, _callee);
43
45
  }));
@@ -26,14 +26,16 @@ 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) 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();
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
+ }
37
39
  }
38
40
  }, _callee);
39
41
  }));
@@ -32,28 +32,30 @@ 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) 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();
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
+ }
57
59
  }
58
60
  }, _callee);
59
61
  }));
@@ -73,21 +75,23 @@ function useCanvasThemeConfig(props) {
73
75
  var _topo$store$getModelS, nodeLabelStyle, defaultEdgeLabelStyle;
74
76
 
75
77
  return _regenerator["default"].wrap(function _callee2$(_context2) {
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();
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
+ }
91
95
  }
92
96
  }, _callee2);
93
97
  }));