From 77779eefa90216d3dbc60d3b255a8c2da9b7936e Mon Sep 17 00:00:00 2001 From: vdpAdmin Date: Thu, 14 Oct 2021 15:20:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=8B=86=E5=88=86=E9=87=8D?= =?UTF-8?q?=E6=9E=84=EF=BC=8C=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE=E6=8B=86?= =?UTF-8?q?=E5=88=86=E9=87=8D=E6=9E=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/form-designer/designer.js | 14 +- .../form-widget/container-widget.vue | 408 ----- .../container-widget/container-wrapper.vue | 100 ++ .../container-widget/containerMixin.js | 89 ++ .../grid-col-widget.vue | 16 +- .../container-widget/grid-widget.vue | 88 ++ .../form-widget/container-widget/index.js | 10 + .../container-widget/tab-widget.vue | 121 ++ .../table-cell-widget.vue | 16 +- .../container-widget/table-widget.vue | 111 ++ .../form-widget/field-widget.vue | 1340 ----------------- .../field-widget/button-widget.vue | 87 ++ .../field-widget/cascader-widget.vue | 104 ++ .../field-widget/checkbox-widget.vue | 105 ++ .../form-widget/field-widget/color-widget.vue | 99 ++ .../field-widget/date-range-widget.vue | 104 ++ .../form-widget/field-widget/date-widget.vue | 103 ++ .../field-widget/divider-widget.vue | 83 + .../form-widget/field-widget/fieldMixin.js | 451 ++++++ .../field-widget/file-upload-widget.vue | 264 ++++ .../field-widget/form-item-wrapper.vue | 331 ++++ .../field-widget/html-text-widget.vue | 82 + .../form-widget/field-widget/index.js | 10 + .../form-widget/field-widget/input-widget.vue | 112 ++ .../field-widget/number-widget.vue | 103 ++ .../field-widget/picture-upload-widget.vue | 219 +++ .../form-widget/field-widget/radio-widget.vue | 105 ++ .../form-widget/field-widget/rate-widget.vue | 102 ++ .../field-widget/rich-editor-widget.vue | 121 ++ .../field-widget/select-widget.vue | 115 ++ .../field-widget/slider-widget.vue | 100 ++ .../field-widget/static-content-wrapper.vue | 185 +++ .../field-widget/static-text-widget.vue | 82 + .../field-widget/switch-widget.vue | 101 ++ .../field-widget/textarea-widget.vue | 99 ++ .../field-widget/time-range-widget.vue | 104 ++ .../form-widget/field-widget/time-widget.vue | 103 ++ .../form-designer/form-widget/index.vue | 23 +- .../form-designer/form-widget/tab-pane.vue | 90 -- src/components/form-designer/index.vue | 27 +- .../setting-panel/form-setting.vue | 300 ++++ .../form-designer/setting-panel/index.vue | 1160 ++------------ .../property-editor/allowCreate-editor.vue | 24 + .../property-editor/appendButton-editor.vue | 28 + .../appendButtonDisabled-editor.vue | 23 + .../automaticDropdown-editor.vue | 23 + .../property-editor/border-editor.vue | 23 + .../property-editor/buttonIcon-editor.vue | 23 + .../property-editor/buttonStyle-editor.vue | 23 + .../property-editor/clearable-editor.vue | 23 + .../property-editor/columnWidth-editor.vue | 40 + .../grid-col-span-editor.vue | 24 + .../container-grid/gutter-editor.vue | 81 + .../showBlankRow-editor.vue | 23 + .../showRowNumber-editor.vue | 23 + .../sub-form-labelAlign-editor.vue | 36 + .../container-tab/tab-customClass-editor.vue | 119 ++ .../cellHeight-editor.vue | 23 + .../container-table-cell/cellWidth-editor.vue | 23 + .../property-editor/customClass-editor.vue | 40 + .../property-editor/defaultValue-editor.vue | 25 + .../property-editor/disabled-editor.vue | 23 + .../property-editor/displayStyle-editor.vue | 26 + .../property-editor/editable-editor.vue | 24 + .../property-editor/endPlaceholder-editor.vue | 23 + .../event-handler/eventMixin.js | 19 + .../event-handler/onBeforeUpload-editor.vue | 30 + .../event-handler/onBlur-editor.vue | 30 + .../event-handler/onChange-editor.vue | 30 + .../event-handler/onClick-editor.vue | 30 + .../event-handler/onCreated-editor.vue | 31 + .../event-handler/onFocus-editor.vue | 30 + .../event-handler/onInput-editor.vue | 30 + .../event-handler/onMounted-editor.vue | 30 + .../event-handler/onRemoteQuery-editor.vue | 30 + .../event-handler/onSubFormRowAdd-editor.vue | 30 + .../onSubFormRowChange-editor.vue | 30 + .../onSubFormRowDelete-editor.vue | 30 + .../onSubFormRowInsert-editor.vue | 30 + .../event-handler/onUploadError-editor.vue | 30 + .../event-handler/onUploadSuccess-editor.vue | 30 + .../event-handler/onValidate-editor.vue | 30 + .../field-button/button-type-editor.vue | 32 + .../field-button/circle-editor.vue | 23 + .../field-button/icon-editor.vue | 23 + .../field-button/plain-editor.vue | 24 + .../field-button/round-editor.vue | 23 + .../field-color/color-defaultValue-editor.vue | 23 + .../date-range-defaultValue-editor.vue | 24 + .../date-range-format-editor.vue | 30 + .../date-range-type-editor.vue | 27 + .../date-range-valueFormat-editor.vue | 26 + .../field-date/date-defaultValue-editor.vue | 24 + .../field-date/date-format-editor.vue | 30 + .../field-date/date-type-editor.vue | 30 + .../field-date/date-valueFormat-editor.vue | 26 + .../field-divider/contentPosition-editor.vue | 27 + .../file-upload-fileTypes-editor.vue | 44 + .../field-html-text/htmlContent-editor.vue | 23 + .../field-number/controlsPosition-editor.vue | 27 + .../picture-upload-fileTypes-editor.vue | 43 + .../field-rate/allowHalf-editor.vue | 23 + .../field-rate/highThreshold-editor.vue | 24 + .../field-rate/lowThreshold-editor.vue | 24 + .../field-rate/rate-defaultValue-editor.vue | 24 + .../field-rate/rate-max-editor.vue | 25 + .../field-rate/showScore-editor.vue | 23 + .../field-rate/showText-editor.vue | 23 + .../field-slider/range-editor.vue | 23 + .../field-slider/vertical-editor.vue | 23 + .../field-static-text/textContent-editor.vue | 23 + .../field-switch/activeText-editor.vue | 23 + .../field-switch/inactiveColor-editor.vue | 23 + .../switch-defaultValue-editor.vue | 23 + .../field-switch/switchWidth-editor.vue | 23 + .../time-range-defaultValue-editor.vue | 24 + .../time-range-format-editor.vue | 27 + .../field-time/time-defaultValue-editor.vue | 24 + .../field-time/time-format-editor.vue | 27 + .../property-editor/fileMaxSize-editor.vue | 23 + .../property-editor/filterable-editor.vue | 23 + .../property-editor/hidden-editor.vue | 23 + .../setting-panel/property-editor/index.js | 10 + .../property-editor/label-editor.vue | 30 + .../property-editor/labelAlign-editor.vue | 42 + .../property-editor/labelHidden-editor.vue | 23 + .../property-editor/labelIconClass-editor.vue | 28 + .../labelIconPosition-editor.vue | 37 + .../property-editor/labelTooltip-editor.vue | 23 + .../property-editor/labelWidth-editor.vue | 25 + .../property-editor/limit-editor.vue | 24 + .../property-editor/max-editor.vue | 39 + .../property-editor/maxLength-editor.vue | 40 + .../property-editor/min-editor.vue | 40 + .../property-editor/minLength-editor.vue | 41 + .../property-editor/multiple-editor.vue | 24 + .../property-editor/multipleLimit-editor.vue | 24 + .../property-editor/multipleSelect-editor.vue | 24 + .../property-editor/name-editor.vue | 57 + .../property-editor/optionItems-editor.vue | 28 + .../property-editor/placeholder-editor.vue | 24 + .../property-editor/precision-editor.vue | 23 + .../property-editor/prefixIcon-editor.vue | 23 + .../property-editor/propertyMixin.js | 47 + .../property-editor/readonly-editor.vue | 23 + .../property-editor/remote-editor.vue | 25 + .../property-editor/required-editor.vue | 23 + .../property-editor/rows-editor.vue | 24 + .../property-editor/showFileList-editor.vue | 23 + .../property-editor/showPassword-editor.vue | 24 + .../property-editor/showWordLimit-editor.vue | 23 + .../property-editor/size-editor.vue | 38 + .../startPlaceholder-editor.vue | 23 + .../property-editor/step-editor.vue | 23 + .../property-editor/suffixIcon-editor.vue | 23 + .../property-editor/type-editor.vue | 33 + .../property-editor/uploadTip-editor.vue | 24 + .../property-editor/uploadURL-editor.vue | 28 + .../property-editor/validation-editor.vue | 48 + .../property-editor/validationHint-editor.vue | 23 + .../withCredentials-editor.vue | 23 + .../setting-panel/propertyRegister.js | 144 ++ .../widget-panel/widgetsConfig.js | 7 + src/components/form-render/container-item.vue | 599 -------- .../container-item/container-item-wrapper.vue | 25 + .../container-item/containerItemMixin.js | 136 ++ .../{ => container-item}/grid-col-item.vue | 20 +- .../form-render/container-item/grid-item.vue | 53 + .../form-render/container-item/index.js | 10 + .../container-item/sub-form-item.vue | 405 +++++ .../form-render/container-item/tab-item.vue | 91 ++ .../{ => container-item}/table-cell-item.vue | 21 +- .../form-render/container-item/table-item.vue | 65 + src/components/form-render/index.vue | 33 +- src/lang/en-US.js | 3 + src/lang/en-US_extension.js | 5 + src/lang/zh-CN.js | 7 +- src/lang/zh-CN_extension.js | 5 + src/utils/config.js | 4 +- src/utils/i18n.js | 8 +- src/utils/util.js | 9 +- 182 files changed, 8855 insertions(+), 3581 deletions(-) delete mode 100644 src/components/form-designer/form-widget/container-widget.vue create mode 100644 src/components/form-designer/form-widget/container-widget/container-wrapper.vue create mode 100644 src/components/form-designer/form-widget/container-widget/containerMixin.js rename src/components/form-designer/form-widget/{ => container-widget}/grid-col-widget.vue (90%) create mode 100644 src/components/form-designer/form-widget/container-widget/grid-widget.vue create mode 100644 src/components/form-designer/form-widget/container-widget/index.js create mode 100644 src/components/form-designer/form-widget/container-widget/tab-widget.vue rename src/components/form-designer/form-widget/{ => container-widget}/table-cell-widget.vue (94%) create mode 100644 src/components/form-designer/form-widget/container-widget/table-widget.vue delete mode 100644 src/components/form-designer/form-widget/field-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/button-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/cascader-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/checkbox-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/color-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/date-range-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/date-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/divider-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/fieldMixin.js create mode 100644 src/components/form-designer/form-widget/field-widget/file-upload-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue create mode 100644 src/components/form-designer/form-widget/field-widget/html-text-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/index.js create mode 100644 src/components/form-designer/form-widget/field-widget/input-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/number-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/radio-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/rate-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/rich-editor-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/select-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/slider-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/static-content-wrapper.vue create mode 100644 src/components/form-designer/form-widget/field-widget/static-text-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/switch-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/textarea-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/time-range-widget.vue create mode 100644 src/components/form-designer/form-widget/field-widget/time-widget.vue delete mode 100644 src/components/form-designer/form-widget/tab-pane.vue create mode 100644 src/components/form-designer/setting-panel/form-setting.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/allowCreate-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/appendButton-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/appendButtonDisabled-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/automaticDropdown-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/border-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/buttonIcon-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/buttonStyle-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/clearable-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/columnWidth-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/container-sub-form/showBlankRow-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/container-sub-form/showRowNumber-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/container-sub-form/sub-form-labelAlign-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/customClass-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/defaultValue-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/disabled-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/displayStyle-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/editable-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/eventMixin.js create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onBeforeUpload-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onBlur-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onChange-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onFocus-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onInput-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onMounted-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onRemoteQuery-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowAdd-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowChange-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowDelete-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowInsert-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onUploadError-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onUploadSuccess-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-button/circle-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-button/icon-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-button/plain-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-button/round-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-color/color-defaultValue-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-rate/allowHalf-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-rate/showScore-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-rate/showText-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-slider/range-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-slider/vertical-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-switch/inactiveColor-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-switch/switch-defaultValue-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/filterable-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/hidden-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/index.js create mode 100644 src/components/form-designer/setting-panel/property-editor/label-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/labelAlign-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/labelHidden-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/labelWidth-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/limit-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/max-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/maxLength-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/min-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/minLength-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/multiple-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/multipleLimit-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/multipleSelect-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/name-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/placeholder-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/precision-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/prefixIcon-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/propertyMixin.js create mode 100644 src/components/form-designer/setting-panel/property-editor/readonly-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/remote-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/required-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/rows-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/showFileList-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/showPassword-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/showWordLimit-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/size-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/step-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/suffixIcon-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/type-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/uploadTip-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/uploadURL-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/validation-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/validationHint-editor.vue create mode 100644 src/components/form-designer/setting-panel/property-editor/withCredentials-editor.vue create mode 100644 src/components/form-designer/setting-panel/propertyRegister.js delete mode 100644 src/components/form-render/container-item.vue create mode 100644 src/components/form-render/container-item/container-item-wrapper.vue create mode 100644 src/components/form-render/container-item/containerItemMixin.js rename src/components/form-render/{ => container-item}/grid-col-item.vue (70%) create mode 100644 src/components/form-render/container-item/grid-item.vue create mode 100644 src/components/form-render/container-item/index.js create mode 100644 src/components/form-render/container-item/sub-form-item.vue create mode 100644 src/components/form-render/container-item/tab-item.vue rename src/components/form-render/{ => container-item}/table-cell-item.vue (61%) create mode 100644 src/components/form-render/container-item/table-item.vue create mode 100644 src/lang/en-US_extension.js create mode 100644 src/lang/zh-CN_extension.js diff --git a/package.json b/package.json index dd78e20..e116f8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "variant-form", - "version": "2.0.1", + "version": "2.1.0", "private": false, "scripts": { "serve": "vue-cli-service serve --open src/main.js", diff --git a/src/components/form-designer/designer.js b/src/components/form-designer/designer.js index 12eb976..900875e 100644 --- a/src/components/form-designer/designer.js +++ b/src/components/form-designer/designer.js @@ -1,7 +1,7 @@ /** * author: vformAdmin * email: vdpadmin@163.com - * website: http://www.vform666.com/ + * website: http://www.vform666.com * date: 2021.08.18 * remark: 如果要分发VForm源码,需在本文件顶部保留此文件头信息!! */ @@ -40,6 +40,8 @@ export function createDesigner(vueInstance) { formWidget: null, //表单设计容器 + cssClassList: [], //自定义样式列表 + historyData: { index: -1, //index: 0, maxStep: 20, @@ -528,7 +530,7 @@ export function createDesigner(vueInstance) { }) return newTable - } else { + } else { //其他容器组件不支持clone操作 return null } }, @@ -683,6 +685,14 @@ export function createDesigner(vueInstance) { this.vueInstance.$on(evtName, (data) => callback(data)) }, + setCssClassList(cssClassList) { + this.cssClassList = cssClassList + }, + + getCssClassList() { + return this.cssClassList + }, + registerFormWidget(formWidget) { this.formWidget = formWidget }, diff --git a/src/components/form-designer/form-widget/container-widget.vue b/src/components/form-designer/form-widget/container-widget.vue deleted file mode 100644 index 8c46883..0000000 --- a/src/components/form-designer/form-widget/container-widget.vue +++ /dev/null @@ -1,408 +0,0 @@ - - - - - diff --git a/src/components/form-designer/form-widget/container-widget/container-wrapper.vue b/src/components/form-designer/form-widget/container-widget/container-wrapper.vue new file mode 100644 index 0000000..40c5e08 --- /dev/null +++ b/src/components/form-designer/form-widget/container-widget/container-wrapper.vue @@ -0,0 +1,100 @@ + + + + + + + diff --git a/src/components/form-designer/form-widget/container-widget/containerMixin.js b/src/components/form-designer/form-widget/container-widget/containerMixin.js new file mode 100644 index 0000000..9b91eb0 --- /dev/null +++ b/src/components/form-designer/form-widget/container-widget/containerMixin.js @@ -0,0 +1,89 @@ +export default { + methods: { + insertTableRow(widget) { + this.designer.insertTableRow(widget) + + this.designer.emitHistoryChange() + }, + + insertTableCol(widget) { + this.designer.insertTableCol(widget) + + this.designer.emitHistoryChange() + }, + + onContainerDragAdd(evt, subList) { + const newIndex = evt.newIndex + if (!!subList[newIndex]) { + this.designer.setSelected( subList[newIndex] ) + } + + this.designer.emitHistoryChange() + }, + + onContainerDragUpdate() { + this.designer.emitHistoryChange() + }, + + checkContainerMove(evt) { + return this.designer.checkWidgetMove(evt) + }, + + selectWidget(widget) { + this.designer.setSelected(widget) + }, + + selectParentWidget() { + if (this.parentWidget) { + this.designer.setSelected(this.parentWidget) + } else { + this.designer.clearSelected() + } + }, + + moveUpWidget() { + this.designer.moveUpWidget(this.parentList, this.indexOfParentList) + this.designer.emitHistoryChange() + }, + + moveDownWidget() { + this.designer.moveDownWidget(this.parentList, this.indexOfParentList) + this.designer.emitHistoryChange() + }, + + cloneContainer(widget) { + if (!!this.parentList) { + let newCon = this.designer.cloneContainer(widget) + this.parentList.splice(this.indexOfParentList + 1, 0, newCon) + this.designer.setSelected(newCon) + + this.designer.emitHistoryChange() + } + }, + + removeWidget() { + if (!!this.parentList) { + let nextSelected = null + if (this.parentList.length === 1) { + if (!!this.parentWidget) { + nextSelected = this.parentWidget + } + } else if (this.parentList.length === (1 + this.indexOfParentList)) { + nextSelected = this.parentList[this.indexOfParentList - 1] + } else { + nextSelected = this.parentList[this.indexOfParentList + 1] + } + + this.$nextTick(() => { + this.parentList.splice(this.indexOfParentList, 1) + //if (!!nextSelected) { + this.designer.setSelected(nextSelected) + //} + + this.designer.emitHistoryChange() + }) + } + }, + + } +} diff --git a/src/components/form-designer/form-widget/grid-col-widget.vue b/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue similarity index 90% rename from src/components/form-designer/form-widget/grid-col-widget.vue rename to src/components/form-designer/form-widget/container-widget/grid-col-widget.vue index 29dada6..4c7b79a 100644 --- a/src/components/form-designer/form-widget/grid-col-widget.vue +++ b/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue @@ -9,12 +9,12 @@ @@ -39,9 +39,9 @@ + + diff --git a/src/components/form-designer/form-widget/container-widget/index.js b/src/components/form-designer/form-widget/container-widget/index.js new file mode 100644 index 0000000..9e0f6ae --- /dev/null +++ b/src/components/form-designer/form-widget/container-widget/index.js @@ -0,0 +1,10 @@ +const requireComponent = require.context('./', false, /\w+\.vue$/) + +let comps = {} + +requireComponent.keys().map(fileName => { + let comp = requireComponent(fileName).default; + comps[comp.name] = comp +}) + +export default comps; diff --git a/src/components/form-designer/form-widget/container-widget/tab-widget.vue b/src/components/form-designer/form-widget/container-widget/tab-widget.vue new file mode 100644 index 0000000..ac8b9fe --- /dev/null +++ b/src/components/form-designer/form-widget/container-widget/tab-widget.vue @@ -0,0 +1,121 @@ + + + + + + + diff --git a/src/components/form-designer/form-widget/table-cell-widget.vue b/src/components/form-designer/form-widget/container-widget/table-cell-widget.vue similarity index 94% rename from src/components/form-designer/form-widget/table-cell-widget.vue rename to src/components/form-designer/form-widget/container-widget/table-cell-widget.vue index 11c4ae9..a7113aa 100644 --- a/src/components/form-designer/form-widget/table-cell-widget.vue +++ b/src/components/form-designer/form-widget/container-widget/table-cell-widget.vue @@ -10,12 +10,12 @@ @@ -53,8 +53,9 @@ + + diff --git a/src/components/form-designer/form-widget/field-widget.vue b/src/components/form-designer/form-widget/field-widget.vue deleted file mode 100644 index 4ec4ef0..0000000 --- a/src/components/form-designer/form-widget/field-widget.vue +++ /dev/null @@ -1,1340 +0,0 @@ - - - - - - - diff --git a/src/components/form-designer/form-widget/field-widget/button-widget.vue b/src/components/form-designer/form-widget/field-widget/button-widget.vue new file mode 100644 index 0000000..5f694b6 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/button-widget.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/cascader-widget.vue b/src/components/form-designer/form-widget/field-widget/cascader-widget.vue new file mode 100644 index 0000000..fc33ad8 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/cascader-widget.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/checkbox-widget.vue b/src/components/form-designer/form-widget/field-widget/checkbox-widget.vue new file mode 100644 index 0000000..0a28898 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/checkbox-widget.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/color-widget.vue b/src/components/form-designer/form-widget/field-widget/color-widget.vue new file mode 100644 index 0000000..d5fca38 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/color-widget.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/date-range-widget.vue b/src/components/form-designer/form-widget/field-widget/date-range-widget.vue new file mode 100644 index 0000000..d47bc1d --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/date-range-widget.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/date-widget.vue b/src/components/form-designer/form-widget/field-widget/date-widget.vue new file mode 100644 index 0000000..01bdd2d --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/date-widget.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/divider-widget.vue b/src/components/form-designer/form-widget/field-widget/divider-widget.vue new file mode 100644 index 0000000..60a9b8a --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/divider-widget.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/fieldMixin.js b/src/components/form-designer/form-widget/field-widget/fieldMixin.js new file mode 100644 index 0000000..d6f1c1d --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/fieldMixin.js @@ -0,0 +1,451 @@ +import {deepClone} from "@/utils/util"; + +export default { + inject: ['refList', 'formConfig', 'globalOptionData', 'globalModel'], + + computed: { + subFormName() { + return !!this.parentWidget ? this.parentWidget.options.name : '' + }, + + subFormItemFlag() { + return !!this.parentWidget ? this.parentWidget.type === 'sub-form' : false + }, + + formModel: { + cache: false, + get() { + return this.globalModel.formModel + } + }, + + }, + + methods: { + + //--------------------- 组件内部方法 begin ------------------// + + initFieldModel() { + if (this.field.formItemFlag === false) { + return + } + + if (!!this.subFormItemFlag && !this.designState) { //SubForm子表单组件需要特殊处理!! + let subFormData = this.formModel[this.subFormName] + if (((subFormData === undefined) || (subFormData[this.subFormRowIndex] === undefined) || + (subFormData[this.subFormRowIndex][this.field.options.name] === undefined)) && + (this.field.options.defaultValue !== undefined)) { + this.fieldModel = this.field.options.defaultValue + subFormData[this.subFormRowIndex][this.field.options.name] = this.field.options.defaultValue + } else if (subFormData[this.subFormRowIndex][this.field.options.name] === undefined) { + this.fieldModel = null + subFormData[this.subFormRowIndex][this.field.options.name] = null + } else { + this.fieldModel = subFormData[this.subFormRowIndex][this.field.options.name] + } + + /* 主动触发子表单内field-widget的onChange事件!! */ + setTimeout(() => { //延时触发onChange事件, 便于更新计算字段!! + this.handleOnChangeForSubForm(this.fieldModel, this.oldFieldValue, subFormData, this.subFormRowId) + }, 800) + this.oldFieldValue = deepClone(this.fieldModel) + + this.initFileList() //处理图片上传、文件上传字段 + + return + } + + if ((this.formModel[this.field.options.name] === undefined) && + (this.field.options.defaultValue !== undefined)) { + this.fieldModel = this.field.options.defaultValue + } else if (this.formModel[this.field.options.name] === undefined) { //如果formModel为空对象,则初始化字段值为null!! + this.formModel[this.field.options.name] = null + } else { + this.fieldModel = this.formModel[this.field.options.name] + } + this.oldFieldValue = deepClone(this.fieldModel) + this.initFileList() //处理图片上传、文件上传字段 + }, + + initFileList() { //初始化上传组件的已上传文件列表 + if ( ((this.field.type !== 'picture-upload') && (this.field.type !== 'file-upload')) || (this.designState === true) ) { + return + } + + if (!!this.fieldModel) { + if (Array.isArray(this.fieldModel)) { + this.fileList = deepClone(this.fieldModel) + } else { + this.fileList.splice(0, 0, deepClone(this.fieldModel)) + } + } + }, + + initEventHandler() { + this.$on('setFormData', function (newFormData) { + console.log('formModel of globalModel----------', this.globalModel.formModel) + if (!this.subFormItemFlag) { + this.setValue(newFormData[this.field.options.name]) + } + }) + + this.$on('field-value-changed', function (values) { + if (!!this.subFormItemFlag) { + let subFormData = this.formModel[this.subFormName] + this.handleOnChangeForSubForm(values[0], values[1], subFormData, this.subFormRowId) + } else { + this.handleOnChange(values[0], values[1]) + } + }) + }, + + handleOnCreated() { + if (!!this.field.options.onCreated) { + let customFunc = new Function(this.field.options.onCreated) + customFunc.call(this) + } + }, + + handleOnMounted() { + if (!!this.field.options.onMounted) { + let mountFunc = new Function(this.field.options.onMounted) + mountFunc.call(this) + } + }, + + registerToRefList(oldRefName) { + if ((this.refList !== null) && !!this.field.options.name) { + if (this.subFormItemFlag && !this.designState) { //处理子表单元素(且非设计状态) + if (!!oldRefName) { + delete this.refList[oldRefName + '@row' + this.subFormRowId] + } + this.refList[this.field.options.name + '@row' + this.subFormRowId] = this + } else { + if (!!oldRefName) { + delete this.refList[oldRefName] + } + this.refList[this.field.options.name] = this + } + } + }, + + unregisterFromRefList() { //销毁组件时注销组件ref + if ((this.refList !== null) && !!this.field.options.name) { + let oldRefName = this.field.options.name + if (this.subFormItemFlag && !this.designState) { //处理子表单元素(且非设计状态) + delete this.refList[oldRefName + '@row' + this.subFormRowId] + } else { + delete this.refList[oldRefName] + } + } + }, + + initOptionItems() { + if (this.designState) { + return + } + + if ((this.field.type === 'radio') || (this.field.type === 'checkbox') + || (this.field.type === 'select') || (this.field.type === 'cascader')) { + if (!!this.globalOptionData && this.globalOptionData.hasOwnProperty(this.field.options.name)) { + this.loadOptions( this.globalOptionData[this.field.options.name] ) + } + } + }, + + refreshDefaultValue() { + if ((this.designState === true) && (this.field.options.defaultValue !== undefined)) { + this.fieldModel = this.field.options.defaultValue + } + }, + + buildFieldRules() { + this.rules.splice(0, this.rules.length) //清空已有 + if (!!this.field.options.required) { + this.rules.push({ + required: true, + message: this.i18nt('render.hint.fieldRequired'), + }) + } + + if (!!this.field.options.validation) { + let vldName = this.field.options.validation + if (!!FormValidators[vldName]) { + this.rules.push({ + validator: FormValidators[vldName], + trigger: ['blur', 'change'], + label: this.field.options.label, + errorMsg: this.field.options.validationHint + }) + } else { + this.rules.push({ + validator: FormValidators['regExp'], + trigger: ['blur', 'change'], + regExp: vldName, + label: this.field.options.label, + errorMsg: this.field.options.validationHint + }) + } + } + + if (!!this.field.options.onValidate) { + let customFn = new Function('rule', 'value', 'callback', this.field.options.onValidate) + this.rules.push({ + validator: customFn, + trigger: ['blur', 'change'], + label: this.field.options.label + }) + } + }, + + disableOptionOfList(optionList, optionValue) { + if (!!optionList && (optionList.length > 0)) { + optionList.forEach(opt => { + if (opt.value === optionValue) { + opt.disabled = true + } + }) + } + }, + + enableOptionOfList(optionList, optionValue) { + if (!!optionList && (optionList.length > 0)) { + optionList.forEach(opt => { + if (opt.value === optionValue) { + opt.disabled = false + } + }) + } + }, + + //--------------------- 组件内部方法 end ------------------// + + //--------------------- 事件处理 begin ------------------// + + emitFieldDataChange(newValue, oldValue) { + this.$emit('field-value-changed', [newValue, oldValue]) + + /* 必须用dispatch向指定父组件派发消息!! */ + this.dispatch('VFormRender', 'fieldChange', + [this.field.options.name, newValue, oldValue, this.subFormName, this.subFormRowIndex]) + }, + + syncUpdateFormModel(value) { + if (!!this.designState) { + return + } + + if (!!this.subFormItemFlag) { + let subFormData = this.formModel[this.subFormName] || [{}] + let subFormDataRow = subFormData[this.subFormRowIndex] + subFormDataRow[this.field.options.name] = value + } else { + this.formModel[this.field.options.name] = value + } + }, + + handleChangeEvent(value) { + this.syncUpdateFormModel(value) + this.emitFieldDataChange(value, this.oldFieldValue) + + //number组件一般不会触发focus事件,故此处需要手工赋值oldFieldValue!! + this.oldFieldValue = deepClone(value) /* oldFieldValue需要在initFieldModel()方法中赋初值!! */ + }, + + handleFocusCustomEvent(event) { + this.oldFieldValue = deepClone(this.fieldModel) //保存修改change之前的值 + + if (!!this.field.options.onFocus) { + let customFn = new Function('event', this.field.options.onFocus) + customFn.call(this, event) + } + }, + + handleBlurCustomEvent(event) { + if (!!this.field.options.onBlur) { + let customFn = new Function('event', this.field.options.onBlur) + customFn.call(this, event) + } + }, + + handleInputCustomEvent(value) { + if (!!this.field.options.onInput) { + let customFn = new Function('value', this.field.options.onInput) + customFn.call(this, value) + } + }, + + emitAppendButtonClick() { + /* 必须调用mixins中的dispatch方法逐级向父组件发送消息!! */ + this.dispatch('VFormRender', 'appendButtonClick', [this]); + }, + + handleOnChange(val, oldVal) { //自定义onChange事件 + if (!!this.field.options.onChange) { + let changeFn = new Function('value', 'oldValue', this.field.options.onChange) + changeFn.call(this, val, oldVal) + } + }, + + handleOnChangeForSubForm(val, oldVal, subFormData, rowId) { //子表单自定义onChange事件 + if (!!this.field.options.onChange) { + let changeFn = new Function('value', 'oldValue', 'subFormData', 'rowId', this.field.options.onChange) + changeFn.call(this, val, oldVal, subFormData, rowId) + } + }, + + handleButtonWidgetClick() { + if (!!this.designState) { //设计状态不触发点击事件 + return + } + + if (!!this.field.options.onClick) { + let changeFn = new Function(this.field.options.onClick) + changeFn.call(this) + } else { + this.dispatch('VFormRender', 'buttonClick', [this]); + } + }, + + remoteQuery(keyword) { + if (!!this.field.options.onRemoteQuery) { + let remoteFn = new Function('keyword', this.field.options.onRemoteQuery) + remoteFn.call(this, keyword) + } + }, + + //--------------------- 事件处理 end ------------------// + + //--------------------- 以下为组件支持外部调用的API方法 begin ------------------// + /* 提示:用户可自行扩充这些方法!!! */ + + getFormRef() { /* 获取VFrom引用,必须在VForm组件created之后方可调用 */ + return this.refList['v_form_ref'] + }, + + getWidgetRef(widgetName, showError) { + let foundRef = this.refList[widgetName] + if (!foundRef && !!showError) { + this.$message.error(this.i18nt('render.hint.refNotFound') + widgetName) + } + return foundRef + }, + + getFieldEditor() { //获取内置的el表单组件 + return this.$refs['fieldEditor'] + }, + + /* + 注意:VFormRender的setFormData方法不会触发子表单内field-widget的setValue方法, + 因为setFormData方法调用后,子表单内所有field-widget组件已被清空,接收不到setFormData事件!! + * */ + setValue(newValue) { + /* if ((this.field.type === 'picture-upload') || (this.field.type === 'file-upload')) { + this.fileList = newValue + } else */ if (!!this.field.formItemFlag) { + let oldValue = deepClone(this.fieldModel) + this.fieldModel = newValue + this.initFileList() + + this.syncUpdateFormModel(newValue) + this.emitFieldDataChange(newValue, oldValue) + } + }, + + getValue() { + /* if ((this.field.type === 'picture-upload') || (this.field.type === 'file-upload')) { + return this.fileList + } else */ { + return this.fieldModel + } + }, + + resetField() { + let defaultValue = this.field.options.defaultValue + this.setValue(defaultValue) + }, + + setWidgetOption(optionName, optionValue) { //通用组件选项修改API + if (this.field.options.hasOwnProperty(optionName)) { + this.field.options[optionName] = optionValue + //TODO: 是否重新构建组件??有些属性修改后必须重新构建组件才能生效,比如字段校验规则。 + } + }, + + setReadonly(flag) { + this.field.options.readonly = flag + }, + + setDisabled(flag) { + this.field.options.disabled = flag + }, + + setAppendButtonVisible(flag) { + this.field.options.appendButton = flag + }, + + setAppendButtonDisabled(flag) { + this.field.options.appendButtonDisabled = flag + }, + + setHidden(flag) { + this.field.options.hidden = flag + }, + + setRequired(flag) { + this.field.options.required = flag + this.buildFieldRules() + }, + + setLabel(newLabel) { + this.field.options.label = newLabel + }, + + focus() { + if (!!this.getFieldEditor() && !!this.getFieldEditor().focus) { + this.getFieldEditor().focus() + } + }, + + clearSelectedOptions() { //清空已选选项 + if ((this.field.type !== 'checkbox') && (this.field.type !== 'radio') && (this.field.type !== 'select')) { + return + } + + if ((this.field.type === 'checkbox') || + ((this.field.type === 'select') && this.field.options.multiple)) { + this.fieldModel = [] + } else { + this.fieldModel = '' + } + }, + + loadOptions(options) { + this.field.options.optionItems = deepClone(options) + this.clearSelectedOptions() //清空已选选项 + }, + + disableOption(optionValue) { + this.disableOptionOfList(this.field.options.optionItems, optionValue) + }, + + enableOption(optionValue) { + this.enableOptionOfList(this.field.options.optionItems, optionValue) + }, + + setUploadHeader(name, value) { + this.$set(this.uploadHeaders, name, value) + }, + + setUploadData(name, value) { + this.$set(this.uploadData, name, value) + }, + + setToolbar(customToolbar) { + this.customToolbar = customToolbar + }, + + //--------------------- 以上为组件支持外部调用的API方法 end ------------------// + + } +} diff --git a/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue b/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue new file mode 100644 index 0000000..cb03216 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue @@ -0,0 +1,264 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue b/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue new file mode 100644 index 0000000..b349931 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue @@ -0,0 +1,331 @@ + + + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/html-text-widget.vue b/src/components/form-designer/form-widget/field-widget/html-text-widget.vue new file mode 100644 index 0000000..f757971 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/html-text-widget.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/index.js b/src/components/form-designer/form-widget/field-widget/index.js new file mode 100644 index 0000000..9e0f6ae --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/index.js @@ -0,0 +1,10 @@ +const requireComponent = require.context('./', false, /\w+\.vue$/) + +let comps = {} + +requireComponent.keys().map(fileName => { + let comp = requireComponent(fileName).default; + comps[comp.name] = comp +}) + +export default comps; diff --git a/src/components/form-designer/form-widget/field-widget/input-widget.vue b/src/components/form-designer/form-widget/field-widget/input-widget.vue new file mode 100644 index 0000000..ae67698 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/input-widget.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/number-widget.vue b/src/components/form-designer/form-widget/field-widget/number-widget.vue new file mode 100644 index 0000000..95b424d --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/number-widget.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue b/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue new file mode 100644 index 0000000..e1f2286 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue @@ -0,0 +1,219 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/radio-widget.vue b/src/components/form-designer/form-widget/field-widget/radio-widget.vue new file mode 100644 index 0000000..db950ed --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/radio-widget.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/rate-widget.vue b/src/components/form-designer/form-widget/field-widget/rate-widget.vue new file mode 100644 index 0000000..4803a38 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/rate-widget.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/rich-editor-widget.vue b/src/components/form-designer/form-widget/field-widget/rich-editor-widget.vue new file mode 100644 index 0000000..99e85d1 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/rich-editor-widget.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/select-widget.vue b/src/components/form-designer/form-widget/field-widget/select-widget.vue new file mode 100644 index 0000000..248ccda --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/select-widget.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/slider-widget.vue b/src/components/form-designer/form-widget/field-widget/slider-widget.vue new file mode 100644 index 0000000..769905f --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/slider-widget.vue @@ -0,0 +1,100 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/static-content-wrapper.vue b/src/components/form-designer/form-widget/field-widget/static-content-wrapper.vue new file mode 100644 index 0000000..6000353 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/static-content-wrapper.vue @@ -0,0 +1,185 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/static-text-widget.vue b/src/components/form-designer/form-widget/field-widget/static-text-widget.vue new file mode 100644 index 0000000..ac7f15e --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/static-text-widget.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/switch-widget.vue b/src/components/form-designer/form-widget/field-widget/switch-widget.vue new file mode 100644 index 0000000..33c3350 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/switch-widget.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/textarea-widget.vue b/src/components/form-designer/form-widget/field-widget/textarea-widget.vue new file mode 100644 index 0000000..618f4a6 --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/textarea-widget.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/time-range-widget.vue b/src/components/form-designer/form-widget/field-widget/time-range-widget.vue new file mode 100644 index 0000000..a9d4d2f --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/time-range-widget.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/src/components/form-designer/form-widget/field-widget/time-widget.vue b/src/components/form-designer/form-widget/field-widget/time-widget.vue new file mode 100644 index 0000000..31f202a --- /dev/null +++ b/src/components/form-designer/form-widget/field-widget/time-widget.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/src/components/form-designer/form-widget/index.vue b/src/components/form-designer/form-widget/index.vue index d55ce26..527ea24 100644 --- a/src/components/form-designer/form-widget/index.vue +++ b/src/components/form-designer/form-widget/index.vue @@ -11,12 +11,12 @@ @@ -29,9 +29,9 @@ - - diff --git a/src/components/form-designer/index.vue b/src/components/form-designer/index.vue index 7e4dd9e..56bd118 100644 --- a/src/components/form-designer/index.vue +++ b/src/components/form-designer/index.vue @@ -2,7 +2,7 @@ /** * author: vformAdmin * email: vdpadmin@163.com - * website: http://www.vform666.com/ + * website: http://www.vform666.com * date: 2021.08.18 * remark: 如果要分发VForm源码,需在本文件顶部保留此文件头信息!! */ @@ -62,7 +62,7 @@ import VFormWidget from './form-widget/index' import {createDesigner} from "@/components/form-designer/designer"; import {addWindowResizeHandler, getQueryParam} from "@/utils/util"; - import {VARIANT_FORM_VERSION} from "@/utils/config"; + import {MOCK_CASE_URL, VARIANT_FORM_VERSION} from "@/utils/config"; import i18n, { changeLocale } from "@/utils/i18n"; export default { @@ -81,6 +81,8 @@ curLangName: '', vsCodeFlag: false, + caseName: '', + docUrl: 'http://www.vform666.com/document.html', gitUrl: 'https://github.com/vform666/variant-form', chatUrl: 'http://www.vform666.com/chat-group.html', @@ -98,6 +100,7 @@ }, created() { this.vsCodeFlag = getQueryParam('vscode') == 1 + this.caseName = getQueryParam('case') }, mounted() { this.initLocale() @@ -108,6 +111,8 @@ this.scrollerHeight = window.innerHeight - 56 - 36 + 'px' }) }) + + this.loadCase() }, methods: { openHome() { @@ -138,6 +143,24 @@ } }, + loadCase() { + if (!this.caseName) { + return + } + + axios.get(MOCK_CASE_URL + this.caseName).then(res => { + if (!!res.data.code) { + this.$message.error(this.i18nt('designer.hint.sampleLoadedFail')) + return + } + + this.setFormJson(res.data) + this.$message.success(this.i18nt('designer.hint.sampleLoadedSuccess')) + }).catch(error => { + this.$message.error(this.i18nt('designer.hint.sampleLoadedFail') + ':' +error) + }) + }, + initLocale() { let curLocale = localStorage.getItem('v_form_locale') if (!!this.vsCodeFlag) { diff --git a/src/components/form-designer/setting-panel/form-setting.vue b/src/components/form-designer/setting-panel/form-setting.vue new file mode 100644 index 0000000..b32bf7a --- /dev/null +++ b/src/components/form-designer/setting-panel/form-setting.vue @@ -0,0 +1,300 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/index.vue b/src/components/form-designer/setting-panel/index.vue index 4085c14..e0a305d 100644 --- a/src/components/form-designer/setting-panel/index.vue +++ b/src/components/form-designer/setting-panel/index.vue @@ -3,668 +3,70 @@ - - - - + - - - - - - - - - - - - {{i18nt('designer.setting.leftPosition')}} - {{i18nt('designer.setting.topPosition')}} - - - - - {{i18nt('designer.setting.leftAlign')}} - {{i18nt('designer.setting.centerAlign')}} - {{i18nt('designer.setting.rightAlign')}} - - - - - - - {{i18nt('designer.setting.addCss')}} - - - - - - - - - - {{i18nt('designer.setting.addEventHandler')}} - - - {{i18nt('designer.setting.formSFCSetting')}} - - - - - - - - - - - - - - - - {{i18nt('designer.setting.addEventHandler')}} - - - - {{i18nt('designer.setting.addEventHandler')}} - - - - - {{i18nt('designer.setting.addEventHandler')}} - - - - - - + @@ -672,7 +74,7 @@ - + - - - - - - - - - - - - - - - - @@ -1217,27 +268,6 @@ ::v-deep .el-form-item--mini.el-form-item { margin-bottom: 6px; } - - .radio-group-custom { - ::v-deep .el-radio-button__inner { - padding-left: 12px; - padding-right: 12px; - } - } - } - - li.col-item { - list-style: none; - - span.col-span-title { - display: inline-block; - font-size: 13px; - width: 120px; - } - - .col-delete-button { - margin-left: 6px; - } } /* 隐藏Chrome浏览器中el-input数字输入框右侧的上下调整小箭头 */ @@ -1251,11 +281,11 @@ -moz-appearance: textfield; } - .custom-divider.el-divider--horizontal { + ::v-deep .custom-divider.el-divider--horizontal { margin: 10px 0; } - .custom-divider-margin-top.el-divider--horizontal { + ::v-deep .custom-divider-margin-top.el-divider--horizontal { margin: 20px 0; } @@ -1265,22 +295,4 @@ } } - .panes-setting { - ul { - padding-inline-start: 0; - padding-left: 0; /* 重置IE11默认样式 */ - margin: 0; - } - - .drag-option { - cursor: move; - } - - li.ghost { - background: #fff; - border: 2px dotted $--color-primary; - } - } - - diff --git a/src/components/form-designer/setting-panel/property-editor/allowCreate-editor.vue b/src/components/form-designer/setting-panel/property-editor/allowCreate-editor.vue new file mode 100644 index 0000000..add2090 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/allowCreate-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/appendButton-editor.vue b/src/components/form-designer/setting-panel/property-editor/appendButton-editor.vue new file mode 100644 index 0000000..d844945 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/appendButton-editor.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/appendButtonDisabled-editor.vue b/src/components/form-designer/setting-panel/property-editor/appendButtonDisabled-editor.vue new file mode 100644 index 0000000..b76e318 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/appendButtonDisabled-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/automaticDropdown-editor.vue b/src/components/form-designer/setting-panel/property-editor/automaticDropdown-editor.vue new file mode 100644 index 0000000..cb8d7c6 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/automaticDropdown-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/border-editor.vue b/src/components/form-designer/setting-panel/property-editor/border-editor.vue new file mode 100644 index 0000000..4f77bec --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/border-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/buttonIcon-editor.vue b/src/components/form-designer/setting-panel/property-editor/buttonIcon-editor.vue new file mode 100644 index 0000000..93848a4 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/buttonIcon-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/buttonStyle-editor.vue b/src/components/form-designer/setting-panel/property-editor/buttonStyle-editor.vue new file mode 100644 index 0000000..cc635df --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/buttonStyle-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/clearable-editor.vue b/src/components/form-designer/setting-panel/property-editor/clearable-editor.vue new file mode 100644 index 0000000..4f79ff0 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/clearable-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/columnWidth-editor.vue b/src/components/form-designer/setting-panel/property-editor/columnWidth-editor.vue new file mode 100644 index 0000000..785e8c6 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/columnWidth-editor.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue b/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue new file mode 100644 index 0000000..a437939 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue b/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue new file mode 100644 index 0000000..0be4106 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/container-sub-form/showBlankRow-editor.vue b/src/components/form-designer/setting-panel/property-editor/container-sub-form/showBlankRow-editor.vue new file mode 100644 index 0000000..32dabd0 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/container-sub-form/showBlankRow-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/container-sub-form/showRowNumber-editor.vue b/src/components/form-designer/setting-panel/property-editor/container-sub-form/showRowNumber-editor.vue new file mode 100644 index 0000000..c69b365 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/container-sub-form/showRowNumber-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/container-sub-form/sub-form-labelAlign-editor.vue b/src/components/form-designer/setting-panel/property-editor/container-sub-form/sub-form-labelAlign-editor.vue new file mode 100644 index 0000000..aea845b --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/container-sub-form/sub-form-labelAlign-editor.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue b/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue new file mode 100644 index 0000000..89fc1dc --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue @@ -0,0 +1,119 @@ + + + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue b/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue new file mode 100644 index 0000000..0fab2bf --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue b/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue new file mode 100644 index 0000000..f2fad36 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/customClass-editor.vue b/src/components/form-designer/setting-panel/property-editor/customClass-editor.vue new file mode 100644 index 0000000..d0042a7 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/customClass-editor.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/defaultValue-editor.vue b/src/components/form-designer/setting-panel/property-editor/defaultValue-editor.vue new file mode 100644 index 0000000..2ccda17 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/defaultValue-editor.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/disabled-editor.vue b/src/components/form-designer/setting-panel/property-editor/disabled-editor.vue new file mode 100644 index 0000000..a25eaca --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/disabled-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/displayStyle-editor.vue b/src/components/form-designer/setting-panel/property-editor/displayStyle-editor.vue new file mode 100644 index 0000000..fef5866 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/displayStyle-editor.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/editable-editor.vue b/src/components/form-designer/setting-panel/property-editor/editable-editor.vue new file mode 100644 index 0000000..3f734c5 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/editable-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue b/src/components/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue new file mode 100644 index 0000000..bfb6a50 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/eventMixin.js b/src/components/form-designer/setting-panel/property-editor/event-handler/eventMixin.js new file mode 100644 index 0000000..b056222 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/eventMixin.js @@ -0,0 +1,19 @@ +import emitter from 'element-ui/lib/mixins/emitter' + +export default { + mixins: [emitter], + created() { + // this.$on('saveEventHandler', function (params) { + // //this.optionModel[eventName] = handlerCodes + // this.optionModel[params[0]] = params[1] + // }) + + }, + methods: { + editEventHandler(eventName, eventParams) { + this.dispatch('SettingPanel', 'editEventHandler', [eventName, [...eventParams]]) + }, + + + } +} diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onBeforeUpload-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onBeforeUpload-editor.vue new file mode 100644 index 0000000..e4355dd --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onBeforeUpload-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onBlur-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onBlur-editor.vue new file mode 100644 index 0000000..393f7e6 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onBlur-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onChange-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onChange-editor.vue new file mode 100644 index 0000000..8010610 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onChange-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue new file mode 100644 index 0000000..c154bcf --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue new file mode 100644 index 0000000..afc1e8c --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onFocus-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onFocus-editor.vue new file mode 100644 index 0000000..1c24dad --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onFocus-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onInput-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onInput-editor.vue new file mode 100644 index 0000000..35d4982 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onInput-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onMounted-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onMounted-editor.vue new file mode 100644 index 0000000..bbb8bc6 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onMounted-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onRemoteQuery-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onRemoteQuery-editor.vue new file mode 100644 index 0000000..5275c61 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onRemoteQuery-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowAdd-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowAdd-editor.vue new file mode 100644 index 0000000..26abcfe --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowAdd-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowChange-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowChange-editor.vue new file mode 100644 index 0000000..254638a --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowChange-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowDelete-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowDelete-editor.vue new file mode 100644 index 0000000..8666b9e --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowDelete-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowInsert-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowInsert-editor.vue new file mode 100644 index 0000000..ed71c3d --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowInsert-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onUploadError-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onUploadError-editor.vue new file mode 100644 index 0000000..7562f96 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onUploadError-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onUploadSuccess-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onUploadSuccess-editor.vue new file mode 100644 index 0000000..925f791 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onUploadSuccess-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue new file mode 100644 index 0000000..44cc2a1 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue new file mode 100644 index 0000000..4bb13de --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-button/circle-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-button/circle-editor.vue new file mode 100644 index 0000000..88522d5 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-button/circle-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-button/icon-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-button/icon-editor.vue new file mode 100644 index 0000000..177ce68 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-button/icon-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-button/plain-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-button/plain-editor.vue new file mode 100644 index 0000000..ed25895 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-button/plain-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-button/round-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-button/round-editor.vue new file mode 100644 index 0000000..8bde2a1 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-button/round-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-color/color-defaultValue-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-color/color-defaultValue-editor.vue new file mode 100644 index 0000000..186e558 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-color/color-defaultValue-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue new file mode 100644 index 0000000..0bb78d8 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue new file mode 100644 index 0000000..35a0353 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue new file mode 100644 index 0000000..e31e968 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue new file mode 100644 index 0000000..bdca28c --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue new file mode 100644 index 0000000..30d7de3 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue new file mode 100644 index 0000000..0a28e69 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue new file mode 100644 index 0000000..2dcb301 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue new file mode 100644 index 0000000..ae5c6f6 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue new file mode 100644 index 0000000..ca21786 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue new file mode 100644 index 0000000..92b2e89 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue new file mode 100644 index 0000000..6f9a893 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue new file mode 100644 index 0000000..6cc39e5 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue new file mode 100644 index 0000000..12457ee --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-rate/allowHalf-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-rate/allowHalf-editor.vue new file mode 100644 index 0000000..fd80e44 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-rate/allowHalf-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue new file mode 100644 index 0000000..c5fe412 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue new file mode 100644 index 0000000..00464b2 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue new file mode 100644 index 0000000..7d690b8 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue new file mode 100644 index 0000000..a43c192 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-rate/showScore-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-rate/showScore-editor.vue new file mode 100644 index 0000000..6be1b18 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-rate/showScore-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-rate/showText-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-rate/showText-editor.vue new file mode 100644 index 0000000..76fa1a8 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-rate/showText-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-slider/range-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-slider/range-editor.vue new file mode 100644 index 0000000..3a431b5 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-slider/range-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-slider/vertical-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-slider/vertical-editor.vue new file mode 100644 index 0000000..e5f0a19 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-slider/vertical-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue new file mode 100644 index 0000000..1056131 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue new file mode 100644 index 0000000..ee05395 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-switch/inactiveColor-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-switch/inactiveColor-editor.vue new file mode 100644 index 0000000..dd4cb5c --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-switch/inactiveColor-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-switch/switch-defaultValue-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-switch/switch-defaultValue-editor.vue new file mode 100644 index 0000000..1cd9b67 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-switch/switch-defaultValue-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue new file mode 100644 index 0000000..969f1c9 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue new file mode 100644 index 0000000..fbb04a4 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue new file mode 100644 index 0000000..d461dcc --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue new file mode 100644 index 0000000..d619b88 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue new file mode 100644 index 0000000..6ffe0bc --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue b/src/components/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue new file mode 100644 index 0000000..52df908 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/filterable-editor.vue b/src/components/form-designer/setting-panel/property-editor/filterable-editor.vue new file mode 100644 index 0000000..b0f9b58 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/filterable-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue b/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue new file mode 100644 index 0000000..53eb456 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/index.js b/src/components/form-designer/setting-panel/property-editor/index.js new file mode 100644 index 0000000..918fbdf --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/index.js @@ -0,0 +1,10 @@ +const requireComponent = require.context('./', true, /\w+\.vue$/) //遍历当前目录和子目录 + +let comps = {} + +requireComponent.keys().map(fileName => { + let comp = requireComponent(fileName).default; + comps[comp.name] = comp +}) + +export default comps; diff --git a/src/components/form-designer/setting-panel/property-editor/label-editor.vue b/src/components/form-designer/setting-panel/property-editor/label-editor.vue new file mode 100644 index 0000000..cfa112e --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/label-editor.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/labelAlign-editor.vue b/src/components/form-designer/setting-panel/property-editor/labelAlign-editor.vue new file mode 100644 index 0000000..a704ab8 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/labelAlign-editor.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/labelHidden-editor.vue b/src/components/form-designer/setting-panel/property-editor/labelHidden-editor.vue new file mode 100644 index 0000000..5225a1b --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/labelHidden-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue b/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue new file mode 100644 index 0000000..5e32f65 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue b/src/components/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue new file mode 100644 index 0000000..805c793 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue b/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue new file mode 100644 index 0000000..3ee1308 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/labelWidth-editor.vue b/src/components/form-designer/setting-panel/property-editor/labelWidth-editor.vue new file mode 100644 index 0000000..96cedad --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/labelWidth-editor.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/limit-editor.vue b/src/components/form-designer/setting-panel/property-editor/limit-editor.vue new file mode 100644 index 0000000..b9a64f2 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/limit-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/max-editor.vue b/src/components/form-designer/setting-panel/property-editor/max-editor.vue new file mode 100644 index 0000000..ab5f320 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/max-editor.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/maxLength-editor.vue b/src/components/form-designer/setting-panel/property-editor/maxLength-editor.vue new file mode 100644 index 0000000..9545cf4 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/maxLength-editor.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/min-editor.vue b/src/components/form-designer/setting-panel/property-editor/min-editor.vue new file mode 100644 index 0000000..513fd24 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/min-editor.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/minLength-editor.vue b/src/components/form-designer/setting-panel/property-editor/minLength-editor.vue new file mode 100644 index 0000000..1b0e2e4 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/minLength-editor.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/multiple-editor.vue b/src/components/form-designer/setting-panel/property-editor/multiple-editor.vue new file mode 100644 index 0000000..48fde31 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/multiple-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/multipleLimit-editor.vue b/src/components/form-designer/setting-panel/property-editor/multipleLimit-editor.vue new file mode 100644 index 0000000..3fae0c7 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/multipleLimit-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/multipleSelect-editor.vue b/src/components/form-designer/setting-panel/property-editor/multipleSelect-editor.vue new file mode 100644 index 0000000..0d2b7fc --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/multipleSelect-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/name-editor.vue b/src/components/form-designer/setting-panel/property-editor/name-editor.vue new file mode 100644 index 0000000..73e9b3d --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/name-editor.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue b/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue new file mode 100644 index 0000000..d911453 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/placeholder-editor.vue b/src/components/form-designer/setting-panel/property-editor/placeholder-editor.vue new file mode 100644 index 0000000..e44ff8e --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/placeholder-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/precision-editor.vue b/src/components/form-designer/setting-panel/property-editor/precision-editor.vue new file mode 100644 index 0000000..4e64878 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/precision-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/prefixIcon-editor.vue b/src/components/form-designer/setting-panel/property-editor/prefixIcon-editor.vue new file mode 100644 index 0000000..361ff3a --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/prefixIcon-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/propertyMixin.js b/src/components/form-designer/setting-panel/property-editor/propertyMixin.js new file mode 100644 index 0000000..2ef6a42 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/propertyMixin.js @@ -0,0 +1,47 @@ +export default { + methods: { + hasConfig(configName) { + if (!this.designer || !this.designer.selectedWidget) { + return false + } + + return this.designer.hasConfig(this.selectedWidget, configName) + }, + + emitDefaultValueChange() { + if (!!this.designer) { + if (!!this.designer.formWidget) { + let fieldWidget = this.designer.formWidget.getWidgetRef(this.designer.selectedWidget.options.name) + if (!!fieldWidget && !!fieldWidget.refreshDefaultValue) { + fieldWidget.refreshDefaultValue() + } + } + } + }, + + inputNumberHandler({target}) { + target.value = target.value.replace(/[^0-9]/gi, '') + }, + + onRemoteChange(val) { + if (!!val) { + this.optionModel.filterable = true + this.optionModel.allowCreate = false + } + }, + + onMultipleSelected(val) { + if (val) { + this.optionModel.defaultValue = [] //清空原默认值!! + } else { + if (!!this.optionModel.defaultValue && (this.optionModel.defaultValue.length > 0)) { + this.optionModel.defaultValue = this.optionModel.defaultValue[0] + } else { + this.optionModel.defaultValue = '' + } + } + }, + + + } +} diff --git a/src/components/form-designer/setting-panel/property-editor/readonly-editor.vue b/src/components/form-designer/setting-panel/property-editor/readonly-editor.vue new file mode 100644 index 0000000..7ff8bfd --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/readonly-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/remote-editor.vue b/src/components/form-designer/setting-panel/property-editor/remote-editor.vue new file mode 100644 index 0000000..2cf2582 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/remote-editor.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/required-editor.vue b/src/components/form-designer/setting-panel/property-editor/required-editor.vue new file mode 100644 index 0000000..6684f39 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/required-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/rows-editor.vue b/src/components/form-designer/setting-panel/property-editor/rows-editor.vue new file mode 100644 index 0000000..dafd688 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/rows-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/showFileList-editor.vue b/src/components/form-designer/setting-panel/property-editor/showFileList-editor.vue new file mode 100644 index 0000000..597e1da --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/showFileList-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/showPassword-editor.vue b/src/components/form-designer/setting-panel/property-editor/showPassword-editor.vue new file mode 100644 index 0000000..38c722f --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/showPassword-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/showWordLimit-editor.vue b/src/components/form-designer/setting-panel/property-editor/showWordLimit-editor.vue new file mode 100644 index 0000000..478f349 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/showWordLimit-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/size-editor.vue b/src/components/form-designer/setting-panel/property-editor/size-editor.vue new file mode 100644 index 0000000..671ceb5 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/size-editor.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue b/src/components/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue new file mode 100644 index 0000000..c1832a8 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/step-editor.vue b/src/components/form-designer/setting-panel/property-editor/step-editor.vue new file mode 100644 index 0000000..ac64aff --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/step-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/suffixIcon-editor.vue b/src/components/form-designer/setting-panel/property-editor/suffixIcon-editor.vue new file mode 100644 index 0000000..6f45b71 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/suffixIcon-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/type-editor.vue b/src/components/form-designer/setting-panel/property-editor/type-editor.vue new file mode 100644 index 0000000..7f4ee50 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/type-editor.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/uploadTip-editor.vue b/src/components/form-designer/setting-panel/property-editor/uploadTip-editor.vue new file mode 100644 index 0000000..f58b6fd --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/uploadTip-editor.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/uploadURL-editor.vue b/src/components/form-designer/setting-panel/property-editor/uploadURL-editor.vue new file mode 100644 index 0000000..6b651ae --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/uploadURL-editor.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/validation-editor.vue b/src/components/form-designer/setting-panel/property-editor/validation-editor.vue new file mode 100644 index 0000000..5ae5362 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/validation-editor.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/validationHint-editor.vue b/src/components/form-designer/setting-panel/property-editor/validationHint-editor.vue new file mode 100644 index 0000000..006696e --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/validationHint-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/property-editor/withCredentials-editor.vue b/src/components/form-designer/setting-panel/property-editor/withCredentials-editor.vue new file mode 100644 index 0000000..39b35eb --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/withCredentials-editor.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/form-designer/setting-panel/propertyRegister.js b/src/components/form-designer/setting-panel/propertyRegister.js new file mode 100644 index 0000000..1e1c9f3 --- /dev/null +++ b/src/components/form-designer/setting-panel/propertyRegister.js @@ -0,0 +1,144 @@ +/** + * 格式说明:属性名称==对应属性编辑器的组件名称 + */ +let COMMON_PROPERTIES = { + //字段 + 'name' : 'name-editor', + 'label' : 'label-editor', + 'labelAlign' : 'labelAlign-editor', + 'type' : 'type-editor', + 'defaultValue' : 'defaultValue-editor', + 'placeholder' : 'placeholder-editor', + 'startPlaceholder' : 'startPlaceholder-editor', + 'endPlaceholder' : 'endPlaceholder-editor', + 'columnWidth' : 'columnWidth-editor', + 'size' : 'size-editor', + 'displayStyle' : 'displayStyle-editor', + 'buttonStyle' : 'buttonStyle-editor', + 'border' : 'border-editor', + 'labelWidth' : 'labelWidth-editor', + 'labelHidden' : 'labelHidden-editor', + 'rows' : 'rows-editor', + 'required' : 'required-editor', + 'validation' : 'validation-editor', + 'validationHint' : 'validationHint-editor', + 'readonly' : 'readonly-editor', + 'disabled' : 'disabled-editor', + 'hidden' : 'hidden-editor', + 'clearable' : 'clearable-editor', + 'editable' : 'editable-editor', + 'showPassword' : 'showPassword-editor', + 'textContent' : 'textContent-editor', + 'htmlContent' : 'htmlContent-editor', + 'format' : 'format-editor', + 'valueFormat' : 'valueFormat-editor', + 'filterable' : 'filterable-editor', + 'allowCreate' : 'allowCreate-editor', + 'remote' : 'remote-editor', + 'automaticDropdown' : 'automaticDropdown-editor', + 'multiple' : 'multiple-editor', + 'multipleLimit' : 'multipleLimit-editor', + 'contentPosition' : 'contentPosition-editor', + 'optionItems' : 'optionItems-editor', + 'uploadURL' : 'uploadURL-editor', + 'uploadTip' : 'uploadTip-editor', + 'withCredentials' : 'withCredentials-editor', + 'multipleSelect' : 'multipleSelect-editor', + 'limit' : 'limit-editor', + 'fileMaxSize' : 'fileMaxSize-editor', + 'fileTypes' : 'fileTypes-editor', + 'customClass' : 'customClass-editor', + + //容器 + 'showBlankRow' : 'showBlankRow-editor', + 'showRowNumber' : 'showRowNumber-editor', + 'cellWidth' : 'cellWidth-editor', + 'cellHeight' : 'cellHeight-editor', + 'gutter' : 'gutter-editor', + 'span' : 'span-editor', + +} + +let ADVANCED_PROPERTIES = { + 'min' : 'min-editor', + 'max' : 'max-editor', + 'precision' : 'precision-editor', + 'step' : 'step-editor', + 'controlsPosition' : 'controlsPosition-editor', + 'minLength' : 'minLength-editor', + 'maxLength' : 'maxLength-editor', + 'showWordLimit' : 'showWordLimit-editor', + 'prefixIcon' : 'prefixIcon-editor', + 'suffixIcon' : 'suffixIcon-editor', + 'switchWidth' : 'switchWidth-editor', + 'activeText' : 'activeText-editor', + 'inactiveText' : 'inactiveText-editor', + 'activeColor' : 'activeColor-editor', + 'inactiveColor' : 'inactiveColor-editor', + 'lowThreshold' : 'lowThreshold-editor', + 'highThreshold' : 'highThreshold-editor', + 'allowHalf' : 'allowHalf-editor', + 'showText' : 'showText-editor', + 'showScore' : 'showScore-editor', + 'range' : 'range-editor', + 'vertical' : 'vertical-editor', + 'plain' : 'plain-editor', + 'round' : 'round-editor', + 'circle' : 'circle-editor', + 'icon' : 'icon-editor', + 'labelIconClass' : 'labelIconClass-editor', + 'labelIconPosition' : 'labelIconPosition-editor', + 'labelTooltip' : 'labelTooltip-editor', + 'appendButton' : 'appendButton-editor', + 'appendButtonDisabled': 'appendButtonDisabled-editor', + 'buttonIcon' : 'buttonIcon-editor', + +} + +let EVENT_PROPERTIES = { + //字段 + 'onCreated' : 'onCreated-editor', + 'onMounted' : 'onMounted-editor', + 'onClick' : 'onClick-editor', + 'onInput' : 'onInput-editor', + 'onChange' : 'onChange-editor', + 'onFocus' : 'onFocus-editor', + 'onBlur' : 'onBlur-editor', + 'onRemoteQuery' : 'onRemoteQuery-editor', + 'onBeforeUpload' : 'onBeforeUpload-editor', + 'onUploadSuccess' : 'onUploadSuccess-editor', + 'onUploadError' : 'onUploadError-editor', + 'onValidate' : 'onValidate-editor', + + //容器 + 'onSubFormRowAdd' : 'onSubFormRowAdd-editor', + 'onSubFormRowInsert': 'onSubFormRowInsert-editor', + 'onSubFormRowDelete': 'onSubFormRowDelete-editor', + 'onSubFormRowChange': 'onSubFormRowChange-editor', + +} + +/** + * 如属性编辑器的组件名称设置为null,则不显示该属性编辑器!! + * @param propName 属性名称 + * @param propEditorName 对应属性编辑器的组件名称 + */ +export function registerCommonProperty(propName, propEditorName) { + COMMON_PROPERTIES[propName] = propEditorName +} + +export function registerAdvancedProperty(propName, propEditorName) { + ADVANCED_PROPERTIES[propName] = propEditorName +} + +export function registerEventProperty(propName, propEditorName) { + EVENT_PROPERTIES[propName] = propEditorName +} + +export default { + COMMON_PROPERTIES, + ADVANCED_PROPERTIES, + EVENT_PROPERTIES +} + + diff --git a/src/components/form-designer/widget-panel/widgetsConfig.js b/src/components/form-designer/widget-panel/widgetsConfig.js index 0c84cd0..be26dd4 100644 --- a/src/components/form-designer/widget-panel/widgetsConfig.js +++ b/src/components/form-designer/widget-panel/widgetsConfig.js @@ -9,6 +9,7 @@ export const containers = [ name: '', hidden: false, gutter: 12, + customClass: '', //自定义css类名 } }, @@ -20,6 +21,7 @@ export const containers = [ options: { name: '', hidden: false, + customClass: '', //自定义css类名 } }, @@ -32,6 +34,7 @@ export const containers = [ options: { name: '', hidden: false, + customClass: '', //自定义css类名 } }, @@ -44,6 +47,7 @@ export const containers = [ options: { name: '', hidden: false, + customClass: '', //自定义css类名 } }, */ @@ -58,6 +62,7 @@ export const containers = [ name: '', hidden: false, span: 12, + customClass: '', //自定义css类名 } }, @@ -74,6 +79,7 @@ export const containers = [ cellHeight: '', colspan: 1, rowspan: 1, + customClass: '', //自定义css类名 } }, @@ -89,6 +95,7 @@ export const containers = [ hidden: false, active: false, disabled: false, + customClass: '', //自定义css类名 } }, diff --git a/src/components/form-render/container-item.vue b/src/components/form-render/container-item.vue deleted file mode 100644 index 8007006..0000000 --- a/src/components/form-render/container-item.vue +++ /dev/null @@ -1,599 +0,0 @@ - - - - - diff --git a/src/components/form-render/container-item/container-item-wrapper.vue b/src/components/form-render/container-item/container-item-wrapper.vue new file mode 100644 index 0000000..b42f7ea --- /dev/null +++ b/src/components/form-render/container-item/container-item-wrapper.vue @@ -0,0 +1,25 @@ + + + + + + + diff --git a/src/components/form-render/container-item/containerItemMixin.js b/src/components/form-render/container-item/containerItemMixin.js new file mode 100644 index 0000000..89de7b0 --- /dev/null +++ b/src/components/form-render/container-item/containerItemMixin.js @@ -0,0 +1,136 @@ +import {generateId} from "@/utils/util"; + +export default { + computed: { + customClass() { + return this.widget.options.customClass || '' + }, + + formModel: { + cache: false, + get() { + return this.globalModel.formModel + } + }, + + }, + + methods: { + unregisterFromRefList() { //销毁容器组件时注销组件ref + if ((this.refList !== null) && !!this.widget.options.name) { + let oldRefName = this.widget.options.name + delete this.refList[oldRefName] + } + }, + + //--------------------- 以下为组件支持外部调用的API方法 begin ------------------// + /* 提示:用户可自行扩充这些方法!!! */ + + setHidden(flag) { + this.widget.options.hidden = flag + }, + + activeTab(tabIndex) { //tabIndex从0计数 + if ((tabIndex >= 0) && (tabIndex < this.widget.tabs.length)) { + this.widget.tabs.forEach((tp, idx) => { + tp.options.active = idx === tabIndex + if (idx === tabIndex) { + this.activeTabName = tp.options.name + } + }) + + } + }, + + disableTab(tabIndex) { + if ((tabIndex >= 0) && (tabIndex < this.widget.tabs.length)) { + this.widget.tabs[tabIndex].options.disabled = true + } + }, + + enableTab(tabIndex) { + if ((tabIndex >= 0) && (tabIndex < this.widget.tabs.length)) { + this.widget.tabs[tabIndex].options.disabled = false + } + }, + + hideTab(tabIndex) { + if ((tabIndex >= 0) && (tabIndex < this.widget.tabs.length)) { + this.widget.tabs[tabIndex].options.hidden = true + } + }, + + showTab(tabIndex) { + if ((tabIndex >= 0) && (tabIndex < this.widget.tabs.length)) { + this.widget.tabs[tabIndex].options.hidden = false + } + }, + + disableSubFormRow(rowIndex) { + this.widget.widgetList.forEach(subWidget => { + let swRefName = subWidget.options.name + '@row' + this.rowIdData[rowIndex] + let foundSW = this.getWidgetRef(swRefName) + if (!!foundSW) { + foundSW.setDisabled(true) + } + }) + }, + + enableSubFormRow(rowIndex) { + this.widget.widgetList.forEach(subWidget => { + let swRefName = subWidget.options.name + '@row' + this.rowIdData[rowIndex] + let foundSW = this.getWidgetRef(swRefName) + if (!!foundSW) { + foundSW.setDisabled(false) + } + }) + }, + + disableSubForm() { + if (this.rowIdData.length > 0) { + this.rowIdData.forEach((dataRow, rIdx) => { + this.disableSubFormRow(rIdx) + }) + } + }, + + enableSubForm() { + if (this.rowIdData.length > 0) { + this.rowIdData.forEach((dataRow, rIdx) => { + this.enableSubFormRow(rIdx) + }) + } + }, + + resetSubForm() { //重置subForm数据为空 + if (this.widget.type === 'sub-form') { + let subFormModel = this.formModel[this.widget.options.name] + if (!!subFormModel) { + subFormModel.splice(0, subFormModel.length) + this.rowIdData.splice(0, this.rowIdData.length) + } + } + }, + + getSubFormValues(needValidation = true) { + if (this.widget.type === 'sub-form') { + //TODO: 逐行校验子表单!! + return this.formModel[this.widget.options.name] + } else { + this.$message.error(this.i18nt('render.hint.nonSubFormType')) + } + }, + + // validateField(fieldName) { //逐行校验子表单字段 + // //TODO: + // }, + // + // validateSubForm() { //逐行校验子表单全部字段 + // //TODO: + // }, + + //--------------------- 以上为组件支持外部调用的API方法 end ------------------// + + }, + +} diff --git a/src/components/form-render/grid-col-item.vue b/src/components/form-render/container-item/grid-col-item.vue similarity index 70% rename from src/components/form-render/grid-col-item.vue rename to src/components/form-render/container-item/grid-col-item.vue index ba2c5ca..bf20f3b 100644 --- a/src/components/form-render/grid-col-item.vue +++ b/src/components/form-render/container-item/grid-col-item.vue @@ -4,12 +4,12 @@ @@ -22,18 +22,18 @@ + + diff --git a/src/components/form-render/container-item/index.js b/src/components/form-render/container-item/index.js new file mode 100644 index 0000000..9e0f6ae --- /dev/null +++ b/src/components/form-render/container-item/index.js @@ -0,0 +1,10 @@ +const requireComponent = require.context('./', false, /\w+\.vue$/) + +let comps = {} + +requireComponent.keys().map(fileName => { + let comp = requireComponent(fileName).default; + comps[comp.name] = comp +}) + +export default comps; diff --git a/src/components/form-render/container-item/sub-form-item.vue b/src/components/form-render/container-item/sub-form-item.vue new file mode 100644 index 0000000..18247ad --- /dev/null +++ b/src/components/form-render/container-item/sub-form-item.vue @@ -0,0 +1,405 @@ + + + + + diff --git a/src/components/form-render/container-item/tab-item.vue b/src/components/form-render/container-item/tab-item.vue new file mode 100644 index 0000000..6b07cf6 --- /dev/null +++ b/src/components/form-render/container-item/tab-item.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/src/components/form-render/table-cell-item.vue b/src/components/form-render/container-item/table-cell-item.vue similarity index 61% rename from src/components/form-render/table-cell-item.vue rename to src/components/form-render/container-item/table-cell-item.vue index 9dec7c4..99e33ba 100644 --- a/src/components/form-render/table-cell-item.vue +++ b/src/components/form-render/container-item/table-cell-item.vue @@ -4,29 +4,30 @@ :style="{width: widget.options.cellWidth + ' !important' || '', height: widget.options.cellHeight + ' !important' || ''}"> + + diff --git a/src/components/form-render/index.vue b/src/components/form-render/index.vue index 6173414..133d1d7 100644 --- a/src/components/form-render/index.vue +++ b/src/components/form-render/index.vue @@ -2,7 +2,7 @@ /** * author: vformAdmin * email: vdpadmin@163.com - * website: http://www.vform666.com/ + * website: http://www.vform666.com * date: 2021.08.18 * remark: 如果要分发VForm源码,需在本文件顶部保留此文件头信息!! */ @@ -15,12 +15,12 @@ @submit.native.prevent> @@ -29,19 +29,20 @@