@luck-design-biz/luckda 1.0.2-2 → 1.0.2-20

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 (283) hide show
  1. package/es/components/Builder/index.js +13 -10
  2. package/es/components/ComplexItem/index.js +5 -3
  3. package/es/components/ComplexItem/service.js +6 -3
  4. package/es/components/LDActions/index.js +1 -0
  5. package/es/components/LdAutoForm/index.js +5 -4
  6. package/es/components/LdCard/index.js +10 -8
  7. package/es/components/LdCom/index.js +3 -2
  8. package/es/components/LdFormList/index.js +10 -7
  9. package/es/components/LdGrid/index.js +11 -12
  10. package/es/components/LdGridForm/index.js +5 -4
  11. package/es/helper/FromItems.js +64 -5
  12. package/es/helper/action.js +2 -0
  13. package/es/helper/ldBuilder.js +5 -4
  14. package/es/helper/ldComBuild.js +16 -11
  15. package/es/locales/zh-CN.js +61 -6
  16. package/es/lowcode/constants/api-url.js +359 -190
  17. package/es/lowcode/constants/event-topics.js +4 -0
  18. package/es/lowcode/constants/index.js +5 -4
  19. package/es/lowcode/engine/meta/box.props.default.json +1 -1
  20. package/es/lowcode/engine/meta/box.props.json +1 -1
  21. package/es/lowcode/engine/meta/cardlist.props.json +3 -5
  22. package/es/lowcode/engine/meta/components-list.json +6 -0
  23. package/es/lowcode/engine/meta/dialog.props.default.json +4 -1
  24. package/es/lowcode/engine/meta/dialog.props.json +24 -4
  25. package/es/lowcode/engine/meta/drawer.props.json +1 -1
  26. package/es/lowcode/engine/meta/fielddate.props.default.json +1 -0
  27. package/es/lowcode/engine/meta/fielddate.props.json +48 -1
  28. package/es/lowcode/engine/meta/fieldeditor.props.json +0 -1
  29. package/es/lowcode/engine/meta/fieldgroup.props.json +0 -1
  30. package/es/lowcode/engine/meta/fieldyear.props.json +0 -1
  31. package/es/lowcode/engine/meta/form.props.json +3 -19
  32. package/es/lowcode/engine/meta/grouptree.props.json +0 -1
  33. package/es/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
  34. package/es/lowcode/engine/meta/jsx.props.default.json +1 -2
  35. package/es/lowcode/engine/meta/jsx.props.json +4 -3
  36. package/es/lowcode/engine/meta/layout.props.default.json +1 -1
  37. package/es/lowcode/engine/meta/layout.props.json +1 -1
  38. package/es/lowcode/engine/meta/proxy.props.default.json +15 -0
  39. package/es/lowcode/engine/meta/proxy.props.json +66 -0
  40. package/es/lowcode/engine/meta/section.props.json +2 -2
  41. package/es/lowcode/engine/meta/table.props.json +0 -7
  42. package/es/lowcode/engine/meta/tabs.props.json +1 -1
  43. package/es/lowcode/engine/meta/tree.props.json +1 -5
  44. package/es/lowcode/engine/provider/ContextProvider/index.js +45 -9
  45. package/es/lowcode/engine/provider/ContextProvider/router.js +21 -1
  46. package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +36 -30
  47. package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +11 -5
  48. package/es/lowcode/engine/provider/ContextProvider/useTodo.js +2 -4
  49. package/es/lowcode/engine/provider/EventBusProvider.js +14 -4
  50. package/es/lowcode/engine/provider/PageProxyProvider.js +95 -0
  51. package/es/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
  52. package/es/lowcode/engine/tools/helper.js +25 -1
  53. package/es/lowcode/engine/tools/initDS.js +4 -4
  54. package/es/lowcode/painter/Design.js +1 -0
  55. package/es/lowcode/painter/DesignOperator.js +135 -27
  56. package/es/lowcode/painter/DesignToolbar.js +102 -188
  57. package/es/lowcode/painter/History.js +300 -0
  58. package/es/lowcode/painter/Panel.js +1 -1
  59. package/es/lowcode/painter/Ribbon.js +37 -1
  60. package/es/lowcode/painter/components/AdvancePanel.js +55 -51
  61. package/es/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
  62. package/es/lowcode/painter/components/TipIcon.js +12 -4
  63. package/es/lowcode/painter/components/TreeEditor.js +76 -8
  64. package/es/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
  65. package/es/lowcode/painter/components/code-editor/DiffEditor.js +41 -0
  66. package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
  67. package/es/lowcode/painter/components/field-setting/SettingUI.js +56 -5
  68. package/es/lowcode/painter/components/field-setting/index.js +24 -1
  69. package/es/lowcode/painter/components/shortcut-modal/KeyIcon.js +11 -0
  70. package/es/lowcode/painter/components/shortcut-modal/index.js +208 -0
  71. package/es/lowcode/painter/panel-section/BlockEditor/index.js +10 -19
  72. package/es/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
  73. package/es/lowcode/painter/panel-section/ConditionCheck.js +70 -0
  74. package/es/lowcode/painter/panel-section/DataSetSelector.js +6 -3
  75. package/es/lowcode/painter/panel-section/DialogSize.js +76 -0
  76. package/es/lowcode/painter/panel-section/DialogWidthHeight.js +60 -0
  77. package/es/lowcode/painter/panel-section/FieldsSetting.js +1 -1
  78. package/es/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
  79. package/es/lowcode/painter/panel-section/JSEditor/ToolBar.js +174 -0
  80. package/es/lowcode/painter/panel-section/JSEditor/index.js +181 -0
  81. package/es/lowcode/painter/panel-section/JSEditor/index.less +4 -0
  82. package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
  83. package/es/lowcode/painter/panel-section/ProxyLinker.js +137 -0
  84. package/es/lowcode/painter/panel-section/ProxyParams.js +28 -0
  85. package/es/lowcode/painter/panel-section/ProxyParamsSetter.js +240 -0
  86. package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
  87. package/es/lowcode/painter/style/action-bind-modal.less +1 -1
  88. package/es/lowcode/painter/style/components.less +1 -1
  89. package/es/lowcode/painter/style/history.less +46 -0
  90. package/es/lowcode/painter/style/outline.less +1 -1
  91. package/es/lowcode/painter/style/panel-item.less +1 -0
  92. package/es/lowcode/preview/DebugTool.js +78 -0
  93. package/es/lowcode/preview/DebugToolDetail.js +103 -0
  94. package/es/lowcode/preview/index.js +10 -17
  95. package/es/lowcode/preview/useDebugSettings.js +62 -0
  96. package/es/lowcode/view/Canvas.js +5 -1
  97. package/es/lowcode/view/ErrorBoundary.js +80 -0
  98. package/es/lowcode/view/Page.js +11 -6
  99. package/es/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
  100. package/es/lowcode/view/lc-components/Box/index.less +2 -2
  101. package/es/lowcode/view/lc-components/Box/meta.json +1 -1
  102. package/es/lowcode/view/lc-components/CardList/index.js +3 -0
  103. package/es/lowcode/view/lc-components/CardList/meta.json +3 -5
  104. package/es/lowcode/view/lc-components/Dialog/index.js +13 -5
  105. package/es/lowcode/view/lc-components/Dialog/meta.json +24 -4
  106. package/es/lowcode/view/lc-components/Drawer/index.js +5 -3
  107. package/es/lowcode/view/lc-components/Drawer/meta.json +1 -1
  108. package/es/lowcode/view/lc-components/FieldDate/meta.json +48 -1
  109. package/es/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
  110. package/es/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
  111. package/es/lowcode/view/lc-components/FieldYear/meta.json +0 -1
  112. package/es/lowcode/view/lc-components/Form/index.js +15 -19
  113. package/es/lowcode/view/lc-components/Form/meta.json +3 -19
  114. package/es/lowcode/view/lc-components/GroupTree/meta.json +0 -1
  115. package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +32 -16
  116. package/es/lowcode/view/lc-components/JSX/meta.json +4 -3
  117. package/es/lowcode/view/lc-components/Layout/meta.json +1 -1
  118. package/es/lowcode/view/lc-components/PageLayout/index.js +1 -1
  119. package/es/lowcode/view/lc-components/Proxy/FunctionDesign.js +17 -0
  120. package/es/lowcode/view/lc-components/Proxy/FunctionLive.js +23 -0
  121. package/es/lowcode/view/lc-components/Proxy/FunctionPreview.js +23 -0
  122. package/es/lowcode/view/lc-components/Proxy/index.js +42 -0
  123. package/es/lowcode/view/lc-components/Proxy/index.less +5 -0
  124. package/es/lowcode/view/lc-components/Proxy/meta.json +66 -0
  125. package/es/lowcode/view/lc-components/Section/meta.json +2 -2
  126. package/es/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
  127. package/es/lowcode/view/lc-components/Table/index.js +11 -3
  128. package/es/lowcode/view/lc-components/Table/meta.json +0 -7
  129. package/es/lowcode/view/lc-components/Tabs/index.js +6 -2
  130. package/es/lowcode/view/lc-components/Tabs/meta.json +1 -1
  131. package/es/lowcode/view/lc-components/Tree/index.js +3 -0
  132. package/es/lowcode/view/lc-components/Tree/meta.json +1 -5
  133. package/es/lowcode/view/lc-components/Wrapper.js +9 -1
  134. package/es/upload/FilesWall/index.js +16 -6
  135. package/es/upload/Form/gridForm.js +16 -6
  136. package/es/upload/FormItem/index.js +16 -4
  137. package/es/utils/action.js +3 -2
  138. package/es/utils/form.js +4 -3
  139. package/es/utils/grid.js +10 -2
  140. package/lib/components/Builder/index.js +13 -10
  141. package/lib/components/ComplexItem/index.js +5 -3
  142. package/lib/components/ComplexItem/service.js +6 -3
  143. package/lib/components/LDActions/index.js +1 -0
  144. package/lib/components/LdAutoForm/index.js +3 -2
  145. package/lib/components/LdCard/index.js +10 -8
  146. package/lib/components/LdCom/index.js +3 -2
  147. package/lib/components/LdFormList/index.js +9 -6
  148. package/lib/components/LdGrid/index.js +11 -12
  149. package/lib/components/LdGridForm/index.js +3 -2
  150. package/lib/helper/FromItems.js +64 -5
  151. package/lib/helper/action.js +2 -0
  152. package/lib/helper/ldBuilder.js +4 -4
  153. package/lib/helper/ldComBuild.js +14 -9
  154. package/lib/locales/zh-CN.js +61 -6
  155. package/lib/lowcode/constants/api-url.js +360 -190
  156. package/lib/lowcode/constants/event-topics.js +5 -1
  157. package/lib/lowcode/constants/index.js +6 -5
  158. package/lib/lowcode/engine/meta/box.props.default.json +1 -1
  159. package/lib/lowcode/engine/meta/box.props.json +1 -1
  160. package/lib/lowcode/engine/meta/cardlist.props.json +3 -5
  161. package/lib/lowcode/engine/meta/components-list.json +6 -0
  162. package/lib/lowcode/engine/meta/dialog.props.default.json +4 -1
  163. package/lib/lowcode/engine/meta/dialog.props.json +24 -4
  164. package/lib/lowcode/engine/meta/drawer.props.json +1 -1
  165. package/lib/lowcode/engine/meta/fielddate.props.default.json +1 -0
  166. package/lib/lowcode/engine/meta/fielddate.props.json +48 -1
  167. package/lib/lowcode/engine/meta/fieldeditor.props.json +0 -1
  168. package/lib/lowcode/engine/meta/fieldgroup.props.json +0 -1
  169. package/lib/lowcode/engine/meta/fieldyear.props.json +0 -1
  170. package/lib/lowcode/engine/meta/form.props.json +3 -19
  171. package/lib/lowcode/engine/meta/grouptree.props.json +0 -1
  172. package/lib/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
  173. package/lib/lowcode/engine/meta/jsx.props.default.json +1 -2
  174. package/lib/lowcode/engine/meta/jsx.props.json +4 -3
  175. package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
  176. package/lib/lowcode/engine/meta/layout.props.json +1 -1
  177. package/lib/lowcode/engine/meta/proxy.props.default.json +15 -0
  178. package/lib/lowcode/engine/meta/proxy.props.json +66 -0
  179. package/lib/lowcode/engine/meta/section.props.json +2 -2
  180. package/lib/lowcode/engine/meta/table.props.json +0 -7
  181. package/lib/lowcode/engine/meta/tabs.props.json +1 -1
  182. package/lib/lowcode/engine/meta/tree.props.json +1 -5
  183. package/lib/lowcode/engine/provider/ContextProvider/index.js +50 -13
  184. package/lib/lowcode/engine/provider/ContextProvider/router.js +22 -1
  185. package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +37 -31
  186. package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +10 -4
  187. package/lib/lowcode/engine/provider/ContextProvider/useTodo.js +1 -3
  188. package/lib/lowcode/engine/provider/EventBusProvider.js +14 -4
  189. package/lib/lowcode/engine/provider/PageProxyProvider.js +103 -0
  190. package/lib/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
  191. package/lib/lowcode/engine/tools/helper.js +25 -0
  192. package/lib/lowcode/engine/tools/initDS.js +4 -4
  193. package/lib/lowcode/painter/Design.js +1 -0
  194. package/lib/lowcode/painter/DesignOperator.js +132 -24
  195. package/lib/lowcode/painter/DesignToolbar.js +98 -184
  196. package/lib/lowcode/painter/History.js +308 -0
  197. package/lib/lowcode/painter/Panel.js +1 -1
  198. package/lib/lowcode/painter/Ribbon.js +37 -1
  199. package/lib/lowcode/painter/components/AdvancePanel.js +53 -49
  200. package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
  201. package/lib/lowcode/painter/components/TipIcon.js +12 -4
  202. package/lib/lowcode/painter/components/TreeEditor.js +76 -8
  203. package/lib/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
  204. package/lib/lowcode/painter/components/code-editor/DiffEditor.js +49 -0
  205. package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
  206. package/lib/lowcode/painter/components/field-setting/SettingUI.js +55 -4
  207. package/lib/lowcode/painter/components/field-setting/index.js +24 -1
  208. package/lib/lowcode/painter/components/shortcut-modal/KeyIcon.js +18 -0
  209. package/lib/lowcode/painter/components/shortcut-modal/index.js +215 -0
  210. package/lib/lowcode/painter/panel-section/BlockEditor/index.js +9 -18
  211. package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
  212. package/lib/lowcode/painter/panel-section/ConditionCheck.js +78 -0
  213. package/lib/lowcode/painter/panel-section/DataSetSelector.js +6 -3
  214. package/lib/lowcode/painter/panel-section/DialogSize.js +83 -0
  215. package/lib/lowcode/painter/panel-section/DialogWidthHeight.js +67 -0
  216. package/lib/lowcode/painter/panel-section/FieldsSetting.js +1 -1
  217. package/lib/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
  218. package/lib/lowcode/painter/panel-section/JSEditor/ToolBar.js +181 -0
  219. package/lib/lowcode/painter/panel-section/JSEditor/index.js +189 -0
  220. package/lib/lowcode/painter/panel-section/JSEditor/index.less +4 -0
  221. package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
  222. package/lib/lowcode/painter/panel-section/ProxyLinker.js +145 -0
  223. package/lib/lowcode/painter/panel-section/ProxyParams.js +35 -0
  224. package/lib/lowcode/painter/panel-section/ProxyParamsSetter.js +248 -0
  225. package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
  226. package/lib/lowcode/painter/style/action-bind-modal.less +1 -1
  227. package/lib/lowcode/painter/style/components.less +1 -1
  228. package/lib/lowcode/painter/style/history.less +46 -0
  229. package/lib/lowcode/painter/style/outline.less +1 -1
  230. package/lib/lowcode/painter/style/panel-item.less +1 -0
  231. package/lib/lowcode/preview/DebugTool.js +86 -0
  232. package/lib/lowcode/preview/DebugToolDetail.js +111 -0
  233. package/lib/lowcode/preview/index.js +10 -18
  234. package/lib/lowcode/preview/useDebugSettings.js +69 -0
  235. package/lib/lowcode/view/Canvas.js +5 -1
  236. package/lib/lowcode/view/ErrorBoundary.js +88 -0
  237. package/lib/lowcode/view/Page.js +12 -7
  238. package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
  239. package/lib/lowcode/view/lc-components/Box/index.less +2 -2
  240. package/lib/lowcode/view/lc-components/Box/meta.json +1 -1
  241. package/lib/lowcode/view/lc-components/CardList/index.js +3 -0
  242. package/lib/lowcode/view/lc-components/CardList/meta.json +3 -5
  243. package/lib/lowcode/view/lc-components/Dialog/index.js +11 -3
  244. package/lib/lowcode/view/lc-components/Dialog/meta.json +24 -4
  245. package/lib/lowcode/view/lc-components/Drawer/index.js +3 -1
  246. package/lib/lowcode/view/lc-components/Drawer/meta.json +1 -1
  247. package/lib/lowcode/view/lc-components/FieldDate/meta.json +48 -1
  248. package/lib/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
  249. package/lib/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
  250. package/lib/lowcode/view/lc-components/FieldYear/meta.json +0 -1
  251. package/lib/lowcode/view/lc-components/Form/index.js +15 -19
  252. package/lib/lowcode/view/lc-components/Form/meta.json +3 -19
  253. package/lib/lowcode/view/lc-components/GroupTree/meta.json +0 -1
  254. package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +33 -16
  255. package/lib/lowcode/view/lc-components/JSX/meta.json +4 -3
  256. package/lib/lowcode/view/lc-components/Layout/meta.json +1 -1
  257. package/lib/lowcode/view/lc-components/PageLayout/index.js +1 -1
  258. package/lib/lowcode/view/lc-components/Proxy/FunctionDesign.js +24 -0
  259. package/lib/lowcode/view/lc-components/Proxy/FunctionLive.js +30 -0
  260. package/lib/lowcode/view/lc-components/Proxy/FunctionPreview.js +30 -0
  261. package/lib/lowcode/view/lc-components/Proxy/index.js +50 -0
  262. package/lib/lowcode/view/lc-components/Proxy/index.less +5 -0
  263. package/lib/lowcode/view/lc-components/Proxy/meta.json +66 -0
  264. package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
  265. package/lib/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
  266. package/lib/lowcode/view/lc-components/Table/index.js +11 -3
  267. package/lib/lowcode/view/lc-components/Table/meta.json +0 -7
  268. package/lib/lowcode/view/lc-components/Tabs/index.js +5 -1
  269. package/lib/lowcode/view/lc-components/Tabs/meta.json +1 -1
  270. package/lib/lowcode/view/lc-components/Tree/index.js +3 -0
  271. package/lib/lowcode/view/lc-components/Tree/meta.json +1 -5
  272. package/lib/lowcode/view/lc-components/Wrapper.js +8 -0
  273. package/lib/upload/FilesWall/index.js +13 -3
  274. package/lib/upload/Form/gridForm.js +13 -3
  275. package/lib/upload/FormItem/index.js +15 -3
  276. package/lib/utils/action.js +6 -0
  277. package/lib/utils/form.js +3 -2
  278. package/lib/utils/grid.js +11 -3
  279. package/package.json +1 -2
  280. package/es/lowcode/painter/panel-section/JSEditor.js +0 -49
  281. package/es/lowcode/view/errorBoundary.js +0 -61
  282. package/lib/lowcode/painter/panel-section/JSEditor.js +0 -57
  283. package/lib/lowcode/view/errorBoundary.js +0 -69
@@ -182,7 +182,6 @@
182
182
  "name": "默认选中行",
183
183
  "type": "_JSEditor",
184
184
  "defaultCode": "function getRowDefaultSelected(data, node) { \n return false; \n}",
185
- "mustConfirm": true,
186
185
  "wrapper": "collapse",
187
186
  "wrapperProps": {
188
187
  "suppressIcon": true
@@ -193,7 +192,6 @@
193
192
  "name": "行是否可选",
194
193
  "type": "_JSEditor",
195
194
  "defaultCode": "function getRowSelectable(data, node) { \n return true; \n}",
196
- "mustConfirm": true,
197
195
  "wrapper": "collapse",
198
196
  "wrapperProps": {
199
197
  "suppressIcon": true
@@ -322,7 +320,6 @@
322
320
  "name": "格式化数据",
323
321
  "type": "_JSEditor",
324
322
  "defaultCode": "function formatDataSource(list, detail) { \n return []; \n}",
325
- "mustConfirm": true,
326
323
  "wrapper": "collapse",
327
324
  "wrapperProps": {
328
325
  "suppressIcon": true
@@ -333,7 +330,6 @@
333
330
  "name": "构建树层级",
334
331
  "type": "_JSEditor",
335
332
  "defaultCode": "function getDataPath(data) { \n return []; \n}",
336
- "mustConfirm": true,
337
333
  "wrapper": "collapse",
338
334
  "wrapperProps": {
339
335
  "suppressIcon": true
@@ -345,7 +341,6 @@
345
341
  "desc": "自定义某些表格列",
346
342
  "type": "_JSEditor",
347
343
  "defaultCode": "function columnsRewrite(columns) { \n return columns; \n}",
348
- "mustConfirm": true,
349
344
  "wrapper": "collapse",
350
345
  "wrapperProps": {
351
346
  "suppressIcon": true
@@ -357,7 +352,6 @@
357
352
  "desc": "完全自定义所有表格列,优先级大于columnsRewrite",
358
353
  "type": "_JSEditor",
359
354
  "defaultCode": "function columnsReset(columns) { \n return columns; \n}",
360
- "mustConfirm": true,
361
355
  "wrapper": "collapse",
362
356
  "wrapperProps": {
363
357
  "suppressIcon": true
@@ -368,7 +362,6 @@
368
362
  "name": "model参数",
369
363
  "type": "_JSEditor",
370
364
  "defaultCode": "function getModelParams() { \n return {}; \n}",
371
- "mustConfirm": true,
372
365
  "wrapper": "collapse",
373
366
  "wrapperProps": {
374
367
  "suppressIcon": true
@@ -84,7 +84,7 @@
84
84
  "name": "tab bar 上额外的元素",
85
85
  "type": "_JSEditor",
86
86
  "defaultCode": "function Component() { \n return <div>extra</div>; \n}",
87
- "mustConfirm": true,
87
+ "isjsx": true,
88
88
  "wrapper": "collapse",
89
89
  "wrapperProps": {
90
90
  "suppressIcon": true
@@ -205,7 +205,6 @@
205
205
  "desc": "返回默认选中的数据主键",
206
206
  "type": "_JSEditor",
207
207
  "defaultCode": "function defaultSelect(treeData) { \n return null; \n}",
208
- "mustConfirm": true,
209
208
  "wrapper": "collapse",
210
209
  "wrapperProps": {
211
210
  "suppressIcon": true
@@ -268,7 +267,6 @@
268
267
  "name": "节点是否有复选框",
269
268
  "type": "_JSEditor",
270
269
  "defaultCode": "function treeNodeCheckable(item) { \n return true; \n}",
271
- "mustConfirm": true,
272
270
  "wrapper": "collapse",
273
271
  "wrapperProps": {
274
272
  "suppressIcon": true
@@ -279,7 +277,6 @@
279
277
  "name": "节点复选框是否禁用",
280
278
  "type": "_JSEditor",
281
279
  "defaultCode": "function treeNodeDisableCheckbox(item) { \n return false; \n}",
282
- "mustConfirm": true,
283
280
  "wrapper": "collapse",
284
281
  "wrapperProps": {
285
282
  "suppressIcon": true
@@ -290,7 +287,6 @@
290
287
  "name": "节点是否禁用",
291
288
  "type": "_JSEditor",
292
289
  "defaultCode": "function treeNodeDisable(item) { \n return false; \n}",
293
- "mustConfirm": true,
294
290
  "wrapper": "collapse",
295
291
  "wrapperProps": {
296
292
  "suppressIcon": true
@@ -301,7 +297,7 @@
301
297
  "name": "节点定制渲染",
302
298
  "type": "_JSEditor",
303
299
  "defaultCode": "function onTreeNodeRender(title, item) { \n return title; \n}",
304
- "mustConfirm": true,
300
+ "isjsx": true,
305
301
  "wrapper": "collapse",
306
302
  "wrapperProps": {
307
303
  "suppressIcon": true
@@ -1,4 +1,7 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
4
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
5
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
6
  import React, { createContext, useContext as useReactContext, useRef } from 'react';
4
7
  import { useMemoizedFn } from 'ahooks';
@@ -7,7 +10,6 @@ import { useLDEventBus } from "../EventBusProvider";
7
10
  import RemoteSourceProvider, { RemoteSourceContext } from "../RemoteSourceProvider";
8
11
  import usePageVar from "./usePageVar";
9
12
  import useTodo from "./useTodo";
10
- import { getModuleData } from "./usePageDataStore";
11
13
  import API_PREFIX from "@/services/ApiConfig";
12
14
  import { getBehaviorUrl } from "../../../constants/api-url";
13
15
  import * as topics from "../../../constants/event-topics";
@@ -60,10 +62,27 @@ export default (function (_ref) {
60
62
  if (index !== -1) {
61
63
  _componentList.current.splice(index, 1);
62
64
  }
63
- ;
64
65
  });
65
- var _initRemoteApiMap = useMemoizedFn(function (_apiMap) {
66
- _remoteApiMap.current = _apiMap;
66
+ var _initRemoteApiMap = useMemoizedFn(function (_apiMap, append) {
67
+ if (append) {
68
+ _remoteApiMap.current = new Map([].concat(_toConsumableArray(_remoteApiMap.current), _toConsumableArray(_apiMap)));
69
+ } else {
70
+ _remoteApiMap.current = _apiMap;
71
+ }
72
+ });
73
+ var _deleteRemoteApis = useMemoizedFn(function (keys) {
74
+ var _iterator = _createForOfIteratorHelper(keys),
75
+ _step;
76
+ try {
77
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
78
+ var key = _step.value;
79
+ _remoteApiMap.current.delete(key);
80
+ }
81
+ } catch (err) {
82
+ _iterator.e(err);
83
+ } finally {
84
+ _iterator.f();
85
+ }
67
86
  });
68
87
  var getElementById = useMemoizedFn(function (compId) {
69
88
  var _componentList$curren;
@@ -81,10 +100,9 @@ export default (function (_ref) {
81
100
  if (!_parentId) return null;
82
101
  return compMap.get(_parentId);
83
102
  });
84
- var want = useMemoizedFn(function (wanted) {
85
- var _getModuleData;
103
+ var want = useMemoizedFn(function (wanted, _serials) {
86
104
  if (isNil(wanted)) return false;
87
- var serials = ((_getModuleData = getModuleData()) === null || _getModuleData === void 0 ? void 0 : _getModuleData.resources) || [];
105
+ var serials = _serials || [];
88
106
  var serialMap = serials.reduce(function (acc, cur, index) {
89
107
  if (!acc[cur]) {
90
108
  acc[cur] = Math.pow(2, index);
@@ -101,6 +119,7 @@ export default (function (_ref) {
101
119
  _register: _register,
102
120
  _unregister: _unregister,
103
121
  _initRemoteApiMap: _initRemoteApiMap,
122
+ _deleteRemoteApis: _deleteRemoteApis,
104
123
  /**
105
124
  * @property {boolean} loading - loading状态
106
125
  */
@@ -179,9 +198,26 @@ export default (function (_ref) {
179
198
  var _privateGetter$curren;
180
199
  return (_privateGetter$curren = _privateGetter.current) === null || _privateGetter$curren === void 0 ? void 0 : _privateGetter$curren[property]();
181
200
  } else if (property === 'state') {
182
- return getState();
201
+ var state = getState();
202
+ return new Proxy(Object.assign({}, state), {
203
+ get: function get(stateTarget, stateProperty, stateReceiver) {
204
+ return Reflect.get(stateTarget, stateProperty, stateReceiver);
205
+ },
206
+ set: function set(stateTarget, stateProperty, stateReceiver) {
207
+ setState(_defineProperty({}, stateProperty, stateReceiver));
208
+ return true;
209
+ }
210
+ });
183
211
  } else if (property === 'global') {
184
- return global.current;
212
+ return new Proxy(Object.assign({}, global.current), {
213
+ get: function get(globalTarget, globalProperty, globalReceiver) {
214
+ return Reflect.get(globalTarget, globalProperty, globalReceiver);
215
+ },
216
+ set: function set(globalTarget, globalProperty, globalReceiver) {
217
+ setGlobal(_defineProperty({}, globalProperty, globalReceiver));
218
+ return true;
219
+ }
220
+ });
185
221
  }
186
222
  return Reflect.get(target, property, receiver);
187
223
  },
@@ -1,5 +1,11 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ var _excluded = ["title", "subTitle"],
5
+ _excluded2 = ["title", "subTitle"];
1
6
  import { history } from 'umi';
2
7
  import { isNil } from 'lodash';
8
+ import { parse, stringify } from 'qs';
3
9
  export function push(path, params) {
4
10
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'push';
5
11
  var blank = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
@@ -12,7 +18,21 @@ export function push(path, params) {
12
18
  method: 'replace'
13
19
  });
14
20
  } else if (type === 'layer') {
15
- window.openUrl("layer:".concat(path), params);
21
+ var _path$split = path.split('?'),
22
+ _path$split2 = _slicedToArray(_path$split, 2),
23
+ _path = _path$split2[0],
24
+ argsStr = _path$split2[1];
25
+ var title = params.title,
26
+ subTitle = params.subTitle,
27
+ _params = _objectWithoutProperties(params, _excluded);
28
+ var _parse = parse(argsStr),
29
+ _title = _parse.title,
30
+ _subTitle = _parse.subTitle,
31
+ args = _objectWithoutProperties(_parse, _excluded2);
32
+ window.openUrl("layer:".concat(_path, "?").concat(stringify(_objectSpread({
33
+ title: title || _title,
34
+ subTitle: subTitle || _subTitle
35
+ }, args))), _params);
16
36
  } else if (type === 'iframe') {
17
37
  window.openUrl("iframe:".concat(path));
18
38
  } else if (type === 'sso') {
@@ -7,6 +7,7 @@ import { subscribeWithSelector } from 'zustand/middleware';
7
7
  import { useShallow } from 'zustand/react/shallow';
8
8
  import { isObject, isArray, isNil, isFunction, isString, get, set as _set, unset, assign, forOwn, forEach, omit, debounce } from 'lodash';
9
9
  import isDeepEqual from 'fast-deep-equal';
10
+ import { usePageProxyContext } from "../PageProxyProvider";
10
11
  import { getPathNodesById, findNodeAndParent } from "../../tools/dataProcess";
11
12
  import { LC_BUILDIN_UNIT_KEY } from "../../../constants";
12
13
  var temporalStateCreator = function temporalStateCreator(userSet, userGet, options) {
@@ -141,18 +142,12 @@ var findNode = function findNode(obj, id) {
141
142
  var usePageDataStore = create()(immer(subscribeWithSelector(temporal(function (set) {
142
143
  return {
143
144
  pageData: null,
144
- moduleData: null,
145
145
  needPrompt: false,
146
146
  initialize: function initialize(data) {
147
147
  return set(function (state) {
148
148
  state.pageData = data;
149
149
  });
150
150
  },
151
- initializeModule: function initializeModule(data) {
152
- return set(function (state) {
153
- state.moduleData = data;
154
- });
155
- },
156
151
  reset: function reset(data) {
157
152
  return set(function (state) {
158
153
  state.pageData = data || null;
@@ -260,20 +255,20 @@ export var modifyNode = function modifyNode(id, data) {
260
255
 
261
256
  /**
262
257
  * 移动页面中的一个节点到另一个位置。
263
- *
258
+ *
264
259
  * @param {string} sid - 源节点的ID。
265
260
  * @param {string} tid - 目标节点的ID。
266
261
  * @param {string} action - 移动类型,可以是 'inside', 'left', 'right' 中的一个。
267
262
  * @param {string} newid - 新节点的ID,仅在创建新节点时使用。
268
263
  * @param {Object} json - 新节点的初始属性,仅在创建新节点时使用。
269
- *
264
+ *
270
265
  * @description
271
266
  * 此函数会更新页面数据状态,根据提供的动作类型(`action`),将源节点(`sourceNode`)移动到目标节点(`targetNode`)的相应位置。
272
267
  * - 'inside': 将源节点作为目标节点的子节点。
273
268
  * - 'left': 将源节点放在目标节点的左边(同一父节点下)。
274
269
  * - 'right': 将源节点放在目标节点的右边(同一父节点下)。
275
270
  * 如果 `sid` 是空但提供了 `newid`,则函数会创建一个新的节点。
276
- *
271
+ *
277
272
  */
278
273
  export var moveNode = function moveNode(sid, tid, action, newid, json) {
279
274
  usePageDataStore.setState(function (state) {
@@ -387,30 +382,41 @@ export var useTask = function useTask(type) {
387
382
  }, []);
388
383
  return task;
389
384
  };
390
- export var useGet = function useGet(_) {
391
- var result = usePageDataStore(useShallow(function (state) {
392
- if (isNil(_)) {
393
- return state.pageData;
394
- } else if (isFunction(_)) {
395
- return _(state.pageData);
396
- } else if (isArray(_)) {
397
- return _.map(function (k) {
398
- var _findNode;
399
- return k.includes('.') ? get(state.pageData, k) : (_findNode = findNode(state.pageData, k)) === null || _findNode === void 0 ? void 0 : _findNode.target;
385
+ var getTargetData = function getTargetData(_, source) {
386
+ if (isNil(_)) {
387
+ return source;
388
+ } else if (isFunction(_)) {
389
+ return _(source);
390
+ } else if (isArray(_)) {
391
+ return _.map(function (k) {
392
+ var _findNode;
393
+ return k.includes('.') ? get(source, k) : (_findNode = findNode(source, k)) === null || _findNode === void 0 ? void 0 : _findNode.target;
394
+ });
395
+ } else if (isObject(_) && _.id) {
396
+ var _findNode2;
397
+ var path = _.path;
398
+ var _target = _.id === LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? source : (_findNode2 = findNode(source, _.id)) === null || _findNode2 === void 0 ? void 0 : _findNode2.target;
399
+ if (isNil(path)) {
400
+ return _target;
401
+ } else if (isString(path)) {
402
+ return get(_target, path);
403
+ } else if (isArray(path)) {
404
+ return path.map(function (k) {
405
+ return get(_target, k);
400
406
  });
401
- } else if (isObject(_) && _.id) {
402
- var _findNode2;
403
- var path = _.path;
404
- var _target = _.id === LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? state.pageData : (_findNode2 = findNode(state.pageData, _.id)) === null || _findNode2 === void 0 ? void 0 : _findNode2.target;
405
- return isNil(path) ? _target : get(_target, path);
406
- } else if (isString(_)) {
407
- return get(state.pageData, _);
408
407
  }
409
- }));
410
- return result;
408
+ } else if (isString(_)) {
409
+ return get(state.pageData, _);
410
+ }
411
411
  };
412
- export var getModuleData = function getModuleData() {
413
- return usePageDataStore.getState().moduleData;
412
+ export var useGet = function useGet(_) {
413
+ var ppCtx = usePageProxyContext();
414
+ if (ppCtx !== null && ppCtx !== void 0 && ppCtx.proxyCode) {
415
+ return getTargetData(_, usePageDataStore.getState()[ppCtx.proxyCode]);
416
+ }
417
+ return usePageDataStore(useShallow(function (state) {
418
+ return getTargetData(_, state.pageData);
419
+ }));
414
420
  };
415
421
  export var setNeedPrompt = function setNeedPrompt(_need) {
416
422
  usePageDataStore.setState(function (state) {
@@ -3,18 +3,24 @@ import { useMemoizedFn } from 'ahooks';
3
3
  import { create } from 'zustand';
4
4
  import { immer } from 'zustand/middleware/immer';
5
5
  import { subscribeWithSelector } from 'zustand/middleware';
6
- import { forOwn, isNil, isString, isObject } from 'lodash';
6
+ import { forOwn, isNil, isString, isObject, omit } from 'lodash';
7
7
  export var useStateStore = create()(immer(subscribeWithSelector(function (set) {
8
8
  return {
9
9
  state: {},
10
- initialize: function initialize(init) {
10
+ initialize: function initialize(init, append) {
11
11
  return set(function (store) {
12
- store.state = init;
12
+ if (append) {
13
+ forOwn(init, function (value, key) {
14
+ store.state[key] = value;
15
+ });
16
+ } else {
17
+ store.state = init;
18
+ }
13
19
  });
14
20
  },
15
- clear: function clear() {
21
+ clear: function clear(_vars) {
16
22
  return set(function (store) {
17
- store.state = {};
23
+ store.state = omit(store.state, _vars);
18
24
  });
19
25
  }
20
26
  };
@@ -6,8 +6,7 @@ var _excluded = ["datasetCode"];
6
6
  import { useBoolean, useMemoizedFn } from 'ahooks';
7
7
  import { message } from 'luck-design/antd';
8
8
  import { keys, isNil, isFunction } from 'lodash';
9
- import { getModuleData } from "./usePageDataStore";
10
- import { executeCode } from "../../tools/helper";
9
+ import { executeCode, getLDMetaAttr } from "../../tools/helper";
11
10
  import { fetchCallBehavior } from "../../../constants/api-url";
12
11
  var useTodo = function useTodo() {
13
12
  var _useBoolean = useBoolean(),
@@ -54,8 +53,7 @@ var useTodo = function useTodo() {
54
53
  params = _ref4.params,
55
54
  data = _ref4.data,
56
55
  after = _ref4.after;
57
- var moduleData = getModuleData();
58
- var _moduleCode = moduleCode || moduleData.moduleCode;
56
+ var _moduleCode = moduleCode || getLDMetaAttr('moduleCode');
59
57
  var _dscode = datasetCode || dsCode;
60
58
  if (!_moduleCode || !_dscode) {
61
59
  message.warning('接口重要参数(模块编码或数据集编码)丢失');
@@ -58,7 +58,7 @@ export default (function (_ref) {
58
58
  var _ref4 = _slicedToArray(_ref3, 2),
59
59
  _id = _ref4[0],
60
60
  _subscriber = _ref4[1];
61
- var temp = _subscriber._before ? _subscriber._before(payload) : null;
61
+ var temp = _subscriber._before ? _subscriber._before(payload, _id) : null;
62
62
  if (_subscriber._before && !isPromise(temp)) {
63
63
  console.error('before hook must return a promise');
64
64
  return;
@@ -68,10 +68,10 @@ export default (function (_ref) {
68
68
  if (!flag) return flag;
69
69
  var func = _subscriber._once || _subscriber._on;
70
70
  if (!func) return;
71
- return func(payload);
71
+ return func(payload, _id);
72
72
  }).then(function (flag) {
73
73
  if (flag === false || !_subscriber._after) return;
74
- return _subscriber._after(payload);
74
+ return _subscriber._after(payload, _id);
75
75
  }).finally(function () {
76
76
  if (_subscriber._once) {
77
77
  $unsubscriber(topic, _id);
@@ -85,6 +85,15 @@ export default (function (_ref) {
85
85
  runtime: runtime
86
86
  }, payload));
87
87
  });
88
+ var $publisherOnce = useMemoizedFn(function (topic, payload) {
89
+ return new Promise(function (resolve) {
90
+ event$.emit(_objectSpread({
91
+ topic: topic,
92
+ runtime: runtime
93
+ }, payload));
94
+ $subscriber(topic).once(resolve).watch();
95
+ });
96
+ });
88
97
  var $subscriber = useMemoizedFn(function (topic) {
89
98
  if (!subscriberPool.has(topic)) subscriberPool.set(topic, []);
90
99
  var id = suid();
@@ -104,7 +113,7 @@ export default (function (_ref) {
104
113
  if (!subscriberPool.get(topic).length) {
105
114
  subscriberPool.delete(topic);
106
115
  }
107
- (_subscriber$_off = (_subscriber2 = _subscriber)._off) === null || _subscriber$_off === void 0 || _subscriber$_off.call(_subscriber2);
116
+ (_subscriber$_off = (_subscriber2 = _subscriber)._off) === null || _subscriber$_off === void 0 || _subscriber$_off.call(_subscriber2, _id);
108
117
  _subscriber = null;
109
118
  }
110
119
  });
@@ -113,6 +122,7 @@ export default (function (_ref) {
113
122
  value: {
114
123
  runtime: runtime,
115
124
  $publisher: $publisher,
125
+ $publisherOnce: $publisherOnce,
116
126
  $subscriber: $subscriber,
117
127
  $unsubscriber: $unsubscriber
118
128
  }
@@ -0,0 +1,95 @@
1
+ import React, { createContext, useContext as useReactContext, useEffect } from 'react';
2
+ import { useRequest, useCreation } from 'ahooks';
3
+ import { Empty, Spin } from 'luck-design/antd';
4
+ import { isNil, reduce } from 'lodash';
5
+ import { formatMessage } from '@luck-design-biz/base/utils';
6
+ import { useContext } from "./ContextProvider";
7
+ import usePageDataStore from "./ContextProvider/usePageDataStore";
8
+ import { decompress } from "../tools/dataProcess";
9
+ import { fetchPageData } from "../../constants/api-url";
10
+ export var Context = /*#__PURE__*/createContext(null);
11
+ export var usePageProxyContext = function usePageProxyContext() {
12
+ return useReactContext(Context);
13
+ };
14
+ export default (function (_ref) {
15
+ var children = _ref.children,
16
+ id = _ref.id,
17
+ proxyCode = _ref.proxyCode,
18
+ destroyOnUnmount = _ref.destroyOnUnmount,
19
+ proxyParams = _ref.proxyParams;
20
+ if (isNil(proxyCode)) return /*#__PURE__*/React.createElement(Empty, {
21
+ description: formatMessage({
22
+ id: 'luckda.lowcode.view.lc-component.design.nocode',
23
+ label: '缺少页面代理编码配置'
24
+ })
25
+ });
26
+ var ctx = useContext();
27
+ var _useRequest = useRequest(fetchPageData, {
28
+ defaultParams: [{
29
+ code: proxyCode
30
+ }],
31
+ ready: !usePageDataStore.getState()[proxyCode],
32
+ onFinally: function onFinally() {
33
+ ctx.$publisher(ctx.topics.PAGE_LOAD_MOUNT, {
34
+ proxyCode: proxyCode
35
+ });
36
+ },
37
+ onSuccess: function onSuccess(_ref2) {
38
+ var code = _ref2.code,
39
+ data = _ref2.data,
40
+ list = _ref2.list,
41
+ detail = _ref2.detail;
42
+ if (code === 1) {
43
+ usePageDataStore.setState(function (state) {
44
+ var source = detail[list[0]].source;
45
+ state[proxyCode] = decompress(source);
46
+ });
47
+ }
48
+ }
49
+ }),
50
+ loading = _useRequest.loading;
51
+ useEffect(function () {
52
+ if (usePageDataStore.getState()[proxyCode]) {
53
+ ctx.$publisher(ctx.topics.PAGE_LOAD_MOUNT, {
54
+ proxyCode: proxyCode
55
+ });
56
+ }
57
+ return function () {
58
+ if (destroyOnUnmount) {
59
+ usePageDataStore.setState(function (state) {
60
+ state[proxyCode] = null;
61
+ });
62
+ }
63
+ };
64
+ }, []);
65
+ var _proxyParams = useCreation(function () {
66
+ return reduce(proxyParams, function (ret, param) {
67
+ switch (param.origin) {
68
+ case 'state':
69
+ ret[param.name] = ctx.state[param.value];
70
+ return ret;
71
+ case 'golbal':
72
+ ret[param.name] = ctx.global[param.value];
73
+ return ret;
74
+ case 'url':
75
+ ret[param.name] = ctx.router.getQuery(param.value);
76
+ return ret;
77
+ case 'string':
78
+ case 'num':
79
+ case 'bool':
80
+ default:
81
+ ret[param.name] = param.value;
82
+ return ret;
83
+ }
84
+ }, {});
85
+ }, []);
86
+ return /*#__PURE__*/React.createElement(Context.Provider, {
87
+ value: {
88
+ id: id,
89
+ proxyCode: proxyCode,
90
+ params: _proxyParams
91
+ }
92
+ }, /*#__PURE__*/React.createElement(Spin, {
93
+ spinning: loading
94
+ }, children));
95
+ });
@@ -1,11 +1,13 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
3
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
4
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
5
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
6
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
7
  import React, { createContext } from 'react';
7
8
  import { useRequest, useSetState, useAsyncEffect, useMemoizedFn, useCreation, useUnmount } from 'ahooks';
8
9
  import { history } from 'umi';
10
+ import { values } from 'lodash';
9
11
  import launcher from "../launcher";
10
12
  import { LuckDaContext } from "../../../components/Builder";
11
13
  import { doAction as doActionUtils } from "../../../helper/action";
@@ -23,12 +25,10 @@ export default (function (_ref) {
23
25
  var _usePageDataStore = usePageDataStore(function (state) {
24
26
  return {
25
27
  initialize: state.initialize,
26
- initializeModule: state.initializeModule,
27
28
  reset: state.reset
28
29
  };
29
30
  }),
30
31
  initialize = _usePageDataStore.initialize,
31
- initializeModule = _usePageDataStore.initializeModule,
32
32
  reset = _usePageDataStore.reset;
33
33
  var _useTemporalStore = useTemporalStore(function (state) {
34
34
  return {
@@ -70,7 +70,6 @@ export default (function (_ref) {
70
70
  setRemoteSource({
71
71
  module: data
72
72
  });
73
- initializeModule(data);
74
73
  }
75
74
  }
76
75
  }),
@@ -153,7 +152,7 @@ export default (function (_ref) {
153
152
  }),
154
153
  runFetchAllBehaviorExport = _useRequest6.run;
155
154
  useAsyncEffect( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
156
- var fetchPageDataRes, data, list, detail, source;
155
+ var fetchPageDataRes, data, list, detail, source, _pageData;
157
156
  return _regeneratorRuntime().wrap(function _callee$(_context) {
158
157
  while (1) switch (_context.prev = _context.next) {
159
158
  case 0:
@@ -173,16 +172,17 @@ export default (function (_ref) {
173
172
  break;
174
173
  }
175
174
  history.replace('/404');
176
- _context.next = 20;
175
+ _context.next = 21;
177
176
  break;
178
177
  case 9:
179
- source = detail[list[0]].source;
180
178
  setMetaAttrs(META_TAG_NAME, data);
181
- _context.next = 13;
179
+ source = detail[list[0]].source;
180
+ _pageData = decompress(source);
181
+ _context.next = 14;
182
182
  return runFetchModlueData(data.dataModelKey, {
183
- moduleCode: data.moduleCode
183
+ moduleCode: [data.moduleCode].concat(_toConsumableArray(values(_pageData.props.proxy))).join(',')
184
184
  });
185
- case 13:
185
+ case 14:
186
186
  runFetchAllBehaviorImport({
187
187
  behaviorMode: 'IMPORT',
188
188
  moduleCode: data.moduleCode
@@ -197,11 +197,9 @@ export default (function (_ref) {
197
197
  runFetchAllSerials({
198
198
  uid: data.moduleId
199
199
  });
200
- initialize(decompress(source));
200
+ initialize(_pageData);
201
201
  resume();
202
202
  eventBus.$publisher(PAGE_LOAD_MOUNT);
203
- case 20:
204
- ;
205
203
  case 21:
206
204
  case "end":
207
205
  return _context.stop();
@@ -3,7 +3,7 @@ import _construct from "@babel/runtime/helpers/esm/construct";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
5
  import _typeof from "@babel/runtime/helpers/esm/typeof";
6
- import { omit, isNil, isString, isArray, has, get } from 'lodash';
6
+ import { omit, isNil, isString, isArray, has, get, cloneDeep, groupBy, keyBy, each } from 'lodash';
7
7
  import postcss from 'postcss';
8
8
  import { META_TAG_NAME } from "../../constants";
9
9
  export function isPromise(value) {
@@ -262,4 +262,28 @@ export function findFirstLeafNode(node) {
262
262
  _iterator2.f();
263
263
  }
264
264
  return null;
265
+ }
266
+ export function dataToTree(data, params) {
267
+ var _ref = params || {},
268
+ _ref$parentKey = _ref.parentKey,
269
+ parentKey = _ref$parentKey === void 0 ? 'parentId' : _ref$parentKey,
270
+ _ref$childKey = _ref.childKey,
271
+ childKey = _ref$childKey === void 0 ? 'children' : _ref$childKey,
272
+ _ref$rootId = _ref.rootId,
273
+ rootId = _ref$rootId === void 0 ? '0' : _ref$rootId,
274
+ _ref$id = _ref.id,
275
+ id = _ref$id === void 0 ? 'id' : _ref$id,
276
+ _ref$stain = _ref.stain,
277
+ stain = _ref$stain === void 0 ? false : _ref$stain;
278
+ var _data = stain ? data : cloneDeep(data);
279
+ var groupedByParents = groupBy(_data, parentKey);
280
+ var itemsById = keyBy(_data, id);
281
+ try {
282
+ each(omit(groupedByParents, rootId), function (children, parentId) {
283
+ itemsById[parentId][childKey] = children;
284
+ });
285
+ } catch (e) {
286
+ console.error('helper.dataToTree error', e);
287
+ }
288
+ return groupedByParents[rootId];
265
289
  }