@luck-design-biz/luckda 1.0.0-alpha → 1.0.1-10
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/LICENSE +21 -21
- package/README.md +40 -40
- package/es/components/Builder/index.js +15 -3
- package/es/components/ComplexItem/index.js +65 -49
- package/es/components/LDActions/index.less +68 -68
- package/es/components/LdAutoForm/index.js +6 -4
- package/es/components/LdFormList/index.js +11 -10
- package/es/components/LdGrid/index.js +4 -4
- package/es/components/LdGridForm/index.js +40 -23
- package/es/components/LdGridForm/index.less +7 -7
- package/es/components/LdTree/index.less +40 -40
- package/es/helper/action.js +6 -6
- package/es/helper/form.js +15 -14
- package/es/helper/index.less +7 -7
- package/es/helper/ldBuilder.js +8 -3
- package/es/locales/zh-CN.js +41 -4
- package/es/lowcode/constants/api-url.js +87 -87
- package/es/lowcode/constants/event-topics.js +0 -2
- package/es/lowcode/engine/launcher.js +3 -1
- package/es/lowcode/engine/meta/box.props.json +3 -3
- package/es/lowcode/engine/meta/button.props.default.json +1 -1
- package/es/lowcode/engine/meta/button.props.json +2 -2
- package/es/lowcode/engine/meta/cardlist.props.default.json +1 -0
- package/es/lowcode/engine/meta/cardlist.props.json +2 -1
- package/es/lowcode/engine/meta/components-list.json +6 -126
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/es/lowcode/engine/meta/dialog.props.json +76 -20
- package/es/lowcode/engine/meta/drawer.props.default.json +15 -4
- package/es/lowcode/engine/meta/drawer.props.json +144 -24
- package/es/lowcode/engine/meta/fieldcomplex.props.default.json +1 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.json +7 -0
- package/es/lowcode/engine/meta/fielddatadic.props.default.json +16 -0
- package/es/lowcode/engine/meta/fielddatadic.props.json +73 -0
- package/es/lowcode/engine/meta/fielddate.props.default.json +2 -0
- package/es/lowcode/engine/meta/fielddate.props.json +4 -2
- package/es/lowcode/engine/meta/fieldnumber.props.default.json +1 -0
- package/es/lowcode/engine/meta/fieldnumber.props.json +3 -2
- package/es/lowcode/engine/meta/fielduser.props.default.json +1 -1
- package/es/lowcode/engine/meta/fielduser.props.json +1 -1
- package/es/lowcode/engine/meta/form.props.default.json +14 -4
- package/es/lowcode/engine/meta/form.props.json +53 -14
- package/es/lowcode/engine/meta/grouptree.props.default.json +16 -0
- package/es/lowcode/engine/meta/grouptree.props.json +89 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +2 -1
- package/es/lowcode/engine/meta/iframe.props.json +3 -2
- package/es/lowcode/engine/meta/image.props.default.json +2 -1
- package/es/lowcode/engine/meta/image.props.json +3 -2
- package/es/lowcode/engine/meta/imex.props.default.json +2 -1
- package/es/lowcode/engine/meta/imex.props.json +27 -6
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +65 -42
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/es/lowcode/engine/meta/jsx.props.json +1 -1
- package/es/lowcode/engine/meta/layout.props.default.json +1 -1
- package/es/lowcode/engine/meta/layout.props.json +5 -5
- package/es/lowcode/engine/meta/link.props.default.json +2 -1
- package/es/lowcode/engine/meta/link.props.json +3 -2
- package/es/lowcode/engine/meta/page.props.json +6 -0
- package/es/lowcode/engine/meta/pagelayout.props.default.json +1 -1
- package/es/lowcode/engine/meta/pagelayout.props.json +1 -1
- package/es/lowcode/engine/meta/section.props.json +2 -1
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +1 -1
- package/es/lowcode/engine/meta/table.props.json +3 -3
- package/es/lowcode/engine/meta/text.props.default.json +4 -2
- package/es/lowcode/engine/meta/text.props.json +8 -6
- package/es/lowcode/engine/meta/tree.props.json +2 -2
- package/es/lowcode/engine/provider/ContextProvider/index.js +83 -66
- package/es/lowcode/engine/provider/ContextProvider/router.js +43 -0
- package/es/lowcode/engine/{tools → provider/ContextProvider}/usePageDataStore.js +9 -7
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +38 -15
- package/es/lowcode/engine/{tools → provider/ContextProvider}/useTodo.js +5 -7
- package/es/lowcode/engine/provider/ContextProvider/utils.js +157 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +1 -2
- package/es/lowcode/engine/tools/dataProcess.js +76 -76
- package/es/lowcode/engine/tools/helper.js +28 -2
- package/es/lowcode/engine/tools/initDS.js +263 -0
- package/es/lowcode/engine/tools/useCanvasRender.js +13 -1
- package/es/lowcode/engine/tools/useCombinedRefs.js +3 -2
- package/es/lowcode/painter/Components.js +2 -2
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +25 -11
- package/es/lowcode/painter/Panel.js +2 -2
- package/es/lowcode/painter/components/AdvancePanel.js +3 -3
- package/es/lowcode/painter/components/Collapse.js +31 -28
- package/es/lowcode/painter/components/ColorInput.js +24 -24
- package/es/lowcode/painter/components/ListEditor.js +24 -24
- package/es/lowcode/painter/components/NumberInput.js +29 -29
- package/es/lowcode/painter/components/PanelItem.js +24 -24
- package/es/lowcode/painter/components/PopConfirm.js +8 -8
- package/es/lowcode/painter/components/PopForm.js +27 -27
- package/es/lowcode/painter/components/RuleInput.js +30 -30
- package/es/lowcode/painter/components/SortBox.js +22 -22
- package/es/lowcode/painter/components/TipIcon.js +16 -0
- package/es/lowcode/painter/components/VarEditor.js +456 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +32 -32
- package/es/lowcode/painter/components/code-editor/CssEditor.js +25 -25
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +25 -25
- package/es/lowcode/painter/components/code-editor/JSEditor.js +23 -21
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/es/lowcode/painter/components/code-editor/VisionEditor.js +81 -0
- package/es/lowcode/painter/components/field-setting/SettingUI.js +47 -5
- package/es/lowcode/painter/components/field-setting/index.js +27 -13
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +2 -1
- package/es/lowcode/painter/index.js +1 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +20 -6
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +2 -2
- package/es/lowcode/painter/panel-section/ComplexPop.js +242 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +8 -0
- package/es/lowcode/painter/panel-section/FieldsSetting.js +30 -4
- package/es/lowcode/painter/panel-section/GroupClassSelector.js +55 -0
- package/es/lowcode/painter/panel-section/I18nInput.js +4 -2
- package/es/lowcode/painter/panel-section/Icon.js +32 -27
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +7 -7
- package/es/lowcode/painter/panel-section/IconSelector.js +17 -17
- package/es/lowcode/painter/panel-section/ImpExp.js +1 -27
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +1 -2
- package/es/lowcode/painter/panel-section/LayoutRatio.js +22 -21
- package/es/lowcode/painter/panel-section/PageVars.js +300 -0
- package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +6 -5
- package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/index.js +15 -15
- package/es/lowcode/painter/panel-section/TabItems.js +6 -42
- package/es/lowcode/painter/panel-section/TextContent.js +79 -0
- package/es/lowcode/painter/services/complexPop.js +21 -0
- package/es/lowcode/painter/style/action-bind-modal.less +102 -102
- package/es/lowcode/painter/style/actions-editor.less +15 -15
- package/es/lowcode/painter/style/border-editor.less +36 -36
- package/es/lowcode/painter/style/border-radius-selector.less +42 -42
- package/es/lowcode/painter/style/border-selector.less +39 -39
- package/es/lowcode/painter/style/button-type.less +5 -5
- package/es/lowcode/painter/style/collapse.less +28 -28
- package/es/lowcode/painter/style/color-input.less +19 -19
- package/es/lowcode/painter/style/components.less +91 -91
- package/es/lowcode/painter/style/design.less +166 -160
- package/es/lowcode/painter/style/display.less +17 -17
- package/es/lowcode/painter/style/dragdrop.less +10 -10
- package/es/lowcode/painter/style/fields-setting.less +25 -25
- package/es/lowcode/painter/style/font-editor.less +9 -9
- package/es/lowcode/painter/style/fullscreen-editor.less +17 -17
- package/es/lowcode/painter/style/icon-selector.less +22 -22
- package/es/lowcode/painter/style/icon.less +10 -10
- package/es/lowcode/painter/style/impexp.less +7 -7
- package/es/lowcode/painter/style/index.less +6 -6
- package/es/lowcode/painter/style/layout-ratio.less +51 -51
- package/es/lowcode/painter/style/list-editor.less +95 -95
- package/es/lowcode/painter/style/number-input.less +17 -17
- package/es/lowcode/painter/style/outline.less +28 -28
- package/es/lowcode/painter/style/page-layout-display.less +27 -27
- package/es/lowcode/painter/style/page-vars.less +25 -0
- package/es/lowcode/painter/style/panel-attrs.less +43 -43
- package/es/lowcode/painter/style/panel-item.less +54 -54
- package/es/lowcode/painter/style/panel.less +98 -98
- package/es/lowcode/painter/style/pop-confirm.less +17 -17
- package/es/lowcode/painter/style/pop-form.less +19 -19
- package/es/lowcode/painter/style/radio.less +24 -24
- package/es/lowcode/painter/style/ribbon.less +5 -5
- package/es/lowcode/painter/style/rule-input.less +12 -12
- package/es/lowcode/painter/style/split-display.less +18 -18
- package/es/lowcode/painter/style/style-panel.less +37 -37
- package/es/lowcode/painter/style/tabitems.less +90 -90
- package/es/lowcode/painter/style/treedragdrop.less +19 -19
- package/es/lowcode/preview/index.js +1 -0
- package/es/lowcode/view/Canvas.js +24 -22
- package/es/lowcode/view/Loading.js +5 -7
- package/es/lowcode/view/Page.js +37 -15
- package/es/lowcode/view/index.js +1 -0
- package/es/lowcode/view/lc-components/Box/index.js +22 -7
- package/es/lowcode/view/lc-components/Box/index.less +14 -14
- package/es/lowcode/view/lc-components/Box/meta.json +40 -40
- package/es/lowcode/view/lc-components/Button/index.js +40 -40
- package/es/lowcode/view/lc-components/Button/meta.json +127 -127
- package/es/lowcode/view/lc-components/Button/style.less +2 -2
- package/es/lowcode/view/lc-components/CardList/meta.json +154 -153
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +14 -6
- package/es/lowcode/view/lc-components/Dialog/index.js +34 -25
- package/es/lowcode/view/lc-components/Dialog/index.less +12 -8
- package/es/lowcode/view/lc-components/Dialog/meta.json +204 -150
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +51 -8
- package/es/lowcode/view/lc-components/Drawer/index.js +149 -34
- package/es/lowcode/view/lc-components/Drawer/index.less +13 -10
- package/es/lowcode/view/lc-components/Drawer/meta.json +242 -131
- package/es/lowcode/view/lc-components/FieldColor/meta.json +157 -157
- package/es/lowcode/view/lc-components/FieldComplex/meta.json +140 -133
- package/es/lowcode/view/lc-components/FieldDate/meta.json +141 -139
- package/es/lowcode/view/lc-components/FieldDict/meta.json +138 -138
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +138 -138
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +167 -167
- package/es/lowcode/view/lc-components/FieldNumber/meta.json +143 -142
- package/es/lowcode/view/lc-components/FieldRadio/meta.json +115 -115
- package/es/lowcode/view/lc-components/FieldRegion/meta.json +121 -121
- package/es/lowcode/view/lc-components/FieldSelect/meta.json +152 -152
- package/es/lowcode/view/lc-components/FieldString/meta.json +152 -152
- package/es/lowcode/view/lc-components/FieldSwitch/meta.json +125 -125
- package/es/lowcode/view/lc-components/FieldTextarea/meta.json +143 -143
- package/es/lowcode/view/lc-components/FieldUpload/meta.json +165 -165
- package/es/lowcode/view/lc-components/FieldUser/meta.json +176 -176
- package/es/lowcode/view/lc-components/FieldYear/meta.json +129 -129
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
- package/es/lowcode/view/lc-components/Form/index.js +76 -51
- package/es/lowcode/view/lc-components/Form/meta.json +645 -610
- package/es/lowcode/view/lc-components/GroupTree/FunctionDesign.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/index.js +201 -0
- package/es/lowcode/view/lc-components/GroupTree/meta.json +89 -0
- package/es/lowcode/view/lc-components/Iframe/meta.json +33 -32
- package/es/lowcode/view/lc-components/ImEx/index.js +199 -128
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -7
- package/es/lowcode/view/lc-components/ImEx/meta.json +134 -113
- package/es/lowcode/view/lc-components/Image/meta.json +115 -114
- package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
- package/es/lowcode/view/lc-components/JSX/meta.json +28 -28
- package/es/lowcode/view/lc-components/Layout/index.js +38 -21
- package/es/lowcode/view/lc-components/Layout/index.less +5 -5
- package/es/lowcode/view/lc-components/Layout/meta.json +107 -107
- package/es/lowcode/view/lc-components/Link/meta.json +113 -112
- package/es/lowcode/view/lc-components/Page/meta.json +61 -55
- package/es/lowcode/view/lc-components/PageContent/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageFooter/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageHeader/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +5 -1
- package/es/lowcode/view/lc-components/PageLayout/meta.json +59 -59
- package/es/lowcode/view/lc-components/Section/index.js +2 -6
- package/es/lowcode/view/lc-components/Section/index.less +7 -7
- package/es/lowcode/view/lc-components/Section/meta.json +108 -107
- package/es/lowcode/view/lc-components/Split/index.js +19 -4
- package/es/lowcode/view/lc-components/Split/meta.json +53 -53
- package/es/lowcode/view/lc-components/Table/index.js +175 -148
- package/es/lowcode/view/lc-components/Table/meta.json +450 -450
- package/es/lowcode/view/lc-components/Tabs/index.js +42 -39
- package/es/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/es/lowcode/view/lc-components/Text/index.js +9 -2
- package/es/lowcode/view/lc-components/Text/meta.json +56 -56
- package/es/lowcode/view/lc-components/Tree/index.js +102 -107
- package/es/lowcode/view/lc-components/Tree/index.less +4 -4
- package/es/lowcode/view/lc-components/Tree/meta.json +357 -357
- package/es/lowcode/view/lc-components/Wrapper.js +17 -2
- package/es/lowcode/view/style/canvas.less +5 -5
- package/es/lowcode/view/style/loading.less +98 -84
- package/es/lowcode/view/style/page.less +7 -7
- package/es/services.js +19 -0
- package/es/upload/FilesWall/index.js +13 -13
- package/es/upload/FilesWall/index.less +74 -74
- package/es/upload/Form/gridForm.js +17 -7
- package/es/upload/Form/index.less +7 -7
- package/es/upload/FormItem/index.js +18 -18
- package/es/utils/form.js +25 -25
- package/es/utils/grid.js +5 -4
- package/lib/components/Builder/index.js +13 -1
- package/lib/components/ComplexItem/index.js +62 -47
- package/lib/components/LDActions/index.less +68 -68
- package/lib/components/LdAutoForm/index.js +5 -3
- package/lib/components/LdFormList/index.js +12 -11
- package/lib/components/LdGrid/index.js +4 -4
- package/lib/components/LdGridForm/index.js +40 -23
- package/lib/components/LdGridForm/index.less +7 -7
- package/lib/components/LdTree/index.less +40 -40
- package/lib/helper/action.js +6 -6
- package/lib/helper/form.js +15 -14
- package/lib/helper/index.less +7 -7
- package/lib/helper/ldBuilder.js +8 -3
- package/lib/locales/zh-CN.js +41 -4
- package/lib/lowcode/constants/api-url.js +87 -87
- package/lib/lowcode/constants/event-topics.js +1 -3
- package/lib/lowcode/engine/launcher.js +3 -1
- package/lib/lowcode/engine/meta/box.props.json +3 -3
- package/lib/lowcode/engine/meta/button.props.default.json +1 -1
- package/lib/lowcode/engine/meta/button.props.json +2 -2
- package/lib/lowcode/engine/meta/cardlist.props.default.json +1 -0
- package/lib/lowcode/engine/meta/cardlist.props.json +2 -1
- package/lib/lowcode/engine/meta/components-list.json +6 -126
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/lib/lowcode/engine/meta/dialog.props.json +76 -20
- package/lib/lowcode/engine/meta/drawer.props.default.json +15 -4
- package/lib/lowcode/engine/meta/drawer.props.json +144 -24
- package/lib/lowcode/engine/meta/fieldcomplex.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.json +7 -0
- package/lib/lowcode/engine/meta/fielddatadic.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fielddatadic.props.json +73 -0
- package/lib/lowcode/engine/meta/fielddate.props.default.json +2 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +4 -2
- package/lib/lowcode/engine/meta/fieldnumber.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.json +3 -2
- package/lib/lowcode/engine/meta/fielduser.props.default.json +1 -1
- package/lib/lowcode/engine/meta/fielduser.props.json +1 -1
- package/lib/lowcode/engine/meta/form.props.default.json +14 -4
- package/lib/lowcode/engine/meta/form.props.json +53 -14
- package/lib/lowcode/engine/meta/grouptree.props.default.json +16 -0
- package/lib/lowcode/engine/meta/grouptree.props.json +89 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +2 -1
- package/lib/lowcode/engine/meta/iframe.props.json +3 -2
- package/lib/lowcode/engine/meta/image.props.default.json +2 -1
- package/lib/lowcode/engine/meta/image.props.json +3 -2
- package/lib/lowcode/engine/meta/imex.props.default.json +2 -1
- package/lib/lowcode/engine/meta/imex.props.json +27 -6
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +65 -42
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/lib/lowcode/engine/meta/jsx.props.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.json +5 -5
- package/lib/lowcode/engine/meta/link.props.default.json +2 -1
- package/lib/lowcode/engine/meta/link.props.json +3 -2
- package/lib/lowcode/engine/meta/page.props.json +6 -0
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/pagelayout.props.json +1 -1
- package/lib/lowcode/engine/meta/section.props.json +2 -1
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +1 -1
- package/lib/lowcode/engine/meta/table.props.json +3 -3
- package/lib/lowcode/engine/meta/text.props.default.json +4 -2
- package/lib/lowcode/engine/meta/text.props.json +8 -6
- package/lib/lowcode/engine/meta/tree.props.json +2 -2
- package/lib/lowcode/engine/provider/ContextProvider/index.js +81 -64
- package/lib/lowcode/engine/provider/ContextProvider/router.js +57 -0
- package/lib/lowcode/engine/{tools → provider/ContextProvider}/usePageDataStore.js +9 -7
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +38 -16
- package/lib/lowcode/engine/{tools → provider/ContextProvider}/useTodo.js +5 -7
- package/lib/lowcode/engine/provider/ContextProvider/utils.js +170 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +2 -3
- package/lib/lowcode/engine/tools/dataProcess.js +76 -76
- package/lib/lowcode/engine/tools/helper.js +29 -2
- package/lib/lowcode/engine/tools/initDS.js +270 -0
- package/lib/lowcode/engine/tools/useCanvasRender.js +13 -1
- package/lib/lowcode/engine/tools/useCombinedRefs.js +2 -1
- package/lib/lowcode/painter/Components.js +2 -2
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +24 -10
- package/lib/lowcode/painter/Panel.js +2 -2
- package/lib/lowcode/painter/components/AdvancePanel.js +3 -3
- package/lib/lowcode/painter/components/Collapse.js +31 -28
- package/lib/lowcode/painter/components/ColorInput.js +24 -24
- package/lib/lowcode/painter/components/ListEditor.js +24 -24
- package/lib/lowcode/painter/components/NumberInput.js +29 -29
- package/lib/lowcode/painter/components/PanelItem.js +24 -24
- package/lib/lowcode/painter/components/PopConfirm.js +8 -8
- package/lib/lowcode/painter/components/PopForm.js +27 -27
- package/lib/lowcode/painter/components/RuleInput.js +30 -30
- package/lib/lowcode/painter/components/SortBox.js +22 -22
- package/lib/lowcode/painter/components/TipIcon.js +23 -0
- package/lib/lowcode/painter/components/VarEditor.js +463 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +32 -32
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +25 -25
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +25 -25
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +23 -21
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/lib/lowcode/painter/components/code-editor/VisionEditor.js +88 -0
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +46 -4
- package/lib/lowcode/painter/components/field-setting/index.js +27 -13
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +2 -1
- package/lib/lowcode/painter/index.js +1 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +19 -5
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +2 -2
- package/lib/lowcode/painter/panel-section/ComplexPop.js +250 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +8 -0
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +30 -4
- package/lib/lowcode/painter/panel-section/GroupClassSelector.js +63 -0
- package/lib/lowcode/painter/panel-section/I18nInput.js +4 -2
- package/lib/lowcode/painter/panel-section/Icon.js +31 -26
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +6 -6
- package/lib/lowcode/painter/panel-section/IconSelector.js +17 -17
- package/lib/lowcode/painter/panel-section/ImpExp.js +0 -26
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +0 -1
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +22 -21
- package/lib/lowcode/painter/panel-section/PageVars.js +308 -0
- package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +6 -5
- package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +15 -15
- package/lib/lowcode/painter/panel-section/TabItems.js +6 -42
- package/lib/lowcode/painter/panel-section/TextContent.js +87 -0
- package/lib/lowcode/painter/services/complexPop.js +28 -0
- package/lib/lowcode/painter/style/action-bind-modal.less +102 -102
- package/lib/lowcode/painter/style/actions-editor.less +15 -15
- package/lib/lowcode/painter/style/border-editor.less +36 -36
- package/lib/lowcode/painter/style/border-radius-selector.less +42 -42
- package/lib/lowcode/painter/style/border-selector.less +39 -39
- package/lib/lowcode/painter/style/button-type.less +5 -5
- package/lib/lowcode/painter/style/collapse.less +28 -28
- package/lib/lowcode/painter/style/color-input.less +19 -19
- package/lib/lowcode/painter/style/components.less +91 -91
- package/lib/lowcode/painter/style/design.less +166 -160
- package/lib/lowcode/painter/style/display.less +17 -17
- package/lib/lowcode/painter/style/dragdrop.less +10 -10
- package/lib/lowcode/painter/style/fields-setting.less +25 -25
- package/lib/lowcode/painter/style/font-editor.less +9 -9
- package/lib/lowcode/painter/style/fullscreen-editor.less +17 -17
- package/lib/lowcode/painter/style/icon-selector.less +22 -22
- package/lib/lowcode/painter/style/icon.less +10 -10
- package/lib/lowcode/painter/style/impexp.less +7 -7
- package/lib/lowcode/painter/style/index.less +6 -6
- package/lib/lowcode/painter/style/layout-ratio.less +51 -51
- package/lib/lowcode/painter/style/list-editor.less +95 -95
- package/lib/lowcode/painter/style/number-input.less +17 -17
- package/lib/lowcode/painter/style/outline.less +28 -28
- package/lib/lowcode/painter/style/page-layout-display.less +27 -27
- package/lib/lowcode/painter/style/page-vars.less +25 -0
- package/lib/lowcode/painter/style/panel-attrs.less +43 -43
- package/lib/lowcode/painter/style/panel-item.less +54 -54
- package/lib/lowcode/painter/style/panel.less +98 -98
- package/lib/lowcode/painter/style/pop-confirm.less +17 -17
- package/lib/lowcode/painter/style/pop-form.less +19 -19
- package/lib/lowcode/painter/style/radio.less +24 -24
- package/lib/lowcode/painter/style/ribbon.less +5 -5
- package/lib/lowcode/painter/style/rule-input.less +12 -12
- package/lib/lowcode/painter/style/split-display.less +18 -18
- package/lib/lowcode/painter/style/style-panel.less +37 -37
- package/lib/lowcode/painter/style/tabitems.less +90 -90
- package/lib/lowcode/painter/style/treedragdrop.less +19 -19
- package/lib/lowcode/preview/index.js +1 -0
- package/lib/lowcode/view/Canvas.js +24 -22
- package/lib/lowcode/view/Loading.js +5 -7
- package/lib/lowcode/view/Page.js +35 -13
- package/lib/lowcode/view/index.js +1 -0
- package/lib/lowcode/view/lc-components/Box/index.js +21 -6
- package/lib/lowcode/view/lc-components/Box/index.less +14 -14
- package/lib/lowcode/view/lc-components/Box/meta.json +40 -40
- package/lib/lowcode/view/lc-components/Button/index.js +38 -38
- package/lib/lowcode/view/lc-components/Button/meta.json +127 -127
- package/lib/lowcode/view/lc-components/Button/style.less +2 -2
- package/lib/lowcode/view/lc-components/CardList/meta.json +154 -153
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +13 -5
- package/lib/lowcode/view/lc-components/Dialog/index.js +34 -25
- package/lib/lowcode/view/lc-components/Dialog/index.less +12 -8
- package/lib/lowcode/view/lc-components/Dialog/meta.json +204 -150
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +52 -8
- package/lib/lowcode/view/lc-components/Drawer/index.js +148 -33
- package/lib/lowcode/view/lc-components/Drawer/index.less +13 -10
- package/lib/lowcode/view/lc-components/Drawer/meta.json +242 -131
- package/lib/lowcode/view/lc-components/FieldColor/meta.json +157 -157
- package/lib/lowcode/view/lc-components/FieldComplex/meta.json +140 -133
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +141 -139
- package/lib/lowcode/view/lc-components/FieldDict/meta.json +138 -138
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +138 -138
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +167 -167
- package/lib/lowcode/view/lc-components/FieldNumber/meta.json +143 -142
- package/lib/lowcode/view/lc-components/FieldRadio/meta.json +115 -115
- package/lib/lowcode/view/lc-components/FieldRegion/meta.json +121 -121
- package/lib/lowcode/view/lc-components/FieldSelect/meta.json +152 -152
- package/lib/lowcode/view/lc-components/FieldString/meta.json +152 -152
- package/lib/lowcode/view/lc-components/FieldSwitch/meta.json +125 -125
- package/lib/lowcode/view/lc-components/FieldTextarea/meta.json +143 -143
- package/lib/lowcode/view/lc-components/FieldUpload/meta.json +165 -165
- package/lib/lowcode/view/lc-components/FieldUser/meta.json +176 -176
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +129 -129
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Form/index.js +75 -50
- package/lib/lowcode/view/lc-components/Form/meta.json +645 -610
- package/lib/lowcode/view/lc-components/GroupTree/FunctionDesign.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/index.js +209 -0
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +89 -0
- package/lib/lowcode/view/lc-components/Iframe/meta.json +33 -32
- package/lib/lowcode/view/lc-components/ImEx/index.js +197 -126
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -7
- package/lib/lowcode/view/lc-components/ImEx/meta.json +134 -113
- package/lib/lowcode/view/lc-components/Image/meta.json +115 -114
- package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
- package/lib/lowcode/view/lc-components/JSX/meta.json +28 -28
- package/lib/lowcode/view/lc-components/Layout/index.js +37 -20
- package/lib/lowcode/view/lc-components/Layout/index.less +5 -5
- package/lib/lowcode/view/lc-components/Layout/meta.json +107 -107
- package/lib/lowcode/view/lc-components/Link/meta.json +113 -112
- package/lib/lowcode/view/lc-components/Page/meta.json +61 -55
- package/lib/lowcode/view/lc-components/PageContent/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageFooter/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageHeader/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +5 -1
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +59 -59
- package/lib/lowcode/view/lc-components/Section/index.js +2 -6
- package/lib/lowcode/view/lc-components/Section/index.less +7 -7
- package/lib/lowcode/view/lc-components/Section/meta.json +108 -107
- package/lib/lowcode/view/lc-components/Split/index.js +18 -3
- package/lib/lowcode/view/lc-components/Split/meta.json +53 -53
- package/lib/lowcode/view/lc-components/Table/index.js +176 -149
- package/lib/lowcode/view/lc-components/Table/meta.json +450 -450
- package/lib/lowcode/view/lc-components/Tabs/index.js +40 -37
- package/lib/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/lib/lowcode/view/lc-components/Text/index.js +8 -1
- package/lib/lowcode/view/lc-components/Text/meta.json +56 -56
- package/lib/lowcode/view/lc-components/Tree/index.js +102 -107
- package/lib/lowcode/view/lc-components/Tree/index.less +4 -4
- package/lib/lowcode/view/lc-components/Tree/meta.json +357 -357
- package/lib/lowcode/view/lc-components/Wrapper.js +16 -1
- package/lib/lowcode/view/style/canvas.less +5 -5
- package/lib/lowcode/view/style/loading.less +98 -84
- package/lib/lowcode/view/style/page.less +7 -7
- package/lib/services.js +20 -0
- package/lib/upload/FilesWall/index.js +13 -13
- package/lib/upload/FilesWall/index.less +74 -74
- package/lib/upload/Form/gridForm.js +17 -7
- package/lib/upload/Form/index.less +7 -7
- package/lib/upload/FormItem/index.js +18 -18
- package/lib/utils/form.js +24 -24
- package/lib/utils/grid.js +4 -3
- package/lowcode.js +1 -1
- package/package.json +175 -175
- package/upload.js +1 -1
- package/utils.js +1 -1
- package/es/lowcode/view/lc-components/Form/index.less +0 -5
- package/lib/lowcode/view/lc-components/Form/index.less +0 -5
|
@@ -14,15 +14,13 @@ exports.useRemoteSource = exports.useContext = exports.default = exports.Context
|
|
|
14
14
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
var _umi = require("umi");
|
|
18
17
|
var _ahooks = require("ahooks");
|
|
19
18
|
var _lodash = require("lodash");
|
|
20
|
-
var _diff2 = _interopRequireDefault(require("../../tools/diff"));
|
|
21
19
|
var _EventBusProvider = require("../EventBusProvider");
|
|
22
20
|
var _RemoteSourceProvider = _interopRequireWildcard(require("../RemoteSourceProvider"));
|
|
23
21
|
var _usePageVar2 = _interopRequireDefault(require("./usePageVar"));
|
|
24
|
-
var _useTodo3 = _interopRequireDefault(require("
|
|
25
|
-
var _usePageDataStore = require("
|
|
22
|
+
var _useTodo3 = _interopRequireDefault(require("./useTodo"));
|
|
23
|
+
var _usePageDataStore = require("./usePageDataStore");
|
|
26
24
|
Object.keys(_usePageDataStore).forEach(function (key) {
|
|
27
25
|
if (key === "default" || key === "__esModule") return;
|
|
28
26
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -34,7 +32,11 @@ Object.keys(_usePageDataStore).forEach(function (key) {
|
|
|
34
32
|
}
|
|
35
33
|
});
|
|
36
34
|
});
|
|
35
|
+
var _ApiConfig = _interopRequireDefault(require("@/services/ApiConfig"));
|
|
36
|
+
var _apiUrl = require("../../../constants/api-url");
|
|
37
37
|
var topics = _interopRequireWildcard(require("../../../constants/event-topics"));
|
|
38
|
+
var utils = _interopRequireWildcard(require("./utils"));
|
|
39
|
+
var router = _interopRequireWildcard(require("./router"));
|
|
38
40
|
var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)(null);
|
|
39
41
|
var useContext = exports.useContext = function useContext() {
|
|
40
42
|
return (0, _react.useContext)(Context);
|
|
@@ -42,30 +44,31 @@ var useContext = exports.useContext = function useContext() {
|
|
|
42
44
|
var useRemoteSource = exports.useRemoteSource = function useRemoteSource() {
|
|
43
45
|
return (0, _react.useContext)(_RemoteSourceProvider.RemoteSourceContext);
|
|
44
46
|
};
|
|
45
|
-
var PRIVATE_KEYS = ['componentList', 'componentMap'];
|
|
47
|
+
var PRIVATE_KEYS = ['componentList', 'componentMap', 'remoteApiMap'];
|
|
46
48
|
var _default = exports.default = function _default(_ref) {
|
|
47
49
|
var children = _ref.children,
|
|
48
50
|
code = _ref.code;
|
|
49
51
|
var eventBus = (0, _EventBusProvider.useLDEventBus)();
|
|
50
52
|
var _useTodo = (0, _useTodo3.default)(),
|
|
51
|
-
_useTodo2 = (0, _slicedToArray2.default)(_useTodo,
|
|
53
|
+
_useTodo2 = (0, _slicedToArray2.default)(_useTodo, 2),
|
|
52
54
|
todo = _useTodo2[0],
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var _usePageVar = (0, _usePageVar2.default)(null, null),
|
|
56
|
-
state = _usePageVar.state,
|
|
57
|
-
prevState = _usePageVar.prevState,
|
|
55
|
+
loading = _useTodo2[1];
|
|
56
|
+
var _usePageVar = (0, _usePageVar2.default)(),
|
|
58
57
|
setState = _usePageVar.setState,
|
|
59
58
|
getState = _usePageVar.getState,
|
|
60
59
|
global = _usePageVar.global,
|
|
61
60
|
setGlobal = _usePageVar.setGlobal;
|
|
62
61
|
var _componentList = (0, _react.useRef)([]);
|
|
62
|
+
var _remoteApiMap = (0, _react.useRef)(new Map());
|
|
63
63
|
var _privateGetter = (0, _react.useRef)({
|
|
64
64
|
componentList: function componentList() {
|
|
65
65
|
return _componentList.current;
|
|
66
66
|
},
|
|
67
67
|
componentMap: function componentMap() {
|
|
68
68
|
return new Map(_componentList.current);
|
|
69
|
+
},
|
|
70
|
+
remoteApiMap: function remoteApiMap() {
|
|
71
|
+
return Object.fromEntries(_remoteApiMap.current.entries());
|
|
69
72
|
}
|
|
70
73
|
});
|
|
71
74
|
var _register = (0, _ahooks.useMemoizedFn)(function (id, component) {
|
|
@@ -78,6 +81,9 @@ var _default = exports.default = function _default(_ref) {
|
|
|
78
81
|
return _id !== id;
|
|
79
82
|
});
|
|
80
83
|
});
|
|
84
|
+
var _initRemoteApiMap = (0, _ahooks.useMemoizedFn)(function (_apiMap) {
|
|
85
|
+
_remoteApiMap.current = _apiMap;
|
|
86
|
+
});
|
|
81
87
|
var getElementById = (0, _ahooks.useMemoizedFn)(function (compId) {
|
|
82
88
|
var _componentList$curren;
|
|
83
89
|
return (_componentList$curren = _componentList.current.find(function (_ref4) {
|
|
@@ -86,15 +92,13 @@ var _default = exports.default = function _default(_ref) {
|
|
|
86
92
|
return compId === _id;
|
|
87
93
|
})) === null || _componentList$curren === void 0 ? void 0 : _componentList$curren[1];
|
|
88
94
|
});
|
|
89
|
-
var
|
|
95
|
+
var getParentElementById = (0, _ahooks.useMemoizedFn)(function (compId) {
|
|
96
|
+
var _target$api$getSelfDa;
|
|
90
97
|
var compMap = new Map(_componentList.current);
|
|
91
98
|
var _target = compMap.get(compId);
|
|
92
|
-
var _parentId = _target.api.getSelfData().parentId;
|
|
99
|
+
var _parentId = (_target$api$getSelfDa = _target.api.getSelfData()) === null || _target$api$getSelfDa === void 0 ? void 0 : _target$api$getSelfDa.props.parentId;
|
|
93
100
|
if (!_parentId) return null;
|
|
94
|
-
return compMap(_parentId);
|
|
95
|
-
});
|
|
96
|
-
var getUrlParams = (0, _ahooks.useMemoizedFn)(function () {
|
|
97
|
-
return _umi.history.location.query;
|
|
101
|
+
return compMap.get(_parentId);
|
|
98
102
|
});
|
|
99
103
|
var want = (0, _ahooks.useMemoizedFn)(function (wanted) {
|
|
100
104
|
var _getModuleData;
|
|
@@ -112,71 +116,82 @@ var _default = exports.default = function _default(_ref) {
|
|
|
112
116
|
}, 0);
|
|
113
117
|
return (serialsValue & (serialMap[wanted] || 0)) === 1;
|
|
114
118
|
});
|
|
115
|
-
(0, _ahooks.useUpdateEffect)(function () {
|
|
116
|
-
var _diff = (0, _diff2.default)(prevState, state);
|
|
117
|
-
eventBus.$publisher(topics.PAGE_STATE_CHANGED, {
|
|
118
|
-
state: state,
|
|
119
|
-
prevState: prevState,
|
|
120
|
-
diff: _diff
|
|
121
|
-
});
|
|
122
|
-
}, [state, prevState]);
|
|
123
119
|
var ctx = new Proxy((0, _objectSpread2.default)({
|
|
124
120
|
_register: _register,
|
|
125
121
|
_unregister: _unregister,
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
_initRemoteApiMap: _initRemoteApiMap,
|
|
123
|
+
/**
|
|
124
|
+
* @property {boolean} loading - loading状态
|
|
128
125
|
*/
|
|
129
126
|
loading: loading,
|
|
130
|
-
/**
|
|
131
|
-
* @property {object}
|
|
132
|
-
*/
|
|
133
|
-
history: _umi.history,
|
|
134
|
-
/**
|
|
135
|
-
* @method - 执行行为接口
|
|
136
|
-
* @param {object} evns - moduleCode: 模块编码,datasetCode:数据集编码,behaviorKey:行为key
|
|
137
|
-
* @param {object} params - 链接参数
|
|
138
|
-
* @param {object} data - body参数
|
|
139
|
-
*/
|
|
140
|
-
callBehavior: callBehavior,
|
|
141
|
-
/**
|
|
142
|
-
* @property {object} topics - 内置的事件话题
|
|
127
|
+
/**
|
|
128
|
+
* @property {object} topics - 内置的事件话题
|
|
143
129
|
*/
|
|
144
130
|
topics: topics,
|
|
145
|
-
/**
|
|
146
|
-
* @property {
|
|
131
|
+
/**
|
|
132
|
+
* @property {object} topics - service api前缀
|
|
133
|
+
*/
|
|
134
|
+
API_PREFIX: _ApiConfig.default,
|
|
135
|
+
/**
|
|
136
|
+
* @property {string} PRIMARY_KEY - 主键key
|
|
147
137
|
*/
|
|
148
138
|
PRIMARY_KEY: window.appConfig.constraintKeys.PRIMARY,
|
|
139
|
+
/**
|
|
140
|
+
* @property {string} PARENT_KEY - 树组件主键key
|
|
141
|
+
*/
|
|
149
142
|
PARENT_KEY: window.appConfig.constraintKeys.PARENT,
|
|
150
|
-
/**
|
|
151
|
-
* @method - 根据组件ID获取实例
|
|
152
|
-
* @param {string} compId - 组件ID
|
|
153
|
-
* @return {object} target - 组件实例
|
|
143
|
+
/**
|
|
144
|
+
* @method - 根据组件ID获取实例
|
|
145
|
+
* @param {string} compId - 组件ID
|
|
146
|
+
* @return {object} target - 组件实例
|
|
154
147
|
*/
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* @method - 根据组件ID获取父组件实例
|
|
158
|
-
* @param {string} compId - 组件ID
|
|
159
|
-
* @return {object} target - 父组件实例
|
|
148
|
+
$: getElementById,
|
|
149
|
+
/**
|
|
150
|
+
* @method - 根据组件ID获取父组件实例
|
|
151
|
+
* @param {string} compId - 组件ID
|
|
152
|
+
* @return {object} target - 父组件实例
|
|
160
153
|
*/
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* @method - 执行行为池
|
|
164
|
-
* @param {object} actionPool - 行为池
|
|
165
|
-
* @param {object} args - 参数
|
|
154
|
+
$$: getParentElementById,
|
|
155
|
+
/**
|
|
156
|
+
* @method - 执行行为池
|
|
157
|
+
* @param {object} actionPool - 行为池
|
|
158
|
+
* @param {object} args - 参数
|
|
166
159
|
*/
|
|
167
160
|
doAction: function doAction(actionPool, args) {
|
|
168
161
|
return todo(this, actionPool, args);
|
|
169
162
|
},
|
|
170
|
-
/**
|
|
171
|
-
* @method -
|
|
172
|
-
* @return {
|
|
163
|
+
/**
|
|
164
|
+
* @method - 是否有权限
|
|
165
|
+
* @return {string} wanted - 期望的资源串
|
|
166
|
+
*/
|
|
167
|
+
want: want,
|
|
168
|
+
/**
|
|
169
|
+
* @method - 获取执行行为请求的接口URL
|
|
170
|
+
* @return {string} BEHAVIOR_URL - 执行行为请求的接口URL
|
|
171
|
+
*/
|
|
172
|
+
getBehaviorUrl: _apiUrl.getBehaviorUrl,
|
|
173
|
+
/**
|
|
174
|
+
* @typedef {Object} Utils
|
|
175
|
+
* @property {function(type, props): void} dialog - 弹出对话框
|
|
176
|
+
* @property {function({ moduleCode, datasetCode, behaviorKey }, params, data): Promise} callBehavior - 执行行为
|
|
177
|
+
* @property {function(type, value, formatOrSeparator): string} formatter - 常用的 formatter 函数用于进行事件、金额、手机号等 format
|
|
178
|
+
* @property {function(when, type): string} getDateTimeRange - 获取当前或指定日期的开始结束区间时间戳
|
|
179
|
+
*/
|
|
180
|
+
/**
|
|
181
|
+
* @property {Utils} 工具类
|
|
182
|
+
*/
|
|
183
|
+
utils: utils,
|
|
184
|
+
/**
|
|
185
|
+
* @typedef {Object} Router
|
|
186
|
+
* @property {function(path, params): void} push - 跳转
|
|
187
|
+
* @property {function(path, state): void} replace - 替换
|
|
188
|
+
* @property {function{}: object} getQuery - 获取URL参数
|
|
189
|
+
* @property {function(params): string} stringifyQuery - 序列化 URL 参数
|
|
173
190
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
* @method - 是否有权限
|
|
177
|
-
* @return {string} wanted - 期望的资源串
|
|
191
|
+
/**
|
|
192
|
+
* @property {Router} router - 路由
|
|
178
193
|
*/
|
|
179
|
-
|
|
194
|
+
router: router
|
|
180
195
|
}, eventBus), {
|
|
181
196
|
get: function get(target, property, receiver) {
|
|
182
197
|
if (PRIVATE_KEYS.includes(property)) {
|
|
@@ -192,6 +207,8 @@ var _default = exports.default = function _default(_ref) {
|
|
|
192
207
|
set: function set(target, property, receiver) {
|
|
193
208
|
if (PRIVATE_KEYS.includes(property)) {
|
|
194
209
|
throw new Error("\u5C5E\u6027 \"".concat(property, "\" \u662F\u53EA\u8BFB\u7684"));
|
|
210
|
+
} else if (property.startsWith('_')) {
|
|
211
|
+
throw new Error("\u5C5E\u6027 \"".concat(property, "\" \u662F\u79C1\u6709\u7684"));
|
|
195
212
|
} else if (property === 'state') {
|
|
196
213
|
setState(receiver);
|
|
197
214
|
return true;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getQuery = getQuery;
|
|
7
|
+
Object.defineProperty(exports, "history", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _umi.history;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
exports.push = push;
|
|
14
|
+
exports.replace = replace;
|
|
15
|
+
exports.stringifyQuery = stringifyQuery;
|
|
16
|
+
var _umi = require("umi");
|
|
17
|
+
var _lodash = require("lodash");
|
|
18
|
+
function push(path, params) {
|
|
19
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'push';
|
|
20
|
+
var blank = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
21
|
+
if (blank) {
|
|
22
|
+
window.openUrl("new:".concat(path));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (type === 'replace') {
|
|
26
|
+
window.openUrl(path, {
|
|
27
|
+
method: 'replace'
|
|
28
|
+
});
|
|
29
|
+
} else if (type === 'layer') {
|
|
30
|
+
window.openUrl("layer:".concat(path), params);
|
|
31
|
+
} else if (type === 'iframe') {
|
|
32
|
+
window.openUrl("iframe:".concat(path));
|
|
33
|
+
} else if (type === 'sso') {
|
|
34
|
+
window.openUrl("sso:".concat(path));
|
|
35
|
+
} else {
|
|
36
|
+
_umi.history[type](path, params);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function replace(path, state) {
|
|
40
|
+
_umi.history.replace(path, state);
|
|
41
|
+
}
|
|
42
|
+
function getQuery(key) {
|
|
43
|
+
var toSearch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
44
|
+
if (toSearch) {
|
|
45
|
+
return _umi.history.location.search;
|
|
46
|
+
}
|
|
47
|
+
var query = _umi.history.location.query;
|
|
48
|
+
if ((0, _lodash.isNil)(key)) {
|
|
49
|
+
return query;
|
|
50
|
+
}
|
|
51
|
+
return query[key];
|
|
52
|
+
}
|
|
53
|
+
function stringifyQuery(params) {
|
|
54
|
+
return Object.keys(params).map(function (key) {
|
|
55
|
+
return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(params[key]));
|
|
56
|
+
}).join('&');
|
|
57
|
+
}
|
|
@@ -14,8 +14,8 @@ var _middleware = require("zustand/middleware");
|
|
|
14
14
|
var _shallow = require("zustand/react/shallow");
|
|
15
15
|
var _lodash = require("lodash");
|
|
16
16
|
var _fastDeepEqual = _interopRequireDefault(require("fast-deep-equal"));
|
|
17
|
-
var _dataProcess = require("
|
|
18
|
-
var _constants = require("
|
|
17
|
+
var _dataProcess = require("../../tools/dataProcess");
|
|
18
|
+
var _constants = require("../../../constants");
|
|
19
19
|
var temporalStateCreator = function temporalStateCreator(userSet, userGet, options) {
|
|
20
20
|
var stateCreator = function stateCreator(set, get) {
|
|
21
21
|
return {
|
|
@@ -191,11 +191,13 @@ var _default = exports.default = usePageDataStore;
|
|
|
191
191
|
usePageDataStore.subscribe(function (state) {
|
|
192
192
|
return state.pageData;
|
|
193
193
|
}, function (_, prev) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
})
|
|
198
|
-
|
|
194
|
+
usePageDataStore.setState(function (state) {
|
|
195
|
+
if (prev === null) {
|
|
196
|
+
state.needPrompt = false;
|
|
197
|
+
} else if (state.needPrompt === false) {
|
|
198
|
+
state.needPrompt = true;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
199
201
|
});
|
|
200
202
|
var resetPageData = exports.resetPageData = function resetPageData(data) {
|
|
201
203
|
usePageDataStore.setState(function (state) {
|
|
@@ -1,25 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
6
|
+
exports.useStateStore = exports.default = void 0;
|
|
10
7
|
var _react = require("react");
|
|
11
8
|
var _ahooks = require("ahooks");
|
|
9
|
+
var _zustand = require("zustand");
|
|
10
|
+
var _immer = require("zustand/middleware/immer");
|
|
11
|
+
var _middleware = require("zustand/middleware");
|
|
12
12
|
var _lodash = require("lodash");
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
var useStateStore = exports.useStateStore = (0, _zustand.create)()((0, _immer.immer)((0, _middleware.subscribeWithSelector)(function (set) {
|
|
14
|
+
return {
|
|
15
|
+
state: {},
|
|
16
|
+
initialize: function initialize(init) {
|
|
17
|
+
return set(function (store) {
|
|
18
|
+
store.state = init;
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
clear: function clear() {
|
|
22
|
+
return set(function (store) {
|
|
23
|
+
store.state = {};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
})));
|
|
28
|
+
var usePageVar = function usePageVar() {
|
|
29
|
+
var globalRef = (0, _react.useRef)(null);
|
|
30
|
+
var state = useStateStore(function (store) {
|
|
31
|
+
return store.state;
|
|
32
|
+
});
|
|
33
|
+
var setState = (0, _ahooks.useMemoizedFn)(function (newState) {
|
|
34
|
+
useStateStore.setState(function (store) {
|
|
35
|
+
(0, _lodash.forOwn)(newState, function (_val, _key) {
|
|
36
|
+
if ((0, _lodash.isNil)(_val)) {
|
|
37
|
+
delete store.state[_key];
|
|
38
|
+
} else {
|
|
39
|
+
store.state[_key] = _val;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
var getState = (0, _ahooks.useMemoizedFn)(function () {
|
|
45
|
+
return useStateStore.getState().state;
|
|
23
46
|
});
|
|
24
47
|
var setGlobal = (0, _ahooks.useMemoizedFn)(function (newGlobal) {
|
|
25
48
|
if ((0, _lodash.isNil)(globalRef.current)) {
|
|
@@ -35,8 +58,7 @@ var usePageVar = function usePageVar(defaultState, defaultGlobal) {
|
|
|
35
58
|
});
|
|
36
59
|
return {
|
|
37
60
|
state: state,
|
|
38
|
-
|
|
39
|
-
setState: setPageState,
|
|
61
|
+
setState: setState,
|
|
40
62
|
getState: getState,
|
|
41
63
|
global: globalRef,
|
|
42
64
|
setGlobal: setGlobal
|
|
@@ -12,9 +12,9 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
12
12
|
var _ahooks = require("ahooks");
|
|
13
13
|
var _antd = require("luck-design/antd");
|
|
14
14
|
var _lodash = require("lodash");
|
|
15
|
-
var _usePageDataStore =
|
|
16
|
-
var _helper = require("
|
|
17
|
-
var _apiUrl = require("
|
|
15
|
+
var _usePageDataStore = require("./usePageDataStore");
|
|
16
|
+
var _helper = require("../../tools/helper");
|
|
17
|
+
var _apiUrl = require("../../../constants/api-url");
|
|
18
18
|
var _excluded = ["datasetCode"];
|
|
19
19
|
var useTodo = function useTodo() {
|
|
20
20
|
var _useBoolean = (0, _ahooks.useBoolean)(),
|
|
@@ -33,9 +33,6 @@ var useTodo = function useTodo() {
|
|
|
33
33
|
behaviorKey: behaviorKey
|
|
34
34
|
}, params), data);
|
|
35
35
|
});
|
|
36
|
-
var moduleData = (0, _usePageDataStore.default)(function (state) {
|
|
37
|
-
return state.moduleData;
|
|
38
|
-
});
|
|
39
36
|
var todo = (0, _ahooks.useMemoizedFn)(function (ctx, actionPool) {
|
|
40
37
|
var argsMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
41
38
|
if ((0, _lodash.isNil)(actionPool)) {
|
|
@@ -64,6 +61,7 @@ var useTodo = function useTodo() {
|
|
|
64
61
|
params = _ref4.params,
|
|
65
62
|
data = _ref4.data,
|
|
66
63
|
after = _ref4.after;
|
|
64
|
+
var moduleData = (0, _usePageDataStore.getModuleData)();
|
|
67
65
|
var _moduleCode = moduleCode || moduleData.moduleCode;
|
|
68
66
|
var _dscode = datasetCode || dsCode;
|
|
69
67
|
if (!_moduleCode || !_dscode) {
|
|
@@ -90,6 +88,6 @@ var useTodo = function useTodo() {
|
|
|
90
88
|
}
|
|
91
89
|
return Promise.resolve();
|
|
92
90
|
});
|
|
93
|
-
return [todo,
|
|
91
|
+
return [todo, loading];
|
|
94
92
|
};
|
|
95
93
|
var _default = exports.default = useTodo;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.callBehavior = callBehavior;
|
|
8
|
+
exports.dialog = dialog;
|
|
9
|
+
exports.formatter = formatter;
|
|
10
|
+
exports.getDateTimeRange = getDateTimeRange;
|
|
11
|
+
exports.getLoginUser = getLoginUser;
|
|
12
|
+
exports.isMobile = isMobile;
|
|
13
|
+
exports.toast = toast;
|
|
14
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
15
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
+
var _antd = require("luck-design/antd");
|
|
18
|
+
var _apiUrl = require("../../../constants/api-url");
|
|
19
|
+
var _umi = require("umi");
|
|
20
|
+
var Formatter = /*#__PURE__*/function () {
|
|
21
|
+
function Formatter() {
|
|
22
|
+
(0, _classCallCheck2.default)(this, Formatter);
|
|
23
|
+
}
|
|
24
|
+
(0, _createClass2.default)(Formatter, null, [{
|
|
25
|
+
key: "formatDate",
|
|
26
|
+
value:
|
|
27
|
+
// 格式化日期
|
|
28
|
+
function formatDate(date, format) {
|
|
29
|
+
var options = {
|
|
30
|
+
'Y+': date.getFullYear().toString(),
|
|
31
|
+
// 年
|
|
32
|
+
'M+': (date.getMonth() + 1).toString().padStart(2, '0'),
|
|
33
|
+
// 月
|
|
34
|
+
'D+': date.getDate().toString().padStart(2, '0'),
|
|
35
|
+
// 日
|
|
36
|
+
'H+': date.getHours().toString().padStart(2, '0'),
|
|
37
|
+
// 时
|
|
38
|
+
'm+': date.getMinutes().toString().padStart(2, '0'),
|
|
39
|
+
// 分
|
|
40
|
+
's+': date.getSeconds().toString().padStart(2, '0') // 秒
|
|
41
|
+
};
|
|
42
|
+
for (var k in options) {
|
|
43
|
+
format = format.replace(new RegExp(k), options[k]);
|
|
44
|
+
}
|
|
45
|
+
return format;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 格式化金额
|
|
49
|
+
}, {
|
|
50
|
+
key: "formatCurrency",
|
|
51
|
+
value: function formatCurrency(amount) {
|
|
52
|
+
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';
|
|
53
|
+
amount = parseFloat(amount).toFixed(2);
|
|
54
|
+
var parts = amount.split('.');
|
|
55
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
56
|
+
return "".concat(parts.join('.'));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 格式化手机号
|
|
60
|
+
}, {
|
|
61
|
+
key: "formatPhoneNumber",
|
|
62
|
+
value: function formatPhoneNumber(phone) {
|
|
63
|
+
phone = phone.toString();
|
|
64
|
+
return phone.replace(/(\+?\d{2})(\d{4})(\d{4})(\d{3})/, '$1 $2 $3 $4');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 格式化银行卡号
|
|
68
|
+
}, {
|
|
69
|
+
key: "formatCardNumber",
|
|
70
|
+
value: function formatCardNumber(cardNumber) {
|
|
71
|
+
cardNumber = cardNumber.toString();
|
|
72
|
+
return cardNumber.replace(/(\d{4})(?=\d)/g, '$1 ');
|
|
73
|
+
}
|
|
74
|
+
}]);
|
|
75
|
+
return Formatter;
|
|
76
|
+
}();
|
|
77
|
+
function dialog() {
|
|
78
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'confirm';
|
|
79
|
+
var props = arguments.length > 1 ? arguments[1] : undefined;
|
|
80
|
+
if (!['info', 'success', 'error', 'warning', 'confirm'].includes(type)) return;
|
|
81
|
+
return _antd.Modal[type](props);
|
|
82
|
+
}
|
|
83
|
+
function toast() {
|
|
84
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'info';
|
|
85
|
+
var props = arguments.length > 1 ? arguments[1] : undefined;
|
|
86
|
+
if (!['info', 'success', 'error', 'warning', 'warn', 'loading'].includes(type)) return;
|
|
87
|
+
return _antd.message[type](props);
|
|
88
|
+
}
|
|
89
|
+
function callBehavior(_ref, params, data) {
|
|
90
|
+
var moduleCode = _ref.moduleCode,
|
|
91
|
+
datasetCode = _ref.datasetCode,
|
|
92
|
+
behaviorKey = _ref.behaviorKey;
|
|
93
|
+
return (0, _apiUrl.fetchCallBehavior)((0, _objectSpread2.default)({
|
|
94
|
+
moduleCode: moduleCode,
|
|
95
|
+
datasetCode: datasetCode,
|
|
96
|
+
behaviorKey: behaviorKey
|
|
97
|
+
}, params), data);
|
|
98
|
+
}
|
|
99
|
+
function formatter(type, value, formatOrSeparator) {
|
|
100
|
+
switch (type) {
|
|
101
|
+
case 'date':
|
|
102
|
+
return Formatter.formatDate(value, formatOrSeparator);
|
|
103
|
+
case 'money':
|
|
104
|
+
return Formatter.formatCurrency(value, formatOrSeparator);
|
|
105
|
+
case 'cnmobile':
|
|
106
|
+
return Formatter.formatPhoneNumber(value);
|
|
107
|
+
case 'card':
|
|
108
|
+
return Formatter.formatCardNumber(value);
|
|
109
|
+
default:
|
|
110
|
+
throw new Error("Unsupported format type: ".concat(type));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function getDateTimeRange() {
|
|
114
|
+
var when = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|
|
115
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'day';
|
|
116
|
+
var start = new Date(when);
|
|
117
|
+
var end = new Date(when);
|
|
118
|
+
switch (type) {
|
|
119
|
+
case 'year':
|
|
120
|
+
start.setMonth(0, 1); // 设置到当年的1月1日
|
|
121
|
+
start.setHours(0, 0, 0, 0);
|
|
122
|
+
end.setMonth(11, 31); // 设置到当年的12月31日
|
|
123
|
+
end.setHours(23, 59, 59, 999);
|
|
124
|
+
break;
|
|
125
|
+
case 'month':
|
|
126
|
+
start.setDate(1); // 设置到当月的1日
|
|
127
|
+
start.setHours(0, 0, 0, 0);
|
|
128
|
+
end.setMonth(end.getMonth() + 1); // 设置到下月的1日
|
|
129
|
+
end.setDate(0); // 回到当月的最后一天
|
|
130
|
+
end.setHours(23, 59, 59, 999);
|
|
131
|
+
break;
|
|
132
|
+
case 'week':
|
|
133
|
+
var dayOfWeek = start.getDay(); // 当前日期是本周的第几天
|
|
134
|
+
var diffToMonday = (dayOfWeek + 6) % 7; // 计算到上一个星期一的天数
|
|
135
|
+
start.setDate(start.getDate() - diffToMonday); // 设置到本周的星期一
|
|
136
|
+
start.setHours(0, 0, 0, 0);
|
|
137
|
+
end.setDate(start.getDate() + 6); // 设置到本周的星期天
|
|
138
|
+
end.setHours(23, 59, 59, 999);
|
|
139
|
+
break;
|
|
140
|
+
case 'day':
|
|
141
|
+
case 'date':
|
|
142
|
+
// 'day' 和 'date' 是一样的处理方式
|
|
143
|
+
start.setHours(0, 0, 0, 0);
|
|
144
|
+
end.setHours(23, 59, 59, 999);
|
|
145
|
+
break;
|
|
146
|
+
case 'hour':
|
|
147
|
+
start.setMinutes(0, 0, 0);
|
|
148
|
+
end.setMinutes(59, 59, 999);
|
|
149
|
+
break;
|
|
150
|
+
case 'minute':
|
|
151
|
+
start.setSeconds(0, 0);
|
|
152
|
+
end.setSeconds(59, 999);
|
|
153
|
+
break;
|
|
154
|
+
case 'second':
|
|
155
|
+
start.setMilliseconds(0);
|
|
156
|
+
end.setMilliseconds(999);
|
|
157
|
+
break;
|
|
158
|
+
default:
|
|
159
|
+
throw new Error("Unsupported range type: ".concat(type));
|
|
160
|
+
}
|
|
161
|
+
return [start.getTime(), end.getTime()];
|
|
162
|
+
}
|
|
163
|
+
function getLoginUser() {
|
|
164
|
+
var _getDvaApp;
|
|
165
|
+
return (_getDvaApp = (0, _umi.getDvaApp)()) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp._store.getState().user.currentUser;
|
|
166
|
+
}
|
|
167
|
+
function isMobile() {
|
|
168
|
+
// return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
169
|
+
return USER_RUNTIME === 'MOBILE';
|
|
170
|
+
}
|
|
@@ -17,8 +17,7 @@ var _umi = require("umi");
|
|
|
17
17
|
var _launcher = _interopRequireDefault(require("../launcher"));
|
|
18
18
|
var _Builder = require("../../../components/Builder");
|
|
19
19
|
var _action2 = require("../../../helper/action");
|
|
20
|
-
var _usePageDataStore2 =
|
|
21
|
-
var _ContextProvider = require("../provider/ContextProvider");
|
|
20
|
+
var _usePageDataStore2 = _interopRequireWildcard(require("./ContextProvider/usePageDataStore"));
|
|
22
21
|
var _dataProcess = require("../tools/dataProcess");
|
|
23
22
|
var _apiUrl = require("../../constants/api-url");
|
|
24
23
|
var _constants = require("../../constants");
|
|
@@ -39,7 +38,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
39
38
|
initialize = _usePageDataStore.initialize,
|
|
40
39
|
initializeModule = _usePageDataStore.initializeModule,
|
|
41
40
|
reset = _usePageDataStore.reset;
|
|
42
|
-
var _useTemporalStore = (0,
|
|
41
|
+
var _useTemporalStore = (0, _usePageDataStore2.useTemporalStore)(function (state) {
|
|
43
42
|
return {
|
|
44
43
|
pause: state.pause,
|
|
45
44
|
resume: state.resume,
|