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,535 @@
|
|
1
|
+
import {deepClone} from "@/utils/util"
|
2
|
+
import FormValidators from '@/utils/validators'
|
3
|
+
|
4
|
+
export default {
|
5
|
+
inject: ['refList', 'formConfig', 'globalOptionData', 'globalModel', 'getOptionData'],
|
6
|
+
|
7
|
+
computed: {
|
8
|
+
subFormName() {
|
9
|
+
return !!this.parentWidget ? this.parentWidget.options.name : ''
|
10
|
+
},
|
11
|
+
|
12
|
+
subFormItemFlag() {
|
13
|
+
return !!this.parentWidget ? this.parentWidget.type === 'sub-form' : false
|
14
|
+
},
|
15
|
+
|
16
|
+
formModel: {
|
17
|
+
cache: false,
|
18
|
+
get() {
|
19
|
+
return this.globalModel.formModel
|
20
|
+
}
|
21
|
+
},
|
22
|
+
|
23
|
+
},
|
24
|
+
|
25
|
+
methods: {
|
26
|
+
|
27
|
+
//--------------------- 组件内部方法 begin ------------------//
|
28
|
+
|
29
|
+
initFieldModel() {
|
30
|
+
if (this.field.formItemFlag === false) {
|
31
|
+
return
|
32
|
+
}
|
33
|
+
|
34
|
+
if (!!this.subFormItemFlag && !this.designState) { //SubForm子表单组件需要特殊处理!!
|
35
|
+
let subFormData = this.formModel[this.subFormName]
|
36
|
+
if (((subFormData === undefined) || (subFormData[this.subFormRowIndex] === undefined) ||
|
37
|
+
(subFormData[this.subFormRowIndex][this.field.options.name] === undefined)) &&
|
38
|
+
(this.field.options.defaultValue !== undefined)) {
|
39
|
+
this.fieldModel = this.field.options.defaultValue
|
40
|
+
subFormData[this.subFormRowIndex][this.field.options.name] = this.field.options.defaultValue
|
41
|
+
} else if (subFormData[this.subFormRowIndex][this.field.options.name] === undefined) {
|
42
|
+
this.fieldModel = null
|
43
|
+
subFormData[this.subFormRowIndex][this.field.options.name] = null
|
44
|
+
} else {
|
45
|
+
this.fieldModel = subFormData[this.subFormRowIndex][this.field.options.name]
|
46
|
+
}
|
47
|
+
|
48
|
+
/* 主动触发子表单内field-widget的onChange事件!! */
|
49
|
+
setTimeout(() => { //延时触发onChange事件, 便于更新计算字段!!
|
50
|
+
this.handleOnChangeForSubForm(this.fieldModel, this.oldFieldValue, subFormData, this.subFormRowId)
|
51
|
+
}, 800)
|
52
|
+
this.oldFieldValue = deepClone(this.fieldModel)
|
53
|
+
|
54
|
+
this.initFileList() //处理图片上传、文件上传字段
|
55
|
+
|
56
|
+
return
|
57
|
+
}
|
58
|
+
|
59
|
+
if ((this.formModel[this.field.options.name] === undefined) &&
|
60
|
+
(this.field.options.defaultValue !== undefined)) {
|
61
|
+
this.fieldModel = this.field.options.defaultValue
|
62
|
+
} else if (this.formModel[this.field.options.name] === undefined) { //如果formModel为空对象,则初始化字段值为null!!
|
63
|
+
this.formModel[this.field.options.name] = null
|
64
|
+
} else {
|
65
|
+
this.fieldModel = this.formModel[this.field.options.name]
|
66
|
+
}
|
67
|
+
this.oldFieldValue = deepClone(this.fieldModel)
|
68
|
+
this.initFileList() //处理图片上传、文件上传字段
|
69
|
+
},
|
70
|
+
|
71
|
+
initFileList() { //初始化上传组件的已上传文件列表
|
72
|
+
if ( ((this.field.type !== 'picture-upload') && (this.field.type !== 'file-upload')) || (this.designState === true) ) {
|
73
|
+
return
|
74
|
+
}
|
75
|
+
|
76
|
+
if (!!this.fieldModel) {
|
77
|
+
if (Array.isArray(this.fieldModel)) {
|
78
|
+
this.fileList = deepClone(this.fieldModel)
|
79
|
+
} else {
|
80
|
+
this.fileList.splice(0, 0, deepClone(this.fieldModel))
|
81
|
+
}
|
82
|
+
}
|
83
|
+
},
|
84
|
+
|
85
|
+
initEventHandler() {
|
86
|
+
this.$on('setFormData', function (newFormData) {
|
87
|
+
console.log('formModel of globalModel----------', this.globalModel.formModel)
|
88
|
+
if (!this.subFormItemFlag) {
|
89
|
+
this.setValue(newFormData[this.field.options.name])
|
90
|
+
}
|
91
|
+
})
|
92
|
+
|
93
|
+
this.$on('field-value-changed', function (values) {
|
94
|
+
if (!!this.subFormItemFlag) {
|
95
|
+
let subFormData = this.formModel[this.subFormName]
|
96
|
+
this.handleOnChangeForSubForm(values[0], values[1], subFormData, this.subFormRowId)
|
97
|
+
} else {
|
98
|
+
this.handleOnChange(values[0], values[1])
|
99
|
+
}
|
100
|
+
})
|
101
|
+
|
102
|
+
/* 监听重新加载选项事件 */
|
103
|
+
this.$on('reloadOptionItems', function (widgetNames) {
|
104
|
+
if ((widgetNames.length === 0) || (widgetNames.indexOf(this.field.options.name) > -1)) {
|
105
|
+
this.initOptionItems(true)
|
106
|
+
}
|
107
|
+
})
|
108
|
+
},
|
109
|
+
|
110
|
+
handleOnCreated() {
|
111
|
+
if (!!this.field.options.onCreated) {
|
112
|
+
let customFunc = new Function(this.field.options.onCreated)
|
113
|
+
customFunc.call(this)
|
114
|
+
}
|
115
|
+
},
|
116
|
+
|
117
|
+
handleOnMounted() {
|
118
|
+
if (!!this.field.options.onMounted) {
|
119
|
+
let mountFunc = new Function(this.field.options.onMounted)
|
120
|
+
mountFunc.call(this)
|
121
|
+
}
|
122
|
+
},
|
123
|
+
|
124
|
+
registerToRefList(oldRefName) {
|
125
|
+
if ((this.refList !== null) && !!this.field.options.name) {
|
126
|
+
if (this.subFormItemFlag && !this.designState) { //处理子表单元素(且非设计状态)
|
127
|
+
if (!!oldRefName) {
|
128
|
+
delete this.refList[oldRefName + '@row' + this.subFormRowId]
|
129
|
+
}
|
130
|
+
this.refList[this.field.options.name + '@row' + this.subFormRowId] = this
|
131
|
+
} else {
|
132
|
+
if (!!oldRefName) {
|
133
|
+
delete this.refList[oldRefName]
|
134
|
+
}
|
135
|
+
this.refList[this.field.options.name] = this
|
136
|
+
}
|
137
|
+
}
|
138
|
+
},
|
139
|
+
|
140
|
+
unregisterFromRefList() { //销毁组件时注销组件ref
|
141
|
+
if ((this.refList !== null) && !!this.field.options.name) {
|
142
|
+
let oldRefName = this.field.options.name
|
143
|
+
if (this.subFormItemFlag && !this.designState) { //处理子表单元素(且非设计状态)
|
144
|
+
delete this.refList[oldRefName + '@row' + this.subFormRowId]
|
145
|
+
} else {
|
146
|
+
delete this.refList[oldRefName]
|
147
|
+
}
|
148
|
+
}
|
149
|
+
},
|
150
|
+
|
151
|
+
initOptionItems(keepSelected) {
|
152
|
+
if (this.designState) {
|
153
|
+
return
|
154
|
+
}
|
155
|
+
|
156
|
+
if ((this.field.type === 'radio') || (this.field.type === 'checkbox')
|
157
|
+
|| (this.field.type === 'select') || (this.field.type === 'cascader')) {
|
158
|
+
if (!!this.globalOptionData && this.globalOptionData.hasOwnProperty(this.field.options.name)) {
|
159
|
+
if (!!keepSelected) {
|
160
|
+
//this.reloadOptions(this.globalOptionData[this.field.options.name]) /* 异步更新option-data之后不能获取到最新值,
|
161
|
+
// 以下改用provide的getOptionData()方法 */
|
162
|
+
const newOptionItems = this.getOptionData()
|
163
|
+
this.reloadOptions(newOptionItems[this.field.options.name])
|
164
|
+
} else {
|
165
|
+
this.loadOptions( this.globalOptionData[this.field.options.name] )
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
},
|
170
|
+
|
171
|
+
refreshDefaultValue() {
|
172
|
+
if ((this.designState === true) && (this.field.options.defaultValue !== undefined)) {
|
173
|
+
this.fieldModel = this.field.options.defaultValue
|
174
|
+
}
|
175
|
+
},
|
176
|
+
|
177
|
+
clearFieldRules() {
|
178
|
+
this.rules.splice(0, this.rules.length) //清空已有
|
179
|
+
},
|
180
|
+
|
181
|
+
buildFieldRules() {
|
182
|
+
this.rules.splice(0, this.rules.length) //清空已有
|
183
|
+
if (!!this.field.options.required) {
|
184
|
+
this.rules.push({
|
185
|
+
required: true,
|
186
|
+
//trigger: ['blur', 'change'],
|
187
|
+
trigger: ['blur'], /* 去掉change事件触发校验,change事件触发时formModel数据尚未更新,导致radio/checkbox必填校验出错!! */
|
188
|
+
message: this.i18nt('render.hint.fieldRequired'),
|
189
|
+
})
|
190
|
+
}
|
191
|
+
|
192
|
+
if (!!this.field.options.validation) {
|
193
|
+
let vldName = this.field.options.validation
|
194
|
+
if (!!FormValidators[vldName]) {
|
195
|
+
this.rules.push({
|
196
|
+
validator: FormValidators[vldName],
|
197
|
+
trigger: ['blur', 'change'],
|
198
|
+
label: this.field.options.label,
|
199
|
+
errorMsg: this.field.options.validationHint
|
200
|
+
})
|
201
|
+
} else {
|
202
|
+
this.rules.push({
|
203
|
+
validator: FormValidators['regExp'],
|
204
|
+
trigger: ['blur', 'change'],
|
205
|
+
regExp: vldName,
|
206
|
+
label: this.field.options.label,
|
207
|
+
errorMsg: this.field.options.validationHint
|
208
|
+
})
|
209
|
+
}
|
210
|
+
}
|
211
|
+
|
212
|
+
if (!!this.field.options.onValidate) {
|
213
|
+
let customFn = new Function('rule', 'value', 'callback', this.field.options.onValidate)
|
214
|
+
this.rules.push({
|
215
|
+
validator: customFn,
|
216
|
+
trigger: ['blur', 'change'],
|
217
|
+
label: this.field.options.label
|
218
|
+
})
|
219
|
+
}
|
220
|
+
},
|
221
|
+
|
222
|
+
/**
|
223
|
+
* 禁用字段值变动触发表单校验
|
224
|
+
*/
|
225
|
+
disableChangeValidate() {
|
226
|
+
if (!this.rules) {
|
227
|
+
return
|
228
|
+
}
|
229
|
+
|
230
|
+
this.rules.forEach(rule => {
|
231
|
+
if (!!rule.trigger) {
|
232
|
+
rule.trigger.splice(0, rule.trigger.length)
|
233
|
+
}
|
234
|
+
})
|
235
|
+
},
|
236
|
+
|
237
|
+
/**
|
238
|
+
* 启用字段值变动触发表单校验
|
239
|
+
*/
|
240
|
+
enableChangeValidate() {
|
241
|
+
if (!this.rules) {
|
242
|
+
return
|
243
|
+
}
|
244
|
+
|
245
|
+
this.rules.forEach(rule => {
|
246
|
+
if (!!rule.trigger) {
|
247
|
+
rule.trigger.push('blur')
|
248
|
+
rule.trigger.push('change')
|
249
|
+
}
|
250
|
+
})
|
251
|
+
},
|
252
|
+
|
253
|
+
disableOptionOfList(optionList, optionValue) {
|
254
|
+
if (!!optionList && (optionList.length > 0)) {
|
255
|
+
optionList.forEach(opt => {
|
256
|
+
if (opt.value === optionValue) {
|
257
|
+
opt.disabled = true
|
258
|
+
}
|
259
|
+
})
|
260
|
+
}
|
261
|
+
},
|
262
|
+
|
263
|
+
enableOptionOfList(optionList, optionValue) {
|
264
|
+
if (!!optionList && (optionList.length > 0)) {
|
265
|
+
optionList.forEach(opt => {
|
266
|
+
if (opt.value === optionValue) {
|
267
|
+
opt.disabled = false
|
268
|
+
}
|
269
|
+
})
|
270
|
+
}
|
271
|
+
},
|
272
|
+
|
273
|
+
//--------------------- 组件内部方法 end ------------------//
|
274
|
+
|
275
|
+
//--------------------- 事件处理 begin ------------------//
|
276
|
+
|
277
|
+
emitFieldDataChange(newValue, oldValue) {
|
278
|
+
this.$emit('field-value-changed', [newValue, oldValue])
|
279
|
+
|
280
|
+
/* 必须用dispatch向指定父组件派发消息!! */
|
281
|
+
this.dispatch('VFormRender', 'fieldChange',
|
282
|
+
[this.field.options.name, newValue, oldValue, this.subFormName, this.subFormRowIndex])
|
283
|
+
},
|
284
|
+
|
285
|
+
syncUpdateFormModel(value) {
|
286
|
+
if (!!this.designState) {
|
287
|
+
return
|
288
|
+
}
|
289
|
+
|
290
|
+
if (!!this.subFormItemFlag) {
|
291
|
+
let subFormData = this.formModel[this.subFormName] || [{}]
|
292
|
+
let subFormDataRow = subFormData[this.subFormRowIndex]
|
293
|
+
subFormDataRow[this.field.options.name] = value
|
294
|
+
} else {
|
295
|
+
this.formModel[this.field.options.name] = value
|
296
|
+
}
|
297
|
+
},
|
298
|
+
|
299
|
+
handleChangeEvent(value) {
|
300
|
+
this.syncUpdateFormModel(value)
|
301
|
+
this.emitFieldDataChange(value, this.oldFieldValue)
|
302
|
+
|
303
|
+
//number组件一般不会触发focus事件,故此处需要手工赋值oldFieldValue!!
|
304
|
+
this.oldFieldValue = deepClone(value) /* oldFieldValue需要在initFieldModel()方法中赋初值!! */
|
305
|
+
|
306
|
+
/* 主动触发表单的单个字段校验,用于清除字段可能存在的校验错误提示 */
|
307
|
+
this.dispatch('VFormRender', 'fieldValidation', [this.field.options.name])
|
308
|
+
},
|
309
|
+
|
310
|
+
handleFocusCustomEvent(event) {
|
311
|
+
this.oldFieldValue = deepClone(this.fieldModel) //保存修改change之前的值
|
312
|
+
|
313
|
+
if (!!this.field.options.onFocus) {
|
314
|
+
let customFn = new Function('event', this.field.options.onFocus)
|
315
|
+
customFn.call(this, event)
|
316
|
+
}
|
317
|
+
},
|
318
|
+
|
319
|
+
handleBlurCustomEvent(event) {
|
320
|
+
if (!!this.field.options.onBlur) {
|
321
|
+
let customFn = new Function('event', this.field.options.onBlur)
|
322
|
+
customFn.call(this, event)
|
323
|
+
}
|
324
|
+
},
|
325
|
+
|
326
|
+
handleInputCustomEvent(value) {
|
327
|
+
this.syncUpdateFormModel(value)
|
328
|
+
|
329
|
+
if (!!this.field.options.onInput) {
|
330
|
+
let customFn = new Function('value', this.field.options.onInput)
|
331
|
+
customFn.call(this, value)
|
332
|
+
}
|
333
|
+
},
|
334
|
+
|
335
|
+
emitAppendButtonClick() {
|
336
|
+
/* 必须调用mixins中的dispatch方法逐级向父组件发送消息!! */
|
337
|
+
this.dispatch('VFormRender', 'appendButtonClick', [this]);
|
338
|
+
},
|
339
|
+
|
340
|
+
handleOnChange(val, oldVal) { //自定义onChange事件
|
341
|
+
if (!!this.field.options.onChange) {
|
342
|
+
let changeFn = new Function('value', 'oldValue', this.field.options.onChange)
|
343
|
+
changeFn.call(this, val, oldVal)
|
344
|
+
}
|
345
|
+
},
|
346
|
+
|
347
|
+
handleOnChangeForSubForm(val, oldVal, subFormData, rowId) { //子表单自定义onChange事件
|
348
|
+
if (!!this.field.options.onChange) {
|
349
|
+
let changeFn = new Function('value', 'oldValue', 'subFormData', 'rowId', this.field.options.onChange)
|
350
|
+
changeFn.call(this, val, oldVal, subFormData, rowId)
|
351
|
+
}
|
352
|
+
},
|
353
|
+
|
354
|
+
handleButtonWidgetClick() {
|
355
|
+
if (!!this.designState) { //设计状态不触发点击事件
|
356
|
+
return
|
357
|
+
}
|
358
|
+
|
359
|
+
if (!!this.field.options.onClick) {
|
360
|
+
let changeFn = new Function(this.field.options.onClick)
|
361
|
+
changeFn.call(this)
|
362
|
+
} else {
|
363
|
+
this.dispatch('VFormRender', 'buttonClick', [this]);
|
364
|
+
}
|
365
|
+
},
|
366
|
+
|
367
|
+
remoteQuery(keyword) {
|
368
|
+
if (!!this.field.options.onRemoteQuery) {
|
369
|
+
let remoteFn = new Function('keyword', this.field.options.onRemoteQuery)
|
370
|
+
remoteFn.call(this, keyword)
|
371
|
+
}
|
372
|
+
},
|
373
|
+
|
374
|
+
//--------------------- 事件处理 end ------------------//
|
375
|
+
|
376
|
+
//--------------------- 以下为组件支持外部调用的API方法 begin ------------------//
|
377
|
+
/* 提示:用户可自行扩充这些方法!!! */
|
378
|
+
|
379
|
+
getFormRef() { /* 获取VFrom引用,必须在VForm组件created之后方可调用 */
|
380
|
+
return this.refList['v_form_ref']
|
381
|
+
},
|
382
|
+
|
383
|
+
getWidgetRef(widgetName, showError) {
|
384
|
+
let foundRef = this.refList[widgetName]
|
385
|
+
if (!foundRef && !!showError) {
|
386
|
+
this.$message.error(this.i18nt('render.hint.refNotFound') + widgetName)
|
387
|
+
}
|
388
|
+
return foundRef
|
389
|
+
},
|
390
|
+
|
391
|
+
getFieldEditor() { //获取内置的el表单组件
|
392
|
+
return this.$refs['fieldEditor']
|
393
|
+
},
|
394
|
+
|
395
|
+
/*
|
396
|
+
注意:VFormRender的setFormData方法不会触发子表单内field-widget的setValue方法,
|
397
|
+
因为setFormData方法调用后,子表单内所有field-widget组件已被清空,接收不到setFormData事件!!
|
398
|
+
* */
|
399
|
+
setValue(newValue) {
|
400
|
+
/* if ((this.field.type === 'picture-upload') || (this.field.type === 'file-upload')) {
|
401
|
+
this.fileList = newValue
|
402
|
+
} else */ if (!!this.field.formItemFlag) {
|
403
|
+
let oldValue = deepClone(this.fieldModel)
|
404
|
+
this.fieldModel = newValue
|
405
|
+
this.initFileList()
|
406
|
+
|
407
|
+
this.syncUpdateFormModel(newValue)
|
408
|
+
this.emitFieldDataChange(newValue, oldValue)
|
409
|
+
}
|
410
|
+
},
|
411
|
+
|
412
|
+
getValue() {
|
413
|
+
/* if ((this.field.type === 'picture-upload') || (this.field.type === 'file-upload')) {
|
414
|
+
return this.fileList
|
415
|
+
} else */ {
|
416
|
+
return this.fieldModel
|
417
|
+
}
|
418
|
+
},
|
419
|
+
|
420
|
+
resetField() {
|
421
|
+
let defaultValue = this.field.options.defaultValue
|
422
|
+
this.setValue(defaultValue)
|
423
|
+
this.$nextTick(() => {
|
424
|
+
//
|
425
|
+
})
|
426
|
+
|
427
|
+
//清空上传组件文件列表
|
428
|
+
if ((this.field.type === 'picture-upload') || (this.field.type === 'file-upload')) {
|
429
|
+
this.$refs['fieldEditor'].clearFiles()
|
430
|
+
this.fileList.splice(0, this.fileList.length)
|
431
|
+
}
|
432
|
+
},
|
433
|
+
|
434
|
+
setWidgetOption(optionName, optionValue) { //通用组件选项修改API
|
435
|
+
if (this.field.options.hasOwnProperty(optionName)) {
|
436
|
+
this.field.options[optionName] = optionValue
|
437
|
+
//TODO: 是否重新构建组件??有些属性修改后必须重新构建组件才能生效,比如字段校验规则。
|
438
|
+
}
|
439
|
+
},
|
440
|
+
|
441
|
+
setReadonly(flag) {
|
442
|
+
this.field.options.readonly = flag
|
443
|
+
},
|
444
|
+
|
445
|
+
setDisabled(flag) {
|
446
|
+
this.field.options.disabled = flag
|
447
|
+
},
|
448
|
+
|
449
|
+
setAppendButtonVisible(flag) {
|
450
|
+
this.field.options.appendButton = flag
|
451
|
+
},
|
452
|
+
|
453
|
+
setAppendButtonDisabled(flag) {
|
454
|
+
this.field.options.appendButtonDisabled = flag
|
455
|
+
},
|
456
|
+
|
457
|
+
setHidden(flag) {
|
458
|
+
this.field.options.hidden = flag
|
459
|
+
|
460
|
+
if (!!flag) { //清除组件校验规则
|
461
|
+
this.clearFieldRules()
|
462
|
+
} else { //重建组件校验规则
|
463
|
+
this.buildFieldRules()
|
464
|
+
}
|
465
|
+
},
|
466
|
+
|
467
|
+
setRequired(flag) {
|
468
|
+
this.field.options.required = flag
|
469
|
+
this.buildFieldRules()
|
470
|
+
},
|
471
|
+
|
472
|
+
setLabel(newLabel) {
|
473
|
+
this.field.options.label = newLabel
|
474
|
+
},
|
475
|
+
|
476
|
+
focus() {
|
477
|
+
if (!!this.getFieldEditor() && !!this.getFieldEditor().focus) {
|
478
|
+
this.getFieldEditor().focus()
|
479
|
+
}
|
480
|
+
},
|
481
|
+
|
482
|
+
clearSelectedOptions() { //清空已选选项
|
483
|
+
if ((this.field.type !== 'checkbox') && (this.field.type !== 'radio') && (this.field.type !== 'select')) {
|
484
|
+
return
|
485
|
+
}
|
486
|
+
|
487
|
+
if ((this.field.type === 'checkbox') ||
|
488
|
+
((this.field.type === 'select') && this.field.options.multiple)) {
|
489
|
+
this.fieldModel = []
|
490
|
+
} else {
|
491
|
+
this.fieldModel = ''
|
492
|
+
}
|
493
|
+
},
|
494
|
+
|
495
|
+
/**
|
496
|
+
* 加载选项,并清空字段值
|
497
|
+
* @param options
|
498
|
+
*/
|
499
|
+
loadOptions(options) {
|
500
|
+
this.field.options.optionItems = deepClone(options)
|
501
|
+
this.clearSelectedOptions() //清空已选选项
|
502
|
+
},
|
503
|
+
|
504
|
+
/**
|
505
|
+
* 重新加载选项,不清空字段值
|
506
|
+
* @param options
|
507
|
+
*/
|
508
|
+
reloadOptions(options) {
|
509
|
+
this.field.options.optionItems = deepClone(options)
|
510
|
+
},
|
511
|
+
|
512
|
+
disableOption(optionValue) {
|
513
|
+
this.disableOptionOfList(this.field.options.optionItems, optionValue)
|
514
|
+
},
|
515
|
+
|
516
|
+
enableOption(optionValue) {
|
517
|
+
this.enableOptionOfList(this.field.options.optionItems, optionValue)
|
518
|
+
},
|
519
|
+
|
520
|
+
setUploadHeader(name, value) {
|
521
|
+
this.$set(this.uploadHeaders, name, value)
|
522
|
+
},
|
523
|
+
|
524
|
+
setUploadData(name, value) {
|
525
|
+
this.$set(this.uploadData, name, value)
|
526
|
+
},
|
527
|
+
|
528
|
+
setToolbar(customToolbar) {
|
529
|
+
this.customToolbar = customToolbar
|
530
|
+
},
|
531
|
+
|
532
|
+
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
533
|
+
|
534
|
+
}
|
535
|
+
}
|