skhj-variant 2.1.12
Sign up to get free protection for your applications and to get access to all the features.
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/package.iml +12 -0
- package/README.md +180 -0
- package/babel.config.js +5 -0
- package/dist/build/css/app.9b74af27.css +1 -0
- package/dist/build/css/chunk-vendors.a16c4353.css +1 -0
- package/dist/build/favicon.ico +0 -0
- package/dist/build/fonts/element-icons.535877f5.woff +0 -0
- package/dist/build/fonts/element-icons.732389de.ttf +0 -0
- package/dist/build/img/t1.21b2c158.png +0 -0
- package/dist/build/img/t2.6991670f.png +0 -0
- package/dist/build/img/t3.49724600.png +0 -0
- package/dist/build/img/t4.4acb1808.png +0 -0
- package/dist/build/img/t5.e5e1948c.png +0 -0
- package/dist/build/img/t6.40836551.png +0 -0
- package/dist/build/img/t7.94cf1cc9.png +0 -0
- package/dist/build/img/t8.9291e9c1.png +0 -0
- package/dist/build/index.html +1 -0
- package/dist/build/js/app.dbcf7751.js +1 -0
- package/dist/build/js/chunk-1d66e3dd.7d669272.js +23 -0
- package/dist/build/js/chunk-vendors.be32fc27.js +24 -0
- package/dist/build/report.html +53 -0
- package/dist/lib/VFormDesigner.common-report.html +53 -0
- package/dist/lib/VFormDesigner.common.1.js +14583 -0
- package/dist/lib/VFormDesigner.common.1.js.map +1 -0
- package/dist/lib/VFormDesigner.common.js +71232 -0
- package/dist/lib/VFormDesigner.common.js.map +1 -0
- package/dist/lib/VFormDesigner.css +1 -0
- package/dist/lib/VFormDesigner.umd-report.html +53 -0
- package/dist/lib/VFormDesigner.umd.1.js +14583 -0
- package/dist/lib/VFormDesigner.umd.1.js.map +1 -0
- package/dist/lib/VFormDesigner.umd.js +71242 -0
- package/dist/lib/VFormDesigner.umd.js.map +1 -0
- package/dist/lib/VFormDesigner.umd.min-report.html +53 -0
- package/dist/lib/VFormDesigner.umd.min.1.js +23 -0
- package/dist/lib/VFormDesigner.umd.min.js +19 -0
- package/dist/lib/demo.html +10 -0
- package/dist/lib/img/t1.21b2c158.png +0 -0
- package/dist/lib/img/t2.6991670f.png +0 -0
- package/dist/lib/img/t3.49724600.png +0 -0
- package/dist/lib/img/t4.4acb1808.png +0 -0
- package/dist/lib/img/t5.e5e1948c.png +0 -0
- package/dist/lib/img/t6.40836551.png +0 -0
- package/dist/lib/img/t7.94cf1cc9.png +0 -0
- package/dist/lib/img/t8.9291e9c1.png +0 -0
- package/dist/lib-render/VFormRender.common-report.html +53 -0
- package/dist/lib-render/VFormRender.common.1.js +14583 -0
- package/dist/lib-render/VFormRender.common.1.js.map +1 -0
- package/dist/lib-render/VFormRender.common.js +32421 -0
- package/dist/lib-render/VFormRender.common.js.map +1 -0
- package/dist/lib-render/VFormRender.css +1 -0
- package/dist/lib-render/VFormRender.umd-report.html +53 -0
- package/dist/lib-render/VFormRender.umd.1.js +14583 -0
- package/dist/lib-render/VFormRender.umd.1.js.map +1 -0
- package/dist/lib-render/VFormRender.umd.js +32431 -0
- package/dist/lib-render/VFormRender.umd.js.map +1 -0
- package/dist/lib-render/VFormRender.umd.min-report.html +53 -0
- package/dist/lib-render/VFormRender.umd.min.1.js +23 -0
- package/dist/lib-render/VFormRender.umd.min.js +15 -0
- package/dist/lib-render/demo.html +10 -0
- package/index_template/index_dev.html +19 -0
- package/index_template/index_prod.html +28 -0
- package/index_template/vform_demo.gif +0 -0
- package/install-render.js +29 -0
- package/install.js +41 -0
- package/jsconfig.json +10 -0
- package/license.txt +8 -0
- package/package.json +58 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +28 -0
- package/src/App.vue +22 -0
- package/src/assets/ft-images/t1.png +0 -0
- package/src/assets/ft-images/t2.png +0 -0
- package/src/assets/ft-images/t3.png +0 -0
- package/src/assets/ft-images/t4.png +0 -0
- package/src/assets/ft-images/t5.png +0 -0
- package/src/assets/ft-images/t6.png +0 -0
- package/src/assets/ft-images/t7.png +0 -0
- package/src/assets/ft-images/t8.png +0 -0
- package/src/assets/style.scss +92 -0
- package/src/assets/vform-logo.png +0 -0
- package/src/components/code-editor/index.vue +130 -0
- package/src/components/form-designer/designer.js +926 -0
- package/src/components/form-designer/form-widget/container-widget/container-wrapper.vue +107 -0
- package/src/components/form-designer/form-widget/container-widget/containerMixin.js +85 -0
- package/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue +310 -0
- package/src/components/form-designer/form-widget/container-widget/grid-widget.vue +89 -0
- package/src/components/form-designer/form-widget/container-widget/index.js +24 -0
- package/src/components/form-designer/form-widget/container-widget/tab-widget.vue +119 -0
- package/src/components/form-designer/form-widget/container-widget/table-cell-widget.vue +341 -0
- package/src/components/form-designer/form-widget/container-widget/table-widget.vue +111 -0
- package/src/components/form-designer/form-widget/field-widget/button-widget.vue +87 -0
- package/src/components/form-designer/form-widget/field-widget/cascader-widget.vue +104 -0
- package/src/components/form-designer/form-widget/field-widget/checkbox-widget.vue +105 -0
- package/src/components/form-designer/form-widget/field-widget/color-widget.vue +99 -0
- package/src/components/form-designer/form-widget/field-widget/date-range-widget.vue +104 -0
- package/src/components/form-designer/form-widget/field-widget/date-widget.vue +103 -0
- package/src/components/form-designer/form-widget/field-widget/divider-widget.vue +83 -0
- package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +535 -0
- package/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue +271 -0
- package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue +331 -0
- package/src/components/form-designer/form-widget/field-widget/html-text-widget.vue +82 -0
- package/src/components/form-designer/form-widget/field-widget/index.js +10 -0
- package/src/components/form-designer/form-widget/field-widget/input-widget.vue +112 -0
- package/src/components/form-designer/form-widget/field-widget/number-widget.vue +103 -0
- package/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue +226 -0
- package/src/components/form-designer/form-widget/field-widget/radio-widget.vue +105 -0
- package/src/components/form-designer/form-widget/field-widget/rate-widget.vue +102 -0
- package/src/components/form-designer/form-widget/field-widget/rich-editor-widget.vue +122 -0
- package/src/components/form-designer/form-widget/field-widget/select-widget.vue +115 -0
- package/src/components/form-designer/form-widget/field-widget/slider-widget.vue +100 -0
- package/src/components/form-designer/form-widget/field-widget/static-content-wrapper.vue +189 -0
- package/src/components/form-designer/form-widget/field-widget/static-text-widget.vue +82 -0
- package/src/components/form-designer/form-widget/field-widget/switch-widget.vue +101 -0
- package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue +99 -0
- package/src/components/form-designer/form-widget/field-widget/time-range-widget.vue +104 -0
- package/src/components/form-designer/form-widget/field-widget/time-widget.vue +103 -0
- package/src/components/form-designer/form-widget/index.vue +260 -0
- package/src/components/form-designer/index.vue +448 -0
- package/src/components/form-designer/setting-panel/form-setting.vue +324 -0
- package/src/components/form-designer/setting-panel/index.vue +328 -0
- package/src/components/form-designer/setting-panel/option-items-setting.vue +234 -0
- package/src/components/form-designer/setting-panel/property-editor/allowCreate-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/appendButton-editor.vue +28 -0
- package/src/components/form-designer/setting-panel/property-editor/appendButtonDisabled-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/automaticDropdown-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/border-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/buttonIcon-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/buttonStyle-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/clearable-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/columnWidth-editor.vue +40 -0
- package/src/components/form-designer/setting-panel/property-editor/container-grid/colHeight-editor.vue +28 -0
- package/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +81 -0
- package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-responsive-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue +48 -0
- package/src/components/form-designer/setting-panel/property-editor/container-sub-form/showBlankRow-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/container-sub-form/showRowNumber-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/container-sub-form/sub-form-labelAlign-editor.vue +36 -0
- package/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue +119 -0
- package/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/customClass-editor.vue +40 -0
- package/src/components/form-designer/setting-panel/property-editor/defaultValue-editor.vue +25 -0
- package/src/components/form-designer/setting-panel/property-editor/disabled-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/displayStyle-editor.vue +26 -0
- package/src/components/form-designer/setting-panel/property-editor/editable-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/eventMixin.js +12 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onBeforeUpload-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onBlur-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onChange-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue +31 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onFocus-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onInput-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onMounted-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onRemoteQuery-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowAdd-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowChange-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowDelete-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowInsert-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onUploadError-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onUploadSuccess-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue +32 -0
- package/src/components/form-designer/setting-panel/property-editor/field-button/circle-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-button/icon-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-button/plain-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/field-button/round-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-color/color-defaultValue-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue +26 -0
- package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue +27 -0
- package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue +26 -0
- package/src/components/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue +27 -0
- package/src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue +44 -0
- package/src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue +27 -0
- package/src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue +43 -0
- package/src/components/form-designer/setting-panel/property-editor/field-rate/allowHalf-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +26 -0
- package/src/components/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue +25 -0
- package/src/components/form-designer/setting-panel/property-editor/field-rate/showScore-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-rate/showText-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-slider/range-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-slider/showStops-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-slider/vertical-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-switch/activeColor-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-switch/inactiveColor-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-switch/inactiveText-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-switch/switch-defaultValue-editor.vue +25 -0
- package/src/components/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue +27 -0
- package/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue +27 -0
- package/src/components/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/filterable-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/index.js +10 -0
- package/src/components/form-designer/setting-panel/property-editor/label-editor.vue +30 -0
- package/src/components/form-designer/setting-panel/property-editor/labelAlign-editor.vue +42 -0
- package/src/components/form-designer/setting-panel/property-editor/labelHidden-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue +28 -0
- package/src/components/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +37 -0
- package/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/labelWidth-editor.vue +25 -0
- package/src/components/form-designer/setting-panel/property-editor/limit-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/max-editor.vue +39 -0
- package/src/components/form-designer/setting-panel/property-editor/maxLength-editor.vue +40 -0
- package/src/components/form-designer/setting-panel/property-editor/min-editor.vue +40 -0
- package/src/components/form-designer/setting-panel/property-editor/minLength-editor.vue +41 -0
- package/src/components/form-designer/setting-panel/property-editor/multiple-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/multipleSelect-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/name-editor.vue +80 -0
- package/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue +28 -0
- package/src/components/form-designer/setting-panel/property-editor/placeholder-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/precision-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/prefixIcon-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/propertyMixin.js +47 -0
- package/src/components/form-designer/setting-panel/property-editor/readonly-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/remote-editor.vue +25 -0
- package/src/components/form-designer/setting-panel/property-editor/required-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/rows-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/showFileList-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/showPassword-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/showWordLimit-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/size-editor.vue +38 -0
- package/src/components/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/step-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/suffixIcon-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/type-editor.vue +33 -0
- package/src/components/form-designer/setting-panel/property-editor/uploadTip-editor.vue +24 -0
- package/src/components/form-designer/setting-panel/property-editor/uploadURL-editor.vue +28 -0
- package/src/components/form-designer/setting-panel/property-editor/validation-editor.vue +48 -0
- package/src/components/form-designer/setting-panel/property-editor/validationHint-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor/withCredentials-editor.vue +23 -0
- package/src/components/form-designer/setting-panel/property-editor-factory.js +173 -0
- package/src/components/form-designer/setting-panel/propertyRegister.js +198 -0
- package/src/components/form-designer/toolbar-panel/index.vue +1070 -0
- package/src/components/form-designer/widget-panel/index.vue +530 -0
- package/src/components/form-designer/widget-panel/templatesConfig.js +58 -0
- package/src/components/form-designer/widget-panel/widgetsConfig.js +966 -0
- package/src/components/form-render/container-item/container-item-wrapper.vue +34 -0
- package/src/components/form-render/container-item/containerItemMixin.js +136 -0
- package/src/components/form-render/container-item/grid-col-item.vue +115 -0
- package/src/components/form-render/container-item/grid-item.vue +54 -0
- package/src/components/form-render/container-item/index.js +24 -0
- package/src/components/form-render/container-item/sub-form-item.vue +405 -0
- package/src/components/form-render/container-item/tab-item.vue +89 -0
- package/src/components/form-render/container-item/table-cell-item.vue +61 -0
- package/src/components/form-render/container-item/table-item.vue +65 -0
- package/src/components/form-render/index.vue +712 -0
- package/src/components/form-render/refMixin.js +22 -0
- package/src/components/svg-icon/index.vue +49 -0
- package/src/components/v-table/index.vue +106 -0
- package/src/extension/extension-helper.js +23 -0
- package/src/extension/extension-loader.js +112 -0
- package/src/extension/samples/alert/alert-widget.vue +72 -0
- package/src/extension/samples/card/card-item.vue +90 -0
- package/src/extension/samples/card/card-widget.vue +119 -0
- package/src/extension/samples/extension-schema.js +36 -0
- package/src/extension/samples/extension-sfc-generator.js +50 -0
- package/src/iconfont/iconfont.css +29 -0
- package/src/iconfont/iconfont.eot +0 -0
- package/src/iconfont/iconfont.js +1 -0
- package/src/iconfont/iconfont.json +37 -0
- package/src/iconfont/iconfont.svg +35 -0
- package/src/iconfont/iconfont.ttf +0 -0
- package/src/iconfont/iconfont.woff +0 -0
- package/src/iconfont/iconfont.woff2 +0 -0
- package/src/icons/index.js +9 -0
- package/src/icons/svg/alert.svg +1 -0
- package/src/icons/svg/button.svg +1 -0
- package/src/icons/svg/card.svg +1 -0
- package/src/icons/svg/cascader-field.svg +1 -0
- package/src/icons/svg/checkbox-field.svg +1 -0
- package/src/icons/svg/color-field.svg +1 -0
- package/src/icons/svg/custom-component.svg +1 -0
- package/src/icons/svg/data-table.svg +1 -0
- package/src/icons/svg/date-field.svg +1 -0
- package/src/icons/svg/date-range-field.svg +1 -0
- package/src/icons/svg/divider.svg +1 -0
- package/src/icons/svg/document.svg +1 -0
- package/src/icons/svg/drag.svg +1 -0
- package/src/icons/svg/file-upload-field.svg +1 -0
- package/src/icons/svg/github.svg +1 -0
- package/src/icons/svg/grid.svg +1 -0
- package/src/icons/svg/html-text.svg +1 -0
- package/src/icons/svg/node-tree.svg +1 -0
- package/src/icons/svg/number-field.svg +1 -0
- package/src/icons/svg/picture-upload-field.svg +1 -0
- package/src/icons/svg/radio-field.svg +1 -0
- package/src/icons/svg/rate-field.svg +1 -0
- package/src/icons/svg/redo.svg +1 -0
- package/src/icons/svg/rich-editor-field.svg +1 -0
- package/src/icons/svg/section.svg +1 -0
- package/src/icons/svg/select-field.svg +1 -0
- package/src/icons/svg/slider-field.svg +1 -0
- package/src/icons/svg/slot-component.svg +1 -0
- package/src/icons/svg/static-text.svg +1 -0
- package/src/icons/svg/sub-form.svg +1 -0
- package/src/icons/svg/switch-field.svg +1 -0
- package/src/icons/svg/tab.svg +1 -0
- package/src/icons/svg/table.svg +1 -0
- package/src/icons/svg/text-field.svg +1 -0
- package/src/icons/svg/textarea-field.svg +1 -0
- package/src/icons/svg/time-field.svg +1 -0
- package/src/icons/svg/time-range-field.svg +1 -0
- package/src/icons/svg/undo.svg +1 -0
- package/src/icons/svg/vue-sfc.svg +1 -0
- package/src/index.js +41 -0
- package/src/lang/en-US.js +321 -0
- package/src/lang/en-US_extension.js +26 -0
- package/src/lang/en-US_render.js +38 -0
- package/src/lang/zh-CN.js +321 -0
- package/src/lang/zh-CN_extension.js +26 -0
- package/src/lang/zh-CN_render.js +38 -0
- package/src/main.js +29 -0
- package/src/styles/global.scss +103 -0
- package/src/styles/index.scss +15 -0
- package/src/utils/beautifierLoader.js +77 -0
- package/src/utils/code-generator.js +91 -0
- package/src/utils/config.js +19 -0
- package/src/utils/debug-console.js +7 -0
- package/src/utils/directive.js +74 -0
- package/src/utils/i18n.js +70 -0
- package/src/utils/sfc-generator.js +583 -0
- package/src/utils/util.js +232 -0
- package/src/utils/validators.js +127 -0
- package/src/utils/vue2js-generator.js +144 -0
- package/src/utils/vue3js-generator.js +70 -0
- package/vue.config.js +92 -0
@@ -0,0 +1,324 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<el-form :model="formConfig" size="mini" label-position="left" label-width="120px"
|
4
|
+
class="setting-form" @submit.native.prevent>
|
5
|
+
<el-collapse v-model="formActiveCollapseNames" class="setting-collapse">
|
6
|
+
<el-collapse-item name="1" :title="i18nt('designer.setting.basicSetting')">
|
7
|
+
<el-form-item :label="i18nt('designer.setting.formSize')">
|
8
|
+
<el-select v-model="formConfig.size">
|
9
|
+
<el-option v-for="item in formSizes" :key="item.value" :label="item.label"
|
10
|
+
:value="item.value">
|
11
|
+
</el-option>
|
12
|
+
</el-select>
|
13
|
+
</el-form-item>
|
14
|
+
<el-form-item :label="i18nt('designer.setting.labelPosition')">
|
15
|
+
<el-radio-group v-model="formConfig.labelPosition" class="radio-group-custom">
|
16
|
+
<el-radio-button label="left">{{i18nt('designer.setting.leftPosition')}}</el-radio-button>
|
17
|
+
<el-radio-button label="top">{{i18nt('designer.setting.topPosition')}}</el-radio-button>
|
18
|
+
</el-radio-group>
|
19
|
+
</el-form-item>
|
20
|
+
<el-form-item :label="i18nt('designer.setting.labelAlign')">
|
21
|
+
<el-radio-group v-model="formConfig.labelAlign" class="radio-group-custom">
|
22
|
+
<el-radio-button label="label-left-align">{{i18nt('designer.setting.leftAlign')}}</el-radio-button>
|
23
|
+
<el-radio-button label="label-center-align">{{i18nt('designer.setting.centerAlign')}}</el-radio-button>
|
24
|
+
<el-radio-button label="label-right-align">{{i18nt('designer.setting.rightAlign')}}</el-radio-button>
|
25
|
+
</el-radio-group>
|
26
|
+
</el-form-item>
|
27
|
+
<el-form-item :label="i18nt('designer.setting.labelWidth')">
|
28
|
+
<el-input-number v-model="formConfig.labelWidth" :min="0" style="width: 100%"></el-input-number>
|
29
|
+
</el-form-item>
|
30
|
+
<el-form-item :label="i18nt('designer.setting.formCss')">
|
31
|
+
<el-button type="info" icon="el-icon-edit" plain round @click="editFormCss">{{i18nt('designer.setting.addCss')}}</el-button>
|
32
|
+
</el-form-item>
|
33
|
+
<!-- -->
|
34
|
+
<el-form-item :label="i18nt('designer.setting.customClass')">
|
35
|
+
<el-select v-model="formConfig.customClass" multiple filterable allow-create
|
36
|
+
default-first-option>
|
37
|
+
<el-option v-for="(item, idx) in cssClassList" :key="idx" :label="item" :value="item"></el-option>
|
38
|
+
</el-select>
|
39
|
+
</el-form-item>
|
40
|
+
<!-- -->
|
41
|
+
<el-form-item :label="i18nt('designer.setting.globalFunctions')">
|
42
|
+
<el-button type="info" icon="el-icon-edit" plain round @click="editGlobalFunctions">{{i18nt('designer.setting.addEventHandler')}}</el-button>
|
43
|
+
</el-form-item>
|
44
|
+
<el-form-item label-width="0">
|
45
|
+
<el-divider class="custom-divider">{{i18nt('designer.setting.formSFCSetting')}}</el-divider>
|
46
|
+
</el-form-item>
|
47
|
+
<el-form-item :label="i18nt('designer.setting.formModelName')">
|
48
|
+
<el-input type="text" v-model="formConfig.modelName"></el-input>
|
49
|
+
</el-form-item>
|
50
|
+
<el-form-item :label="i18nt('designer.setting.formRefName')">
|
51
|
+
<el-input type="text" v-model="formConfig.refName"></el-input>
|
52
|
+
</el-form-item>
|
53
|
+
<el-form-item :label="i18nt('designer.setting.formRulesName')">
|
54
|
+
<el-input type="text" v-model="formConfig.rulesName"></el-input>
|
55
|
+
</el-form-item>
|
56
|
+
</el-collapse-item>
|
57
|
+
|
58
|
+
<el-collapse-item v-if="showEventCollapse()" name="2" :title="i18nt('designer.setting.eventSetting')">
|
59
|
+
<el-form-item label="onFormCreated" label-width="150px">
|
60
|
+
<el-button type="info" icon="el-icon-edit" plain round @click="editFormEventHandler('onFormCreated')">
|
61
|
+
{{i18nt('designer.setting.addEventHandler')}}</el-button>
|
62
|
+
</el-form-item>
|
63
|
+
<el-form-item label="onFormMounted" label-width="150px">
|
64
|
+
<el-button type="info" icon="el-icon-edit" plain round @click="editFormEventHandler('onFormMounted')">
|
65
|
+
{{i18nt('designer.setting.addEventHandler')}}</el-button>
|
66
|
+
</el-form-item>
|
67
|
+
<!-- -->
|
68
|
+
<el-form-item label="onFormDataChange" label-width="150px">
|
69
|
+
<el-button type="info" icon="el-icon-edit" plain round @click="editFormEventHandler('onFormDataChange')">
|
70
|
+
{{i18nt('designer.setting.addEventHandler')}}</el-button>
|
71
|
+
</el-form-item>
|
72
|
+
<!-- -->
|
73
|
+
<!--
|
74
|
+
<el-form-item label="onFormValidate">
|
75
|
+
<el-button type="info" icon="el-icon-edit" plain round @click="editFormEventHandler('onFormValidate')">
|
76
|
+
{{i18nt('designer.setting.addEventHandler')}}</el-button>
|
77
|
+
</el-form-item>
|
78
|
+
-->
|
79
|
+
</el-collapse-item>
|
80
|
+
</el-collapse>
|
81
|
+
</el-form>
|
82
|
+
|
83
|
+
<el-dialog :title="i18nt('designer.setting.editFormEventHandler')" :visible.sync="showFormEventDialogFlag"
|
84
|
+
v-if="showFormEventDialogFlag" :show-close="true" class="small-padding-dialog" v-dialog-drag
|
85
|
+
:close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true">
|
86
|
+
<el-alert type="info" :closable="false" :title="'form.' + eventParamsMap[curEventName]"></el-alert>
|
87
|
+
<code-editor :mode="'javascript'" :readonly="false" v-model="formEventHandlerCode"></code-editor>
|
88
|
+
<el-alert type="info" :closable="false" title="}"></el-alert>
|
89
|
+
<div slot="footer" class="dialog-footer">
|
90
|
+
<el-button @click="showFormEventDialogFlag = false">
|
91
|
+
{{i18nt('designer.hint.cancel')}}</el-button>
|
92
|
+
<el-button type="primary" @click="saveFormEventHandler">
|
93
|
+
{{i18nt('designer.hint.confirm')}}</el-button>
|
94
|
+
</div>
|
95
|
+
</el-dialog>
|
96
|
+
|
97
|
+
<el-dialog :title="i18nt('designer.setting.formCss')" :visible.sync="showEditFormCssDialogFlag"
|
98
|
+
v-if="showEditFormCssDialogFlag" :show-close="true" class="small-padding-dialog" v-dialog-drag
|
99
|
+
:close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true">
|
100
|
+
<code-editor :mode="'css'" :readonly="false" v-model="formCssCode"></code-editor>
|
101
|
+
<div slot="footer" class="dialog-footer">
|
102
|
+
<el-button @click="showEditFormCssDialogFlag = false">
|
103
|
+
{{i18nt('designer.hint.cancel')}}</el-button>
|
104
|
+
<el-button type="primary" @click="saveFormCss">
|
105
|
+
{{i18nt('designer.hint.confirm')}}</el-button>
|
106
|
+
</div>
|
107
|
+
</el-dialog>
|
108
|
+
|
109
|
+
<el-dialog :title="i18nt('designer.setting.globalFunctions')" :visible.sync="showEditFunctionsDialogFlag"
|
110
|
+
v-if="showEditFunctionsDialogFlag" :show-close="true" class="small-padding-dialog" v-dialog-drag
|
111
|
+
:close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true">
|
112
|
+
<code-editor :mode="'javascript'" :readonly="false" v-model="functionsCode"></code-editor>
|
113
|
+
<div slot="footer" class="dialog-footer">
|
114
|
+
<el-button @click="showEditFunctionsDialogFlag = false">
|
115
|
+
{{i18nt('designer.hint.cancel')}}</el-button>
|
116
|
+
<el-button type="primary" @click="saveGlobalFunctions">
|
117
|
+
{{i18nt('designer.hint.confirm')}}</el-button>
|
118
|
+
</div>
|
119
|
+
</el-dialog>
|
120
|
+
|
121
|
+
</div>
|
122
|
+
</template>
|
123
|
+
|
124
|
+
<script>
|
125
|
+
import i18n from "@/utils/i18n"
|
126
|
+
import CodeEditor from '@/components/code-editor/index'
|
127
|
+
import {deepClone, insertCustomCssToHead, insertGlobalFunctionsToHtml} from "@/utils/util"
|
128
|
+
|
129
|
+
export default {
|
130
|
+
name: "form-setting",
|
131
|
+
mixins: [i18n],
|
132
|
+
components: {
|
133
|
+
CodeEditor,
|
134
|
+
},
|
135
|
+
props: {
|
136
|
+
designer: Object,
|
137
|
+
formConfig: Object,
|
138
|
+
},
|
139
|
+
inject: ['getDesignerConfig'],
|
140
|
+
data() {
|
141
|
+
return {
|
142
|
+
designerConfig: this.getDesignerConfig(),
|
143
|
+
|
144
|
+
formActiveCollapseNames: ['1', '2'],
|
145
|
+
|
146
|
+
formSizes: [
|
147
|
+
{label: 'default', value: ''},
|
148
|
+
{label: 'large', value: 'large'},
|
149
|
+
{label: 'medium', value: 'medium'},
|
150
|
+
{label: 'small', value: 'small'},
|
151
|
+
{label: 'mini', value: 'mini'},
|
152
|
+
],
|
153
|
+
|
154
|
+
showEditFormCssDialogFlag: false,
|
155
|
+
formCssCode: '',
|
156
|
+
cssClassList: [],
|
157
|
+
|
158
|
+
showEditFunctionsDialogFlag: false,
|
159
|
+
functionsCode: '',
|
160
|
+
|
161
|
+
showFormEventDialogFlag: false,
|
162
|
+
formEventHandlerCode: '',
|
163
|
+
curEventName: '',
|
164
|
+
|
165
|
+
eventParamsMap: {
|
166
|
+
'onFormCreated': 'onFormCreated() {',
|
167
|
+
'onFormMounted': 'onFormMounted() {',
|
168
|
+
'onFormDataChange': 'onFormDataChange(fieldName, newValue, oldValue, formModel, subFormName, subFormRowIndex) {',
|
169
|
+
//'onFormValidate': 'onFormValidate() {',
|
170
|
+
},
|
171
|
+
|
172
|
+
}
|
173
|
+
},
|
174
|
+
created() {
|
175
|
+
//导入表单JSON后需要重新加载自定义CSS样式!!!
|
176
|
+
this.designer.handleEvent('form-json-imported', () => {
|
177
|
+
this.formCssCode = this.formConfig.cssCode
|
178
|
+
insertCustomCssToHead(this.formCssCode)
|
179
|
+
this.extractCssClass()
|
180
|
+
this.designer.emitEvent('form-css-updated', deepClone(this.cssClassList))
|
181
|
+
})
|
182
|
+
},
|
183
|
+
mounted() {
|
184
|
+
/* SettingPanel和FormWidget为兄弟组件, 在FormWidget加载formConfig时,
|
185
|
+
此处SettingPanel可能无法获取到formConfig.cssCode, 故加个延时函数! */
|
186
|
+
setTimeout(() => {
|
187
|
+
this.formCssCode = this.formConfig.cssCode
|
188
|
+
insertCustomCssToHead(this.formCssCode)
|
189
|
+
this.extractCssClass()
|
190
|
+
this.designer.emitEvent('form-css-updated', deepClone(this.cssClassList))
|
191
|
+
}, 1200)
|
192
|
+
},
|
193
|
+
methods: {
|
194
|
+
showEventCollapse() {
|
195
|
+
if (this.designerConfig['eventCollapse'] === undefined) {
|
196
|
+
return true
|
197
|
+
}
|
198
|
+
|
199
|
+
return !!this.designerConfig['eventCollapse']
|
200
|
+
},
|
201
|
+
|
202
|
+
editFormCss() {
|
203
|
+
this.formCssCode = this.designer.formConfig.cssCode
|
204
|
+
this.showEditFormCssDialogFlag = true
|
205
|
+
},
|
206
|
+
|
207
|
+
extractCssClass() {
|
208
|
+
let regExp = /\..*{/g
|
209
|
+
let result = this.formCssCode.match(regExp)
|
210
|
+
let cssNameArray = []
|
211
|
+
|
212
|
+
if (!!result && result.length > 0) {
|
213
|
+
result.forEach((rItem) => {
|
214
|
+
let classArray = rItem.split(',') //切分逗号分割的多个class
|
215
|
+
if (classArray.length > 0) {
|
216
|
+
classArray.forEach((cItem) => {
|
217
|
+
let caItem = cItem.trim()
|
218
|
+
if (caItem.indexOf('.', 1) !== -1) { //查找第二个.位置
|
219
|
+
let newClass = caItem.substring(caItem.indexOf('.') + 1, caItem.indexOf('.', 1)) //仅截取第一、二个.号之间的class
|
220
|
+
if (!!newClass) {
|
221
|
+
cssNameArray.push(newClass.trim())
|
222
|
+
}
|
223
|
+
} else if (caItem.indexOf(' ') !== -1) { //查找第一个空格位置
|
224
|
+
let newClass = caItem.substring(caItem.indexOf('.') + 1, caItem.indexOf(' ')) //仅截取第一、二个.号之间的class
|
225
|
+
if (!!newClass) {
|
226
|
+
cssNameArray.push(newClass.trim())
|
227
|
+
}
|
228
|
+
} else {
|
229
|
+
if (caItem.indexOf('{') !== -1) { //查找第一个{位置
|
230
|
+
let newClass = caItem.substring(caItem.indexOf('.') + 1, caItem.indexOf('{'))
|
231
|
+
cssNameArray.push( newClass.trim() )
|
232
|
+
} else {
|
233
|
+
let newClass = caItem.substring(caItem.indexOf('.') + 1)
|
234
|
+
cssNameArray.push( newClass.trim() )
|
235
|
+
}
|
236
|
+
}
|
237
|
+
})
|
238
|
+
}
|
239
|
+
})
|
240
|
+
}
|
241
|
+
|
242
|
+
//this.cssClassList.length = 0
|
243
|
+
this.cssClassList.splice(0, this.cssClassList.length) //清除数组必须用splice,length=0不会响应式更新!!
|
244
|
+
this.cssClassList = Array.from( new Set(cssNameArray) ) //数组去重
|
245
|
+
},
|
246
|
+
|
247
|
+
saveFormCss() {
|
248
|
+
this.extractCssClass()
|
249
|
+
this.designer.formConfig.cssCode = this.formCssCode
|
250
|
+
insertCustomCssToHead(this.formCssCode)
|
251
|
+
this.showEditFormCssDialogFlag = false
|
252
|
+
|
253
|
+
this.designer.emitEvent('form-css-updated', deepClone(this.cssClassList))
|
254
|
+
},
|
255
|
+
|
256
|
+
editGlobalFunctions() {
|
257
|
+
this.functionsCode = this.designer.formConfig.functions
|
258
|
+
this.showEditFunctionsDialogFlag = true
|
259
|
+
},
|
260
|
+
|
261
|
+
saveGlobalFunctions() {
|
262
|
+
this.designer.formConfig.functions = this.functionsCode
|
263
|
+
insertGlobalFunctionsToHtml(this.functionsCode)
|
264
|
+
this.showEditFunctionsDialogFlag = false
|
265
|
+
},
|
266
|
+
|
267
|
+
editFormEventHandler(eventName) {
|
268
|
+
this.curEventName = eventName
|
269
|
+
this.formEventHandlerCode = this.formConfig[eventName]
|
270
|
+
this.showFormEventDialogFlag = true
|
271
|
+
},
|
272
|
+
|
273
|
+
saveFormEventHandler() {
|
274
|
+
this.formConfig[this.curEventName] = this.formEventHandlerCode
|
275
|
+
this.showFormEventDialogFlag = false
|
276
|
+
},
|
277
|
+
|
278
|
+
}
|
279
|
+
}
|
280
|
+
</script>
|
281
|
+
|
282
|
+
<style lang="scss" scoped>
|
283
|
+
.setting-form {
|
284
|
+
::v-deep .el-form-item__label {
|
285
|
+
font-size: 13px;
|
286
|
+
//text-overflow: ellipsis;
|
287
|
+
overflow: hidden;
|
288
|
+
white-space: nowrap;
|
289
|
+
}
|
290
|
+
|
291
|
+
::v-deep .el-form-item--mini.el-form-item {
|
292
|
+
margin-bottom: 6px;
|
293
|
+
}
|
294
|
+
|
295
|
+
.radio-group-custom {
|
296
|
+
::v-deep .el-radio-button__inner {
|
297
|
+
padding-left: 12px;
|
298
|
+
padding-right: 12px;
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
.custom-divider.el-divider--horizontal {
|
303
|
+
margin: 10px 0;
|
304
|
+
}
|
305
|
+
}
|
306
|
+
|
307
|
+
.setting-collapse {
|
308
|
+
::v-deep .el-collapse-item__content {
|
309
|
+
padding-bottom: 6px;
|
310
|
+
}
|
311
|
+
|
312
|
+
::v-deep .el-collapse-item__header {
|
313
|
+
font-style: italic;
|
314
|
+
font-weight: bold;
|
315
|
+
}
|
316
|
+
}
|
317
|
+
|
318
|
+
.small-padding-dialog {
|
319
|
+
::v-deep .el-dialog__body {
|
320
|
+
padding: 6px 15px 12px 15px;
|
321
|
+
}
|
322
|
+
}
|
323
|
+
|
324
|
+
</style>
|
@@ -0,0 +1,328 @@
|
|
1
|
+
<template>
|
2
|
+
<el-container class="panel-container">
|
3
|
+
<el-tabs :active-name="activeTab" style="height: 100%; overflow: hidden">
|
4
|
+
<el-tab-pane :label="i18nt('designer.hint.widgetSetting')" name="1">
|
5
|
+
<el-scrollbar class="setting-scrollbar" :style="{height: scrollerHeight}">
|
6
|
+
|
7
|
+
<template v-if="!!designer.selectedWidget && !designer.selectedWidget.category">
|
8
|
+
<el-form :model="optionModel" size="mini" label-position="left" label-width="120px" class="setting-form"
|
9
|
+
@submit.native.prevent>
|
10
|
+
<el-collapse v-model="widgetActiveCollapseNames" class="setting-collapse">
|
11
|
+
<el-collapse-item name="1" v-if="showCollapse(commonProps)" :title="i18nt('designer.setting.commonSetting')">
|
12
|
+
<template v-for="(editorName, propName) in commonProps">
|
13
|
+
<component v-if="hasPropEditor(propName, editorName)" :is="getPropEditor(propName, editorName)"
|
14
|
+
:designer="designer" :selected-widget="selectedWidget" :option-model="optionModel"></component>
|
15
|
+
</template>
|
16
|
+
</el-collapse-item>
|
17
|
+
|
18
|
+
<el-collapse-item name="2" v-if="showCollapse(advProps)" :title="i18nt('designer.setting.advancedSetting')">
|
19
|
+
<template v-for="(editorName, propName) in advProps">
|
20
|
+
<component v-if="hasPropEditor(propName, editorName)" :is="getPropEditor(propName, editorName)"
|
21
|
+
:designer="designer" :selected-widget="selectedWidget" :option-model="optionModel"></component>
|
22
|
+
</template>
|
23
|
+
</el-collapse-item>
|
24
|
+
|
25
|
+
<el-collapse-item name="3" v-if="showEventCollapse() && showCollapse(eventProps)" :title="i18nt('designer.setting.eventSetting')">
|
26
|
+
<template v-for="(editorName, propName) in eventProps">
|
27
|
+
<component v-if="hasPropEditor(propName, editorName)" :is="getPropEditor(propName, editorName)"
|
28
|
+
:designer="designer" :selected-widget="selectedWidget" :option-model="optionModel"></component>
|
29
|
+
</template>
|
30
|
+
</el-collapse-item>
|
31
|
+
</el-collapse>
|
32
|
+
|
33
|
+
</el-form>
|
34
|
+
</template>
|
35
|
+
|
36
|
+
<template v-if="(!!designer.selectedWidget && !!designer.selectedWidget.category)">
|
37
|
+
<el-form :model="optionModel" size="mini" label-position="left" label-width="120px" class="setting-form"
|
38
|
+
@submit.native.prevent>
|
39
|
+
<el-collapse v-model="widgetActiveCollapseNames" class="setting-collapse">
|
40
|
+
<el-collapse-item name="1" v-if="showCollapse(commonProps)" :title="i18nt('designer.setting.commonSetting')">
|
41
|
+
<template v-for="(editorName, propName) in commonProps">
|
42
|
+
<component v-if="hasPropEditor(propName, editorName)" :is="getPropEditor(propName, editorName)"
|
43
|
+
:designer="designer" :selected-widget="selectedWidget" :option-model="optionModel"></component>
|
44
|
+
</template>
|
45
|
+
</el-collapse-item>
|
46
|
+
|
47
|
+
<el-collapse-item name="2" v-if="showCollapse(advProps)" :title="i18nt('designer.setting.advancedSetting')">
|
48
|
+
<template v-for="(editorName, propName) in advProps">
|
49
|
+
<component v-if="hasPropEditor(propName, editorName)" :is="getPropEditor(propName, editorName)"
|
50
|
+
:designer="designer" :selected-widget="selectedWidget" :option-model="optionModel"></component>
|
51
|
+
</template>
|
52
|
+
</el-collapse-item>
|
53
|
+
|
54
|
+
<el-collapse-item name="3" v-if="showEventCollapse() && showCollapse(eventProps)" :title="i18nt('designer.setting.eventSetting')">
|
55
|
+
<template v-for="(editorName, propName) in eventProps">
|
56
|
+
<component v-if="hasPropEditor(propName, editorName)" :is="getPropEditor(propName, editorName)"
|
57
|
+
:designer="designer" :selected-widget="selectedWidget" :option-model="optionModel"></component>
|
58
|
+
</template>
|
59
|
+
</el-collapse-item>
|
60
|
+
</el-collapse>
|
61
|
+
</el-form>
|
62
|
+
</template>
|
63
|
+
|
64
|
+
</el-scrollbar>
|
65
|
+
</el-tab-pane>
|
66
|
+
|
67
|
+
<el-tab-pane v-if="!!designer" :label="i18nt('designer.hint.formSetting')" name="2">
|
68
|
+
<el-scrollbar class="setting-scrollbar" :style="{height: scrollerHeight}">
|
69
|
+
<form-setting :designer="designer" :form-config="formConfig"></form-setting>
|
70
|
+
</el-scrollbar>
|
71
|
+
</el-tab-pane>
|
72
|
+
</el-tabs>
|
73
|
+
|
74
|
+
<el-dialog :title="i18nt('designer.setting.editWidgetEventHandler')" :visible.sync="showWidgetEventDialogFlag"
|
75
|
+
v-if="showWidgetEventDialogFlag" :show-close="true" class="small-padding-dialog" v-dialog-drag
|
76
|
+
:close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true">
|
77
|
+
<el-alert type="info" :closable="false" :title="eventHeader"></el-alert>
|
78
|
+
<code-editor :mode="'javascript'" :readonly="false" v-model="eventHandlerCode"></code-editor>
|
79
|
+
<el-alert type="info" :closable="false" title="}"></el-alert>
|
80
|
+
<div slot="footer" class="dialog-footer">
|
81
|
+
<el-button @click="showWidgetEventDialogFlag = false">
|
82
|
+
{{i18nt('designer.hint.cancel')}}</el-button>
|
83
|
+
<el-button type="primary" @click="saveEventHandler">
|
84
|
+
{{i18nt('designer.hint.confirm')}}</el-button>
|
85
|
+
</div>
|
86
|
+
</el-dialog>
|
87
|
+
|
88
|
+
</el-container>
|
89
|
+
</template>
|
90
|
+
|
91
|
+
<script>
|
92
|
+
import CodeEditor from '@/components/code-editor/index'
|
93
|
+
import PropertyEditors from './property-editor/index'
|
94
|
+
import FormSetting from './form-setting'
|
95
|
+
import WidgetProperties from './propertyRegister'
|
96
|
+
import {
|
97
|
+
addWindowResizeHandler,
|
98
|
+
} from "@/utils/util";
|
99
|
+
import i18n from "@/utils/i18n";
|
100
|
+
|
101
|
+
const {COMMON_PROPERTIES, ADVANCED_PROPERTIES, EVENT_PROPERTIES} = WidgetProperties
|
102
|
+
|
103
|
+
export default {
|
104
|
+
name: "SettingPanel",
|
105
|
+
componentName: "SettingPanel",
|
106
|
+
mixins: [i18n],
|
107
|
+
components: {
|
108
|
+
CodeEditor,
|
109
|
+
FormSetting,
|
110
|
+
...PropertyEditors,
|
111
|
+
},
|
112
|
+
props: {
|
113
|
+
designer: Object,
|
114
|
+
selectedWidget: Object,
|
115
|
+
formConfig: Object,
|
116
|
+
},
|
117
|
+
inject: ['getDesignerConfig'],
|
118
|
+
data() {
|
119
|
+
return {
|
120
|
+
designerConfig: this.getDesignerConfig(),
|
121
|
+
|
122
|
+
scrollerHeight: 0,
|
123
|
+
|
124
|
+
activeTab: "2",
|
125
|
+
widgetActiveCollapseNames: ['1', '3'], //['1', '2', '3'],
|
126
|
+
formActiveCollapseNames: ['1', '2'],
|
127
|
+
|
128
|
+
commonProps: COMMON_PROPERTIES,
|
129
|
+
advProps: ADVANCED_PROPERTIES,
|
130
|
+
eventProps: EVENT_PROPERTIES,
|
131
|
+
|
132
|
+
showWidgetEventDialogFlag: false,
|
133
|
+
eventHandlerCode: '',
|
134
|
+
curEventName: '',
|
135
|
+
eventHeader: '',
|
136
|
+
|
137
|
+
subFormChildWidgetFlag: false,
|
138
|
+
}
|
139
|
+
},
|
140
|
+
computed: {
|
141
|
+
optionModel: {
|
142
|
+
get() {
|
143
|
+
return this.selectedWidget.options
|
144
|
+
},
|
145
|
+
|
146
|
+
set(newValue) {
|
147
|
+
this.selectedWidget.options = newValue
|
148
|
+
}
|
149
|
+
},
|
150
|
+
|
151
|
+
},
|
152
|
+
watch: {
|
153
|
+
'designer.selectedWidget': {
|
154
|
+
handler(val) {
|
155
|
+
if (!!val) {
|
156
|
+
this.activeTab = "1"
|
157
|
+
}
|
158
|
+
}
|
159
|
+
},
|
160
|
+
|
161
|
+
'selectedWidget.options': { //组件属性变动后,立即保存表单JSON!!
|
162
|
+
deep: true,
|
163
|
+
handler() {
|
164
|
+
this.designer.saveCurrentHistoryStep()
|
165
|
+
}
|
166
|
+
},
|
167
|
+
|
168
|
+
formConfig: {
|
169
|
+
deep: true,
|
170
|
+
handler() {
|
171
|
+
this.designer.saveCurrentHistoryStep()
|
172
|
+
}
|
173
|
+
},
|
174
|
+
|
175
|
+
},
|
176
|
+
created() {
|
177
|
+
this.$on('editEventHandler', function (eventName, eventParams) {
|
178
|
+
this.editEventHandler(eventName, eventParams)
|
179
|
+
})
|
180
|
+
|
181
|
+
this.designer.handleEvent('form-css-updated', (cssClassList) => {
|
182
|
+
this.designer.setCssClassList(cssClassList)
|
183
|
+
})
|
184
|
+
},
|
185
|
+
mounted() {
|
186
|
+
if (!this.designer.selectedWidget) {
|
187
|
+
this.activeTab = "2"
|
188
|
+
} else {
|
189
|
+
this.activeTab = "1"
|
190
|
+
}
|
191
|
+
|
192
|
+
this.scrollerHeight = window.innerHeight - 56 - 48 + 'px'
|
193
|
+
addWindowResizeHandler(() => {
|
194
|
+
this.$nextTick(() => {
|
195
|
+
this.scrollerHeight = window.innerHeight - 56 - 48 + 'px'
|
196
|
+
//console.log(this.scrollerHeight)
|
197
|
+
})
|
198
|
+
})
|
199
|
+
},
|
200
|
+
methods: {
|
201
|
+
showEventCollapse() {
|
202
|
+
if (this.designerConfig['eventCollapse'] === undefined) {
|
203
|
+
return true
|
204
|
+
}
|
205
|
+
|
206
|
+
return !!this.designerConfig['eventCollapse']
|
207
|
+
},
|
208
|
+
|
209
|
+
hasPropEditor(propName, editorName) {
|
210
|
+
if (!editorName) {
|
211
|
+
return false
|
212
|
+
}
|
213
|
+
|
214
|
+
let originalPropName = propName.replace(this.selectedWidget.type + '-', '') //去掉组件名称前缀-,如果有的话!!
|
215
|
+
return this.designer.hasConfig(this.selectedWidget, originalPropName)
|
216
|
+
},
|
217
|
+
|
218
|
+
getPropEditor(propName, editorName) {
|
219
|
+
let originalPropName = propName.replace(this.selectedWidget.type + '-', '') //去掉组件名称前缀-,如果有的话!!
|
220
|
+
let ownPropEditorName = `${this.selectedWidget.type}-${originalPropName}-editor`
|
221
|
+
//console.log(ownPropEditorName, this.$options.components[ownPropEditorName])
|
222
|
+
if (!!this.$options.components[ownPropEditorName]) { //局部注册的属性编辑器组件
|
223
|
+
return ownPropEditorName
|
224
|
+
}
|
225
|
+
|
226
|
+
return !!this.$root.$options.components[ownPropEditorName] ? ownPropEditorName : editorName //全局注册的属性编辑器组件
|
227
|
+
},
|
228
|
+
|
229
|
+
showCollapse(propsObj) {
|
230
|
+
let result = false
|
231
|
+
|
232
|
+
for (let propName in propsObj) {
|
233
|
+
if (!propsObj.hasOwnProperty(propName)) {
|
234
|
+
continue
|
235
|
+
}
|
236
|
+
|
237
|
+
if (this.hasPropEditor(propName, propsObj[propName])) {
|
238
|
+
result = true
|
239
|
+
break
|
240
|
+
}
|
241
|
+
}
|
242
|
+
|
243
|
+
return result
|
244
|
+
},
|
245
|
+
|
246
|
+
editEventHandler(eventName, eventParams) {
|
247
|
+
this.curEventName = eventName
|
248
|
+
this.eventHeader = `${this.optionModel.name}.${eventName}(${eventParams.join(', ')}) {`
|
249
|
+
this.eventHandlerCode = this.selectedWidget.options[eventName] || ''
|
250
|
+
|
251
|
+
// 设置字段校验函数示例代码
|
252
|
+
if ((eventName === 'onValidate') && (!this.optionModel['onValidate'])) {
|
253
|
+
this.eventHandlerCode = " /* sample code */\n /*\n if ((value > 100) || (value < 0)) {\n callback(new Error('error message')) //fail\n } else {\n callback(); //pass\n }\n */"
|
254
|
+
}
|
255
|
+
|
256
|
+
this.showWidgetEventDialogFlag = true
|
257
|
+
},
|
258
|
+
|
259
|
+
saveEventHandler() {
|
260
|
+
this.selectedWidget.options[this.curEventName] = this.eventHandlerCode
|
261
|
+
this.showWidgetEventDialogFlag = false
|
262
|
+
},
|
263
|
+
|
264
|
+
}
|
265
|
+
}
|
266
|
+
</script>
|
267
|
+
|
268
|
+
<style lang="scss" scoped>
|
269
|
+
.panel-container {
|
270
|
+
padding: 0 8px;
|
271
|
+
}
|
272
|
+
|
273
|
+
.setting-scrollbar {
|
274
|
+
::v-deep .el-scrollbar__wrap {
|
275
|
+
overflow-x: hidden; /* IE浏览器隐藏水平滚动条箭头!! */
|
276
|
+
}
|
277
|
+
}
|
278
|
+
|
279
|
+
.setting-collapse {
|
280
|
+
::v-deep .el-collapse-item__content {
|
281
|
+
padding-bottom: 6px;
|
282
|
+
}
|
283
|
+
|
284
|
+
::v-deep .el-collapse-item__header {
|
285
|
+
font-style: italic;
|
286
|
+
font-weight: bold;
|
287
|
+
}
|
288
|
+
}
|
289
|
+
|
290
|
+
.setting-form {
|
291
|
+
::v-deep .el-form-item__label {
|
292
|
+
font-size: 13px;
|
293
|
+
//text-overflow: ellipsis;
|
294
|
+
overflow: hidden;
|
295
|
+
white-space: nowrap;
|
296
|
+
}
|
297
|
+
|
298
|
+
::v-deep .el-form-item--mini.el-form-item {
|
299
|
+
margin-bottom: 6px;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
|
303
|
+
/* 隐藏Chrome浏览器中el-input数字输入框右侧的上下调整小箭头 */
|
304
|
+
::v-deep .hide-spin-button input::-webkit-outer-spin-button,
|
305
|
+
::v-deep .hide-spin-button input::-webkit-inner-spin-button {
|
306
|
+
-webkit-appearance: none !important;
|
307
|
+
}
|
308
|
+
|
309
|
+
/* 隐藏Firefox浏览器中el-input数字输入框右侧的上下调整小箭头 */
|
310
|
+
::v-deep .hide-spin-button input[type="number"] {
|
311
|
+
-moz-appearance: textfield;
|
312
|
+
}
|
313
|
+
|
314
|
+
::v-deep .custom-divider.el-divider--horizontal {
|
315
|
+
margin: 10px 0;
|
316
|
+
}
|
317
|
+
|
318
|
+
::v-deep .custom-divider-margin-top.el-divider--horizontal {
|
319
|
+
margin: 20px 0;
|
320
|
+
}
|
321
|
+
|
322
|
+
.small-padding-dialog {
|
323
|
+
::v-deep .el-dialog__body {
|
324
|
+
padding: 6px 15px 12px 15px;
|
325
|
+
}
|
326
|
+
}
|
327
|
+
|
328
|
+
</style>
|