@gct-paas/design 0.1.4-dev.8 → 0.1.5-dev.0
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/dist/index.min.css +2 -1
- package/dist/loader.esm.min.js +1 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +7 -8
- package/es/_virtual/_rolldown/runtime.mjs +13 -0
- package/es/components/design-icon-button/design-icon-button.d.ts +2 -4
- package/es/components/design-icon-button/design-icon-button.mjs +95 -148
- package/es/components/design-save-tip/design-save-tip.mjs +76 -102
- package/es/components/design-step-check/design-step-check.mjs +92 -118
- package/es/components/design-view-layout/{design-view-layout.module.css → design-view-layout.css} +28 -25
- package/es/components/design-view-layout/design-view-layout.mjs +135 -204
- package/es/components/editor/index.mjs +13 -15
- package/es/components/editor/style/border-editor/border-box.vue.mjs +7 -7
- package/es/components/editor/style/border-editor/border-box.vue_vue_type_script_setup_true_name_border-box_lang.mjs +245 -0
- package/es/components/editor/style/border-editor/border-editor.vue.mjs +7 -7
- package/es/components/editor/style/border-editor/border-editor.vue_vue_type_script_setup_true_lang.mjs +57 -0
- package/es/components/editor/style/border-editor/border-radius.vue.mjs +7 -7
- package/es/components/editor/style/border-editor/border-radius.vue_vue_type_script_setup_true_lang.mjs +177 -0
- package/es/components/editor/style/border-editor/util.mjs +48 -70
- package/es/components/editor/style/font-editor/align-group.vue.mjs +7 -7
- package/es/components/editor/style/font-editor/align-group.vue_vue_type_script_setup_true_name_align-group_lang.mjs +54 -0
- package/es/components/editor/style/font-editor/font-editor.vue.mjs +5 -72
- package/es/components/editor/style/font-editor/font-editor.vue_vue_type_script_setup_true_name_font-editor_lang.mjs +61 -0
- package/es/components/editor/style/font-editor/font-style-group.vue.mjs +7 -7
- package/es/components/editor/style/font-editor/font-style-group.vue_vue_type_script_setup_true_lang.mjs +72 -0
- package/es/components/editor/style/font-editor/util.mjs +10 -10
- package/es/components/editor/style/position-editor/position-editor.vue.mjs +7 -7
- package/es/components/editor/style/position-editor/position-editor.vue_vue_type_script_setup_true_name_position-editor_lang.mjs +193 -0
- package/es/components/editor/style/spacing-editor/spacing-editor.vue.mjs +7 -7
- package/es/components/editor/style/spacing-editor/spacing-editor.vue_vue_type_script_setup_true_lang.mjs +262 -0
- package/es/components/field-cascader/index.d.ts +2 -0
- package/es/components/field-cascader/index.mjs +1 -0
- package/es/components/field-cascader/src/FieldCascader.vue.d.ts +87 -0
- package/es/components/field-cascader/src/FieldCascader.vue.mjs +6 -0
- package/es/components/field-cascader/src/FieldCascader.vue_vue_type_script_setup_true_lang.mjs +115 -0
- package/es/components/field-cascader/src/FieldCascader.vue_vue_type_style_index_0_lang.css +69 -0
- package/es/components/field-cascader/src/SearchInput.vue.d.ts +11 -0
- package/es/components/field-cascader/src/SearchInput.vue.mjs +7 -0
- package/es/components/field-cascader/src/SearchInput.vue_vue_type_script_setup_true_lang.mjs +38 -0
- package/es/components/field-cascader/src/SearchInput.vue_vue_type_style_index_0_scoped_512c4b38_lang.css +9 -0
- package/es/components/field-cascader/src/hooks.d.ts +129 -0
- package/es/components/field-cascader/src/hooks.mjs +163 -0
- package/es/components/field-transfer/components/Cascader/FieldCascader.d.ts +25 -0
- package/es/components/field-transfer/components/Cascader/FieldCascader.mjs +150 -0
- package/es/components/field-transfer/components/Transfer/AdvancedColumnSetting.d.ts +46 -0
- package/es/components/field-transfer/components/Transfer/AdvancedColumnSetting.mjs +45 -0
- package/es/components/field-transfer/components/Transfer/AdvancedTransfer.d.ts +39 -0
- package/es/components/field-transfer/components/Transfer/AdvancedTransfer.mjs +124 -0
- package/es/components/field-transfer/components/Transfer/FieldTransfer.d.ts +83 -0
- package/es/components/field-transfer/components/Transfer/FieldTransfer.mjs +112 -0
- package/es/components/field-transfer/components/Transfer/TransferTree.d.ts +62 -0
- package/es/components/field-transfer/components/Transfer/TransferTree.mjs +84 -0
- package/es/components/field-transfer/components/Transfer/TreeItem.d.ts +17 -0
- package/es/components/field-transfer/components/Transfer/TreeItem.mjs +25 -0
- package/es/components/field-transfer/components/field-transfer-modal.vue.d.ts +43 -0
- package/es/components/field-transfer/components/field-transfer-modal.vue.mjs +7 -0
- package/es/components/field-transfer/components/field-transfer-modal.vue_vue_type_script_setup_true_name_field-transfer-modal_lang.mjs +166 -0
- package/es/components/field-transfer/components/field-transfer-modal.vue_vue_type_style_index_0_scoped_0c9dd8a1_lang.css +5 -0
- package/es/components/field-transfer/components/modal-wrapper.vue.d.ts +19 -0
- package/es/components/field-transfer/components/modal-wrapper.vue.mjs +5 -0
- package/es/components/field-transfer/components/modal-wrapper.vue_vue_type_script_setup_true_name_modal-wrapper_lang.mjs +27 -0
- package/es/components/field-transfer/hooks/useTreeData.d.ts +139 -0
- package/es/components/field-transfer/hooks/useTreeData.mjs +136 -0
- package/es/components/field-transfer/index.d.ts +21 -0
- package/es/components/field-transfer/index.mjs +1 -0
- package/es/components/field-transfer/less/AdvancedTransfer.css +60 -0
- package/es/components/field-transfer/less/FieldCascader.css +57 -0
- package/es/components/field-transfer/less/TransferTree.css +86 -0
- package/es/components/field-transfer/less/TreeItem.css +29 -0
- package/es/components/field-transfer/useFieldTransfer.d.ts +47 -0
- package/es/components/field-transfer/useFieldTransfer.mjs +48 -0
- package/es/components/field-transfer/utils/tree-tool.d.ts +6 -0
- package/es/components/field-transfer/utils/tree-tool.mjs +62 -0
- package/es/components/icon/downleft-icon.vue.mjs +21 -25
- package/es/components/icon/downleft-icon.vue_vue_type_script_lang.mjs +9 -0
- package/es/components/icon/downright-icon.vue.mjs +21 -25
- package/es/components/icon/downright-icon.vue_vue_type_script_lang.mjs +9 -0
- package/es/components/icon/upleft-icon.vue.mjs +21 -25
- package/es/components/icon/upleft-icon.vue_vue_type_script_lang.mjs +9 -0
- package/es/components/icon/upright-icon.vue.mjs +21 -25
- package/es/components/icon/upright-icon.vue_vue_type_script_lang.mjs +9 -0
- package/es/components/index.d.ts +3 -0
- package/es/components/index.mjs +23 -25
- package/es/components/mobile-container/mobile-container.d.ts +3 -0
- package/es/components/mobile-container/mobile-container.mjs +39 -78
- package/es/components/modal-name-editor/modal-name-editor.d.ts +2 -2
- package/es/components/modal-name-editor/modal-name-editor.mjs +132 -171
- package/es/components/user-occupy/index.d.ts +4 -0
- package/es/components/user-occupy/index.mjs +3 -0
- package/es/components/user-occupy/occupy.const.d.ts +4 -0
- package/es/components/user-occupy/occupy.const.mjs +7 -0
- package/es/components/user-occupy/useUserOccupy.d.ts +38 -0
- package/es/components/user-occupy/useUserOccupy.mjs +162 -0
- package/es/components/user-occupy/user-lock.vue.d.ts +2 -0
- package/es/components/user-occupy/user-lock.vue.mjs +7 -0
- package/es/components/user-occupy/user-lock.vue_vue_type_script_setup_true_lang.mjs +16 -0
- package/es/components/user-occupy/user-lock.vue_vue_type_style_index_0_scoped_b40d46ff_lang.css +29 -0
- package/es/components/user-occupy/user-occupy.vue.d.ts +2 -0
- package/es/components/user-occupy/user-occupy.vue.mjs +7 -0
- package/es/components/user-occupy/user-occupy.vue_vue_type_script_setup_true_lang.mjs +34 -0
- package/es/components/user-occupy/user-occupy.vue_vue_type_style_index_0_scoped_24cb9749_lang.css +25 -0
- package/es/constant/design-editor-type.mjs +53 -14
- package/es/constant/index.d.ts +0 -26
- package/es/constant/index.mjs +241 -72
- package/es/constant/page-designer.d.ts +1 -12
- package/es/constant/page-designer.mjs +58 -51
- package/es/create-app-vue.d.ts +8 -0
- package/es/create-app-vue.mjs +13 -0
- package/es/data/design-container-node/design-container-node.d.ts +1 -1
- package/es/data/design-container-node/design-container-node.mjs +15 -5
- package/es/data/design-editor-node/design-editor-node.d.ts +1 -1
- package/es/data/design-editor-node/design-editor-node.mjs +18 -7
- package/es/data/design-node/design-node.d.ts +1 -1
- package/es/data/design-node/design-node.mjs +60 -65
- package/es/data/index.mjs +3 -0
- package/es/hooks/design-view/constants/style-editor.const.d.ts +24 -0
- package/es/hooks/design-view/constants/style-editor.const.mjs +63 -0
- package/es/hooks/design-view/design-state.d.ts +2586 -0
- package/es/hooks/design-view/design-state.mjs +103 -0
- package/es/hooks/design-view/designer/useDesignCache.d.ts +4 -0
- package/es/hooks/design-view/designer/useDesignCache.mjs +48 -0
- package/es/hooks/design-view/designer/useDesignHistory.d.ts +16 -0
- package/es/hooks/design-view/designer/useDesignHistory.mjs +110 -0
- package/es/hooks/design-view/designer/useDesignModal.d.ts +3150 -0
- package/es/hooks/design-view/designer/useDesignModal.mjs +109 -0
- package/es/hooks/design-view/designer/useDesignPreview.d.ts +11 -0
- package/es/hooks/design-view/designer/useDesignPreview.mjs +117 -0
- package/es/hooks/design-view/designer/useDesignSave.d.ts +12 -0
- package/es/hooks/design-view/designer/useDesignSave.mjs +225 -0
- package/es/hooks/design-view/{usePropEditor.d.ts → editor/usePropEditor.d.ts} +3 -3
- package/es/hooks/design-view/editor/usePropEditor.mjs +93 -0
- package/es/hooks/design-view/{useStyle.d.ts → editor/useStyle.d.ts} +2 -2
- package/es/hooks/design-view/editor/useStyle.mjs +39 -0
- package/es/hooks/design-view/editor/useStyleEditor.d.ts +30 -0
- package/es/hooks/design-view/editor/useStyleEditor.mjs +84 -0
- package/es/hooks/design-view/{useGlobal.d.ts → global/useGlobal.d.ts} +200 -108
- package/es/hooks/design-view/global/useGlobal.mjs +77 -0
- package/es/hooks/design-view/{useScope.d.ts → layout/useScope.d.ts} +3 -3
- package/es/hooks/design-view/layout/useScope.mjs +83 -0
- package/es/hooks/design-view/{useToolkit.d.ts → layout/useToolkit.d.ts} +63 -33
- package/es/hooks/design-view/layout/useToolkit.mjs +304 -0
- package/es/hooks/design-view/{usePage.d.ts → page/usePage.d.ts} +1 -3
- package/es/hooks/design-view/page/usePage.mjs +161 -0
- package/es/hooks/design-view/page/usePageOccupy.d.ts +33 -0
- package/es/hooks/design-view/page/usePageOccupy.mjs +98 -0
- package/es/hooks/design-view/useDesigner.d.ts +1651 -337
- package/es/hooks/design-view/useDesigner.mjs +123 -819
- package/es/hooks/design-view/utils/color.util.d.ts +21 -0
- package/es/hooks/design-view/utils/color.util.mjs +56 -0
- package/es/hooks/design-view/utils/field-schema.util.d.ts +55 -0
- package/es/hooks/design-view/utils/field-schema.util.mjs +93 -0
- package/es/hooks/design-view/widget/useSelectedWidget.d.ts +53 -0
- package/es/hooks/design-view/widget/useSelectedWidget.mjs +228 -0
- package/es/hooks/design-view/{useWidget.d.ts → widget/useWidget.d.ts} +12 -13
- package/es/hooks/design-view/widget/useWidget.mjs +97 -0
- package/es/hooks/design-view/widget/useWidgetQuery.d.ts +13 -0
- package/es/hooks/design-view/widget/useWidgetQuery.mjs +106 -0
- package/es/hooks/design-view/widget/useWidgetRegistry.d.ts +11 -0
- package/es/hooks/design-view/widget/useWidgetRegistry.mjs +89 -0
- package/es/hooks/designer.hooks.mjs +17 -11
- package/es/hooks/develop/useCacheHistory.mjs +129 -152
- package/es/hooks/develop/useKeyParser.mjs +76 -68
- package/es/hooks/index.d.ts +22 -11
- package/es/hooks/index.mjs +28 -0
- package/es/hooks/use-model-field/use-model-field.d.ts +32 -0
- package/es/hooks/use-model-field/use-model-field.mjs +269 -0
- package/es/hooks/widgets/useAsyncFields.d.ts +17 -0
- package/es/hooks/widgets/useAsyncFields.mjs +143 -0
- package/es/hooks/widgets/useFileAttrsHooks.d.ts +28 -0
- package/es/hooks/widgets/useFileAttrsHooks.mjs +37 -0
- package/es/index.d.ts +3 -8
- package/es/index.mjs +95 -52
- package/es/interface/actions/i-design-view.actions.d.ts +1 -1
- package/es/interface/controller/i-design-view.controller.d.ts +1 -1
- package/es/interface/design/i-model-field-node-data/i-model-field-node-data.d.ts +1 -1
- package/es/interface/design/index.d.ts +0 -8
- package/es/interface/designer/i-designer-provider.d.ts +2 -85
- package/es/interface/designer/i-designer-state.d.ts +14 -0
- package/es/interface/designer/index.d.ts +0 -2
- package/es/interface/i-drag-item/i-drag-item.d.ts +1 -1
- package/es/interface/index.d.ts +0 -2
- package/es/interface/state/i-design-view.state.d.ts +1 -1
- package/es/loader.d.ts +1 -0
- package/es/props/index.d.ts +1 -1
- package/es/props/index.mjs +55 -52
- package/es/register/designer-register/designer-register.d.ts +29 -0
- package/es/register/designer-register/designer-register.mjs +111 -66
- package/es/register/index.d.ts +0 -1
- package/es/register/index.mjs +2 -0
- package/es/register/material/material.register.mjs +131 -133
- package/es/schema/begin-drag/begin-drag.d.ts +13 -0
- package/es/schema/begin-drag/begin-drag.mjs +108 -0
- package/es/schema/common-config/autofill-editor-config.d.ts +5 -0
- package/es/schema/common-config/autofill-editor-config.mjs +34 -0
- package/es/schema/common-config/base-button-config.d.ts +3 -0
- package/es/schema/common-config/base-button-config.mjs +76 -0
- package/es/schema/common-config/button-editor-config.d.ts +4 -0
- package/es/schema/common-config/button-editor-config.mjs +134 -0
- package/es/schema/common-config/button-props-func.d.ts +5 -0
- package/es/schema/common-config/button-props-func.mjs +11 -0
- package/es/schema/common-config/column-editor-config.d.ts +6 -0
- package/es/schema/common-config/column-editor-config.mjs +28 -0
- package/es/schema/common-config/common-event-config.d.ts +6 -0
- package/es/schema/common-config/common-event-config.mjs +16 -0
- package/es/schema/common-config/common-field-editor-config.d.ts +49 -0
- package/es/schema/common-config/common-field-editor-config.mjs +292 -0
- package/es/schema/common-config/common-style.d.ts +3 -0
- package/es/schema/common-config/common-style.mjs +85 -0
- package/es/schema/common-config/display-editor-config.d.ts +3 -0
- package/es/schema/common-config/display-editor-config.mjs +70 -0
- package/es/schema/common-config/formItem-editor-config.d.ts +2 -0
- package/es/schema/common-config/formItem-editor-config.mjs +20 -0
- package/es/schema/common-config/permission-editor-config.d.ts +2 -0
- package/es/schema/common-config/permission-editor-config.mjs +13 -0
- package/es/schema/field/card-list-field.d.ts +4 -0
- package/es/schema/field/card-list-field.mjs +269 -0
- package/es/schema/field/data-table-column.d.ts +81 -0
- package/es/schema/field/data-table-column.mjs +269 -0
- package/es/schema/field/descriptions-field.d.ts +3 -0
- package/es/schema/field/index.d.ts +14 -0
- package/es/schema/field/index.mjs +65 -0
- package/es/schema/index.d.ts +18 -0
- package/es/schema/index.mjs +17 -0
- package/es/schema/modal/modal-body.d.ts +2 -0
- package/es/schema/modal/modal-body.mjs +9 -0
- package/es/schema/modal/modal-footer.d.ts +2 -0
- package/es/schema/modal/modal-footer.mjs +9 -0
- package/es/schema/modal/modal.d.ts +8 -0
- package/es/schema/modal/modal.mjs +173 -0
- package/es/schema/search/BaseDate.d.ts +143 -0
- package/es/schema/search/BaseDate.mjs +114 -0
- package/es/schema/search/BaseSearch.d.ts +141 -0
- package/es/schema/search/BaseSearch.mjs +155 -0
- package/es/schema/utils.d.ts +8 -0
- package/es/schema/utils.mjs +76 -0
- package/es/setup-app.d.ts +1 -0
- package/es/setup-app.mjs +11 -0
- package/es/utils/design-interceptors/design-interceptors.d.ts +8 -0
- package/es/utils/design-interceptors/design-interceptors.mjs +23 -0
- package/es/utils/design-plugin-pkg-util/design-plugin-pkg-util.d.ts +28 -0
- package/es/utils/design-plugin-pkg-util/design-plugin-pkg-util.mjs +57 -0
- package/es/utils/design-view/index.d.ts +9 -0
- package/es/utils/design-view/index.mjs +20 -0
- package/es/utils/field-attrs/basicAttrs.mjs +577 -721
- package/es/utils/field-attrs/index.mjs +10 -6
- package/es/utils/field-filter/index.d.ts +4 -0
- package/es/utils/field-filter/index.mjs +68 -0
- package/es/utils/find-deep-types/find-deep-types.mjs +34 -24
- package/es/utils/flatten.d.ts +12 -0
- package/es/utils/flatten.mjs +32 -0
- package/es/utils/formula-editor-design/formula-editor-design.d.ts +9 -0
- package/es/utils/formula-editor-design/formula-editor-design.mjs +31 -0
- package/es/utils/index.d.ts +10 -4
- package/es/utils/index.mjs +13 -0
- package/es/utils/init-widget-info/init-widget-info.d.ts +16 -0
- package/es/utils/init-widget-info/init-widget-info.mjs +53 -0
- package/es/utils/schema/index.d.ts +10 -0
- package/es/utils/schema/index.mjs +18 -0
- package/es/utils/transform-js/index.d.ts +1 -0
- package/es/utils/transform-js/index.mjs +1 -0
- package/es/utils/transform-js/transform-js.d.ts +14 -0
- package/es/utils/transform-js/transform-js.mjs +76 -0
- package/package.json +27 -18
- package/dist/index.esm.min.mjs +0 -25068
- package/dist/index.min.cjs +0 -70
- package/dist/index.system.min.js +0 -70
- package/es/components/design/design-content/design-content.css +0 -76
- package/es/components/design/design-content/design-content.d.ts +0 -191
- package/es/components/design/design-content/design-content.mjs +0 -361
- package/es/components/design/design-drag-item/design-drag-item.css +0 -179
- package/es/components/design/design-drag-item/design-drag-item.d.ts +0 -55
- package/es/components/design/design-drag-item/design-drag-item.mjs +0 -293
- package/es/components/design/design-drop-container/design-drop-container.css +0 -103
- package/es/components/design/design-drop-container/design-drop-container.d.ts +0 -87
- package/es/components/design/design-drop-container/design-drop-container.mjs +0 -217
- package/es/components/design/design-drop-line/design-drop-line.css +0 -165
- package/es/components/design/design-drop-line/design-drop-line.d.ts +0 -72
- package/es/components/design/design-drop-line/design-drop-line.mjs +0 -174
- package/es/components/design/design-item-actions/design-item-actions.css +0 -97
- package/es/components/design/design-item-actions/design-item-actions.d.ts +0 -42
- package/es/components/design/design-item-actions/design-item-actions.mjs +0 -195
- package/es/components/design/design-item-highlighter/design-item-highlighter.css +0 -70
- package/es/components/design/design-item-highlighter/design-item-highlighter.d.ts +0 -168
- package/es/components/design/design-item-highlighter/design-item-highlighter.mjs +0 -164
- package/es/components/design/design-item-highlighter-container/design-item-highlighter-container.css +0 -85
- package/es/components/design/design-item-highlighter-container/design-item-highlighter-container.d.ts +0 -53
- package/es/components/design/design-item-highlighter-container/design-item-highlighter-container.mjs +0 -223
- package/es/components/design/design-item-hover-title/design-item-hover-title.css +0 -12
- package/es/components/design/design-item-hover-title/design-item-hover-title.d.ts +0 -60
- package/es/components/design/design-item-hover-title/design-item-hover-title.mjs +0 -74
- package/es/components/design/design-item-preview/design-item-preview.css +0 -91
- package/es/components/design/design-item-preview/design-item-preview.d.ts +0 -1
- package/es/components/design/design-item-preview/design-item-preview.mjs +0 -50
- package/es/components/design/design-not-drag-item/design-not-drag-item.css +0 -67
- package/es/components/design/design-not-drag-item/design-not-drag-item.d.ts +0 -49
- package/es/components/design/design-not-drag-item/design-not-drag-item.mjs +0 -85
- package/es/components/design/design-not-found/design-not-found.css +0 -68
- package/es/components/design/design-not-found/design-not-found.d.ts +0 -14
- package/es/components/design/design-not-found/design-not-found.mjs +0 -26
- package/es/components/design/index.d.ts +0 -6
- package/es/components/design/index.mjs +0 -22
- package/es/components/design-view-layout/design-view-layout.module.scss.mjs +0 -27
- package/es/components/editor/style/border-editor/border-box.vue2.mjs +0 -305
- package/es/components/editor/style/border-editor/border-editor.vue2.mjs +0 -60
- package/es/components/editor/style/border-editor/border-radius.vue2.mjs +0 -212
- package/es/components/editor/style/font-editor/align-group.vue2.mjs +0 -66
- package/es/components/editor/style/font-editor/font-editor.vue2.mjs +0 -5
- package/es/components/editor/style/font-editor/font-style-group.vue2.mjs +0 -105
- package/es/components/editor/style/position-editor/position-editor.vue2.mjs +0 -242
- package/es/components/editor/style/spacing-editor/spacing-editor.vue2.mjs +0 -311
- package/es/components/icon/downleft-icon.vue2.mjs +0 -11
- package/es/components/icon/downright-icon.vue2.mjs +0 -11
- package/es/components/icon/upleft-icon.vue2.mjs +0 -11
- package/es/components/icon/upright-icon.vue2.mjs +0 -11
- package/es/components/material/index.d.ts +0 -5
- package/es/components/material/index.mjs +0 -9
- package/es/components/material/material-content/material-content.css +0 -86
- package/es/components/material/material-content/material-content.d.ts +0 -179
- package/es/components/material/material-content/material-content.mjs +0 -59
- package/es/components/material/material-module/material-module.css +0 -104
- package/es/components/material/material-module/material-module.d.ts +0 -68
- package/es/components/material/material-module/material-module.mjs +0 -108
- package/es/components/material/material-module-drag-container/material-module-drag-container.css +0 -69
- package/es/components/material/material-module-drag-container/material-module-drag-container.d.ts +0 -58
- package/es/components/material/material-module-drag-container/material-module-drag-container.mjs +0 -32
- package/es/components/material/material-module-drag-item/material-module-drag-item.css +0 -83
- package/es/components/material/material-module-drag-item/material-module-drag-item.d.ts +0 -17
- package/es/components/material/material-module-drag-item/material-module-drag-item.mjs +0 -101
- package/es/components/material/material-outline-tree/material-outline-tree.css +0 -81
- package/es/components/material/material-outline-tree/material-outline-tree.d.ts +0 -1
- package/es/components/material/material-outline-tree/material-outline-tree.mjs +0 -87
- package/es/components/material/material-tab-pane/material-tab-pane.css +0 -68
- package/es/components/material/material-tab-pane/material-tab-pane.d.ts +0 -13
- package/es/components/material/material-tab-pane/material-tab-pane.mjs +0 -26
- package/es/components/material/material-tabs/material-tabs.css +0 -105
- package/es/components/material/material-tabs/material-tabs.d.ts +0 -99
- package/es/components/material/material-tabs/material-tabs.mjs +0 -69
- package/es/components/panel/index.d.ts +0 -5
- package/es/components/panel/index.mjs +0 -9
- package/es/components/panel/panel-content/panel-content.css +0 -183
- package/es/components/panel/panel-content/panel-content.d.ts +0 -19
- package/es/components/panel/panel-content/panel-content.mjs +0 -71
- package/es/components/panel/panel-form/panel-form.css +0 -67
- package/es/components/panel/panel-form/panel-form.d.ts +0 -62
- package/es/components/panel/panel-form/panel-form.mjs +0 -73
- package/es/components/panel/panel-path/panel-path.css +0 -89
- package/es/components/panel/panel-path/panel-path.d.ts +0 -35
- package/es/components/panel/panel-path/panel-path.mjs +0 -72
- package/es/controller/index.d.ts +0 -1
- package/es/controller/view/design-view.controller.d.ts +0 -47
- package/es/controller/view/design-view.controller.mjs +0 -184
- package/es/dictionary/tab-type/tab-type.mjs +0 -24
- package/es/editor/child-list-editor/child-list-editor.css +0 -76
- package/es/editor/child-list-editor/child-list-editor.d.ts +0 -163
- package/es/editor/child-list-editor/child-list-editor.mjs +0 -143
- package/es/editor/child-list-editor/child-list-editor.provider.d.ts +0 -13
- package/es/editor/child-list-editor/child-list-editor.provider.mjs +0 -5
- package/es/editor/child-list-editor/components/child-list-item-editor.css +0 -112
- package/es/editor/child-list-editor/components/child-list-item-editor.d.ts +0 -133
- package/es/editor/child-list-editor/components/child-list-item-editor.mjs +0 -238
- package/es/editor/child-list-editor/index.d.ts +0 -4
- package/es/editor/child-list-editor/index.mjs +0 -13
- package/es/editor/content-tag-style/content-tag-style.css +0 -164
- package/es/editor/content-tag-style/content-tag-style.d.ts +0 -112
- package/es/editor/content-tag-style/content-tag-style.mjs +0 -103
- package/es/editor/content-tag-style/index.d.ts +0 -8
- package/es/editor/content-tag-style/index.mjs +0 -15
- package/es/editor/custom-exp-menu-editor/components/custom-exp-menu-item.css +0 -156
- package/es/editor/custom-exp-menu-editor/components/custom-exp-menu-item.d.ts +0 -29
- package/es/editor/custom-exp-menu-editor/components/custom-exp-menu-item.mjs +0 -134
- package/es/editor/custom-exp-menu-editor/custom-exp-menu-editor.css +0 -76
- package/es/editor/custom-exp-menu-editor/custom-exp-menu-editor.d.ts +0 -38
- package/es/editor/custom-exp-menu-editor/custom-exp-menu-editor.mjs +0 -163
- package/es/editor/custom-exp-menu-editor/custom-exp-menu-editor.provider.d.ts +0 -13
- package/es/editor/custom-exp-menu-editor/custom-exp-menu-editor.provider.mjs +0 -5
- package/es/editor/custom-exp-menu-editor/i-custom-exp-menu-model.d.ts +0 -23
- package/es/editor/custom-exp-menu-editor/index.d.ts +0 -5
- package/es/editor/custom-exp-menu-editor/index.mjs +0 -13
- package/es/editor/custom-exp-menu-editor/modal/exp-menu.modal.d.ts +0 -37
- package/es/editor/field-info-editor/field-info-editor.css +0 -125
- package/es/editor/field-info-editor/field-info-editor.d.ts +0 -111
- package/es/editor/field-info-editor/field-info-editor.mjs +0 -60
- package/es/editor/field-info-editor/index.d.ts +0 -8
- package/es/editor/field-info-editor/index.mjs +0 -13
- package/es/editor/index.d.ts +0 -5
- package/es/editor/index.mjs +0 -27
- package/es/editor/model-field-select/index.d.ts +0 -8
- package/es/editor/model-field-select/index.mjs +0 -13
- package/es/editor/model-field-select/model-field-select.css +0 -141
- package/es/editor/model-field-select/model-field-select.d.ts +0 -42
- package/es/editor/model-field-select/model-field-select.mjs +0 -312
- package/es/editor/style-border/index.d.ts +0 -8
- package/es/editor/style-border/index.mjs +0 -15
- package/es/editor/style-border/style-border.d.ts +0 -38
- package/es/editor/style-border/style-border.mjs +0 -45
- package/es/editor/style-font/index.d.ts +0 -8
- package/es/editor/style-font/index.mjs +0 -15
- package/es/editor/style-font/style-font.css +0 -86
- package/es/editor/style-font/style-font.d.ts +0 -38
- package/es/editor/style-font/style-font.mjs +0 -45
- package/es/editor/style-position/index.d.ts +0 -8
- package/es/editor/style-position/index.mjs +0 -15
- package/es/editor/style-position/style-position.d.ts +0 -38
- package/es/editor/style-position/style-position.mjs +0 -44
- package/es/editor/style-spacing/index.d.ts +0 -8
- package/es/editor/style-spacing/index.mjs +0 -15
- package/es/editor/style-spacing/style-spacing.d.ts +0 -40
- package/es/editor/style-spacing/style-spacing.mjs +0 -69
- package/es/editor/system-page-select/i-system-page-select.d.ts +0 -23
- package/es/editor/system-page-select/index.d.ts +0 -9
- package/es/editor/system-page-select/index.mjs +0 -15
- package/es/editor/system-page-select/system-page-select.css +0 -119
- package/es/editor/system-page-select/system-page-select.d.ts +0 -38
- package/es/editor/system-page-select/system-page-select.mjs +0 -82
- package/es/hooks/design-view/getFieldSchema.d.ts +0 -26
- package/es/hooks/design-view/getFieldSchema.mjs +0 -78
- package/es/hooks/design-view/useGlobal.mjs +0 -74
- package/es/hooks/design-view/usePage.mjs +0 -171
- package/es/hooks/design-view/usePageOccupy.d.ts +0 -13
- package/es/hooks/design-view/usePageOccupy.mjs +0 -69
- package/es/hooks/design-view/usePropEditor.mjs +0 -99
- package/es/hooks/design-view/useScope.mjs +0 -92
- package/es/hooks/design-view/useSelectedWidget.d.ts +0 -53
- package/es/hooks/design-view/useSelectedWidget.mjs +0 -249
- package/es/hooks/design-view/useStyle.mjs +0 -30
- package/es/hooks/design-view/useStyleEditor.d.ts +0 -27
- package/es/hooks/design-view/useToolkit.mjs +0 -299
- package/es/hooks/design-view/useWidget.mjs +0 -124
- package/es/hooks/use-design-view-controller/use-design-view-controller.d.ts +0 -11
- package/es/hooks/use-design-view-controller/use-design-view-controller.mjs +0 -26
- package/es/hooks/web/useUUid.d.ts +0 -41
- package/es/hooks/web/useUUid.mjs +0 -93
- package/es/interface/design/i-design-container-node.d.ts +0 -13
- package/es/interface/design/i-design-data.d.ts +0 -44
- package/es/interface/design/i-design-editor-data.d.ts +0 -20
- package/es/interface/design/i-design-editor-node.d.ts +0 -15
- package/es/interface/design/i-design-node-data.d.ts +0 -19
- package/es/interface/design/i-design-node.d.ts +0 -80
- package/es/interface/design/i-design-page-node-data.d.ts +0 -15
- package/es/interface/design/i-design-tree-item.d.ts +0 -26
- package/es/interface/designer/i-designer-dnd-item-hooks.d.ts +0 -21
- package/es/interface/designer/i-designer-schema-exports.d.ts +0 -13
- package/es/interface/editor/child-list-editor/child-list-editor.d.ts +0 -114
- package/es/interface/editor/index.d.ts +0 -9
- package/es/interface/editor/style-border/i-style-border.controller.d.ts +0 -11
- package/es/interface/editor/style-border/i-style-border.d.ts +0 -22
- package/es/interface/editor/style-font/i-style-font.controller.d.ts +0 -11
- package/es/interface/editor/style-font/i-style-font.d.ts +0 -13
- package/es/interface/editor/style-position/i-style-position.controller.d.ts +0 -11
- package/es/interface/editor/style-position/i-style-position.d.ts +0 -13
- package/es/interface/editor/style-spacing/i-style-spacing.controller.d.ts +0 -11
- package/es/interface/editor/style-spacing/i-style-spacing.d.ts +0 -22
- package/es/interface/provider/i-node-provider.d.ts +0 -142
- package/es/plugins/design-custom-exp-menu/components/design-custom-exp-menu-component.css +0 -87
- package/es/plugins/design-custom-exp-menu/components/design-custom-exp-menu.component.d.ts +0 -9
- package/es/plugins/design-custom-exp-menu/components/design-custom-exp-menu.component.mjs +0 -106
- package/es/plugins/design-custom-exp-menu/design-custom-exp-menu.data.d.ts +0 -51
- package/es/plugins/design-custom-exp-menu/design-custom-exp-menu.data.mjs +0 -89
- package/es/plugins/design-custom-exp-menu/design-custom-exp-menu.provider.d.ts +0 -23
- package/es/plugins/design-custom-exp-menu/design-custom-exp-menu.provider.mjs +0 -159
- package/es/plugins/design-editor/index.d.ts +0 -5
- package/es/plugins/design-editor/index.mjs +0 -13
- package/es/plugins/design-editor/upload-file/index.d.ts +0 -4
- package/es/plugins/design-editor/upload-file/index.mjs +0 -12
- package/es/plugins/design-editor/upload-file/upload-file.css +0 -124
- package/es/plugins/design-editor/upload-file/upload-file.d.ts +0 -46
- package/es/plugins/design-editor/upload-file/upload-file.mjs +0 -51
- package/es/plugins/design-editor/upload-image/index.d.ts +0 -4
- package/es/plugins/design-editor/upload-image/index.mjs +0 -12
- package/es/plugins/design-editor/upload-image/upload-image.css +0 -79
- package/es/plugins/design-editor/upload-image/upload-image.d.ts +0 -46
- package/es/plugins/design-editor/upload-image/upload-image.mjs +0 -23
- package/es/plugins/design-editor/user-signature/index.d.ts +0 -4
- package/es/plugins/design-editor/user-signature/index.mjs +0 -12
- package/es/plugins/design-editor/user-signature/user-signature.css +0 -79
- package/es/plugins/design-editor/user-signature/user-signature.d.ts +0 -46
- package/es/plugins/design-editor/user-signature/user-signature.mjs +0 -23
- package/es/plugins/design-grid/components/design-grid.component.css +0 -68
- package/es/plugins/design-grid/components/design-grid.component.d.ts +0 -39
- package/es/plugins/design-grid/components/design-grid.component.mjs +0 -57
- package/es/plugins/design-grid/design-grid.data.d.ts +0 -34
- package/es/plugins/design-grid/design-grid.data.mjs +0 -17
- package/es/plugins/design-grid/design-grid.provider.d.ts +0 -26
- package/es/plugins/design-grid/design-grid.provider.mjs +0 -240
- package/es/plugins/design-grid-item/components/design-grid-item.component.d.ts +0 -38
- package/es/plugins/design-grid-item/components/design-grid-item.component.mjs +0 -36
- package/es/plugins/design-grid-item/design-grid-item.data.d.ts +0 -26
- package/es/plugins/design-grid-item/design-grid-item.data.mjs +0 -17
- package/es/plugins/design-grid-item/design-grid-item.provider.d.ts +0 -25
- package/es/plugins/design-grid-item/design-grid-item.provider.mjs +0 -172
- package/es/plugins/design-menu-list/components/design-menu-list.component.css +0 -131
- package/es/plugins/design-menu-list/components/design-menu-list.component.d.ts +0 -18
- package/es/plugins/design-menu-list/components/design-menu-list.component.mjs +0 -110
- package/es/plugins/design-menu-list/design-menu-list.data.d.ts +0 -62
- package/es/plugins/design-menu-list/design-menu-list.data.mjs +0 -21
- package/es/plugins/design-menu-list/design-menu-list.provider.d.ts +0 -23
- package/es/plugins/design-menu-list/design-menu-list.provider.mjs +0 -265
- package/es/plugins/design-page/design-page.data.d.ts +0 -15
- package/es/plugins/design-page/design-page.data.mjs +0 -17
- package/es/plugins/design-page/design-page.provider.d.ts +0 -23
- package/es/plugins/design-page/design-page.provider.mjs +0 -109
- package/es/plugins/design-panel/components/design-panel-component.css +0 -108
- package/es/plugins/design-panel/components/design-panel.component.d.ts +0 -39
- package/es/plugins/design-panel/components/design-panel.component.mjs +0 -49
- package/es/plugins/design-panel/design-panel.data.d.ts +0 -64
- package/es/plugins/design-panel/design-panel.data.mjs +0 -27
- package/es/plugins/design-panel/design-panel.provider.d.ts +0 -23
- package/es/plugins/design-panel/design-panel.provider.mjs +0 -298
- package/es/plugins/design-personal-center/components/design-personal-center.component.css +0 -48
- package/es/plugins/design-personal-center/components/design-personal-center.component.vue.d.ts +0 -36
- package/es/plugins/design-personal-center/components/design-personal-center.component.vue.mjs +0 -7
- package/es/plugins/design-personal-center/components/design-personal-center.component.vue2.mjs +0 -97
- package/es/plugins/design-personal-center/design-personal-center.data.d.ts +0 -27
- package/es/plugins/design-personal-center/design-personal-center.data.mjs +0 -21
- package/es/plugins/design-personal-center/design-personal-center.provider.d.ts +0 -13
- package/es/plugins/design-personal-center/design-personal-center.provider.mjs +0 -144
- package/es/plugins/design-select-component/components/design-select-component.component.css +0 -107
- package/es/plugins/design-select-component/components/design-select-component.component.d.ts +0 -41
- package/es/plugins/design-select-component/components/design-select-component.component.mjs +0 -57
- package/es/plugins/design-select-component/design-select-component.data.d.ts +0 -57
- package/es/plugins/design-select-component/design-select-component.data.mjs +0 -18
- package/es/plugins/design-select-component/design-select-component.provider.d.ts +0 -23
- package/es/plugins/design-select-component/design-select-component.provider.mjs +0 -207
- package/es/plugins/design-tab-item/components/design-tab-item.component.d.ts +0 -38
- package/es/plugins/design-tab-item/components/design-tab-item.component.mjs +0 -36
- package/es/plugins/design-tab-item/design-tab-item.data.d.ts +0 -35
- package/es/plugins/design-tab-item/design-tab-item.data.mjs +0 -22
- package/es/plugins/design-tab-item/design-tab-item.provider.d.ts +0 -25
- package/es/plugins/design-tab-item/design-tab-item.provider.mjs +0 -185
- package/es/plugins/design-tabs/components/design-tabs.component.css +0 -105
- package/es/plugins/design-tabs/components/design-tabs.component.d.ts +0 -40
- package/es/plugins/design-tabs/components/design-tabs.component.mjs +0 -82
- package/es/plugins/design-tabs/design-tabs.data.d.ts +0 -66
- package/es/plugins/design-tabs/design-tabs.data.mjs +0 -19
- package/es/plugins/design-tabs/design-tabs.provider.d.ts +0 -26
- package/es/plugins/design-tabs/design-tabs.provider.mjs +0 -261
- package/es/plugins/index.d.ts +0 -5
- package/es/plugins/index.mjs +0 -116
- package/es/plugins/install-material.d.ts +0 -8
- package/es/plugins/install-material.mjs +0 -55
- package/es/provider/design-editor-node/design-editor-node.provider.d.ts +0 -40
- package/es/provider/design-editor-node/design-editor-node.provider.mjs +0 -44
- package/es/provider/index.d.ts +0 -2
- package/es/provider/node-base/node-base.provider.d.ts +0 -25
- package/es/provider/node-base/node-base.provider.mjs +0 -26
- package/es/register/node/node.register.d.ts +0 -113
- package/es/register/node/node.register.mjs +0 -134
- package/es/store/index.d.ts +0 -1
- package/es/store/view/design-view.store.d.ts +0 -5
- package/es/store/view/design-view.store.mjs +0 -412
- package/es/utils/can-drop/can-drop.d.ts +0 -12
- package/es/utils/can-drop/can-drop.mjs +0 -56
- package/es/utils/design-install/design-install.d.ts +0 -16
- package/es/utils/design-install/design-install.mjs +0 -22
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +0 -97
- package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +0 -266
- package/es/views/design-view.css +0 -218
- package/es/views/design-view.d.ts +0 -87
- package/es/views/design-view.mjs +0 -343
- package/es/views/index.d.ts +0 -1
- /package/es/components/editor/style/border-editor/{border-box.css → border-box.vue_vue_type_style_index_0_scoped_a5616984_lang.css} +0 -0
- /package/es/components/editor/style/border-editor/{border-editor.css → border-editor.vue_vue_type_style_index_0_scoped_f973ba6b_lang.css} +0 -0
- /package/es/components/editor/style/border-editor/{border-radius.css → border-radius.vue_vue_type_style_index_0_scoped_1cb5bbdc_lang.css} +0 -0
- /package/es/components/editor/style/font-editor/{align-group.css → align-group.vue_vue_type_style_index_0_scoped_afcacb4b_lang.css} +0 -0
- /package/es/components/editor/style/font-editor/{font-style-group.css → font-style-group.vue_vue_type_style_index_0_scoped_7df87cdb_lang.css} +0 -0
- /package/es/components/editor/style/position-editor/{position-editor.css → position-editor.vue_vue_type_style_index_0_scoped_cc7cb9d8_lang.css} +0 -0
- /package/es/components/editor/style/spacing-editor/{spacing-editor.css → spacing-editor.vue_vue_type_style_index_0_scoped_18c72ccf_lang.css} +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { widget } from "../../../schema/modal/modal.mjs";
|
|
2
|
+
import "../../../schema/index.mjs";
|
|
3
|
+
import { modalDesignId, modalDesignState, modalInfo, pageJson, subTableModalId, subTableModalState, wfNodesModalId, wfNodesModalState, workflowModalId, workflowModalState } from "../design-state.mjs";
|
|
4
|
+
import { useScope } from "../layout/useScope.mjs";
|
|
5
|
+
import { useGlobal } from "../global/useGlobal.mjs";
|
|
6
|
+
import { cloneDeep } from "lodash-es";
|
|
7
|
+
import { BuiltinType, TreeHelper } from "@gct-paas/core";
|
|
8
|
+
import { computed } from "vue";
|
|
9
|
+
//#region src/hooks/design-view/designer/useDesignModal.ts
|
|
10
|
+
/**
|
|
11
|
+
* 弹框管理 Hook
|
|
12
|
+
*
|
|
13
|
+
* 管理设计器中所有弹框相关的状态和操作,包括普通弹框、子表弹框、
|
|
14
|
+
* 工作流节点弹框、节点配置弹框的显示/隐藏、信息获取等。
|
|
15
|
+
*/
|
|
16
|
+
function useDesignModal() {
|
|
17
|
+
const { queryInfo } = useGlobal();
|
|
18
|
+
const { scopeData } = useScope();
|
|
19
|
+
/**
|
|
20
|
+
* 打开/关闭模态框设计模式
|
|
21
|
+
*
|
|
22
|
+
* @param {boolean} flag 打开模态框设置模式
|
|
23
|
+
* @param {string} modalId 编辑时的modalId
|
|
24
|
+
* @param {boolean} isGlobal 是否是全局模态框
|
|
25
|
+
*/
|
|
26
|
+
async function setModalDesignState(flag, modalId = "", isGlobal = false) {
|
|
27
|
+
if (flag) await getModalInfo(modalId, isGlobal);
|
|
28
|
+
else modalInfo.value = cloneDeep(widget);
|
|
29
|
+
modalDesignState.value = flag;
|
|
30
|
+
modalDesignId.value = modalId;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 获取modal
|
|
34
|
+
*
|
|
35
|
+
* @param {string} modelId 编辑时传参,如果新建则没有则会返回新的一个modal,保存时在pageJSON里插入一个新的modal
|
|
36
|
+
* @param {boolean} isGlobal 是否是全局模态框
|
|
37
|
+
*/
|
|
38
|
+
async function getModalInfo(modelId, isGlobal = false) {
|
|
39
|
+
if (isGlobal) {
|
|
40
|
+
const data = await queryInfo(modelId);
|
|
41
|
+
if (data && data.length > 0) modalInfo.value = JSON.parse(data[0].configJson);
|
|
42
|
+
} else modalInfo.value = pageJson.modals.find((d) => d.id === modelId);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 设置子表弹框设计状态
|
|
46
|
+
*
|
|
47
|
+
* @param {boolean} flag 开关标识
|
|
48
|
+
* @param {string} needId 子表ID
|
|
49
|
+
*/
|
|
50
|
+
function setSubTableModalDesignState(flag, needId = "") {
|
|
51
|
+
subTableModalState.value = flag;
|
|
52
|
+
subTableModalId.value = needId;
|
|
53
|
+
}
|
|
54
|
+
function setWfNodesModalDesignState(flag, needId = "") {
|
|
55
|
+
wfNodesModalState.value = flag;
|
|
56
|
+
wfNodesModalId.value = needId;
|
|
57
|
+
}
|
|
58
|
+
function setWorkflowNodesModalDesignState(flag, needId = "") {
|
|
59
|
+
workflowModalId.value = needId;
|
|
60
|
+
workflowModalState.value = flag;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 设置弹框信息
|
|
64
|
+
*
|
|
65
|
+
* @param {LowCodeModal.Modal} modal 弹框数据
|
|
66
|
+
*/
|
|
67
|
+
function setModalInfo(modal) {
|
|
68
|
+
modalInfo.value = modal;
|
|
69
|
+
}
|
|
70
|
+
/** 弹框主体区域 */
|
|
71
|
+
const modalBody = computed(() => {
|
|
72
|
+
return modalInfo.value.children.find((d) => d?.type === BuiltinType.MODAL_BODY);
|
|
73
|
+
});
|
|
74
|
+
/** 弹框底部区域 */
|
|
75
|
+
const modalFooter = computed(() => {
|
|
76
|
+
return modalInfo.value.children.find((d) => d?.type === BuiltinType.MODAL_FOOTER);
|
|
77
|
+
});
|
|
78
|
+
/** 弹框底部按钮容器 */
|
|
79
|
+
const modalBottomBtn = computed(() => {
|
|
80
|
+
return modalInfo.value.children.find((d) => d?.type === BuiltinType.BottomButtonContainer);
|
|
81
|
+
});
|
|
82
|
+
/** 根据 subTableModalId 获取子表信息 */
|
|
83
|
+
const subTableInfo = computed(() => {
|
|
84
|
+
return TreeHelper.findNode(scopeData.value, (widget) => {
|
|
85
|
+
return widget.id === subTableModalId.value;
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
return {
|
|
89
|
+
modalInfo,
|
|
90
|
+
modalDesignState,
|
|
91
|
+
modalDesignId,
|
|
92
|
+
modalBody,
|
|
93
|
+
modalFooter,
|
|
94
|
+
modalBottomBtn,
|
|
95
|
+
isGlobalModal: computed(() => {
|
|
96
|
+
return /^i?g_modal_/.test(modalInfo.value.id);
|
|
97
|
+
}),
|
|
98
|
+
subTableInfo,
|
|
99
|
+
setModalDesignState,
|
|
100
|
+
setModalInfo,
|
|
101
|
+
setSubTableModalDesignState,
|
|
102
|
+
setWfNodesModalDesignState,
|
|
103
|
+
setWorkflowNodesModalDesignState,
|
|
104
|
+
subTableModalState,
|
|
105
|
+
subTableModalId
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
export { useDesignModal };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Platform } from '@gct-paas/core';
|
|
2
|
+
export declare function useDesignPreview(): {
|
|
3
|
+
preview: import('@vueuse/core').UseDebounceFnReturn<() => void>;
|
|
4
|
+
previewSandbox: import('@vueuse/core').UseDebounceFnReturn<() => void>;
|
|
5
|
+
sandboxList: import('vue').Ref<any, any>;
|
|
6
|
+
getDataList: () => Promise<void>;
|
|
7
|
+
historyPreview: (hid: string) => {
|
|
8
|
+
url: string;
|
|
9
|
+
platform: Platform;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { platform } from "../../../utils/design-view/index.mjs";
|
|
2
|
+
import "../design-state.mjs";
|
|
3
|
+
import { Platform, openWindow, stringifyMatrixParams } from "@gct-paas/core";
|
|
4
|
+
import { ref } from "vue";
|
|
5
|
+
import { useDebounceFn } from "@vueuse/core";
|
|
6
|
+
//#region src/hooks/design-view/designer/useDesignPreview.ts
|
|
7
|
+
/**
|
|
8
|
+
* 预览功能 Hook
|
|
9
|
+
*
|
|
10
|
+
* 管理设计器的页面预览、沙箱预览、历史预览等预览相关功能。
|
|
11
|
+
*/
|
|
12
|
+
function useDesignPreview() {
|
|
13
|
+
/**
|
|
14
|
+
* 构建预览 URL
|
|
15
|
+
* 组合基础 URL、矩阵参数和时间戳
|
|
16
|
+
*
|
|
17
|
+
* @param {string} baseUrl 基础 URL(如 /web-render/)
|
|
18
|
+
* @param {Record<string, unknown>} matrixParams 矩阵参数对象
|
|
19
|
+
* @returns {string} 完整的预览 URL
|
|
20
|
+
*/
|
|
21
|
+
function buildPreviewUrl(baseUrl, matrixParams) {
|
|
22
|
+
const matrixParamStr = stringifyMatrixParams(matrixParams);
|
|
23
|
+
const timestamp = `?_t=${Date.now()}`;
|
|
24
|
+
return `${location.origin}${baseUrl}${matrixParamStr}${timestamp}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 基础预览方法,根据平台类型打开对应预览窗口
|
|
28
|
+
*
|
|
29
|
+
* @param {IObject} params 预览参数
|
|
30
|
+
*/
|
|
31
|
+
function basicPreview({ pid, webUrl, mobileUrl, padUrl }) {
|
|
32
|
+
const matrixParams = {
|
|
33
|
+
aid: _gct.store.context.aid,
|
|
34
|
+
pid,
|
|
35
|
+
bid: _gct.store.context.bid
|
|
36
|
+
};
|
|
37
|
+
if (platform.value === Platform.MOBILE) openWindow(buildPreviewUrl(mobileUrl, matrixParams), {
|
|
38
|
+
noopener: false,
|
|
39
|
+
noreferrer: false,
|
|
40
|
+
target: "_blank",
|
|
41
|
+
optionStr: `width=414,height=896,top=200,left=${(window.screen.availWidth - 360) / 2}`
|
|
42
|
+
})?.resizeTo(414, 896);
|
|
43
|
+
else if (platform.value === Platform.PAD) openWindow(buildPreviewUrl(padUrl, matrixParams), { target: "_blank" });
|
|
44
|
+
else openWindow(buildPreviewUrl(webUrl, matrixParams), { target: "_blank" });
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 预览(防抖)
|
|
48
|
+
* 使用 @vueuse/core 的 useDebounceFn:连续点击只在最后一次点击 400ms 后执行
|
|
49
|
+
* 若需要"首次立即 + 间隔限制"语义可改用 useThrottleFn。
|
|
50
|
+
*/
|
|
51
|
+
const _doPreview = () => {
|
|
52
|
+
basicPreview({
|
|
53
|
+
pid: _gct.store.context.pid,
|
|
54
|
+
webUrl: "/web-render/",
|
|
55
|
+
mobileUrl: "/mobile-render/",
|
|
56
|
+
padUrl: "/pad-render/"
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const preview = useDebounceFn(_doPreview, 400);
|
|
60
|
+
/** 是否存在沙箱环境 */
|
|
61
|
+
const sandboxList = ref();
|
|
62
|
+
/** 获取沙箱环境列表 */
|
|
63
|
+
const getDataList = async () => {
|
|
64
|
+
const data = await _api.apaas.sandboxConfig.getList();
|
|
65
|
+
if (!data.length) return;
|
|
66
|
+
if (data && data.length && data[0].status !== "INIT") sandboxList.value = data.map((i) => {
|
|
67
|
+
return {
|
|
68
|
+
...i,
|
|
69
|
+
web: i.webRoutePath,
|
|
70
|
+
mobile: i.pdaRoutePath,
|
|
71
|
+
pad: i.padRoutePath
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* 预览沙箱环境数据(防抖)
|
|
77
|
+
*/
|
|
78
|
+
const _doPreviewSandbox = () => {
|
|
79
|
+
basicPreview({
|
|
80
|
+
pid: _gct.store.context.pid,
|
|
81
|
+
webUrl: "/web-sandbox/",
|
|
82
|
+
mobileUrl: "/mobile-sandbox/",
|
|
83
|
+
padUrl: "/pad-sandbox/"
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const previewSandbox = useDebounceFn(_doPreviewSandbox, 400);
|
|
87
|
+
/**
|
|
88
|
+
* 历史预览,根据平台返回预览 URL 和平台信息
|
|
89
|
+
*
|
|
90
|
+
* @param {string} hid 历史记录ID
|
|
91
|
+
* @returns {{ url: string; platform: Platform }} 预览URL和平台类型
|
|
92
|
+
*/
|
|
93
|
+
function historyPreview(hid) {
|
|
94
|
+
const matrixParams = {
|
|
95
|
+
aid: _gct.store.context.aid,
|
|
96
|
+
pid: hid,
|
|
97
|
+
bid: _gct.store.context.bid
|
|
98
|
+
};
|
|
99
|
+
let url;
|
|
100
|
+
if (platform.value === Platform.MOBILE) url = buildPreviewUrl("/mobile-render/", matrixParams);
|
|
101
|
+
else if (platform.value === Platform.PAD) url = buildPreviewUrl("/pad-render/", matrixParams);
|
|
102
|
+
else url = buildPreviewUrl("/web-render/", matrixParams);
|
|
103
|
+
return {
|
|
104
|
+
url,
|
|
105
|
+
platform: platform.value
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
preview,
|
|
110
|
+
previewSandbox,
|
|
111
|
+
sandboxList,
|
|
112
|
+
getDataList,
|
|
113
|
+
historyPreview
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { useDesignPreview };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PageJson, RuntimePageJson } from '@gct-paas/schema';
|
|
2
|
+
export declare function useDesignSave(): {
|
|
3
|
+
save: (flag?: boolean, showSuccess?: boolean) => Promise<boolean>;
|
|
4
|
+
validateWidgets: (widgets: IData[], parents?: IData[]) => boolean;
|
|
5
|
+
savePageJsonSnapshot: (json?: PageJson) => void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* 递归遍历 tree 并组装运行时 JSON
|
|
9
|
+
*
|
|
10
|
+
* @returns {Promise<RuntimePageJson>} 运行时页面JSON
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildRuntimeJson(): Promise<RuntimePageJson>;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { platform } from "../../../utils/design-view/index.mjs";
|
|
2
|
+
import { buildRunJs } from "../../../utils/transform-js/transform-js.mjs";
|
|
3
|
+
import "../../../utils/index.mjs";
|
|
4
|
+
import { noMore, pageDesignHistoryList, pageJson, pageJsonSnapshot, pageNo, regRoot, transformPageJson, widgetInfo } from "../design-state.mjs";
|
|
5
|
+
import { useUserOccupy } from "../../../components/user-occupy/useUserOccupy.mjs";
|
|
6
|
+
import "../../../components/index.mjs";
|
|
7
|
+
import { isArray, isEmpty, isNil } from "lodash-es";
|
|
8
|
+
import { Platform, SearchComponents, TreeHelper, t } from "@gct-paas/core";
|
|
9
|
+
import { message } from "ant-design-vue";
|
|
10
|
+
//#region src/hooks/design-view/designer/useDesignSave.ts
|
|
11
|
+
/**
|
|
12
|
+
* 保存与数据校验 Hook
|
|
13
|
+
*
|
|
14
|
+
* 管理设计器页面数据的保存、预处理和校验逻辑,
|
|
15
|
+
* 包括组件必填校验、数值范围校验、运行时 JSON 构建等。
|
|
16
|
+
*/
|
|
17
|
+
function useDesignSave() {
|
|
18
|
+
const { cancelOccupy } = useUserOccupy();
|
|
19
|
+
/**
|
|
20
|
+
* 保存页面数据快照,用于脏检查对比
|
|
21
|
+
*
|
|
22
|
+
* @param {PageJson} json 可选,传入则保存此 json 的快照,否则保存当前 pageJson
|
|
23
|
+
*/
|
|
24
|
+
function savePageJsonSnapshot(json) {
|
|
25
|
+
pageJsonSnapshot.value = JSON.stringify(json ?? pageJson);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 保存时对数据做校验
|
|
29
|
+
*
|
|
30
|
+
* @author zhanghanrui
|
|
31
|
+
* @date 2024-05-11 11:05:14
|
|
32
|
+
* @param {IData[]} widgets 组件数据列表
|
|
33
|
+
* @param {IData[]} parents 父级数据列表
|
|
34
|
+
* @returns {boolean} 是否校验通过
|
|
35
|
+
*/
|
|
36
|
+
function validateWidgets(widgets, parents = []) {
|
|
37
|
+
for (let i = 0; i < widgets.length; i++) {
|
|
38
|
+
const widget = widgets[i];
|
|
39
|
+
const { type, props } = widget;
|
|
40
|
+
const configs = widgetInfo.value.propEditors[type];
|
|
41
|
+
const models = configs && isArray(configs) ? configs : configs(widgets, parents);
|
|
42
|
+
for (let j = 0; j < models.length; j++) {
|
|
43
|
+
const model = models[j];
|
|
44
|
+
if (model?.required === true) {
|
|
45
|
+
const { name } = model;
|
|
46
|
+
let keys = [];
|
|
47
|
+
const isObject = typeof name === "object";
|
|
48
|
+
if (typeof name === "object") keys = Object.keys(name).map((item) => {
|
|
49
|
+
return name[item];
|
|
50
|
+
});
|
|
51
|
+
else if (name?.startsWith("root:")) {
|
|
52
|
+
const val = widget[name.substring(5)];
|
|
53
|
+
if (isNil(val) || isEmpty(val)) {
|
|
54
|
+
message.error(`【${widget.alias || widget.props.label || widget.props.fieldName || ""} ${widget.id}】${t("sys.pageDesigner.widget")} -【${t("sys.pageDesigner.prop")} - ${t(`sys.pageDesigner.${model.group}Prop`)} ${model.label ? "-" + t(model.label) : ""}】${t("sys.model.required")}`);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
} else keys = name.replace(regRoot, "").split(".");
|
|
58
|
+
let memo = props;
|
|
59
|
+
for (let k = 0; k < keys.length; k++) {
|
|
60
|
+
const key = keys[k];
|
|
61
|
+
const val = isObject ? props[key] : memo[key];
|
|
62
|
+
memo = val;
|
|
63
|
+
if (model.hidden) {
|
|
64
|
+
if (model.hidden(widget) === true) continue;
|
|
65
|
+
}
|
|
66
|
+
if (isNil(val) || isEmpty(val)) {
|
|
67
|
+
message.error(`【${widget.alias || widget.props.label || widget.props.fieldName || ""} ${widget.id}】${t("sys.pageDesigner.widget")} -【${t("sys.pageDesigner.prop")} - ${t(`sys.pageDesigner.${model.group}Prop`)} ${model.label ? "-" + t(model.label) : ""}】${t("sys.model.required")}`);
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (model?.saveHook) model.saveHook(widget);
|
|
73
|
+
}
|
|
74
|
+
if ([SearchComponents.SearchNumberInput, SearchComponents.SearchStringNumberInput].includes(type) && props?.isRang && props?.defaultValue && Array.isArray(props?.defaultValue)) {
|
|
75
|
+
const start = props.defaultValue[0];
|
|
76
|
+
const end = props.defaultValue[1];
|
|
77
|
+
if ((start || start === 0) && (end || end === 0) && start > end) {
|
|
78
|
+
message.error(`【${widget.alias || widget.props.label || widget.props.fieldName || ""} ${widget.id}】${t("sys.pageDesigner.widget")} -【${t("sys.pageDesigner.prop")} - ${t("sys.pageDesigner.defaultValue")}】- ${t("sys.model.numMaxGTMin")}`);
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (widget.children) {
|
|
83
|
+
parents.push(widget);
|
|
84
|
+
const bol = validateWidgets(widget.children, parents);
|
|
85
|
+
if (bol === false) return bol;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* 保存完成解除占用
|
|
92
|
+
*
|
|
93
|
+
* @param {boolean} flag 是否为保存操作(true为保存,false为恢复)
|
|
94
|
+
* @param {boolean} showSuccess 是否显示成功提示
|
|
95
|
+
* @returns {Promise<boolean>} 是否保存成功
|
|
96
|
+
*/
|
|
97
|
+
async function save(flag = true, showSuccess = true) {
|
|
98
|
+
const pageId = _gct.store.context.pid;
|
|
99
|
+
const _pageJson = transformPageJson(pageJson);
|
|
100
|
+
if (validateWidgets(_pageJson.widgets) === false) return false;
|
|
101
|
+
if (_pageJson.widgets.some((n) => n.type === "data-list")) _pageJson.widgets.forEach((item) => {
|
|
102
|
+
if (item.type === "data-list" && !item.props.showFieldExp) item.props.showFieldExpVal = "";
|
|
103
|
+
});
|
|
104
|
+
if (validateWidgets(_pageJson.modals) === false) return false;
|
|
105
|
+
if (_pageJson.modals.length) _pageJson.modals.forEach((item) => {
|
|
106
|
+
if (!item.props.hasFooter) item.children = item.children.filter((n) => {
|
|
107
|
+
return n?.type !== "bottom-button-container";
|
|
108
|
+
});
|
|
109
|
+
if (item.props.hasFooter && item.children.some((n) => n?.type === "modalFooter")) item.children = item.children.filter((n) => {
|
|
110
|
+
return n?.type !== "modalFooter";
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
const plugins = [];
|
|
114
|
+
/**
|
|
115
|
+
* 递归查找所有插件
|
|
116
|
+
*
|
|
117
|
+
* @param {LowCodeWidget.BasicSchema[]} widgets 组件列表
|
|
118
|
+
* @returns {PagePlugin[]} 插件列表
|
|
119
|
+
*/
|
|
120
|
+
function deepFindPlugins(widgets) {
|
|
121
|
+
const items = [];
|
|
122
|
+
widgets.forEach((widget) => {
|
|
123
|
+
if (widget._plugin) items.push({
|
|
124
|
+
key: widget._plugin.key,
|
|
125
|
+
version: widget._plugin.version,
|
|
126
|
+
url: widget._plugin.url
|
|
127
|
+
});
|
|
128
|
+
if (widget.children && widget.children.length > 0) items.push(...deepFindPlugins(widget.children));
|
|
129
|
+
});
|
|
130
|
+
return items;
|
|
131
|
+
}
|
|
132
|
+
plugins.push(...deepFindPlugins(_pageJson.widgets));
|
|
133
|
+
if (_pageJson.modals) _pageJson.modals.forEach((modal) => {
|
|
134
|
+
if (modal.children) modal.children.forEach((item) => {
|
|
135
|
+
plugins.push(...deepFindPlugins(item.children));
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
_pageJson.plugins = plugins;
|
|
139
|
+
const runtimeJson = await buildRuntimeJson();
|
|
140
|
+
if (platform.value === Platform.MOBILE) await _api.apaas.mobilePage.putUpdateDesignerJsonId({ id: pageId }, {
|
|
141
|
+
designerJson: JSON.stringify(_pageJson),
|
|
142
|
+
runtimeJson: JSON.stringify(runtimeJson),
|
|
143
|
+
logId: (pageDesignHistoryList.value[0] ?? {}).id
|
|
144
|
+
});
|
|
145
|
+
else if (platform.value === Platform.PAD) await _api.apaas.padPage.putUpdateDesignerJsonId({ id: pageId }, {
|
|
146
|
+
designerJson: JSON.stringify(_pageJson),
|
|
147
|
+
runtimeJson: JSON.stringify(runtimeJson),
|
|
148
|
+
logId: (pageDesignHistoryList.value[0] ?? {}).id
|
|
149
|
+
});
|
|
150
|
+
else await _api.apaas.webpage.putUpdateDesignerJsonId({ id: pageId }, {
|
|
151
|
+
designerJson: JSON.stringify(_pageJson),
|
|
152
|
+
runtimeJson: JSON.stringify(runtimeJson),
|
|
153
|
+
logId: (pageDesignHistoryList.value[0] ?? {}).id
|
|
154
|
+
});
|
|
155
|
+
savePageJsonSnapshot(_pageJson);
|
|
156
|
+
if (showSuccess) _gct.message.success(flag ? "sys.saveSuccess" : "sys.recoverSuccess");
|
|
157
|
+
cancelOccupy();
|
|
158
|
+
noMore.value = false;
|
|
159
|
+
pageNo.value = 1;
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
save,
|
|
164
|
+
validateWidgets,
|
|
165
|
+
savePageJsonSnapshot
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* 递归遍历 tree 并组装运行时 JSON
|
|
170
|
+
*
|
|
171
|
+
* @returns {Promise<RuntimePageJson>} 运行时页面JSON
|
|
172
|
+
*/
|
|
173
|
+
async function buildRuntimeJson() {
|
|
174
|
+
try {
|
|
175
|
+
const runtimeWidgets = TreeHelper.traverseAndBuildTree(JSON.parse(JSON.stringify(pageJson.widgets)), (node) => findWidgetCallback(node));
|
|
176
|
+
/**经过babel转换过的所有函数集合包含未export ES5字符串
|
|
177
|
+
来源于页面JS和逻辑编排*/
|
|
178
|
+
const funcStr = await buildRunJs(pageJson.js);
|
|
179
|
+
const modals = pageJson.modals.map(async (modal) => {
|
|
180
|
+
const modalFuncStr = await buildRunJs(modal.js);
|
|
181
|
+
const runtimeWidgets = TreeHelper.traverseAndBuildTree(JSON.parse(JSON.stringify(modal.children)), (node) => findWidgetCallback(node, modal));
|
|
182
|
+
return {
|
|
183
|
+
props: modal.props,
|
|
184
|
+
css: modal.css,
|
|
185
|
+
modalName: modal.modalName,
|
|
186
|
+
id: modal.id,
|
|
187
|
+
i18n: modal.i18n || {},
|
|
188
|
+
events: modal.events,
|
|
189
|
+
children: runtimeWidgets,
|
|
190
|
+
runJs: modalFuncStr,
|
|
191
|
+
style: modal.style
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
return {
|
|
195
|
+
widgets: runtimeWidgets,
|
|
196
|
+
runJs: funcStr,
|
|
197
|
+
modals: await Promise.all(modals),
|
|
198
|
+
css: pageJson.css,
|
|
199
|
+
keepAlive: pageJson.keepAlive,
|
|
200
|
+
globalEvents: pageJson.globalEvents,
|
|
201
|
+
pageEvents: pageJson.pageEvents,
|
|
202
|
+
permissions: pageJson.permissions,
|
|
203
|
+
pageStyle: pageJson.style,
|
|
204
|
+
pageConfig: pageJson.pageConfig,
|
|
205
|
+
pageVars: pageJson.pageVars,
|
|
206
|
+
plugins: pageJson.plugins,
|
|
207
|
+
pageLayoutMode: pageJson.pageLayoutMode
|
|
208
|
+
};
|
|
209
|
+
} catch (error) {
|
|
210
|
+
message.warn(t("sys.pageDesigner.codeError"));
|
|
211
|
+
throw error;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* 查找组件的运行时回调处理
|
|
216
|
+
*
|
|
217
|
+
* @param {LowCodeWidget.BasicSchema} node 组件节点
|
|
218
|
+
* @param {LowCodeModal.Modal} modal 所属弹框
|
|
219
|
+
* @returns {*} 回调结果
|
|
220
|
+
*/
|
|
221
|
+
function findWidgetCallback(node, modal) {
|
|
222
|
+
return widgetInfo.value.callback[node.type]?.(node, modal);
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
export { buildRuntimeJson, useDesignSave };
|
|
@@ -4,9 +4,9 @@ import { LowCodeWidget, LowCodeModal } from '@gct-paas/schema';
|
|
|
4
4
|
* propName 类型定义:可以是字符串或对象映射
|
|
5
5
|
*/
|
|
6
6
|
type PropNameType = string | Record<string, string>;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const propEditorProps: {
|
|
8
8
|
propName: {
|
|
9
|
-
type:
|
|
9
|
+
type: StringConstructor;
|
|
10
10
|
default: string;
|
|
11
11
|
};
|
|
12
12
|
propConfig: {
|
|
@@ -14,7 +14,7 @@ export declare const props: {
|
|
|
14
14
|
default: {};
|
|
15
15
|
};
|
|
16
16
|
changeCallback: {
|
|
17
|
-
type:
|
|
17
|
+
type: PropType<(widget: LowCodeWidget.BasicSchema | LowCodeModal.Modal | Partial<LowCodeWidget.BasicSchema> | Partial<LowCodeModal.Modal> | undefined, value: unknown) => void>;
|
|
18
18
|
};
|
|
19
19
|
required: {
|
|
20
20
|
type: BooleanConstructor;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { regRoot } from "../design-state.mjs";
|
|
2
|
+
import { useSelectedWidget } from "../widget/useSelectedWidget.mjs";
|
|
3
|
+
import { useDesignCache } from "../designer/useDesignCache.mjs";
|
|
4
|
+
import { isObject, isString } from "lodash-es";
|
|
5
|
+
import { computed, nextTick } from "vue";
|
|
6
|
+
//#region src/hooks/design-view/editor/usePropEditor.ts
|
|
7
|
+
var propEditorProps = {
|
|
8
|
+
propName: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: ""
|
|
11
|
+
},
|
|
12
|
+
propConfig: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: {}
|
|
15
|
+
},
|
|
16
|
+
changeCallback: { type: Function },
|
|
17
|
+
required: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
validate: { type: Promise },
|
|
22
|
+
widget: { type: Object }
|
|
23
|
+
};
|
|
24
|
+
function usePropEditor(propName, changeCallback, globData = {}) {
|
|
25
|
+
const { selectedProps, selectedRef } = useSelectedWidget();
|
|
26
|
+
const { emitCache } = useDesignCache();
|
|
27
|
+
/**
|
|
28
|
+
* propName支持字符串链式调用,对象情况支持多字段
|
|
29
|
+
*
|
|
30
|
+
* @param {unknown} value 要设置的值
|
|
31
|
+
* @param {PropNameType} name 属性名称或映射
|
|
32
|
+
*/
|
|
33
|
+
function setValue(value, name) {
|
|
34
|
+
if (isString(name)) {
|
|
35
|
+
/**root 开头的字段就在全链路处理 */
|
|
36
|
+
const widget = regRoot.test(name) ? selectedRef : selectedProps;
|
|
37
|
+
const keyslist = name.replace(regRoot, "").split(".");
|
|
38
|
+
const len = keyslist.length - 1;
|
|
39
|
+
keyslist.reduce((memo, cur, index) => {
|
|
40
|
+
if (index === len) memo[cur] = value;
|
|
41
|
+
return memo[cur];
|
|
42
|
+
}, widget.value);
|
|
43
|
+
}
|
|
44
|
+
if (isObject(name)) {
|
|
45
|
+
const valueMap = value;
|
|
46
|
+
for (const key in name) {
|
|
47
|
+
const valKey = name[key];
|
|
48
|
+
setValue(valueMap[key], valKey);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 获取属性值,支持链式路径和对象映射
|
|
54
|
+
*
|
|
55
|
+
* @param {PropNameType} name 属性名称或映射
|
|
56
|
+
* @returns {unknown} 属性值
|
|
57
|
+
*/
|
|
58
|
+
function getValue(name) {
|
|
59
|
+
if (isString(name)) {
|
|
60
|
+
const widget = regRoot.test(name) ? selectedRef : selectedProps;
|
|
61
|
+
if (!widget?.value) return;
|
|
62
|
+
const keyslist = name.replace(regRoot, "").split(".");
|
|
63
|
+
try {
|
|
64
|
+
return keyslist.reduce((memo, cur) => memo[cur], widget.value);
|
|
65
|
+
} catch (err) {
|
|
66
|
+
console.warn(err);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (isObject(name)) {
|
|
70
|
+
const valueMap = {};
|
|
71
|
+
for (const key in name) {
|
|
72
|
+
const valKey = name[key];
|
|
73
|
+
valueMap[key] = getValue(valKey);
|
|
74
|
+
}
|
|
75
|
+
return valueMap;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return { propValue: computed({
|
|
79
|
+
get() {
|
|
80
|
+
const baseValue = getValue(propName);
|
|
81
|
+
return baseValue ?? (isString(propName) ? globData[propName] : baseValue);
|
|
82
|
+
},
|
|
83
|
+
set(val) {
|
|
84
|
+
setValue(val, propName);
|
|
85
|
+
if (!!changeCallback && typeof changeCallback === "function") nextTick().then(() => {
|
|
86
|
+
changeCallback(selectedRef.value, val);
|
|
87
|
+
});
|
|
88
|
+
emitCache();
|
|
89
|
+
}
|
|
90
|
+
}) };
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { propEditorProps, usePropEditor };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
-
export declare function useStyle(widget: LowCodeWidget.BasicSchema): {
|
|
1
|
+
import { LowCodeModal, LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
+
export declare function useStyle(widget: LowCodeWidget.BasicSchema | LowCodeModal.Modal): {
|
|
3
3
|
wrapperStyle: import('vue').ComputedRef<IObject>;
|
|
4
4
|
wStyle: import('vue').ComputedRef<IObject>;
|
|
5
5
|
labelFont: import('vue').ComputedRef<IObject>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { extractFontStyle, generateWrapperStyle, propsToStyle } from "@gct-paas/schema";
|
|
3
|
+
//#region src/hooks/design-view/editor/useStyle.ts
|
|
4
|
+
function useStyle(widget) {
|
|
5
|
+
const { style = {}, ignoringStyle } = widget;
|
|
6
|
+
const wStyle = computed(() => {
|
|
7
|
+
return propsToStyle(style);
|
|
8
|
+
});
|
|
9
|
+
return {
|
|
10
|
+
wrapperStyle: computed(() => {
|
|
11
|
+
return generateWrapperStyle(style, ignoringStyle);
|
|
12
|
+
}),
|
|
13
|
+
wStyle,
|
|
14
|
+
labelFont: computed(() => {
|
|
15
|
+
return extractFontStyle(style.labelFont);
|
|
16
|
+
}),
|
|
17
|
+
contentFont: computed(() => {
|
|
18
|
+
return extractFontStyle(style.contentFont);
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 将样式对象转换为字体样式
|
|
24
|
+
*
|
|
25
|
+
* @param schema - 样式配置对象
|
|
26
|
+
* @returns 转换后的字体样式对象
|
|
27
|
+
*/
|
|
28
|
+
var schemaToStyle = (schema) => extractFontStyle(schema);
|
|
29
|
+
/**
|
|
30
|
+
* 将样式属性对象转换为 CSS 样式字符串格式
|
|
31
|
+
*
|
|
32
|
+
* @param styleProps - 样式属性对象
|
|
33
|
+
* @returns 转换后的样式对象
|
|
34
|
+
*/
|
|
35
|
+
function propsToStyle$1(styleProps = {}) {
|
|
36
|
+
return propsToStyle(styleProps);
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { propsToStyle$1 as propsToStyle, schemaToStyle, useStyle };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { LowCodeWidget, LowCodeModal } from '@gct-paas/schema';
|
|
3
|
+
import { shadeColor, rgba2hex } from '../utils/color.util';
|
|
4
|
+
import { PRESET_COLOR, BTN_TYPE_COLOR } from '../constants/style-editor.const';
|
|
5
|
+
export { shadeColor, rgba2hex };
|
|
6
|
+
export { PRESET_COLOR as presetColor, BTN_TYPE_COLOR as btnTypeColor };
|
|
7
|
+
export declare const styleEditorProps: {
|
|
8
|
+
editor: {
|
|
9
|
+
type: PropType<LowCodeWidget.StyleEditor>;
|
|
10
|
+
default: {};
|
|
11
|
+
};
|
|
12
|
+
widget: {
|
|
13
|
+
type: PropType<LowCodeWidget.BasicSchema | LowCodeModal.Modal>;
|
|
14
|
+
};
|
|
15
|
+
propConfig: {
|
|
16
|
+
type: ObjectConstructor;
|
|
17
|
+
default: {};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 样式编辑器 composable
|
|
22
|
+
* 封装样式属性的读写逻辑,支持链式路径和对象映射
|
|
23
|
+
*
|
|
24
|
+
* @template T 样式值类型
|
|
25
|
+
* @param {IObject} editor 样式编辑器配置
|
|
26
|
+
* @returns {{ styleValue: ComputedRef<T> }}
|
|
27
|
+
*/
|
|
28
|
+
export declare function useStyleEditor<T = IObject>(editor: IObject): {
|
|
29
|
+
styleValue: import('vue').WritableComputedRef<T, T>;
|
|
30
|
+
};
|