@luck-design-biz/luckda 1.0.2-2 → 1.0.2-20temp
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/Builder/index.js +37 -27
- package/es/components/ComplexItem/index.js +5 -3
- package/es/components/ComplexItem/service.js +6 -3
- package/es/components/LDActions/index.js +1 -0
- package/es/components/LdAutoForm/index.js +18 -8
- package/es/components/LdCard/index.js +10 -8
- package/es/components/LdCom/index.js +3 -2
- package/es/components/LdFormList/index.js +10 -7
- package/es/components/LdGrid/index.js +24 -16
- package/es/components/LdGridForm/index.js +16 -7
- package/es/helper/FromItems.js +64 -5
- package/es/helper/action.js +2 -0
- package/es/helper/form.js +7 -1
- package/es/helper/ldBuilder.js +9 -5
- package/es/helper/ldComBuild.js +16 -11
- package/es/locales/zh-CN.js +61 -6
- package/es/lowcode/constants/api-url.js +359 -190
- package/es/lowcode/constants/event-topics.js +4 -0
- package/es/lowcode/constants/index.js +5 -4
- package/es/lowcode/engine/meta/box.props.default.json +1 -1
- package/es/lowcode/engine/meta/box.props.json +1 -1
- package/es/lowcode/engine/meta/cardlist.props.json +3 -5
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -1
- package/es/lowcode/engine/meta/dialog.props.json +24 -4
- package/es/lowcode/engine/meta/drawer.props.json +1 -1
- package/es/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/es/lowcode/engine/meta/fielddate.props.json +48 -1
- package/es/lowcode/engine/meta/fieldeditor.props.json +0 -1
- package/es/lowcode/engine/meta/fieldgroup.props.json +0 -1
- package/es/lowcode/engine/meta/fieldyear.props.json +0 -1
- package/es/lowcode/engine/meta/form.props.json +3 -19
- package/es/lowcode/engine/meta/grouptree.props.json +0 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -2
- package/es/lowcode/engine/meta/jsx.props.json +4 -3
- package/es/lowcode/engine/meta/layout.props.default.json +1 -1
- package/es/lowcode/engine/meta/layout.props.json +1 -1
- package/es/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/es/lowcode/engine/meta/proxy.props.json +66 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/table.props.json +0 -7
- package/es/lowcode/engine/meta/tabs.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.json +1 -5
- package/es/lowcode/engine/provider/ContextProvider/index.js +45 -9
- package/es/lowcode/engine/provider/ContextProvider/router.js +21 -1
- package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +36 -30
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +11 -5
- package/es/lowcode/engine/provider/ContextProvider/useTodo.js +2 -4
- package/es/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/es/lowcode/engine/provider/PageProxyProvider.js +95 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/es/lowcode/engine/tools/helper.js +25 -1
- package/es/lowcode/engine/tools/initDS.js +4 -4
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +135 -27
- package/es/lowcode/painter/DesignToolbar.js +102 -188
- package/es/lowcode/painter/History.js +300 -0
- package/es/lowcode/painter/Panel.js +1 -1
- package/es/lowcode/painter/Ribbon.js +37 -1
- package/es/lowcode/painter/components/AdvancePanel.js +55 -51
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
- package/es/lowcode/painter/components/TipIcon.js +12 -4
- package/es/lowcode/painter/components/TreeEditor.js +76 -8
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
- package/es/lowcode/painter/components/code-editor/DiffEditor.js +41 -0
- package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/es/lowcode/painter/components/field-setting/SettingUI.js +56 -5
- package/es/lowcode/painter/components/field-setting/index.js +24 -1
- package/es/lowcode/painter/components/shortcut-modal/KeyIcon.js +11 -0
- package/es/lowcode/painter/components/shortcut-modal/index.js +208 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +10 -19
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/es/lowcode/painter/panel-section/ConditionCheck.js +70 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/es/lowcode/painter/panel-section/DialogSize.js +76 -0
- package/es/lowcode/painter/panel-section/DialogWidthHeight.js +60 -0
- package/es/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
- package/es/lowcode/painter/panel-section/JSEditor/ToolBar.js +174 -0
- package/es/lowcode/painter/panel-section/JSEditor/index.js +181 -0
- package/es/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/es/lowcode/painter/panel-section/ProxyLinker.js +137 -0
- package/es/lowcode/painter/panel-section/ProxyParams.js +28 -0
- package/es/lowcode/painter/panel-section/ProxyParamsSetter.js +240 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
- package/es/lowcode/painter/style/action-bind-modal.less +1 -1
- package/es/lowcode/painter/style/components.less +1 -1
- package/es/lowcode/painter/style/history.less +46 -0
- package/es/lowcode/painter/style/outline.less +1 -1
- package/es/lowcode/painter/style/panel-item.less +1 -0
- package/es/lowcode/preview/DebugTool.js +78 -0
- package/es/lowcode/preview/DebugToolDetail.js +103 -0
- package/es/lowcode/preview/index.js +10 -17
- package/es/lowcode/preview/useDebugSettings.js +62 -0
- package/es/lowcode/view/Canvas.js +5 -1
- package/es/lowcode/view/ErrorBoundary.js +80 -0
- package/es/lowcode/view/Page.js +11 -6
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
- package/es/lowcode/view/lc-components/Box/index.less +2 -2
- package/es/lowcode/view/lc-components/Box/meta.json +1 -1
- package/es/lowcode/view/lc-components/CardList/index.js +3 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +3 -5
- package/es/lowcode/view/lc-components/Dialog/index.js +13 -5
- package/es/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/es/lowcode/view/lc-components/Drawer/index.js +5 -3
- package/es/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/es/lowcode/view/lc-components/FieldDate/meta.json +48 -1
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
- package/es/lowcode/view/lc-components/FieldYear/meta.json +0 -1
- package/es/lowcode/view/lc-components/Form/index.js +15 -19
- package/es/lowcode/view/lc-components/Form/meta.json +3 -19
- package/es/lowcode/view/lc-components/GroupTree/meta.json +0 -1
- package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +32 -16
- package/es/lowcode/view/lc-components/JSX/meta.json +4 -3
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/es/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/es/lowcode/view/lc-components/Proxy/FunctionDesign.js +17 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionLive.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionPreview.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/index.js +42 -0
- package/es/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/es/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/es/lowcode/view/lc-components/Section/meta.json +2 -2
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
- package/es/lowcode/view/lc-components/Table/index.js +11 -3
- package/es/lowcode/view/lc-components/Table/meta.json +0 -7
- package/es/lowcode/view/lc-components/Tabs/index.js +6 -2
- package/es/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/index.js +3 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +1 -5
- package/es/lowcode/view/lc-components/Wrapper.js +9 -1
- package/es/services.js +24 -7
- package/es/upload/FilesWall/index.js +16 -6
- package/es/upload/Form/gridForm.js +16 -6
- package/es/upload/FormItem/index.js +16 -4
- package/es/utils/action.js +3 -2
- package/es/utils/form.js +40 -6
- package/es/utils/grid.js +12 -3
- package/lib/components/Builder/index.js +36 -26
- package/lib/components/ComplexItem/index.js +5 -3
- package/lib/components/ComplexItem/service.js +6 -3
- package/lib/components/LDActions/index.js +1 -0
- package/lib/components/LdAutoForm/index.js +15 -5
- package/lib/components/LdCard/index.js +10 -8
- package/lib/components/LdCom/index.js +3 -2
- package/lib/components/LdFormList/index.js +9 -6
- package/lib/components/LdGrid/index.js +24 -16
- package/lib/components/LdGridForm/index.js +13 -4
- package/lib/helper/FromItems.js +64 -5
- package/lib/helper/action.js +2 -0
- package/lib/helper/form.js +7 -1
- package/lib/helper/ldBuilder.js +8 -5
- package/lib/helper/ldComBuild.js +14 -9
- package/lib/locales/zh-CN.js +61 -6
- package/lib/lowcode/constants/api-url.js +360 -190
- package/lib/lowcode/constants/event-topics.js +5 -1
- package/lib/lowcode/constants/index.js +6 -5
- package/lib/lowcode/engine/meta/box.props.default.json +1 -1
- package/lib/lowcode/engine/meta/box.props.json +1 -1
- package/lib/lowcode/engine/meta/cardlist.props.json +3 -5
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -1
- package/lib/lowcode/engine/meta/dialog.props.json +24 -4
- package/lib/lowcode/engine/meta/drawer.props.json +1 -1
- package/lib/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +48 -1
- package/lib/lowcode/engine/meta/fieldeditor.props.json +0 -1
- package/lib/lowcode/engine/meta/fieldgroup.props.json +0 -1
- package/lib/lowcode/engine/meta/fieldyear.props.json +0 -1
- package/lib/lowcode/engine/meta/form.props.json +3 -19
- package/lib/lowcode/engine/meta/grouptree.props.json +0 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -2
- package/lib/lowcode/engine/meta/jsx.props.json +4 -3
- package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.json +1 -1
- package/lib/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/lib/lowcode/engine/meta/proxy.props.json +66 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/table.props.json +0 -7
- package/lib/lowcode/engine/meta/tabs.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.json +1 -5
- package/lib/lowcode/engine/provider/ContextProvider/index.js +50 -13
- package/lib/lowcode/engine/provider/ContextProvider/router.js +22 -1
- package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +37 -31
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +10 -4
- package/lib/lowcode/engine/provider/ContextProvider/useTodo.js +1 -3
- package/lib/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/lib/lowcode/engine/provider/PageProxyProvider.js +103 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/lib/lowcode/engine/tools/helper.js +25 -0
- package/lib/lowcode/engine/tools/initDS.js +4 -4
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +132 -24
- package/lib/lowcode/painter/DesignToolbar.js +98 -184
- package/lib/lowcode/painter/History.js +308 -0
- package/lib/lowcode/painter/Panel.js +1 -1
- package/lib/lowcode/painter/Ribbon.js +37 -1
- package/lib/lowcode/painter/components/AdvancePanel.js +53 -49
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
- package/lib/lowcode/painter/components/TipIcon.js +12 -4
- package/lib/lowcode/painter/components/TreeEditor.js +76 -8
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
- package/lib/lowcode/painter/components/code-editor/DiffEditor.js +49 -0
- package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +55 -4
- package/lib/lowcode/painter/components/field-setting/index.js +24 -1
- package/lib/lowcode/painter/components/shortcut-modal/KeyIcon.js +18 -0
- package/lib/lowcode/painter/components/shortcut-modal/index.js +215 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +9 -18
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/lib/lowcode/painter/panel-section/ConditionCheck.js +78 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/lib/lowcode/painter/panel-section/DialogSize.js +83 -0
- package/lib/lowcode/painter/panel-section/DialogWidthHeight.js +67 -0
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/JSEditor/ToolBar.js +181 -0
- package/lib/lowcode/painter/panel-section/JSEditor/index.js +189 -0
- package/lib/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/lib/lowcode/painter/panel-section/ProxyLinker.js +145 -0
- package/lib/lowcode/painter/panel-section/ProxyParams.js +35 -0
- package/lib/lowcode/painter/panel-section/ProxyParamsSetter.js +248 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
- package/lib/lowcode/painter/style/action-bind-modal.less +1 -1
- package/lib/lowcode/painter/style/components.less +1 -1
- package/lib/lowcode/painter/style/history.less +46 -0
- package/lib/lowcode/painter/style/outline.less +1 -1
- package/lib/lowcode/painter/style/panel-item.less +1 -0
- package/lib/lowcode/preview/DebugTool.js +86 -0
- package/lib/lowcode/preview/DebugToolDetail.js +111 -0
- package/lib/lowcode/preview/index.js +10 -18
- package/lib/lowcode/preview/useDebugSettings.js +69 -0
- package/lib/lowcode/view/Canvas.js +5 -1
- package/lib/lowcode/view/ErrorBoundary.js +88 -0
- package/lib/lowcode/view/Page.js +12 -7
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
- package/lib/lowcode/view/lc-components/Box/index.less +2 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -1
- package/lib/lowcode/view/lc-components/CardList/index.js +3 -0
- package/lib/lowcode/view/lc-components/CardList/meta.json +3 -5
- package/lib/lowcode/view/lc-components/Dialog/index.js +11 -3
- package/lib/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/lib/lowcode/view/lc-components/Drawer/index.js +3 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +48 -1
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Form/index.js +15 -19
- package/lib/lowcode/view/lc-components/Form/meta.json +3 -19
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +0 -1
- package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +33 -16
- package/lib/lowcode/view/lc-components/JSX/meta.json +4 -3
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/lib/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/lib/lowcode/view/lc-components/Proxy/FunctionDesign.js +24 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionLive.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionPreview.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/index.js +50 -0
- package/lib/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/lib/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
- package/lib/lowcode/view/lc-components/Table/index.js +11 -3
- package/lib/lowcode/view/lc-components/Table/meta.json +0 -7
- package/lib/lowcode/view/lc-components/Tabs/index.js +5 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +3 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +1 -5
- package/lib/lowcode/view/lc-components/Wrapper.js +8 -0
- package/lib/services.js +25 -7
- package/lib/upload/FilesWall/index.js +13 -3
- package/lib/upload/Form/gridForm.js +13 -3
- package/lib/upload/FormItem/index.js +15 -3
- package/lib/utils/action.js +6 -0
- package/lib/utils/form.js +40 -5
- package/lib/utils/grid.js +13 -4
- package/package.json +1 -2
- package/es/lowcode/painter/panel-section/JSEditor.js +0 -49
- package/es/lowcode/view/errorBoundary.js +0 -61
- package/lib/lowcode/painter/panel-section/JSEditor.js +0 -57
- 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
|
|
@@ -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
|
-
"
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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
|
-
|
|
408
|
+
} else if (isString(_)) {
|
|
409
|
+
return get(state.pageData, _);
|
|
410
|
+
}
|
|
411
411
|
};
|
|
412
|
-
export var
|
|
413
|
-
|
|
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
|
-
|
|
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 {
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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
|
|
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(
|
|
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
|
}
|