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,712 @@
|
|
1
|
+
<!--
|
2
|
+
/**
|
3
|
+
* author: vformAdmin
|
4
|
+
* email: vdpadmin@163.com
|
5
|
+
* website: https://www.vform666.com
|
6
|
+
* date: 2021.08.18
|
7
|
+
* remark: 如果要分发VForm源码,需在本文件顶部保留此文件头信息!!
|
8
|
+
*/
|
9
|
+
-->
|
10
|
+
|
11
|
+
<template>
|
12
|
+
<div class="widgetEvent">
|
13
|
+
<el-form
|
14
|
+
:label-position="labelPosition"
|
15
|
+
:size="size"
|
16
|
+
:class="['render-form', customClass]"
|
17
|
+
:label-width="labelWidth"
|
18
|
+
:validate-on-rule-change="false"
|
19
|
+
:model="formDataModel"
|
20
|
+
ref="renderForm"
|
21
|
+
@submit.native.prevent
|
22
|
+
>
|
23
|
+
<template v-for="(widget, index) in widgetList">
|
24
|
+
<template v-if="'container' === widget.category">
|
25
|
+
<component
|
26
|
+
:is="getContainerWidgetName(widget)"
|
27
|
+
:widget="widget"
|
28
|
+
:key="widget.id"
|
29
|
+
:parent-list="widgetList"
|
30
|
+
:index-of-parent-list="index"
|
31
|
+
:parent-widget="null"
|
32
|
+
></component>
|
33
|
+
</template>
|
34
|
+
<template v-else>
|
35
|
+
<component
|
36
|
+
:is="getWidgetName(widget)"
|
37
|
+
:field="widget"
|
38
|
+
:form-model="formDataModel"
|
39
|
+
:designer="null"
|
40
|
+
:key="widget.id"
|
41
|
+
:parent-list="widgetList"
|
42
|
+
:index-of-parent-list="index"
|
43
|
+
:parent-widget="null"
|
44
|
+
></component>
|
45
|
+
</template>
|
46
|
+
</template>
|
47
|
+
</el-form>
|
48
|
+
</div>
|
49
|
+
</template>
|
50
|
+
|
51
|
+
<script>
|
52
|
+
//import ElForm from 'element-ui/packages/form/src/form.vue' /* 用于源码调试Element UI */
|
53
|
+
import emitter from "element-ui/lib/mixins/emitter";
|
54
|
+
import "./container-item/index";
|
55
|
+
import FieldComponents from "@/components/form-designer/form-widget/field-widget/index";
|
56
|
+
import {
|
57
|
+
deepClone,
|
58
|
+
insertCustomCssToHead,
|
59
|
+
insertGlobalFunctionsToHtml,
|
60
|
+
} from "../../utils/util";
|
61
|
+
import i18n, { changeLocale } from "../../utils/i18n";
|
62
|
+
|
63
|
+
export default {
|
64
|
+
name: "VFormRender",
|
65
|
+
componentName: "VFormRender",
|
66
|
+
mixins: [emitter, i18n],
|
67
|
+
components: {
|
68
|
+
//ElForm,
|
69
|
+
|
70
|
+
...FieldComponents,
|
71
|
+
},
|
72
|
+
props: {
|
73
|
+
formJson: Object, //prop传入的表单JSON配置
|
74
|
+
formData: {
|
75
|
+
//prop传入的表单数据
|
76
|
+
Object,
|
77
|
+
default: () => {},
|
78
|
+
},
|
79
|
+
optionData: {
|
80
|
+
//prop传入的选项数据
|
81
|
+
type: Object,
|
82
|
+
default: () => {},
|
83
|
+
},
|
84
|
+
previewState: {
|
85
|
+
//是否表单预览状态
|
86
|
+
type: Boolean,
|
87
|
+
default: false,
|
88
|
+
},
|
89
|
+
},
|
90
|
+
provide() {
|
91
|
+
return {
|
92
|
+
refList: this.widgetRefList,
|
93
|
+
sfRefList: this.subFormRefList, //收集SubForm引用
|
94
|
+
formConfig: this.formConfig,
|
95
|
+
globalOptionData: this.optionData,
|
96
|
+
getOptionData: () =>
|
97
|
+
this
|
98
|
+
.optionData /* 该方法用于在异步更新option-data之后重新获取到最新值 */,
|
99
|
+
globalModel: {
|
100
|
+
formModel: this.formDataModel,
|
101
|
+
},
|
102
|
+
previewState: this.previewState,
|
103
|
+
};
|
104
|
+
},
|
105
|
+
data() {
|
106
|
+
return {
|
107
|
+
formJsonObj: this.formJson,
|
108
|
+
|
109
|
+
formDataModel: {
|
110
|
+
//
|
111
|
+
},
|
112
|
+
widgetRefList: {},
|
113
|
+
subFormRefList: {},
|
114
|
+
};
|
115
|
+
},
|
116
|
+
computed: {
|
117
|
+
formConfig() {
|
118
|
+
return this.formJsonObj.formConfig;
|
119
|
+
},
|
120
|
+
|
121
|
+
widgetList() {
|
122
|
+
return this.formJsonObj.widgetList;
|
123
|
+
},
|
124
|
+
|
125
|
+
labelPosition() {
|
126
|
+
if (!!this.formConfig && !!this.formConfig.labelPosition) {
|
127
|
+
return this.formConfig.labelPosition;
|
128
|
+
}
|
129
|
+
|
130
|
+
return "left";
|
131
|
+
},
|
132
|
+
|
133
|
+
labelWidth() {
|
134
|
+
if (!!this.formConfig && !!this.formConfig.labelWidth) {
|
135
|
+
return this.formConfig.labelWidth + "px";
|
136
|
+
}
|
137
|
+
|
138
|
+
return "80px";
|
139
|
+
},
|
140
|
+
|
141
|
+
size() {
|
142
|
+
if (!!this.formConfig && !!this.formConfig.size) {
|
143
|
+
return this.formConfig.size;
|
144
|
+
}
|
145
|
+
|
146
|
+
return "medium";
|
147
|
+
},
|
148
|
+
|
149
|
+
customClass() {
|
150
|
+
return !!this.formConfig && !!this.formConfig.customClass
|
151
|
+
? this.formConfig.customClass
|
152
|
+
: "";
|
153
|
+
},
|
154
|
+
},
|
155
|
+
watch: {
|
156
|
+
//
|
157
|
+
},
|
158
|
+
created() {
|
159
|
+
this.buildFormModel(!this.formJsonObj ? null : this.formJsonObj.widgetList);
|
160
|
+
this.initFormObject();
|
161
|
+
},
|
162
|
+
mounted() {
|
163
|
+
this.initLocale();
|
164
|
+
this.handleOnMounted();
|
165
|
+
},
|
166
|
+
methods: {
|
167
|
+
initFormObject() {
|
168
|
+
this.insertCustomStyleAndScriptNode();
|
169
|
+
this.addFieldChangeEventHandler();
|
170
|
+
this.addFieldValidateEventHandler();
|
171
|
+
this.registerFormToRefList();
|
172
|
+
this.handleOnCreated();
|
173
|
+
},
|
174
|
+
|
175
|
+
getContainerWidgetName(widget) {
|
176
|
+
return widget.type + "-item";
|
177
|
+
},
|
178
|
+
|
179
|
+
getWidgetName(widget) {
|
180
|
+
return widget.type + "-widget";
|
181
|
+
},
|
182
|
+
|
183
|
+
initLocale() {
|
184
|
+
let curLocale = localStorage.getItem("v_form_locale") || "zh-CN";
|
185
|
+
this.changeLanguage(curLocale);
|
186
|
+
},
|
187
|
+
|
188
|
+
insertCustomStyleAndScriptNode() {
|
189
|
+
if (!!this.formConfig && !!this.formConfig.cssCode) {
|
190
|
+
insertCustomCssToHead(this.formConfig.cssCode);
|
191
|
+
}
|
192
|
+
|
193
|
+
if (!!this.formConfig && !!this.formConfig.functions) {
|
194
|
+
insertGlobalFunctionsToHtml(this.formConfig.functions);
|
195
|
+
}
|
196
|
+
},
|
197
|
+
|
198
|
+
buildFormModel(widgetList) {
|
199
|
+
if (!!widgetList && widgetList.length > 0) {
|
200
|
+
widgetList.forEach((wItem) => {
|
201
|
+
this.buildDataFromWidget(wItem);
|
202
|
+
});
|
203
|
+
}
|
204
|
+
},
|
205
|
+
|
206
|
+
buildDataFromWidget(wItem) {
|
207
|
+
if (wItem.category === "container") {
|
208
|
+
if (wItem.type === "grid") {
|
209
|
+
if (!!wItem.cols && wItem.cols.length > 0) {
|
210
|
+
wItem.cols.forEach((childItem) => {
|
211
|
+
this.buildDataFromWidget(childItem);
|
212
|
+
});
|
213
|
+
}
|
214
|
+
} else if (wItem.type === "table") {
|
215
|
+
if (!!wItem.rows && wItem.rows.length > 0) {
|
216
|
+
wItem.rows.forEach((rowItem) => {
|
217
|
+
if (!!rowItem.cols && rowItem.cols.length > 0) {
|
218
|
+
rowItem.cols.forEach((colItem) => {
|
219
|
+
this.buildDataFromWidget(colItem);
|
220
|
+
});
|
221
|
+
}
|
222
|
+
});
|
223
|
+
}
|
224
|
+
} else if (wItem.type === "tab") {
|
225
|
+
if (!!wItem.tabs && wItem.tabs.length > 0) {
|
226
|
+
wItem.tabs.forEach((tabItem) => {
|
227
|
+
if (!!tabItem.widgetList && tabItem.widgetList.length > 0) {
|
228
|
+
tabItem.widgetList.forEach((childItem) => {
|
229
|
+
this.buildDataFromWidget(childItem);
|
230
|
+
});
|
231
|
+
}
|
232
|
+
});
|
233
|
+
}
|
234
|
+
} else if (wItem.type === "sub-form") {
|
235
|
+
let subFormName = wItem.options.name;
|
236
|
+
if (!this.formData.hasOwnProperty(subFormName)) {
|
237
|
+
let subFormDataRow = {};
|
238
|
+
if (wItem.options.showBlankRow) {
|
239
|
+
wItem.widgetList.forEach((subFormItem) => {
|
240
|
+
if (!!subFormItem.formItemFlag) {
|
241
|
+
subFormDataRow[subFormItem.options.name] =
|
242
|
+
subFormItem.options.defaultValue;
|
243
|
+
}
|
244
|
+
});
|
245
|
+
|
246
|
+
this.$set(this.formDataModel, subFormName, [subFormDataRow]); //
|
247
|
+
} else {
|
248
|
+
this.$set(this.formDataModel, subFormName, []); //
|
249
|
+
}
|
250
|
+
} else {
|
251
|
+
let initialValue = this.formData[subFormName];
|
252
|
+
this.$set(this.formDataModel, subFormName, deepClone(initialValue));
|
253
|
+
}
|
254
|
+
} else if (wItem.type === "grid-col" || wItem.type === "table-cell") {
|
255
|
+
if (!!wItem.widgetList && wItem.widgetList.length > 0) {
|
256
|
+
wItem.widgetList.forEach((childItem) => {
|
257
|
+
this.buildDataFromWidget(childItem);
|
258
|
+
});
|
259
|
+
}
|
260
|
+
} else {
|
261
|
+
//自定义容器组件
|
262
|
+
if (!!wItem.widgetList && wItem.widgetList.length > 0) {
|
263
|
+
wItem.widgetList.forEach((childItem) => {
|
264
|
+
this.buildDataFromWidget(childItem);
|
265
|
+
});
|
266
|
+
}
|
267
|
+
}
|
268
|
+
} else if (!!wItem.formItemFlag) {
|
269
|
+
if (!this.formData.hasOwnProperty(wItem.options.name)) {
|
270
|
+
//this.formDataModel[wItem.options.name] = '' //这种写法不支持对象属性响应式更新,必须用$set方法!!
|
271
|
+
this.$set(
|
272
|
+
this.formDataModel,
|
273
|
+
wItem.options.name,
|
274
|
+
wItem.options.defaultValue
|
275
|
+
); //设置字段默认值
|
276
|
+
} else {
|
277
|
+
let initialValue = this.formData[wItem.options.name];
|
278
|
+
this.$set(
|
279
|
+
this.formDataModel,
|
280
|
+
wItem.options.name,
|
281
|
+
deepClone(initialValue)
|
282
|
+
);
|
283
|
+
}
|
284
|
+
}
|
285
|
+
},
|
286
|
+
|
287
|
+
addFieldChangeEventHandler() {
|
288
|
+
this.$off("fieldChange"); //移除原有事件监听
|
289
|
+
|
290
|
+
this.$on(
|
291
|
+
"fieldChange",
|
292
|
+
function (fieldName, newValue, oldValue, subFormName, subFormRowIndex) {
|
293
|
+
this.handleFieldDataChange(
|
294
|
+
fieldName,
|
295
|
+
newValue,
|
296
|
+
oldValue,
|
297
|
+
subFormName,
|
298
|
+
subFormRowIndex
|
299
|
+
);
|
300
|
+
this.$emit(
|
301
|
+
"formChange",
|
302
|
+
fieldName,
|
303
|
+
newValue,
|
304
|
+
oldValue,
|
305
|
+
this.formDataModel,
|
306
|
+
subFormName,
|
307
|
+
subFormRowIndex
|
308
|
+
);
|
309
|
+
}
|
310
|
+
);
|
311
|
+
},
|
312
|
+
|
313
|
+
addFieldValidateEventHandler() {
|
314
|
+
this.$off("fieldValidation"); //移除原有事件监听
|
315
|
+
this.$on("fieldValidation", (fieldName) => {
|
316
|
+
this.$refs.renderForm.validateField(fieldName);
|
317
|
+
});
|
318
|
+
},
|
319
|
+
|
320
|
+
registerFormToRefList() {
|
321
|
+
this.widgetRefList["v_form_ref"] = this;
|
322
|
+
},
|
323
|
+
|
324
|
+
handleFieldDataChange(
|
325
|
+
fieldName,
|
326
|
+
newValue,
|
327
|
+
oldValue,
|
328
|
+
subFormName,
|
329
|
+
subFormRowIndex
|
330
|
+
) {
|
331
|
+
if (!!this.formConfig && !!this.formConfig.onFormDataChange) {
|
332
|
+
let customFunc = new Function(
|
333
|
+
"fieldName",
|
334
|
+
"newValue",
|
335
|
+
"oldValue",
|
336
|
+
"formModel",
|
337
|
+
"subFormName",
|
338
|
+
"subFormRowIndex",
|
339
|
+
this.formConfig.onFormDataChange
|
340
|
+
);
|
341
|
+
customFunc.call(
|
342
|
+
this,
|
343
|
+
fieldName,
|
344
|
+
newValue,
|
345
|
+
oldValue,
|
346
|
+
this.formDataModel,
|
347
|
+
subFormName,
|
348
|
+
subFormRowIndex
|
349
|
+
);
|
350
|
+
}
|
351
|
+
},
|
352
|
+
|
353
|
+
handleOnCreated() {
|
354
|
+
if (!!this.formConfig && !!this.formConfig.onFormCreated) {
|
355
|
+
let customFunc = new Function(this.formConfig.onFormCreated);
|
356
|
+
customFunc.call(this);
|
357
|
+
}
|
358
|
+
},
|
359
|
+
|
360
|
+
handleOnMounted() {
|
361
|
+
if (!!this.formConfig && !!this.formConfig.onFormMounted) {
|
362
|
+
let customFunc = new Function(this.formConfig.onFormMounted);
|
363
|
+
customFunc.call(this);
|
364
|
+
}
|
365
|
+
},
|
366
|
+
|
367
|
+
findWidgetAndSetDisabled(widgetName, disabledFlag) {
|
368
|
+
let foundW = this.getWidgetRef(widgetName);
|
369
|
+
if (!!foundW) {
|
370
|
+
foundW.setDisabled(disabledFlag);
|
371
|
+
}
|
372
|
+
},
|
373
|
+
|
374
|
+
findWidgetAndSetHidden(widgetName, hiddenFlag) {
|
375
|
+
let foundW = this.getWidgetRef(widgetName);
|
376
|
+
if (!!foundW) {
|
377
|
+
foundW.setHidden(hiddenFlag);
|
378
|
+
}
|
379
|
+
},
|
380
|
+
|
381
|
+
//--------------------- 以下为组件支持外部调用的API方法 begin ------------------//
|
382
|
+
/* 提示:用户可自行扩充这些方法!!! */
|
383
|
+
|
384
|
+
changeLanguage(langName) {
|
385
|
+
changeLocale(langName);
|
386
|
+
},
|
387
|
+
|
388
|
+
getNativeForm() {
|
389
|
+
//获取原生form引用
|
390
|
+
return this.$refs["renderForm"];
|
391
|
+
},
|
392
|
+
|
393
|
+
getWidgetRef(widgetName, showError = false) {
|
394
|
+
let foundRef = this.widgetRefList[widgetName];
|
395
|
+
if (!foundRef && !!showError) {
|
396
|
+
this.$message.error(this.i18nt("render.hint.refNotFound") + widgetName);
|
397
|
+
}
|
398
|
+
return foundRef;
|
399
|
+
},
|
400
|
+
|
401
|
+
clearFormDataModel() {
|
402
|
+
for (let pkey in this.formDataModel) {
|
403
|
+
delete this.formDataModel[pkey];
|
404
|
+
}
|
405
|
+
},
|
406
|
+
|
407
|
+
/**
|
408
|
+
* 动态加载表单JSON
|
409
|
+
* @param newFormJson
|
410
|
+
*/
|
411
|
+
setFormJson(newFormJson) {
|
412
|
+
if (!!newFormJson) {
|
413
|
+
if (
|
414
|
+
typeof newFormJson === "string" ||
|
415
|
+
newFormJson.constructor === Object
|
416
|
+
) {
|
417
|
+
let newFormJsonObj = null;
|
418
|
+
if (typeof newFormJson === "string") {
|
419
|
+
newFormJsonObj = JSON.parse(newFormJson);
|
420
|
+
} else {
|
421
|
+
newFormJsonObj = newFormJson;
|
422
|
+
}
|
423
|
+
|
424
|
+
if (!newFormJsonObj.formConfig || !newFormJsonObj.widgetList) {
|
425
|
+
this.$message.error("Invalid format of form json.");
|
426
|
+
return;
|
427
|
+
}
|
428
|
+
|
429
|
+
/* formDataModel必须在widgetList赋值完成初始化,因为widgetList赋值意味着子组件开始创建!!! */
|
430
|
+
//this.formDataModel = {} //清空表单数据对象(有bug,会导致表单校验失败!!)
|
431
|
+
this.clearFormDataModel(); //上行代码有问题,会导致表单校验失败,故保留原对象引用只清空对象属性!!
|
432
|
+
this.buildFormModel(newFormJsonObj.widgetList);
|
433
|
+
|
434
|
+
this.$set(this.formJsonObj, "formConfig", newFormJsonObj.formConfig);
|
435
|
+
this._provided.formConfig = newFormJsonObj.formConfig; //强制更新provide的formConfig对象
|
436
|
+
this.$set(this.formJsonObj, "widgetList", newFormJsonObj.widgetList);
|
437
|
+
|
438
|
+
this.initFormObject();
|
439
|
+
this.handleOnMounted();
|
440
|
+
} else {
|
441
|
+
this.$message.error("Set form json failed.");
|
442
|
+
}
|
443
|
+
}
|
444
|
+
},
|
445
|
+
|
446
|
+
/**
|
447
|
+
* 重新加载选项数据
|
448
|
+
* @param widgetNames 指定重新加载的组件名称或组件名数组,不传则重新加载所有选项字段
|
449
|
+
*/
|
450
|
+
reloadOptionData(widgetNames) {
|
451
|
+
//this._provided.globalOptionData = this.optionData
|
452
|
+
|
453
|
+
let eventParams = [];
|
454
|
+
if (!!widgetNames && typeof widgetNames === "string") {
|
455
|
+
eventParams = [widgetNames];
|
456
|
+
} else if (!!widgetNames && Array.isArray(widgetNames)) {
|
457
|
+
eventParams = [...widgetNames];
|
458
|
+
}
|
459
|
+
this.broadcast("FieldWidget", "reloadOptionItems", [eventParams]);
|
460
|
+
},
|
461
|
+
|
462
|
+
getFormData(needValidation = true) {
|
463
|
+
if (!needValidation) {
|
464
|
+
return this.formDataModel;
|
465
|
+
}
|
466
|
+
|
467
|
+
let callback = function nullFunc() {};
|
468
|
+
let promise = new window.Promise(function (resolve, reject) {
|
469
|
+
callback = function (formData, error) {
|
470
|
+
!error ? resolve(formData) : reject(error);
|
471
|
+
};
|
472
|
+
});
|
473
|
+
|
474
|
+
this.$refs["renderForm"].validate((valid) => {
|
475
|
+
if (valid) {
|
476
|
+
callback(this.formDataModel);
|
477
|
+
} else {
|
478
|
+
callback(
|
479
|
+
this.formDataModel,
|
480
|
+
this.i18nt("render.hint.validationFailed")
|
481
|
+
);
|
482
|
+
}
|
483
|
+
});
|
484
|
+
|
485
|
+
return promise;
|
486
|
+
},
|
487
|
+
|
488
|
+
setFormData(formData) {
|
489
|
+
//设置表单数据
|
490
|
+
//this.formDataModel = formData //inject注入的formModel不是响应式的,直接赋值在其他组件拿不到最新值!!
|
491
|
+
|
492
|
+
Object.keys(this.formDataModel).forEach((propName) => {
|
493
|
+
if (!!formData && formData.hasOwnProperty(propName)) {
|
494
|
+
this.formDataModel[propName] = deepClone(formData[propName]);
|
495
|
+
}
|
496
|
+
});
|
497
|
+
|
498
|
+
//this.formDataModel = formData
|
499
|
+
//this._provided.globalModel.formModel = formData /* 这种写法可使inject的属性保持响应式更新!! */
|
500
|
+
//
|
501
|
+
|
502
|
+
// 通知SubForm组件:表单数据更新事件!!
|
503
|
+
//this.broadcast('ContainerItem', 'setFormData', formData)
|
504
|
+
this.broadcast("ContainerItem", "setFormData", this.formDataModel);
|
505
|
+
|
506
|
+
// 通知FieldWidget组件:表单数据更新事件!!
|
507
|
+
//this.broadcast('FieldWidget', 'setFormData', formData)
|
508
|
+
this.broadcast("FieldWidget", "setFormData", this.formDataModel);
|
509
|
+
},
|
510
|
+
|
511
|
+
getFieldValue(fieldName) {
|
512
|
+
//单个字段获取值
|
513
|
+
let fieldRef = this.getWidgetRef(fieldName);
|
514
|
+
if (!!fieldRef && !!fieldRef.getValue) {
|
515
|
+
fieldRef.getValue();
|
516
|
+
}
|
517
|
+
},
|
518
|
+
|
519
|
+
setFieldValue(fieldName, fieldValue) {
|
520
|
+
//单个更新字段值
|
521
|
+
let fieldRef = this.getWidgetRef(fieldName);
|
522
|
+
if (!!fieldRef && !!fieldRef.setValue) {
|
523
|
+
fieldRef.setValue(fieldValue);
|
524
|
+
}
|
525
|
+
},
|
526
|
+
|
527
|
+
getSubFormValues(subFormName, needValidation = true) {
|
528
|
+
let foundSFRef = this.subFormRefList[subFormName];
|
529
|
+
// if (!foundSFRef) {
|
530
|
+
// return this.formDataModel[subFormName]
|
531
|
+
// }
|
532
|
+
return foundSFRef.getSubFormValues(needValidation);
|
533
|
+
},
|
534
|
+
|
535
|
+
disableForm() {
|
536
|
+
let wNameList = Object.keys(this.widgetRefList);
|
537
|
+
wNameList.forEach((wName) => {
|
538
|
+
let foundW = this.getWidgetRef(wName);
|
539
|
+
if (!!foundW) {
|
540
|
+
// if (!!foundW.setDisabled) {
|
541
|
+
// foundW.setDisabled(true)
|
542
|
+
// }
|
543
|
+
|
544
|
+
!!foundW.setDisabled && foundW.setDisabled(true);
|
545
|
+
}
|
546
|
+
});
|
547
|
+
},
|
548
|
+
|
549
|
+
enableForm() {
|
550
|
+
let wNameList = Object.keys(this.widgetRefList);
|
551
|
+
wNameList.forEach((wName) => {
|
552
|
+
let foundW = this.getWidgetRef(wName);
|
553
|
+
if (!!foundW) {
|
554
|
+
// if (!!foundW.setDisabled) {
|
555
|
+
// foundW.setDisabled(false)
|
556
|
+
// }
|
557
|
+
|
558
|
+
!!foundW.setDisabled && foundW.setDisabled(false);
|
559
|
+
}
|
560
|
+
});
|
561
|
+
},
|
562
|
+
|
563
|
+
resetForm() {
|
564
|
+
//重置表单
|
565
|
+
let subFormNames = Object.keys(this.subFormRefList);
|
566
|
+
subFormNames.forEach((sfName) => {
|
567
|
+
if (!!this.subFormRefList[sfName].resetSubForm) {
|
568
|
+
this.subFormRefList[sfName].resetSubForm();
|
569
|
+
}
|
570
|
+
});
|
571
|
+
|
572
|
+
let wNameList = Object.keys(this.widgetRefList);
|
573
|
+
wNameList.forEach((wName) => {
|
574
|
+
let foundW = this.getWidgetRef(wName);
|
575
|
+
if (!!foundW && !!foundW.resetField) {
|
576
|
+
foundW.resetField();
|
577
|
+
}
|
578
|
+
});
|
579
|
+
|
580
|
+
this.$nextTick(() => {
|
581
|
+
this.clearValidate(); /* 清除resetField方法触发的校验错误提示 */
|
582
|
+
});
|
583
|
+
},
|
584
|
+
|
585
|
+
clearValidate(props) {
|
586
|
+
this.$refs.renderForm.clearValidate(props);
|
587
|
+
},
|
588
|
+
|
589
|
+
validateForm() {
|
590
|
+
//
|
591
|
+
},
|
592
|
+
|
593
|
+
validateFields() {
|
594
|
+
//
|
595
|
+
},
|
596
|
+
|
597
|
+
disableWidgets(widgetNames) {
|
598
|
+
if (!!widgetNames) {
|
599
|
+
if (typeof widgetNames === "string") {
|
600
|
+
this.findWidgetAndSetDisabled(widgetNames, true);
|
601
|
+
} else if (Array.isArray(widgetNames)) {
|
602
|
+
widgetNames.forEach((wn) => {
|
603
|
+
this.findWidgetAndSetDisabled(wn, true);
|
604
|
+
});
|
605
|
+
}
|
606
|
+
}
|
607
|
+
},
|
608
|
+
|
609
|
+
enableWidgets(widgetNames) {
|
610
|
+
if (!!widgetNames) {
|
611
|
+
if (typeof widgetNames === "string") {
|
612
|
+
this.findWidgetAndSetDisabled(widgetNames, false);
|
613
|
+
} else if (Array.isArray(widgetNames)) {
|
614
|
+
widgetNames.forEach((wn) => {
|
615
|
+
this.findWidgetAndSetDisabled(wn, false);
|
616
|
+
});
|
617
|
+
}
|
618
|
+
}
|
619
|
+
},
|
620
|
+
|
621
|
+
hideWidgets(widgetNames) {
|
622
|
+
if (!!widgetNames) {
|
623
|
+
if (typeof widgetNames === "string") {
|
624
|
+
this.findWidgetAndSetHidden(widgetNames, true);
|
625
|
+
} else if (Array.isArray(widgetNames)) {
|
626
|
+
widgetNames.forEach((wn) => {
|
627
|
+
this.findWidgetAndSetHidden(wn, true);
|
628
|
+
});
|
629
|
+
}
|
630
|
+
}
|
631
|
+
},
|
632
|
+
|
633
|
+
showWidgets(widgetNames) {
|
634
|
+
if (!!widgetNames) {
|
635
|
+
if (typeof widgetNames === "string") {
|
636
|
+
this.findWidgetAndSetHidden(widgetNames, false);
|
637
|
+
} else if (Array.isArray(widgetNames)) {
|
638
|
+
widgetNames.forEach((wn) => {
|
639
|
+
this.findWidgetAndSetHidden(wn, false);
|
640
|
+
});
|
641
|
+
}
|
642
|
+
}
|
643
|
+
},
|
644
|
+
|
645
|
+
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
646
|
+
},
|
647
|
+
};
|
648
|
+
</script>
|
649
|
+
|
650
|
+
<style lang="scss" scoped>
|
651
|
+
.el-form ::v-deep .el-row {
|
652
|
+
padding: 8px;
|
653
|
+
}
|
654
|
+
.topBox {
|
655
|
+
padding: 10px;
|
656
|
+
margin-bottom: 27px;
|
657
|
+
.nameBox {
|
658
|
+
width: 100%;
|
659
|
+
font-size: 14px;
|
660
|
+
font-weight: 600;
|
661
|
+
color: #4a4a4a;
|
662
|
+
}
|
663
|
+
.disBox {
|
664
|
+
width: 100%;
|
665
|
+
display: flex;
|
666
|
+
font-size: 12px;
|
667
|
+
.contentAndType {
|
668
|
+
width: 200px;
|
669
|
+
color: rgba(74, 74, 74, 0.59);
|
670
|
+
font-weight: 400;
|
671
|
+
div {
|
672
|
+
height: 20px;
|
673
|
+
}
|
674
|
+
}
|
675
|
+
.timeAndState {
|
676
|
+
width: 62px;
|
677
|
+
color: #4a4a4a;
|
678
|
+
font-weight: 400;
|
679
|
+
div {
|
680
|
+
height: 20px;
|
681
|
+
}
|
682
|
+
.state {
|
683
|
+
color: #00b873;
|
684
|
+
}
|
685
|
+
}
|
686
|
+
.imgBox {
|
687
|
+
width: 40px;
|
688
|
+
height: 40px;
|
689
|
+
background: #00913a;
|
690
|
+
border-radius: 1px;
|
691
|
+
margin-left: 5px;
|
692
|
+
margin-top: -5px;
|
693
|
+
}
|
694
|
+
}
|
695
|
+
}
|
696
|
+
.bottomBox {
|
697
|
+
margin-top: 21px;
|
698
|
+
padding: 0 20px 20px;
|
699
|
+
.btmTitle {
|
700
|
+
font-size: 14px;
|
701
|
+
font-weight: 600;
|
702
|
+
color: #b3baba;
|
703
|
+
margin-bottom: 8px;
|
704
|
+
}
|
705
|
+
.btmContent {
|
706
|
+
color: rgba(2, 2, 2, 0.59);
|
707
|
+
font-size: 12px;
|
708
|
+
font-weight: 400;
|
709
|
+
line-height: 16px;
|
710
|
+
}
|
711
|
+
}
|
712
|
+
</style>
|