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,22 @@
|
|
1
|
+
export default {
|
2
|
+
methods: {
|
3
|
+
initRefList() {
|
4
|
+
if ((this.refList !== null) && !!this.widget.options.name) {
|
5
|
+
this.refList[this.widget.options.name] = this
|
6
|
+
}
|
7
|
+
},
|
8
|
+
|
9
|
+
getWidgetRef(widgetName, showError) {
|
10
|
+
let foundRef = this.refList[widgetName]
|
11
|
+
if (!foundRef && !!showError) {
|
12
|
+
this.$message.error(this.i18nt('render.hint.refNotFound') + widgetName)
|
13
|
+
}
|
14
|
+
return foundRef
|
15
|
+
},
|
16
|
+
|
17
|
+
getFormRef() { /* 获取VFrom引用,必须在VForm组件created之后方可调用 */
|
18
|
+
return this.refList['v_form_ref']
|
19
|
+
},
|
20
|
+
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<template>
|
2
|
+
<svg :class="svgClass" aria-hidden="true">
|
3
|
+
<use :xlink:href="iconName"></use>
|
4
|
+
<title v-if="!!title">{{title}}</title>
|
5
|
+
</svg>
|
6
|
+
</template>
|
7
|
+
|
8
|
+
<script>
|
9
|
+
export default {
|
10
|
+
name: 'SvgIcon',
|
11
|
+
props: {
|
12
|
+
iconClass: {
|
13
|
+
type: String,
|
14
|
+
required: true
|
15
|
+
},
|
16
|
+
className: {
|
17
|
+
type: String
|
18
|
+
},
|
19
|
+
title: {
|
20
|
+
type: String,
|
21
|
+
default: ''
|
22
|
+
}
|
23
|
+
},
|
24
|
+
computed: {
|
25
|
+
iconName() {
|
26
|
+
return `#icon-${this.iconClass}`
|
27
|
+
},
|
28
|
+
svgClass() {
|
29
|
+
if (this.className) {
|
30
|
+
return 'svg-icon ' + this.className
|
31
|
+
} else {
|
32
|
+
return 'svg-icon'
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
</script>
|
38
|
+
|
39
|
+
<style lang="scss" scoped>
|
40
|
+
.svg-icon {
|
41
|
+
width: 1.1em;
|
42
|
+
height: 1.1em;
|
43
|
+
margin-left: 0.35em;
|
44
|
+
margin-right: 0.35em;
|
45
|
+
vertical-align: -0.15em;
|
46
|
+
fill: currentColor;
|
47
|
+
overflow: hidden;
|
48
|
+
}
|
49
|
+
</style>
|
@@ -0,0 +1,106 @@
|
|
1
|
+
<template>
|
2
|
+
<el-container id="commonTable">
|
3
|
+
<el-main>
|
4
|
+
<el-table :data="data" :height="height" :max-height="maxHeight" border stripe tooltip-effect="light"
|
5
|
+
@selection-change="handleSelectionChange" :size="tableSize" :style="{width: tableWidth}">
|
6
|
+
<el-table-column v-if="showCheckBox" type="selection" width="45"></el-table-column>
|
7
|
+
<template v-for="(item, index) in columns">
|
8
|
+
<el-table-column
|
9
|
+
v-if="item.show !== false"
|
10
|
+
:key="index"
|
11
|
+
:fixed="item.fixed"
|
12
|
+
:prop="item.prop"
|
13
|
+
:label="item.label"
|
14
|
+
:align="item.align ? item.align:'center'"
|
15
|
+
:width="item.width"
|
16
|
+
:show-overflow-tooltip="true"
|
17
|
+
:formatter="item.formatter ? item.formatter : formatterValue">
|
18
|
+
</el-table-column>
|
19
|
+
</template>
|
20
|
+
<slot name="table_operation"/>
|
21
|
+
</el-table>
|
22
|
+
</el-main>
|
23
|
+
|
24
|
+
<el-footer id="simpleTableFooter" v-if="showPager" style="height: 42px;padding-top: 6px; background: white">
|
25
|
+
<el-pagination
|
26
|
+
@size-change="handleSizeChange"
|
27
|
+
@current-change="handleCurrentChange"
|
28
|
+
style="text-align: right;margin:0;"
|
29
|
+
:current-page="pagination.pageNo"
|
30
|
+
:page-size="pagination.limit"
|
31
|
+
:page-sizes="pagination.sizes"
|
32
|
+
:total="pagination.total"
|
33
|
+
layout="total, sizes, prev, pager, next, jumper">
|
34
|
+
</el-pagination>
|
35
|
+
</el-footer>
|
36
|
+
</el-container>
|
37
|
+
</template>
|
38
|
+
|
39
|
+
<script>
|
40
|
+
export default {
|
41
|
+
name: 'VTable',
|
42
|
+
props: {
|
43
|
+
tableWidth: [String, Number],
|
44
|
+
columns: Array,
|
45
|
+
data: Array,
|
46
|
+
showPager: {
|
47
|
+
type: Boolean,
|
48
|
+
default: true
|
49
|
+
},
|
50
|
+
showCheckBox: {
|
51
|
+
type: Boolean,
|
52
|
+
default: false
|
53
|
+
},
|
54
|
+
pagination: Object,
|
55
|
+
height: {
|
56
|
+
type: String,
|
57
|
+
default: "100%"
|
58
|
+
},
|
59
|
+
maxHeight: {
|
60
|
+
type: Number,
|
61
|
+
default: 2000
|
62
|
+
},
|
63
|
+
tableSize: {
|
64
|
+
type: String,
|
65
|
+
default: 'medium'
|
66
|
+
},
|
67
|
+
},
|
68
|
+
methods: {
|
69
|
+
handleSelectionChange(val) {
|
70
|
+
this.$emit('handleSelectionChange', val);
|
71
|
+
},
|
72
|
+
handleSizeChange(val) {
|
73
|
+
this.$emit('handleSizeChange', val);
|
74
|
+
},
|
75
|
+
handleCurrentChange(val) {
|
76
|
+
this.$emit('handleCurrentChange', val);
|
77
|
+
},
|
78
|
+
formatterValue(row, column, cellValue) {
|
79
|
+
return cellValue;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
</script>
|
84
|
+
|
85
|
+
<style lang="scss" scoped>
|
86
|
+
|
87
|
+
.el-table {
|
88
|
+
// 解决table组件内容滚动时页面滚动条同步滚动
|
89
|
+
overflow: auto;
|
90
|
+
// 必须设置
|
91
|
+
position: relative;
|
92
|
+
|
93
|
+
::v-deep .el-table__fixed-header-wrapper thead th > .cell {
|
94
|
+
white-space: nowrap !important; /* 禁止表头换行 */
|
95
|
+
}
|
96
|
+
|
97
|
+
::v-deep .el-table__header-wrapper thead th > .cell {
|
98
|
+
white-space: nowrap !important; /* 禁止表头换行 */
|
99
|
+
}
|
100
|
+
|
101
|
+
::v-deep .el-table__body-wrapper {
|
102
|
+
//height: 100% !important;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
</style>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import {
|
2
|
+
addContainerWidgetSchema,
|
3
|
+
addBasicFieldSchema,
|
4
|
+
addAdvancedFieldSchema,
|
5
|
+
addCustomWidgetSchema
|
6
|
+
} from '@/components/form-designer/widget-panel/widgetsConfig'
|
7
|
+
import {
|
8
|
+
registerCommonProperty,
|
9
|
+
registerAdvancedProperty,
|
10
|
+
registerEventProperty
|
11
|
+
} from '@/components/form-designer/setting-panel/propertyRegister'
|
12
|
+
|
13
|
+
|
14
|
+
export default {
|
15
|
+
addContainerWidgetSchema,
|
16
|
+
addBasicFieldSchema,
|
17
|
+
addAdvancedFieldSchema,
|
18
|
+
addCustomWidgetSchema,
|
19
|
+
|
20
|
+
registerCommonProperty,
|
21
|
+
registerAdvancedProperty,
|
22
|
+
registerEventProperty,
|
23
|
+
}
|
@@ -0,0 +1,112 @@
|
|
1
|
+
import Vue from 'vue'
|
2
|
+
|
3
|
+
import {
|
4
|
+
addContainerWidgetSchema,
|
5
|
+
addCustomWidgetSchema
|
6
|
+
} from '@/components/form-designer/widget-panel/widgetsConfig'
|
7
|
+
import * as PERegister from '@/components/form-designer/setting-panel/propertyRegister'
|
8
|
+
import * as PEFactory from '@/components/form-designer/setting-panel/property-editor-factory'
|
9
|
+
|
10
|
+
import {cardSchema} from "@/extension/samples/extension-schema"
|
11
|
+
import CardWidget from '@/extension/samples/card/card-widget'
|
12
|
+
import CardItem from '@/extension/samples/card/card-item'
|
13
|
+
import {registerCWGenerator} from '@/utils/sfc-generator'
|
14
|
+
import {cardTemplateGenerator} from '@/extension/samples/extension-sfc-generator'
|
15
|
+
|
16
|
+
import {alertSchema} from "@/extension/samples/extension-schema"
|
17
|
+
import AlertWidget from '@/extension/samples/alert/alert-widget'
|
18
|
+
import {registerFWGenerator} from '@/utils/sfc-generator'
|
19
|
+
import {alertTemplateGenerator} from '@/extension/samples/extension-sfc-generator'
|
20
|
+
|
21
|
+
export const loadExtension = function () {
|
22
|
+
|
23
|
+
/**
|
24
|
+
* 加载容器组件步骤:
|
25
|
+
* 1. 加载组件Json Schema;
|
26
|
+
* 2. 全局注册容器组件,容器组件有两种状态——设计期和运行期,故需要注册两个组件;
|
27
|
+
* 3. 全局注册属性编辑器组件(基本属性、高级属性、事件属性);
|
28
|
+
* 4. 注册容器组件的代码生成器;
|
29
|
+
* 5. 加载完毕。
|
30
|
+
*/
|
31
|
+
addContainerWidgetSchema(cardSchema) //加载组件Json Schema
|
32
|
+
/* -------------------------------------------------- */
|
33
|
+
Vue.component(CardWidget.name, CardWidget) //注册设计期的容器组件
|
34
|
+
Vue.component(CardItem.name, CardItem) //注册运行期的容器组件
|
35
|
+
/* -------------------------------------------------- */
|
36
|
+
PERegister.registerCPEditor('card-folded', 'card-folded-editor',
|
37
|
+
PEFactory.createBooleanEditor('folded', 'extension.setting.cardFolded'))
|
38
|
+
|
39
|
+
PERegister.registerCPEditor('card-showFold', 'card-showFold-editor',
|
40
|
+
PEFactory.createBooleanEditor('showFold', 'extension.setting.cardShowFold'))
|
41
|
+
|
42
|
+
PERegister.registerCPEditor('card-cardWidth', 'card-cardWidth-editor',
|
43
|
+
PEFactory.createInputTextEditor('cardWidth', 'extension.setting.cardWidth'))
|
44
|
+
|
45
|
+
let shadowOptions = [
|
46
|
+
{label: 'never', value: 'never'},
|
47
|
+
{label: 'hover', value: 'hover'},
|
48
|
+
{label: 'always', value: 'always'},
|
49
|
+
]
|
50
|
+
PERegister.registerCPEditor('card-shadow', 'card-shadow-editor',
|
51
|
+
PEFactory.createSelectEditor('shadow', 'extension.setting.cardShadow',
|
52
|
+
{optionItems: shadowOptions}))
|
53
|
+
/* -------------------------------------------------- */
|
54
|
+
registerCWGenerator('card', cardTemplateGenerator) //注册容器组件的代码生成器
|
55
|
+
/* -------------------------------------------------- */
|
56
|
+
/* 容器组件加载完毕 end */
|
57
|
+
|
58
|
+
/**
|
59
|
+
* 加载字段组件步骤:
|
60
|
+
* 1. 加载组件Json Schema;
|
61
|
+
* 2. 全局注册字段组件,字段组件设计期和运行期共用,故需要仅需注册一个组件;
|
62
|
+
* 3. 全局注册属性编辑器组件(基本属性、高级属性、事件属性);
|
63
|
+
* 4. 注册字段组件的代码生成器;
|
64
|
+
* 5. 加载完毕。
|
65
|
+
*/
|
66
|
+
addCustomWidgetSchema(alertSchema) //加载组件Json Schema
|
67
|
+
/* -------------------------------------------------- */
|
68
|
+
Vue.component(AlertWidget.name, AlertWidget) //注册组件
|
69
|
+
/* -------------------------------------------------- */
|
70
|
+
PERegister.registerCPEditor('alert-title', 'alert-title-editor',
|
71
|
+
PEFactory.createInputTextEditor('title', 'extension.setting.alertTitle'))
|
72
|
+
|
73
|
+
let typeOptions = [
|
74
|
+
{label: 'success', value: 'success'},
|
75
|
+
{label: 'warning', value: 'warning'},
|
76
|
+
{label: 'info', value: 'info'},
|
77
|
+
{label: 'error', value: 'error'},
|
78
|
+
]
|
79
|
+
PERegister.registerCPEditor('alert-type', 'alert-type-editor',
|
80
|
+
PEFactory.createSelectEditor('type', 'extension.setting.alertType',
|
81
|
+
{optionItems: typeOptions}))
|
82
|
+
|
83
|
+
PERegister.registerCPEditor('alert-description', 'alert-description-editor',
|
84
|
+
PEFactory.createInputTextEditor('description', 'extension.setting.description'))
|
85
|
+
|
86
|
+
PERegister.registerCPEditor('alert-closable', 'alert-closable-editor',
|
87
|
+
PEFactory.createBooleanEditor('closable', 'extension.setting.closable'))
|
88
|
+
|
89
|
+
PERegister.registerCPEditor('alert-closeText', 'alert-closeText-editor',
|
90
|
+
PEFactory.createInputTextEditor('closeText', 'extension.setting.closeText'))
|
91
|
+
|
92
|
+
PERegister.registerCPEditor('alert-center', 'alert-center-editor',
|
93
|
+
PEFactory.createBooleanEditor('center', 'extension.setting.center'))
|
94
|
+
|
95
|
+
PERegister.registerCPEditor('alert-showIcon', 'alert-showIcon-editor',
|
96
|
+
PEFactory.createBooleanEditor('showIcon', 'extension.setting.showIcon'))
|
97
|
+
|
98
|
+
let effectOptions = [
|
99
|
+
{label: 'light', value: 'light'},
|
100
|
+
{label: 'dark', value: 'dark'},
|
101
|
+
]
|
102
|
+
PERegister.registerCPEditor('alert-effect', 'alert-effect-editor',
|
103
|
+
PEFactory.createRadioButtonGroupEditor('effect', 'extension.setting.effect',
|
104
|
+
{optionItems: effectOptions}))
|
105
|
+
|
106
|
+
PERegister.registerEPEditor('alert-onClose', 'alert-onClose-editor',
|
107
|
+
PEFactory.createEventHandlerEditor('onClose', []))
|
108
|
+
/* -------------------------------------------------- */
|
109
|
+
registerFWGenerator('alert', alertTemplateGenerator) //注册字段组件的代码生成器
|
110
|
+
/* -------------------------------------------------- */
|
111
|
+
/* 字段组件加载完毕 end */
|
112
|
+
}
|
@@ -0,0 +1,72 @@
|
|
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
|
+
<el-alert ref="fieldEditor" :title="field.options.title" :type="field.options.type"
|
6
|
+
:description="field.options.description" :closable="field.options.closable"
|
7
|
+
:center="field.options.center" :close-text="field.options.closeText"
|
8
|
+
:show-icon="field.options.showIcon" :effect="field.options.effect" @close="handelCloseCustomEvent"></el-alert>
|
9
|
+
</static-content-wrapper>
|
10
|
+
</template>
|
11
|
+
|
12
|
+
<script>
|
13
|
+
import StaticContentWrapper from '@/components/form-designer/form-widget/field-widget/static-content-wrapper'
|
14
|
+
import emitter from 'element-ui/lib/mixins/emitter'
|
15
|
+
import i18n from "@/utils/i18n"
|
16
|
+
import fieldMixin from "@/components/form-designer/form-widget/field-widget/fieldMixin"
|
17
|
+
|
18
|
+
export default {
|
19
|
+
name: "alert-widget",
|
20
|
+
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
21
|
+
mixins: [emitter, fieldMixin, i18n],
|
22
|
+
props: {
|
23
|
+
field: Object,
|
24
|
+
parentWidget: Object,
|
25
|
+
parentList: Array,
|
26
|
+
indexOfParentList: Number,
|
27
|
+
designer: Object,
|
28
|
+
|
29
|
+
designState: {
|
30
|
+
type: Boolean,
|
31
|
+
default: false
|
32
|
+
},
|
33
|
+
|
34
|
+
subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
|
35
|
+
type: Number,
|
36
|
+
default: -1
|
37
|
+
},
|
38
|
+
subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
|
39
|
+
type: Number,
|
40
|
+
default: -1
|
41
|
+
},
|
42
|
+
subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
|
43
|
+
type: String,
|
44
|
+
default: ''
|
45
|
+
},
|
46
|
+
|
47
|
+
},
|
48
|
+
components: {
|
49
|
+
StaticContentWrapper,
|
50
|
+
},
|
51
|
+
created() {
|
52
|
+
this.registerToRefList()
|
53
|
+
this.initEventHandler()
|
54
|
+
},
|
55
|
+
beforeDestroy() {
|
56
|
+
this.unregisterFromRefList()
|
57
|
+
},
|
58
|
+
methods: {
|
59
|
+
handelCloseCustomEvent() {
|
60
|
+
if (!!this.field.options.onClose) {
|
61
|
+
let changeFn = new Function(this.field.options.onClose)
|
62
|
+
changeFn.call(this)
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
}
|
67
|
+
}
|
68
|
+
</script>
|
69
|
+
|
70
|
+
<style lang="scss" scoped>
|
71
|
+
|
72
|
+
</style>
|
@@ -0,0 +1,90 @@
|
|
1
|
+
<template>
|
2
|
+
<container-item-wrapper :widget="widget">
|
3
|
+
<el-card :key="widget.id" class="card-container" :class="[!!widget.options.folded ? 'folded' : '', customClass]"
|
4
|
+
:shadow="widget.options.shadow" :style="{width: widget.options.cardWidth + '!important' || ''}"
|
5
|
+
:ref="widget.id" v-show="!widget.options.hidden">
|
6
|
+
<div slot="header" class="clear-fix">
|
7
|
+
<span>{{widget.options.label}}</span>
|
8
|
+
<i v-if="widget.options.showFold" class="float-right"
|
9
|
+
:class="[!widget.options.folded ? 'el-icon-arrow-down' : 'el-icon-arrow-up']" @click="toggleCard"></i>
|
10
|
+
</div>
|
11
|
+
<template v-if="!!widget.widgetList && (widget.widgetList.length > 0)">
|
12
|
+
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
13
|
+
<template v-if="'container' === subWidget.category">
|
14
|
+
<component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
|
15
|
+
:index-of-parent-list="swIdx" :parent-widget="widget"></component>
|
16
|
+
</template>
|
17
|
+
<template v-else>
|
18
|
+
<component :is="subWidget.type + '-widget'" :field="subWidget" :designer="null" :key="swIdx" :parent-list="widget.widgetList"
|
19
|
+
:index-of-parent-list="swIdx" :parent-widget="widget"></component>
|
20
|
+
</template>
|
21
|
+
</template>
|
22
|
+
</template>
|
23
|
+
</el-card>
|
24
|
+
</container-item-wrapper>
|
25
|
+
</template>
|
26
|
+
|
27
|
+
<script>
|
28
|
+
import emitter from 'element-ui/lib/mixins/emitter'
|
29
|
+
import i18n from "@/utils/i18n"
|
30
|
+
import refMixin from "@/components/form-render/refMixin"
|
31
|
+
import ContainerItemWrapper from '@/components/form-render/container-item/container-item-wrapper'
|
32
|
+
import containerItemMixin from "@/components/form-render/container-item/containerItemMixin"
|
33
|
+
import FieldComponents from '@/components/form-designer/form-widget/field-widget/index'
|
34
|
+
|
35
|
+
export default {
|
36
|
+
name: "card-item",
|
37
|
+
componentName: 'ContainerItem',
|
38
|
+
mixins: [emitter, i18n, refMixin, containerItemMixin],
|
39
|
+
components: {
|
40
|
+
ContainerItemWrapper,
|
41
|
+
...FieldComponents,
|
42
|
+
},
|
43
|
+
props: {
|
44
|
+
widget: Object,
|
45
|
+
},
|
46
|
+
inject: ['refList', 'sfRefList', 'globalModel'],
|
47
|
+
computed: {
|
48
|
+
customClass() {
|
49
|
+
return this.widget.options.customClass || ''
|
50
|
+
},
|
51
|
+
|
52
|
+
},
|
53
|
+
created() {
|
54
|
+
this.initRefList()
|
55
|
+
},
|
56
|
+
beforeDestroy() {
|
57
|
+
this.unregisterFromRefList()
|
58
|
+
},
|
59
|
+
methods: {
|
60
|
+
toggleCard() {
|
61
|
+
this.widget.options.folded = !this.widget.options.folded
|
62
|
+
},
|
63
|
+
|
64
|
+
},
|
65
|
+
}
|
66
|
+
</script>
|
67
|
+
|
68
|
+
<style lang="scss" scoped>
|
69
|
+
::v-deep .el-card__header {
|
70
|
+
padding: 10px 12px;
|
71
|
+
}
|
72
|
+
|
73
|
+
.folded ::v-deep .el-card__body {
|
74
|
+
display: none;
|
75
|
+
}
|
76
|
+
|
77
|
+
.clear-fix:before, .clear-fix:after {
|
78
|
+
display: table;
|
79
|
+
content: "";
|
80
|
+
}
|
81
|
+
|
82
|
+
.clear-fix:after {
|
83
|
+
clear: both;
|
84
|
+
}
|
85
|
+
|
86
|
+
.float-right {
|
87
|
+
float: right;
|
88
|
+
}
|
89
|
+
|
90
|
+
</style>
|
@@ -0,0 +1,119 @@
|
|
1
|
+
<template>
|
2
|
+
<container-wrapper :designer="designer" :widget="widget" :parent-widget="parentWidget" :parent-list="parentList"
|
3
|
+
:index-of-parent-list="indexOfParentList">
|
4
|
+
<el-card :key="widget.id" class="card-container" @click.native.stop="selectWidget(widget)"
|
5
|
+
:shadow="widget.options.shadow" :style="{width: widget.options.cardWidth + '!important' || ''}"
|
6
|
+
:class="[selected ? 'selected' : '', !!widget.options.folded ? 'folded' : '', customClass]">
|
7
|
+
<div slot="header" class="clear-fix">
|
8
|
+
<span>{{widget.options.label}}</span>
|
9
|
+
<i v-if="widget.options.showFold" class="float-right"
|
10
|
+
:class="[!widget.options.folded ? 'el-icon-arrow-down' : 'el-icon-arrow-up']"
|
11
|
+
@click="toggleCard"></i>
|
12
|
+
</div>
|
13
|
+
<draggable :list="widget.widgetList" v-bind="{group:'dragGroup', ghostClass: 'ghost',animation: 200}"
|
14
|
+
handle=".drag-handler"
|
15
|
+
@add="(evt) => onContainerDragAdd(evt, widget.widgetList)"
|
16
|
+
@update="onContainerDragUpdate" :move="checkContainerMove">
|
17
|
+
<transition-group name="fade" tag="div" class="form-widget-list">
|
18
|
+
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
19
|
+
<template v-if="'container' === subWidget.category">
|
20
|
+
<component :is="subWidget.type + '-widget'" :widget="subWidget" :designer="designer" :key="subWidget.id" :parent-list="widget.widgetList"
|
21
|
+
:index-of-parent-list="swIdx" :parent-widget="widget"></component>
|
22
|
+
</template>
|
23
|
+
<template v-else>
|
24
|
+
<component :is="subWidget.type + '-widget'" :field="subWidget" :designer="designer" :key="subWidget.id" :parent-list="widget.widgetList"
|
25
|
+
:index-of-parent-list="swIdx" :parent-widget="widget" :design-state="true"></component>
|
26
|
+
</template>
|
27
|
+
</template>
|
28
|
+
</transition-group>
|
29
|
+
</draggable>
|
30
|
+
</el-card>
|
31
|
+
</container-wrapper>
|
32
|
+
</template>
|
33
|
+
|
34
|
+
<script>
|
35
|
+
import i18n from "@/utils/i18n"
|
36
|
+
import containerMixin from "@/components/form-designer/form-widget/container-widget/containerMixin"
|
37
|
+
import Draggable from 'vuedraggable'
|
38
|
+
import ContainerWrapper from "@/components/form-designer/form-widget/container-widget/container-wrapper"
|
39
|
+
import FieldComponents from '@/components/form-designer/form-widget/field-widget/index'
|
40
|
+
|
41
|
+
export default {
|
42
|
+
name: "card-widget",
|
43
|
+
componentName: 'ContainerWidget',
|
44
|
+
mixins: [i18n, containerMixin],
|
45
|
+
components: {
|
46
|
+
Draggable,
|
47
|
+
ContainerWrapper,
|
48
|
+
...FieldComponents,
|
49
|
+
},
|
50
|
+
props: {
|
51
|
+
widget: Object,
|
52
|
+
parentWidget: Object,
|
53
|
+
parentList: Array,
|
54
|
+
indexOfParentList: Number,
|
55
|
+
designer: Object,
|
56
|
+
},
|
57
|
+
computed: {
|
58
|
+
selected() {
|
59
|
+
return this.widget.id === this.designer.selectedId
|
60
|
+
},
|
61
|
+
|
62
|
+
customClass() {
|
63
|
+
return this.widget.options.customClass || ''
|
64
|
+
},
|
65
|
+
|
66
|
+
},
|
67
|
+
methods: {
|
68
|
+
/**
|
69
|
+
* 检查接收哪些组件拖放,如不接受某些组件拖放,则根据组件类型判断后返回false
|
70
|
+
* @param evt
|
71
|
+
* @returns {boolean}
|
72
|
+
*/
|
73
|
+
checkContainerMove(evt) {
|
74
|
+
return true
|
75
|
+
},
|
76
|
+
|
77
|
+
toggleCard() {
|
78
|
+
this.widget.options.folded = !this.widget.options.folded
|
79
|
+
},
|
80
|
+
|
81
|
+
/**
|
82
|
+
* 设置折叠/打开状态
|
83
|
+
* @param folded
|
84
|
+
*/
|
85
|
+
setFolded(folded) {
|
86
|
+
this.widget.options.folded = !!folded
|
87
|
+
}
|
88
|
+
|
89
|
+
}
|
90
|
+
}
|
91
|
+
</script>
|
92
|
+
|
93
|
+
<style lang="scss" scoped>
|
94
|
+
.card-container.selected {
|
95
|
+
outline: 2px solid $--color-primary !important;
|
96
|
+
}
|
97
|
+
|
98
|
+
::v-deep .el-card__header {
|
99
|
+
padding: 10px 12px;
|
100
|
+
}
|
101
|
+
|
102
|
+
.folded ::v-deep .el-card__body {
|
103
|
+
display: none;
|
104
|
+
}
|
105
|
+
|
106
|
+
.clear-fix:before, .clear-fix:after {
|
107
|
+
display: table;
|
108
|
+
content: "";
|
109
|
+
}
|
110
|
+
|
111
|
+
.clear-fix:after {
|
112
|
+
clear: both;
|
113
|
+
}
|
114
|
+
|
115
|
+
.float-right {
|
116
|
+
float: right;
|
117
|
+
}
|
118
|
+
|
119
|
+
</style>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
export const cardSchema = {
|
2
|
+
type: 'card',
|
3
|
+
category: 'container',
|
4
|
+
icon: 'card',
|
5
|
+
widgetList: [],
|
6
|
+
options: {
|
7
|
+
name: '',
|
8
|
+
label: 'card',
|
9
|
+
hidden: false,
|
10
|
+
folded: false,
|
11
|
+
showFold: true,
|
12
|
+
cardWidth: '100%',
|
13
|
+
shadow: 'never',
|
14
|
+
customClass: '',
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
export const alertSchema = {
|
19
|
+
type: 'alert',
|
20
|
+
icon: 'alert',
|
21
|
+
formItemFlag: false,
|
22
|
+
options: {
|
23
|
+
name: '',
|
24
|
+
title: 'Good things are coming...',
|
25
|
+
type: 'info',
|
26
|
+
description: '',
|
27
|
+
closable: true,
|
28
|
+
closeText: '',
|
29
|
+
center: true,
|
30
|
+
showIcon: false,
|
31
|
+
effect: 'light',
|
32
|
+
hidden: false,
|
33
|
+
onClose: '',
|
34
|
+
customClass: '',
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import {buildClassAttr, buildContainerWidget, buildFieldWidget} from '@/utils/sfc-generator'
|
2
|
+
|
3
|
+
export const cardTemplateGenerator = function (cw, formConfig) {
|
4
|
+
const wop = cw.options
|
5
|
+
//const headerAttr = `header="${wop.label}"`
|
6
|
+
const classAttr = buildClassAttr(cw)
|
7
|
+
const styleAttr = !!wop.cardWidth ? `style="{width: ${wop.cardWidth} !important}"` : ''
|
8
|
+
const shadowAttr = `shadow="${wop.shadow}"`
|
9
|
+
const vShowAttr = !!wop.hidden ? `v-show="false"` : ''
|
10
|
+
|
11
|
+
const cardTemplate =
|
12
|
+
`<div class="card-container">
|
13
|
+
<el-card ${classAttr} ${styleAttr} ${shadowAttr} ${vShowAttr}>
|
14
|
+
<div slot="header" class="clear-fix">
|
15
|
+
<span>${wop.label}</span>
|
16
|
+
${!!wop.showFold ? `<i class="float-right el-icon-arrow-down"></i>` : ''}
|
17
|
+
</div>
|
18
|
+
${
|
19
|
+
cw.widgetList.map(wItem => {
|
20
|
+
if (wItem.category === 'container') {
|
21
|
+
return buildContainerWidget(wItem, formConfig)
|
22
|
+
} else {
|
23
|
+
return buildFieldWidget(wItem, formConfig)
|
24
|
+
}
|
25
|
+
}).join('')
|
26
|
+
}
|
27
|
+
</el-card>
|
28
|
+
</div>`
|
29
|
+
|
30
|
+
return cardTemplate
|
31
|
+
}
|
32
|
+
|
33
|
+
export const alertTemplateGenerator = function(fw, formConfig) {
|
34
|
+
const wop = fw.options
|
35
|
+
const titleAttr = `title="${wop.title}"`
|
36
|
+
const typeAttr = `type=${wop.type}`
|
37
|
+
const descriptionAttr = !!wop.description ? `description="${wop.description}"` : ''
|
38
|
+
const closableAttr = `:closable="${wop.closable}"`
|
39
|
+
const closeTextAttr = !!wop.closeText ? `close-text="${wop.closeText}"` : ''
|
40
|
+
const centerAttr = `:center="${wop.center}"`
|
41
|
+
const showIconAttr = `:show-icon="${wop.showIcon}"`
|
42
|
+
const effectAttr = `effect="${wop.effect}"`
|
43
|
+
|
44
|
+
const alertTemplate =
|
45
|
+
`<el-alert ${titleAttr} ${typeAttr} ${descriptionAttr} ${closableAttr} ${closeTextAttr} ${centerAttr}
|
46
|
+
${showIconAttr} ${effectAttr}>
|
47
|
+
</el-alert>`
|
48
|
+
|
49
|
+
return alertTemplate
|
50
|
+
}
|