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,271 @@
|
|
1
|
+
<template>
|
2
|
+
<form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
|
3
|
+
:parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
|
4
|
+
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
|
5
|
+
<!-- el-upload增加:name="field.options.name"后,会导致又拍云上传失败!故删除之!! -->
|
6
|
+
<el-upload ref="fieldEditor" :disabled="field.options.disabled"
|
7
|
+
:style="styleVariables" class="dynamicPseudoAfter"
|
8
|
+
:action="field.options.uploadURL" :headers="uploadHeaders" :data="uploadData"
|
9
|
+
:with-credentials="field.options.withCredentials"
|
10
|
+
:multiple="field.options.multipleSelect" :file-list="fileList"
|
11
|
+
:show-file-list="field.options.showFileList" :class="{'hideUploadDiv': uploadBtnHidden}"
|
12
|
+
:limit="field.options.limit" :on-exceed="handleFileExceed" :before-upload="beforeFileUpload"
|
13
|
+
:on-success="handleFileUpload" :on-error="handelUploadError" :on-remove="handleFileRemove">
|
14
|
+
<div slot="tip" class="el-upload__tip"
|
15
|
+
v-if="!!field.options.uploadTip">{{field.options.uploadTip}}</div>
|
16
|
+
<i slot="default" class="el-icon-plus avatar-uploader-icon"></i>
|
17
|
+
<div slot="file" slot-scope="{file}" class="upload-file-list">
|
18
|
+
<span class="upload-file-name" :title="file.name">{{file.name}}</span>
|
19
|
+
<a :href="file.url" download="">
|
20
|
+
<i class="el-icon-download file-action" title="i18nt('render.hint.downloadFile')"></i></a>
|
21
|
+
<i class="el-icon-delete file-action" title="i18nt('render.hint.removeFile')" v-if="!field.options.disabled"
|
22
|
+
@click="removeUploadFile(file.name)"></i>
|
23
|
+
</div>
|
24
|
+
</el-upload>
|
25
|
+
</form-item-wrapper>
|
26
|
+
</template>
|
27
|
+
|
28
|
+
<script>
|
29
|
+
import FormItemWrapper from './form-item-wrapper'
|
30
|
+
import emitter from 'element-ui/lib/mixins/emitter'
|
31
|
+
import i18n, {translate} from "@/utils/i18n";
|
32
|
+
import {deepClone} from "@/utils/util";
|
33
|
+
import fieldMixin from "@/components/form-designer/form-widget/field-widget/fieldMixin";
|
34
|
+
|
35
|
+
let selectFileText = "'" + translate('render.hint.selectFile') + "'"
|
36
|
+
|
37
|
+
export default {
|
38
|
+
name: "file-upload-widget",
|
39
|
+
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
40
|
+
mixins: [emitter, fieldMixin, i18n],
|
41
|
+
props: {
|
42
|
+
field: Object,
|
43
|
+
parentWidget: Object,
|
44
|
+
parentList: Array,
|
45
|
+
indexOfParentList: Number,
|
46
|
+
designer: Object,
|
47
|
+
|
48
|
+
designState: {
|
49
|
+
type: Boolean,
|
50
|
+
default: false
|
51
|
+
},
|
52
|
+
|
53
|
+
subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
|
54
|
+
type: Number,
|
55
|
+
default: -1
|
56
|
+
},
|
57
|
+
subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
|
58
|
+
type: Number,
|
59
|
+
default: -1
|
60
|
+
},
|
61
|
+
subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
|
62
|
+
type: String,
|
63
|
+
default: ''
|
64
|
+
},
|
65
|
+
|
66
|
+
},
|
67
|
+
components: {
|
68
|
+
FormItemWrapper,
|
69
|
+
},
|
70
|
+
inject: ['refList', 'formConfig', 'globalOptionData', 'globalModel'],
|
71
|
+
data() {
|
72
|
+
return {
|
73
|
+
oldFieldValue: null, //field组件change之前的值
|
74
|
+
fieldModel: null,
|
75
|
+
rules: [],
|
76
|
+
|
77
|
+
uploadHeaders: {},
|
78
|
+
uploadData: {
|
79
|
+
key: '', //七牛云上传文件名
|
80
|
+
//token: '', //七牛云上传token
|
81
|
+
|
82
|
+
//policy: '', //又拍云上传policy
|
83
|
+
//authorization: '', //又拍云上传签名
|
84
|
+
},
|
85
|
+
fileList: [], //上传文件列表
|
86
|
+
uploadBtnHidden: false,
|
87
|
+
|
88
|
+
styleVariables: {
|
89
|
+
'--select-file-action': selectFileText,
|
90
|
+
},
|
91
|
+
}
|
92
|
+
},
|
93
|
+
computed: {
|
94
|
+
|
95
|
+
},
|
96
|
+
beforeCreate() {
|
97
|
+
/* 这里不能访问方法和属性!! */
|
98
|
+
},
|
99
|
+
|
100
|
+
created() {
|
101
|
+
/* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
|
102
|
+
需要在父组件created中初始化!! */
|
103
|
+
this.initFieldModel()
|
104
|
+
this.registerToRefList()
|
105
|
+
this.initEventHandler()
|
106
|
+
this.buildFieldRules()
|
107
|
+
|
108
|
+
this.handleOnCreated()
|
109
|
+
},
|
110
|
+
|
111
|
+
mounted() {
|
112
|
+
this.handleOnMounted()
|
113
|
+
},
|
114
|
+
|
115
|
+
beforeDestroy() {
|
116
|
+
this.unregisterFromRefList()
|
117
|
+
},
|
118
|
+
|
119
|
+
methods: {
|
120
|
+
handleFileExceed() {
|
121
|
+
let uploadLimit = this.field.options.limit /* 此行不能注释,下一行ES6模板字符串需要用到!! */
|
122
|
+
this.$message.warning(eval('`' + this.i18nt('render.hint.uploadExceed') + '`'));
|
123
|
+
},
|
124
|
+
|
125
|
+
updateUploadFieldModelAndEmitDataChange(fileList) {
|
126
|
+
let oldValue = deepClone(this.fieldModel)
|
127
|
+
this.fieldModel = deepClone(fileList)
|
128
|
+
this.syncUpdateFormModel(this.fieldModel)
|
129
|
+
this.emitFieldDataChange(this.fieldModel, oldValue)
|
130
|
+
},
|
131
|
+
|
132
|
+
beforeFileUpload(file) {
|
133
|
+
let fileTypeCheckResult = false
|
134
|
+
let extFileName = file.name.substring(file.name.lastIndexOf('.') + 1)
|
135
|
+
if (!!this.field.options && !!this.field.options.fileTypes) {
|
136
|
+
let uploadFileTypes = this.field.options.fileTypes
|
137
|
+
if (uploadFileTypes.length > 0) {
|
138
|
+
fileTypeCheckResult = uploadFileTypes.some( (ft) => {
|
139
|
+
return extFileName.toLowerCase() === ft.toLowerCase()
|
140
|
+
})
|
141
|
+
}
|
142
|
+
}
|
143
|
+
if (!fileTypeCheckResult) {
|
144
|
+
this.$message.error(this.i18nt('render.hint.unsupportedFileType') + extFileName)
|
145
|
+
return false;
|
146
|
+
}
|
147
|
+
|
148
|
+
let fileSizeCheckResult = false
|
149
|
+
let uploadFileMaxSize = 5 //5MB
|
150
|
+
if (!!this.field.options && !!this.field.options.fileMaxSize) {
|
151
|
+
uploadFileMaxSize = this.field.options.fileMaxSize
|
152
|
+
}
|
153
|
+
fileSizeCheckResult = file.size / 1024 / 1024 <= uploadFileMaxSize
|
154
|
+
if (!fileSizeCheckResult) {
|
155
|
+
this.$message.error(this.i18nt('render.hint.fileSizeExceed') + uploadFileMaxSize + 'MB')
|
156
|
+
return false;
|
157
|
+
}
|
158
|
+
|
159
|
+
this.uploadData.key = file.name
|
160
|
+
return this.handleOnBeforeUpload(file)
|
161
|
+
},
|
162
|
+
|
163
|
+
handleOnBeforeUpload(file) {
|
164
|
+
if (!!this.field.options.onBeforeUpload) {
|
165
|
+
let bfFunc = new Function('file', this.field.options.onBeforeUpload)
|
166
|
+
let result = bfFunc.call(this, file)
|
167
|
+
if (typeof result === 'boolean') {
|
168
|
+
return result
|
169
|
+
} else {
|
170
|
+
return true
|
171
|
+
}
|
172
|
+
}
|
173
|
+
|
174
|
+
return true
|
175
|
+
},
|
176
|
+
|
177
|
+
handleFileUpload(res, file, fileList) {
|
178
|
+
if (!!this.field.options.onUploadSuccess) {
|
179
|
+
let mountFunc = new Function('result', 'file', 'fileList', this.field.options.onUploadSuccess)
|
180
|
+
mountFunc.call(this, res, file, fileList)
|
181
|
+
} else {
|
182
|
+
if (file.status === 'success') {
|
183
|
+
//this.fileList.push(file) /* 上传过程中,this.fileList是只读的,不能修改赋值!! */
|
184
|
+
this.updateUploadFieldModelAndEmitDataChange(fileList)
|
185
|
+
|
186
|
+
this.uploadBtnHidden = fileList.length >= this.field.options.limit
|
187
|
+
}
|
188
|
+
}
|
189
|
+
},
|
190
|
+
|
191
|
+
handleFileRemove(file, fileList) {
|
192
|
+
this.fileList = fileList
|
193
|
+
this.updateUploadFieldModelAndEmitDataChange(fileList)
|
194
|
+
|
195
|
+
this.uploadBtnHidden = fileList.length >= this.field.options.limit
|
196
|
+
},
|
197
|
+
|
198
|
+
removeUploadFile(fileName) {
|
199
|
+
let foundIdx = -1
|
200
|
+
this.fileList.forEach((file,idx) => {
|
201
|
+
if (file.name === fileName) {
|
202
|
+
foundIdx = idx
|
203
|
+
}
|
204
|
+
})
|
205
|
+
|
206
|
+
if (foundIdx >= 0) {
|
207
|
+
this.fileList.splice(foundIdx, 1)
|
208
|
+
this.updateUploadFieldModelAndEmitDataChange(this.fileList)
|
209
|
+
|
210
|
+
this.uploadBtnHidden = this.fileList.length >= this.field.options.limit
|
211
|
+
}
|
212
|
+
},
|
213
|
+
|
214
|
+
handelUploadError(err, file, fileList) {
|
215
|
+
if (!!this.field.options.onUploadError) {
|
216
|
+
let customFn = new Function('error', 'file', 'fileList', this.field.options.onUploadError)
|
217
|
+
customFn.call(this, err, file, fileList)
|
218
|
+
} else {
|
219
|
+
this.$message({
|
220
|
+
message: this.i18nt('render.hint.uploadError') + err,
|
221
|
+
duration: 3000,
|
222
|
+
type: 'error',
|
223
|
+
})
|
224
|
+
}
|
225
|
+
},
|
226
|
+
|
227
|
+
}
|
228
|
+
}
|
229
|
+
</script>
|
230
|
+
|
231
|
+
<style lang="scss" scoped>
|
232
|
+
@import "../../../../styles/global.scss"; //* form-item-wrapper已引入,还需要重复引入吗? *//
|
233
|
+
|
234
|
+
.full-width-input {
|
235
|
+
width: 100% !important;
|
236
|
+
}
|
237
|
+
|
238
|
+
.dynamicPseudoAfter ::v-deep .el-upload.el-upload--text {
|
239
|
+
color: $--color-primary;
|
240
|
+
font-size: 12px;
|
241
|
+
.el-icon-plus:after {
|
242
|
+
content: var(--select-file-action);
|
243
|
+
}
|
244
|
+
}
|
245
|
+
|
246
|
+
.hideUploadDiv {
|
247
|
+
::v-deep div.el-upload--picture-card { /* 隐藏最后的图片上传按钮 */
|
248
|
+
display: none;
|
249
|
+
}
|
250
|
+
|
251
|
+
::v-deep div.el-upload--text { /* 隐藏最后的文件上传按钮 */
|
252
|
+
display: none;
|
253
|
+
}
|
254
|
+
|
255
|
+
::v-deep div.el-upload__tip { /* 隐藏最后的文件上传按钮 */
|
256
|
+
display: none;
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
.upload-file-list {
|
261
|
+
font-size: 12px;
|
262
|
+
|
263
|
+
.file-action {
|
264
|
+
color: $--color-primary;
|
265
|
+
margin-left: 5px;
|
266
|
+
margin-right: 5px;
|
267
|
+
cursor: pointer;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
</style>
|
@@ -0,0 +1,331 @@
|
|
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="field-wrapper" :class="{'design-time-bottom-margin': !!this.designer}">
|
13
|
+
<el-form-item v-if="!!field.formItemFlag" :label="label" :label-width="labelWidth + 'px'"
|
14
|
+
:title="field.options.labelTooltip"
|
15
|
+
v-show="!field.options.hidden || (designState === true)"
|
16
|
+
:rules="rules" :prop="getPropName()"
|
17
|
+
:class="[selected ? 'selected' : '', labelAlign, customClass, field.options.required ? 'required' : '']"
|
18
|
+
@click.native.stop="selectField(field)">
|
19
|
+
|
20
|
+
<span v-if="!!field.options.labelIconClass" slot="label" class="custom-label">
|
21
|
+
<template v-if="field.options.labelIconPosition === 'front'">
|
22
|
+
<template v-if="!!field.options.labelTooltip">
|
23
|
+
<el-tooltip :content="field.options.labelTooltip" effect="light">
|
24
|
+
<i :class="field.options.labelIconClass"></i></el-tooltip>{{label}}</template>
|
25
|
+
<template v-else>
|
26
|
+
<i :class="field.options.labelIconClass"></i>{{label}}</template>
|
27
|
+
</template>
|
28
|
+
<template v-else-if="field.options.labelIconPosition === 'rear'">
|
29
|
+
<template v-if="!!field.options.labelTooltip">
|
30
|
+
{{label}}<el-tooltip :content="field.options.labelTooltip" effect="light">
|
31
|
+
<i :class="field.options.labelIconClass"></i></el-tooltip></template>
|
32
|
+
<template v-else>
|
33
|
+
{{label}}<i :class="field.options.labelIconClass"></i></template>
|
34
|
+
</template>
|
35
|
+
</span>
|
36
|
+
<slot></slot>
|
37
|
+
</el-form-item>
|
38
|
+
|
39
|
+
<template v-if="!!this.designer">
|
40
|
+
<div class="field-action" v-if="designer.selectedId === field.id">
|
41
|
+
<i class="el-icon-back" :title="i18nt('designer.hint.selectParentWidget')" @click.stop="selectParentWidget(field)"></i>
|
42
|
+
<i class="el-icon-top" v-if="!!parentList && (parentList.length > 1)" :title="i18nt('designer.hint.moveUpWidget')"
|
43
|
+
@click.stop="moveUpWidget(field)"></i>
|
44
|
+
<i class="el-icon-bottom" v-if="!!parentList && (parentList.length > 1)" :title="i18nt('designer.hint.moveDownWidget')"
|
45
|
+
@click.stop="moveDownWidget(field)"></i>
|
46
|
+
<i class="el-icon-delete" :title="i18nt('designer.hint.remove')" @click.stop="removeFieldWidget"></i>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<div class="drag-handler background-opacity" v-if="designer.selectedId === field.id">
|
50
|
+
<i class="el-icon-rank" :title="i18nt('designer.hint.dragHandler')"></i>
|
51
|
+
<i>{{i18n2t(`designer.widgetLabel.${field.type}`, `extension.widgetLabel.${field.type}`)}}</i>
|
52
|
+
<i v-if="field.options.hidden === true" class="iconfont icon-hide"></i>
|
53
|
+
</div>
|
54
|
+
</template>
|
55
|
+
</div>
|
56
|
+
</template>
|
57
|
+
|
58
|
+
<script>
|
59
|
+
import i18n from "@/utils/i18n";
|
60
|
+
|
61
|
+
export default {
|
62
|
+
name: "form-item-wrapper",
|
63
|
+
mixins: [i18n],
|
64
|
+
props: {
|
65
|
+
field: Object,
|
66
|
+
designer: Object,
|
67
|
+
parentWidget: Object,
|
68
|
+
parentList: Array,
|
69
|
+
indexOfParentList: Number,
|
70
|
+
|
71
|
+
designState: {
|
72
|
+
type: Boolean,
|
73
|
+
default: false
|
74
|
+
},
|
75
|
+
|
76
|
+
subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
|
77
|
+
type: Number,
|
78
|
+
default: -1
|
79
|
+
},
|
80
|
+
subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
|
81
|
+
type: Number,
|
82
|
+
default: -1
|
83
|
+
},
|
84
|
+
subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
|
85
|
+
type: String,
|
86
|
+
default: ''
|
87
|
+
},
|
88
|
+
|
89
|
+
rules: Array,
|
90
|
+
},
|
91
|
+
inject: ['formConfig'],
|
92
|
+
computed: {
|
93
|
+
selected() {
|
94
|
+
return !!this.designer && this.field.id === this.designer.selectedId
|
95
|
+
},
|
96
|
+
|
97
|
+
label() {
|
98
|
+
if (!!this.field.options.labelHidden) {
|
99
|
+
return ''
|
100
|
+
}
|
101
|
+
|
102
|
+
return this.field.options.label
|
103
|
+
},
|
104
|
+
|
105
|
+
labelWidth() {
|
106
|
+
if (!!this.field.options.labelHidden) {
|
107
|
+
return 0
|
108
|
+
}
|
109
|
+
|
110
|
+
if (!!this.field.options.labelWidth) {
|
111
|
+
return this.field.options.labelWidth
|
112
|
+
}
|
113
|
+
|
114
|
+
if (!!this.designer) {
|
115
|
+
return this.designer.formConfig.labelWidth
|
116
|
+
} else {
|
117
|
+
return this.formConfig.labelWidth
|
118
|
+
}
|
119
|
+
},
|
120
|
+
|
121
|
+
labelAlign() {
|
122
|
+
if (!!this.field.options.labelAlign) {
|
123
|
+
return this.field.options.labelAlign
|
124
|
+
}
|
125
|
+
|
126
|
+
if (!!this.designer) {
|
127
|
+
return this.designer.formConfig.labelAlign || 'label-left-align'
|
128
|
+
} else {
|
129
|
+
return this.formConfig.labelAlign || 'label-left-align'
|
130
|
+
}
|
131
|
+
},
|
132
|
+
|
133
|
+
customClass() {
|
134
|
+
return !!this.field.options.customClass ? this.field.options.customClass.join(' ') : ''
|
135
|
+
},
|
136
|
+
|
137
|
+
subFormName() {
|
138
|
+
return !!this.parentWidget ? this.parentWidget.options.name : ''
|
139
|
+
},
|
140
|
+
|
141
|
+
subFormItemFlag() {
|
142
|
+
return !!this.parentWidget ? this.parentWidget.type === 'sub-form' : false
|
143
|
+
},
|
144
|
+
|
145
|
+
},
|
146
|
+
created() {
|
147
|
+
//
|
148
|
+
},
|
149
|
+
methods: {
|
150
|
+
|
151
|
+
selectField(field) {
|
152
|
+
if (!!this.designer) {
|
153
|
+
this.designer.setSelected(field)
|
154
|
+
this.designer.emitEvent('field-selected', this.parentWidget) //发送选中组件的父组件对象
|
155
|
+
}
|
156
|
+
},
|
157
|
+
|
158
|
+
selectParentWidget() {
|
159
|
+
if (this.parentWidget) {
|
160
|
+
this.designer.setSelected(this.parentWidget)
|
161
|
+
} else {
|
162
|
+
this.designer.clearSelected()
|
163
|
+
}
|
164
|
+
},
|
165
|
+
|
166
|
+
moveUpWidget() {
|
167
|
+
this.designer.moveUpWidget(this.parentList, this.indexOfParentList)
|
168
|
+
this.designer.emitHistoryChange()
|
169
|
+
},
|
170
|
+
|
171
|
+
moveDownWidget() {
|
172
|
+
this.designer.moveDownWidget(this.parentList, this.indexOfParentList)
|
173
|
+
this.designer.emitHistoryChange()
|
174
|
+
},
|
175
|
+
|
176
|
+
removeFieldWidget() {
|
177
|
+
if (!!this.parentList) {
|
178
|
+
let nextSelected = null
|
179
|
+
if (this.parentList.length === 1) {
|
180
|
+
if (!!this.parentWidget) {
|
181
|
+
nextSelected = this.parentWidget
|
182
|
+
}
|
183
|
+
} else if (this.parentList.length === (1 + this.indexOfParentList)) {
|
184
|
+
nextSelected = this.parentList[this.indexOfParentList - 1]
|
185
|
+
} else {
|
186
|
+
nextSelected = this.parentList[this.indexOfParentList + 1]
|
187
|
+
}
|
188
|
+
|
189
|
+
this.$nextTick(() => {
|
190
|
+
this.parentList.splice(this.indexOfParentList, 1)
|
191
|
+
//if (!!nextSelected) {
|
192
|
+
this.designer.setSelected(nextSelected)
|
193
|
+
//}
|
194
|
+
|
195
|
+
this.designer.emitHistoryChange()
|
196
|
+
})
|
197
|
+
}
|
198
|
+
},
|
199
|
+
|
200
|
+
getPropName() {
|
201
|
+
if (this.subFormItemFlag && !this.designState) {
|
202
|
+
return this.subFormName + "." + this.subFormRowIndex + "." + this.field.options.name + ""
|
203
|
+
} else {
|
204
|
+
return this.field.options.name
|
205
|
+
}
|
206
|
+
},
|
207
|
+
|
208
|
+
|
209
|
+
}
|
210
|
+
}
|
211
|
+
</script>
|
212
|
+
|
213
|
+
<style lang="scss" scoped>
|
214
|
+
@import "../../../../styles/global.scss";
|
215
|
+
|
216
|
+
.design-time-bottom-margin {
|
217
|
+
margin-bottom: 5px;
|
218
|
+
}
|
219
|
+
|
220
|
+
.field-wrapper {
|
221
|
+
position: relative;
|
222
|
+
|
223
|
+
.field-action{
|
224
|
+
position: absolute;
|
225
|
+
//bottom: -24px;
|
226
|
+
bottom: 0;
|
227
|
+
right: -2px;
|
228
|
+
height: 22px;
|
229
|
+
line-height: 22px;
|
230
|
+
background: $--color-primary;
|
231
|
+
z-index: 9;
|
232
|
+
|
233
|
+
i {
|
234
|
+
font-size: 14px;
|
235
|
+
color: #fff;
|
236
|
+
margin: 0 5px;
|
237
|
+
cursor: pointer;
|
238
|
+
}
|
239
|
+
}
|
240
|
+
|
241
|
+
.drag-handler {
|
242
|
+
position: absolute;
|
243
|
+
top: 0;
|
244
|
+
//bottom: -22px; /* 拖拽手柄位于组件下方,有时无法正常拖动,原因未明?? */
|
245
|
+
left: -1px;
|
246
|
+
height: 20px;
|
247
|
+
line-height: 20px;
|
248
|
+
//background: $--color-primary;
|
249
|
+
z-index: 9;
|
250
|
+
|
251
|
+
i {
|
252
|
+
font-size: 12px;
|
253
|
+
font-style: normal;
|
254
|
+
color: #fff;
|
255
|
+
margin: 4px;
|
256
|
+
cursor: move;
|
257
|
+
}
|
258
|
+
|
259
|
+
&:hover {
|
260
|
+
//opacity: 1;
|
261
|
+
background: $--color-primary;
|
262
|
+
}
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
.el-form-item {
|
267
|
+
//margin-bottom: 0 !important;
|
268
|
+
//margin-bottom: 6px;
|
269
|
+
|
270
|
+
//margin-top: 2px;
|
271
|
+
position: relative;
|
272
|
+
|
273
|
+
::v-deep .el-form-item__label {
|
274
|
+
white-space: nowrap;
|
275
|
+
text-overflow: ellipsis;
|
276
|
+
}
|
277
|
+
|
278
|
+
::v-deep .el-form-item__content {
|
279
|
+
//position: unset; /* TODO: 忘了这个样式设置是为了解决什么问题?? */
|
280
|
+
}
|
281
|
+
|
282
|
+
span.custom-label i {
|
283
|
+
margin: 0 3px;
|
284
|
+
}
|
285
|
+
|
286
|
+
/* 隐藏Chrome浏览器中el-input数字输入框右侧的上下调整小箭头 */
|
287
|
+
::v-deep .hide-spin-button input::-webkit-outer-spin-button,
|
288
|
+
::v-deep .hide-spin-button input::-webkit-inner-spin-button {
|
289
|
+
-webkit-appearance: none !important;
|
290
|
+
}
|
291
|
+
|
292
|
+
/* 隐藏Firefox浏览器中el-input数字输入框右侧的上下调整小箭头 */
|
293
|
+
::v-deep .hide-spin-button input[type="number"] {
|
294
|
+
-moz-appearance: textfield;
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
.required ::v-deep .el-form-item__label::before {
|
299
|
+
content: '*';
|
300
|
+
color: #F56C6C;
|
301
|
+
margin-right: 4px;
|
302
|
+
}
|
303
|
+
|
304
|
+
.static-content-item {
|
305
|
+
min-height: 20px;
|
306
|
+
display: flex; /* 垂直居中 */
|
307
|
+
align-items: center; /* 垂直居中 */
|
308
|
+
|
309
|
+
::v-deep .el-divider--horizontal {
|
310
|
+
margin: 0;
|
311
|
+
}
|
312
|
+
}
|
313
|
+
|
314
|
+
.el-form-item.selected, .static-content-item.selected {
|
315
|
+
outline: 2px solid $--color-primary;
|
316
|
+
}
|
317
|
+
|
318
|
+
::v-deep .label-left-align .el-form-item__label {
|
319
|
+
text-align: left;
|
320
|
+
}
|
321
|
+
|
322
|
+
::v-deep .label-center-align .el-form-item__label {
|
323
|
+
text-align: center;
|
324
|
+
}
|
325
|
+
|
326
|
+
::v-deep .label-right-align .el-form-item__label {
|
327
|
+
text-align: right;
|
328
|
+
}
|
329
|
+
|
330
|
+
|
331
|
+
</style>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
<template>
|
2
|
+
<static-content-wrapper :designer="designer" :field="field" :design-state="designState"
|
3
|
+
:parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
|
4
|
+
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
|
5
|
+
<div ref="fieldEditor" v-html="field.options.htmlContent"></div>
|
6
|
+
</static-content-wrapper>
|
7
|
+
</template>
|
8
|
+
|
9
|
+
<script>
|
10
|
+
import StaticContentWrapper from './static-content-wrapper'
|
11
|
+
import emitter from 'element-ui/lib/mixins/emitter'
|
12
|
+
import i18n, {translate} from "@/utils/i18n";
|
13
|
+
import fieldMixin from "@/components/form-designer/form-widget/field-widget/fieldMixin";
|
14
|
+
|
15
|
+
export default {
|
16
|
+
name: "html-text-widget",
|
17
|
+
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
18
|
+
mixins: [emitter, fieldMixin, i18n],
|
19
|
+
props: {
|
20
|
+
field: Object,
|
21
|
+
parentWidget: Object,
|
22
|
+
parentList: Array,
|
23
|
+
indexOfParentList: Number,
|
24
|
+
designer: Object,
|
25
|
+
|
26
|
+
designState: {
|
27
|
+
type: Boolean,
|
28
|
+
default: false
|
29
|
+
},
|
30
|
+
|
31
|
+
subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
|
32
|
+
type: Number,
|
33
|
+
default: -1
|
34
|
+
},
|
35
|
+
subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
|
36
|
+
type: Number,
|
37
|
+
default: -1
|
38
|
+
},
|
39
|
+
subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
|
40
|
+
type: String,
|
41
|
+
default: ''
|
42
|
+
},
|
43
|
+
|
44
|
+
},
|
45
|
+
components: {
|
46
|
+
StaticContentWrapper,
|
47
|
+
},
|
48
|
+
computed: {
|
49
|
+
|
50
|
+
},
|
51
|
+
beforeCreate() {
|
52
|
+
/* 这里不能访问方法和属性!! */
|
53
|
+
},
|
54
|
+
|
55
|
+
created() {
|
56
|
+
/* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
|
57
|
+
需要在父组件created中初始化!! */
|
58
|
+
this.registerToRefList()
|
59
|
+
this.initEventHandler()
|
60
|
+
|
61
|
+
this.handleOnCreated()
|
62
|
+
},
|
63
|
+
|
64
|
+
mounted() {
|
65
|
+
this.handleOnMounted()
|
66
|
+
},
|
67
|
+
|
68
|
+
beforeDestroy() {
|
69
|
+
this.unregisterFromRefList()
|
70
|
+
},
|
71
|
+
|
72
|
+
methods: {
|
73
|
+
|
74
|
+
}
|
75
|
+
|
76
|
+
}
|
77
|
+
</script>
|
78
|
+
|
79
|
+
<style lang="scss" scoped>
|
80
|
+
@import "../../../../styles/global.scss"; //* static-content-wrapper已引入,还需要重复引入吗? *//
|
81
|
+
|
82
|
+
</style>
|