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,405 @@
|
|
1
|
+
<template>
|
2
|
+
<container-item-wrapper :widget="widget">
|
3
|
+
|
4
|
+
<div :key="widget.id" class="sub-form-container"
|
5
|
+
v-show="!widget.options.hidden">
|
6
|
+
<el-row class="header-row">
|
7
|
+
<div class="action-header-column">
|
8
|
+
<span class="action-label">{{i18nt('render.hint.subFormAction')}}</span>
|
9
|
+
<el-button round type="primary" size="mini" class="action-button" @click="addSubFormRow"
|
10
|
+
:title="i18nt('render.hint.subFormAddActionHint')">
|
11
|
+
{{i18nt('render.hint.subFormAddAction')}}<i class="el-icon-plus el-icon-right"></i></el-button>
|
12
|
+
</div>
|
13
|
+
<template v-for="(subWidget) in widget.widgetList">
|
14
|
+
<div :key="subWidget.id + 'thc'" class="field-header-column"
|
15
|
+
:class="[getLabelAlign(widget, subWidget), !!subWidget.options.required ? 'is-required' : '']"
|
16
|
+
:style="{width: subWidget.options.columnWidth}">
|
17
|
+
<span v-if="!!subWidget.options.labelIconClass" class="custom-label">
|
18
|
+
<template v-if="subWidget.options.labelIconPosition === 'front'">
|
19
|
+
<template v-if="!!subWidget.options.labelTooltip">
|
20
|
+
<el-tooltip :content="subWidget.options.labelTooltip" effect="light">
|
21
|
+
<i :class="subWidget.options.labelIconClass"></i></el-tooltip>{{subWidget.options.label}}</template>
|
22
|
+
<template v-else>
|
23
|
+
<i :class="subWidget.options.labelIconClass"></i>{{subWidget.options.label}}</template>
|
24
|
+
</template>
|
25
|
+
<template v-else-if="subWidget.options.labelIconPosition === 'rear'">
|
26
|
+
<template v-if="!!subWidget.options.labelTooltip">
|
27
|
+
{{subWidget.options.label}}<el-tooltip :content="subWidget.options.labelTooltip" effect="light">
|
28
|
+
<i :class="subWidget.options.labelIconClass"></i></el-tooltip></template>
|
29
|
+
<template v-else>
|
30
|
+
{{subWidget.options.label}}<i :class="subWidget.options.labelIconClass"></i></template>
|
31
|
+
</template>
|
32
|
+
</span>
|
33
|
+
<template v-else>
|
34
|
+
<span :title="subWidget.options.labelTooltip">{{subWidget.options.label}}</span></template>
|
35
|
+
</div>
|
36
|
+
</template>
|
37
|
+
</el-row>
|
38
|
+
<el-row v-for="(subFormRowId, sfrIdx) in rowIdData" class="sub-form-row" :key="subFormRowId">
|
39
|
+
<div class="sub-form-action-column hide-label">
|
40
|
+
<div class="action-button-column">
|
41
|
+
<el-button circle type="" icon="el-icon-circle-plus-outline" @click="insertSubFormRow(sfrIdx)"
|
42
|
+
:title="i18nt('render.hint.insertSubFormRow')"></el-button>
|
43
|
+
<el-button circle type="" icon="el-icon-delete" @click="deleteSubFormRow(sfrIdx)"
|
44
|
+
:title="i18nt('render.hint.deleteSubFormRow')"></el-button>
|
45
|
+
<span v-if="widget.options.showRowNumber" class="row-number-span">#{{sfrIdx+1}}</span>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
49
|
+
<div class="sub-form-table-column hide-label" :key="subWidget.id + 'tc' + subFormRowId"
|
50
|
+
:style="{width: subWidget.options.columnWidth}">
|
51
|
+
<component :is="subWidget.type + '-widget'" :field="fieldSchemaData[sfrIdx][swIdx]"
|
52
|
+
:key="fieldSchemaData[sfrIdx][swIdx].id" :parent-list="widget.widgetList"
|
53
|
+
:index-of-parent-list="swIdx" :parent-widget="widget"
|
54
|
+
:sub-form-row-id="subFormRowId"
|
55
|
+
:sub-form-row-index="sfrIdx" :sub-form-col-index="swIdx"></component>
|
56
|
+
</div>
|
57
|
+
</template>
|
58
|
+
</el-row>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
</container-item-wrapper>
|
62
|
+
</template>
|
63
|
+
|
64
|
+
<script>
|
65
|
+
import emitter from 'element-ui/lib/mixins/emitter'
|
66
|
+
import i18n from "../../../utils/i18n"
|
67
|
+
import {deepClone, generateId} from "../../../utils/util"
|
68
|
+
import refMixin from "../../../components/form-render/refMixin"
|
69
|
+
import ContainerItemWrapper from './container-item-wrapper'
|
70
|
+
import containerItemMixin from "./containerItemMixin";
|
71
|
+
import FieldComponents from '@/components/form-designer/form-widget/field-widget/index'
|
72
|
+
|
73
|
+
export default {
|
74
|
+
name: "sub-form-item",
|
75
|
+
componentName: 'ContainerItem',
|
76
|
+
mixins: [emitter, i18n, refMixin, containerItemMixin],
|
77
|
+
components: {
|
78
|
+
ContainerItemWrapper,
|
79
|
+
...FieldComponents,
|
80
|
+
},
|
81
|
+
props: {
|
82
|
+
widget: Object,
|
83
|
+
},
|
84
|
+
inject: ['refList', 'sfRefList', 'globalModel'],
|
85
|
+
data() {
|
86
|
+
return {
|
87
|
+
rowIdData: [],
|
88
|
+
fieldSchemaData: [],
|
89
|
+
}
|
90
|
+
},
|
91
|
+
created() {
|
92
|
+
this.initRefList()
|
93
|
+
this.registerSubFormToRefList()
|
94
|
+
this.initRowIdData(true)
|
95
|
+
this.initFieldSchemaData()
|
96
|
+
this.initEventHandler()
|
97
|
+
},
|
98
|
+
mounted() {
|
99
|
+
this.handleSubFormFirstRowAdd() //默认添加首行后,主动触发相关事件!!
|
100
|
+
},
|
101
|
+
beforeDestroy() {
|
102
|
+
this.unregisterFromRefList()
|
103
|
+
},
|
104
|
+
methods: {
|
105
|
+
getLabelAlign(widget, subWidget) {
|
106
|
+
return subWidget.options.labelAlign || widget.options.labelAlign
|
107
|
+
},
|
108
|
+
|
109
|
+
registerSubFormToRefList() {
|
110
|
+
if (this.widget.type === 'sub-form') {
|
111
|
+
this.sfRefList[this.widget.options.name] = this
|
112
|
+
}
|
113
|
+
},
|
114
|
+
|
115
|
+
initRowIdData(initFlag) {
|
116
|
+
if (this.widget.type === 'sub-form') {
|
117
|
+
this.rowIdData.splice(0, this.rowIdData.length) //清除数组必须用splice,length=0不会响应式更新!!
|
118
|
+
let subFormModel = this.formModel[this.widget.options.name]
|
119
|
+
if (!!subFormModel && (subFormModel.length > 0)) {
|
120
|
+
subFormModel.forEach(() => {
|
121
|
+
this.rowIdData.push('r' + generateId())
|
122
|
+
})
|
123
|
+
|
124
|
+
if (!!initFlag) {
|
125
|
+
//注意:事件触发需延期执行,SumFormDataChange事件处理代码中可能存在尚未创建完成的组件!!
|
126
|
+
setTimeout(() => {
|
127
|
+
this.handleSubFormRowChange(subFormModel)
|
128
|
+
}, 800)
|
129
|
+
}
|
130
|
+
}
|
131
|
+
}
|
132
|
+
},
|
133
|
+
|
134
|
+
addToRowIdData() {
|
135
|
+
this.rowIdData.push('rowId' + generateId())
|
136
|
+
},
|
137
|
+
|
138
|
+
insertToRowIdData(rowIndex) {
|
139
|
+
this.rowIdData.splice(rowIndex, 0, 'rowId' + generateId())
|
140
|
+
},
|
141
|
+
|
142
|
+
deleteFromRowIdData(rowIndex) {
|
143
|
+
this.rowIdData.splice(rowIndex, 1)
|
144
|
+
},
|
145
|
+
|
146
|
+
initFieldSchemaData() { //初始化fieldSchemaData!!!
|
147
|
+
if (this.widget.type !== 'sub-form') {
|
148
|
+
return
|
149
|
+
}
|
150
|
+
|
151
|
+
let rowLength = this.rowIdData.length
|
152
|
+
this.fieldSchemaData.splice(0, this.fieldSchemaData.length) //清除数组必须用splice,length=0不会响应式更新!!
|
153
|
+
if (rowLength > 0) {
|
154
|
+
for (let i = 0; i < rowLength; i++) {
|
155
|
+
let fieldSchemas = []
|
156
|
+
this.widget.widgetList.forEach(swItem => {
|
157
|
+
fieldSchemas.push( this.cloneFieldSchema(swItem) )
|
158
|
+
})
|
159
|
+
this.fieldSchemaData.push(fieldSchemas)
|
160
|
+
}
|
161
|
+
}
|
162
|
+
},
|
163
|
+
|
164
|
+
addToFieldSchemaData(rowIndex) {
|
165
|
+
let fieldSchemas = []
|
166
|
+
this.widget.widgetList.forEach(swItem => {
|
167
|
+
fieldSchemas.push( this.cloneFieldSchema(swItem) )
|
168
|
+
})
|
169
|
+
|
170
|
+
if (rowIndex === undefined) {
|
171
|
+
this.fieldSchemaData.push(fieldSchemas)
|
172
|
+
} else {
|
173
|
+
this.fieldSchemaData.splice(rowIndex, 0, fieldSchemas)
|
174
|
+
}
|
175
|
+
},
|
176
|
+
|
177
|
+
deleteFromFieldSchemaData(rowIndex) {
|
178
|
+
this.fieldSchemaData.splice(rowIndex, 1)
|
179
|
+
},
|
180
|
+
|
181
|
+
cloneFieldSchema(fieldWidget) {
|
182
|
+
let newFieldSchema = deepClone(fieldWidget)
|
183
|
+
newFieldSchema.id = fieldWidget.type + generateId()
|
184
|
+
return newFieldSchema
|
185
|
+
},
|
186
|
+
|
187
|
+
initEventHandler() {
|
188
|
+
if (this.widget.type !== 'sub-form') {
|
189
|
+
return
|
190
|
+
}
|
191
|
+
|
192
|
+
this.$on('setFormData', function (newFormData) {
|
193
|
+
this.initRowIdData(false)
|
194
|
+
this.initFieldSchemaData()
|
195
|
+
|
196
|
+
let subFormData = newFormData[this.widget.options.name] || []
|
197
|
+
setTimeout(() => { //延时触发SubFormRowChange事件, 便于更新计算字段!!
|
198
|
+
this.handleSubFormRowChange(subFormData)
|
199
|
+
}, 800)
|
200
|
+
})
|
201
|
+
},
|
202
|
+
|
203
|
+
handleSubFormFirstRowAdd() {
|
204
|
+
if (this.widget.type !== 'sub-form') {
|
205
|
+
return
|
206
|
+
}
|
207
|
+
|
208
|
+
if (!!this.widget.options.showBlankRow && (this.rowIdData.length === 1)) {
|
209
|
+
let oldSubFormData = this.formModel[this.widget.options.name] || []
|
210
|
+
this.handleSubFormRowAdd(oldSubFormData, this.rowIdData[0])
|
211
|
+
this.handleSubFormRowChange(oldSubFormData)
|
212
|
+
}
|
213
|
+
},
|
214
|
+
|
215
|
+
addSubFormRow() {
|
216
|
+
let newSubFormDataRow = {}
|
217
|
+
this.widget.widgetList.forEach(subFormItem => {
|
218
|
+
if (!!subFormItem.formItemFlag) {
|
219
|
+
newSubFormDataRow[subFormItem.options.name] = subFormItem.options.defaultValue
|
220
|
+
}
|
221
|
+
})
|
222
|
+
|
223
|
+
let oldSubFormData = this.formModel[this.widget.options.name] || []
|
224
|
+
oldSubFormData.push(newSubFormDataRow)
|
225
|
+
this.addToRowIdData()
|
226
|
+
this.addToFieldSchemaData()
|
227
|
+
|
228
|
+
this.handleSubFormRowAdd(oldSubFormData, this.rowIdData[oldSubFormData.length - 1])
|
229
|
+
this.handleSubFormRowChange(oldSubFormData)
|
230
|
+
},
|
231
|
+
|
232
|
+
insertSubFormRow(beforeFormRowIndex) {
|
233
|
+
let newSubFormDataRow = {}
|
234
|
+
this.widget.widgetList.forEach(subFormItem => {
|
235
|
+
if (!!subFormItem.formItemFlag) {
|
236
|
+
newSubFormDataRow[subFormItem.options.name] = subFormItem.options.defaultValue
|
237
|
+
}
|
238
|
+
})
|
239
|
+
|
240
|
+
let oldSubFormData = this.formModel[this.widget.options.name] || []
|
241
|
+
oldSubFormData.splice(beforeFormRowIndex, 0, newSubFormDataRow)
|
242
|
+
this.insertToRowIdData(beforeFormRowIndex)
|
243
|
+
this.addToFieldSchemaData(beforeFormRowIndex)
|
244
|
+
|
245
|
+
this.handleSubFormRowInsert(oldSubFormData, this.rowIdData[beforeFormRowIndex])
|
246
|
+
this.handleSubFormRowChange(oldSubFormData)
|
247
|
+
},
|
248
|
+
|
249
|
+
deleteSubFormRow(formRowIndex) {
|
250
|
+
this.$confirm(this.i18nt('render.hint.deleteSubFormRow') + '?', this.i18nt('render.hint.prompt'), {
|
251
|
+
confirmButtonText: this.i18nt('render.hint.confirm'),
|
252
|
+
cancelButtonText: this.i18nt('render.hint.cancel')
|
253
|
+
}).then(() => {
|
254
|
+
let oldSubFormData = this.formModel[this.widget.options.name] || []
|
255
|
+
let deletedDataRow = deepClone(oldSubFormData[formRowIndex])
|
256
|
+
oldSubFormData.splice(formRowIndex, 1)
|
257
|
+
this.deleteFromRowIdData(formRowIndex)
|
258
|
+
this.deleteFromFieldSchemaData(formRowIndex)
|
259
|
+
|
260
|
+
this.handelSubFormRowDelete(oldSubFormData, deletedDataRow)
|
261
|
+
this.handleSubFormRowChange(oldSubFormData)
|
262
|
+
}).catch(() => {
|
263
|
+
//
|
264
|
+
})
|
265
|
+
},
|
266
|
+
|
267
|
+
handleSubFormRowChange(subFormData) {
|
268
|
+
if (!!this.widget.options.onSubFormRowChange) {
|
269
|
+
let customFunc = new Function('subFormData', this.widget.options.onSubFormRowChange)
|
270
|
+
customFunc.call(this, subFormData)
|
271
|
+
}
|
272
|
+
},
|
273
|
+
|
274
|
+
handleSubFormRowAdd(subFormData, newRowId) {
|
275
|
+
if (!!this.widget.options.onSubFormRowAdd) {
|
276
|
+
let customFunc = new Function('subFormData', 'newRowId', this.widget.options.onSubFormRowAdd)
|
277
|
+
customFunc.call(this, subFormData, newRowId)
|
278
|
+
}
|
279
|
+
},
|
280
|
+
|
281
|
+
handleSubFormRowInsert(subFormData, newRowId) {
|
282
|
+
if (!!this.widget.options.onSubFormRowInsert) {
|
283
|
+
let customFunc = new Function('subFormData', 'newRowId', this.widget.options.onSubFormRowInsert)
|
284
|
+
customFunc.call(this, subFormData, newRowId)
|
285
|
+
}
|
286
|
+
},
|
287
|
+
|
288
|
+
handelSubFormRowDelete(subFormData, deletedDataRow) {
|
289
|
+
if (!!this.widget.options.onSubFormRowDelete) {
|
290
|
+
let customFunc = new Function('subFormData', 'deletedDataRow', this.widget.options.onSubFormRowDelete)
|
291
|
+
customFunc.call(this, subFormData, deletedDataRow)
|
292
|
+
}
|
293
|
+
},
|
294
|
+
|
295
|
+
},
|
296
|
+
}
|
297
|
+
</script>
|
298
|
+
|
299
|
+
<style lang="scss" scoped>
|
300
|
+
.sub-form-container {
|
301
|
+
margin-bottom: 8px;
|
302
|
+
text-align: left; //IE浏览器强制居左对齐
|
303
|
+
|
304
|
+
::v-deep .el-row.header-row {
|
305
|
+
padding-bottom: 0;
|
306
|
+
}
|
307
|
+
|
308
|
+
::v-deep .el-row.sub-form-row {
|
309
|
+
padding-top: 3px;
|
310
|
+
padding-bottom: 3px;
|
311
|
+
|
312
|
+
.row-number-span {
|
313
|
+
margin-left: 16px;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
}
|
317
|
+
|
318
|
+
div.action-header-column {
|
319
|
+
display: inline-block;
|
320
|
+
width: 120px;
|
321
|
+
|
322
|
+
.action-label {
|
323
|
+
margin-right: 12px;
|
324
|
+
}
|
325
|
+
|
326
|
+
.action-button {
|
327
|
+
padding-left: 8px;
|
328
|
+
padding-right: 8px;
|
329
|
+
}
|
330
|
+
}
|
331
|
+
|
332
|
+
div.field-header-column {
|
333
|
+
display: inline-block;
|
334
|
+
//overflow: hidden;
|
335
|
+
//white-space: nowrap; //文字超出长度不自动换行
|
336
|
+
//text-overflow: ellipsis; //文字超出长度显示省略号
|
337
|
+
|
338
|
+
span.custom-label i {
|
339
|
+
margin: 0 3px;
|
340
|
+
}
|
341
|
+
}
|
342
|
+
|
343
|
+
div.field-header-column.is-required:before {
|
344
|
+
content: '*';
|
345
|
+
color: #F56C6C;
|
346
|
+
margin-right: 4px;
|
347
|
+
}
|
348
|
+
|
349
|
+
div.label-center-left {
|
350
|
+
text-align: left;
|
351
|
+
}
|
352
|
+
|
353
|
+
div.label-center-align {
|
354
|
+
text-align: center;
|
355
|
+
}
|
356
|
+
|
357
|
+
div.label-right-align {
|
358
|
+
text-align: right;
|
359
|
+
}
|
360
|
+
|
361
|
+
div.sub-form-action-column {
|
362
|
+
display: inline-block;
|
363
|
+
width: 120px;
|
364
|
+
|
365
|
+
::v-deep .el-form-item {
|
366
|
+
margin-bottom: 0;
|
367
|
+
}
|
368
|
+
|
369
|
+
::v-deep .el-button {
|
370
|
+
font-size: 18px;
|
371
|
+
padding: 0;
|
372
|
+
background: #DCDFE6;
|
373
|
+
border: 4px solid #DCDFE6;
|
374
|
+
}
|
375
|
+
|
376
|
+
}
|
377
|
+
|
378
|
+
div.sub-form-action-column.hide-label {
|
379
|
+
::v-deep .el-form-item__label {
|
380
|
+
display: none;
|
381
|
+
}
|
382
|
+
}
|
383
|
+
|
384
|
+
div.sub-form-table-column {
|
385
|
+
display: inline-block;
|
386
|
+
//width: 200px;
|
387
|
+
|
388
|
+
::v-deep .el-form-item {
|
389
|
+
margin-left: 4px;
|
390
|
+
margin-right: 4px;
|
391
|
+
margin-bottom: 0;
|
392
|
+
}
|
393
|
+
|
394
|
+
::v-deep .el-form-item__content {
|
395
|
+
margin-left: 0 !important;
|
396
|
+
}
|
397
|
+
}
|
398
|
+
|
399
|
+
div.sub-form-table-column.hide-label {
|
400
|
+
::v-deep .el-form-item__label {
|
401
|
+
display: none;
|
402
|
+
}
|
403
|
+
}
|
404
|
+
|
405
|
+
</style>
|
@@ -0,0 +1,89 @@
|
|
1
|
+
<template>
|
2
|
+
<container-item-wrapper :widget="widget">
|
3
|
+
|
4
|
+
<div :key="widget.id" class="tab-container"
|
5
|
+
v-show="!widget.options.hidden">
|
6
|
+
<el-tabs v-model="activeTabName" :type="widget.displayType" :ref="widget.id" :class="[customClass]">
|
7
|
+
<el-tab-pane v-for="(tab, index) in visibleTabs" :key="index" :label="tab.options.label"
|
8
|
+
:disabled="tab.options.disabled" :name="tab.options.name">
|
9
|
+
<template v-for="(subWidget, swIdx) in tab.widgetList">
|
10
|
+
<template v-if="'container' === subWidget.category">
|
11
|
+
<component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="tab.widgetList"
|
12
|
+
:index-of-parent-list="swIdx" :parent-widget="widget"></component>
|
13
|
+
</template>
|
14
|
+
<template v-else>
|
15
|
+
<component :is="subWidget.type + '-widget'" :field="subWidget" :key="swIdx" :parent-list="tab.widgetList"
|
16
|
+
:index-of-parent-list="swIdx" :parent-widget="widget"></component>
|
17
|
+
</template>
|
18
|
+
</template>
|
19
|
+
</el-tab-pane>
|
20
|
+
</el-tabs>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
</container-item-wrapper>
|
24
|
+
</template>
|
25
|
+
|
26
|
+
<script>
|
27
|
+
import emitter from 'element-ui/lib/mixins/emitter'
|
28
|
+
import i18n from "../../../utils/i18n"
|
29
|
+
import refMixin from "../../../components/form-render/refMixin"
|
30
|
+
import ContainerItemWrapper from './container-item-wrapper'
|
31
|
+
import containerItemMixin from "./containerItemMixin";
|
32
|
+
import FieldComponents from '@/components/form-designer/form-widget/field-widget/index'
|
33
|
+
|
34
|
+
export default {
|
35
|
+
name: "tab-item",
|
36
|
+
componentName: 'ContainerItem',
|
37
|
+
mixins: [emitter, i18n, refMixin, containerItemMixin],
|
38
|
+
components: {
|
39
|
+
ContainerItemWrapper,
|
40
|
+
...FieldComponents,
|
41
|
+
},
|
42
|
+
props: {
|
43
|
+
widget: Object,
|
44
|
+
},
|
45
|
+
inject: ['refList', 'sfRefList', 'globalModel'],
|
46
|
+
data() {
|
47
|
+
return {
|
48
|
+
activeTabName: '',
|
49
|
+
}
|
50
|
+
},
|
51
|
+
computed: {
|
52
|
+
visibleTabs() {
|
53
|
+
return this.widget.tabs.filter(tp => {
|
54
|
+
return !tp.options.hidden
|
55
|
+
})
|
56
|
+
},
|
57
|
+
|
58
|
+
},
|
59
|
+
created() {
|
60
|
+
this.initRefList()
|
61
|
+
},
|
62
|
+
mounted() {
|
63
|
+
this.initActiveTab()
|
64
|
+
},
|
65
|
+
beforeDestroy() {
|
66
|
+
this.unregisterFromRefList()
|
67
|
+
},
|
68
|
+
methods: {
|
69
|
+
initActiveTab() {
|
70
|
+
if ((this.widget.type === 'tab') && (this.widget.tabs.length > 0)) {
|
71
|
+
let activePanes = this.widget.tabs.filter((tp) => {
|
72
|
+
return tp.options.active === true
|
73
|
+
})
|
74
|
+
if (activePanes.length > 0) {
|
75
|
+
this.activeTabName = activePanes[0].options.name
|
76
|
+
} else {
|
77
|
+
this.activeTabName = this.widget.tabs[0].options.name
|
78
|
+
}
|
79
|
+
}
|
80
|
+
},
|
81
|
+
|
82
|
+
},
|
83
|
+
}
|
84
|
+
</script>
|
85
|
+
|
86
|
+
<style lang="scss" scoped>
|
87
|
+
|
88
|
+
|
89
|
+
</style>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<template>
|
2
|
+
<td class="table-cell" :class="[customClass]"
|
3
|
+
:colspan="widget.options.colspan || 1" :rowspan="widget.options.rowspan || 1"
|
4
|
+
:style="{width: widget.options.cellWidth + ' !important' || '', height: widget.options.cellHeight + ' !important' || ''}">
|
5
|
+
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
6
|
+
<template v-if="'container' === subWidget.category">
|
7
|
+
<component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
|
8
|
+
:index-of-parent-list="swIdx" :parent-widget="widget"></component>
|
9
|
+
</template>
|
10
|
+
<template v-else>
|
11
|
+
<component :is="subWidget.type + '-widget'" :field="subWidget" :key="swIdx" :parent-list="widget.widgetList"
|
12
|
+
:index-of-parent-list="swIdx" :parent-widget="widget"></component>
|
13
|
+
</template>
|
14
|
+
</template>
|
15
|
+
</td>
|
16
|
+
</template>
|
17
|
+
|
18
|
+
<script>
|
19
|
+
import i18n from "../../../utils/i18n"
|
20
|
+
import refMixin from "../../../components/form-render/refMixin"
|
21
|
+
import FieldComponents from '@/components/form-designer/form-widget/field-widget/index'
|
22
|
+
|
23
|
+
export default {
|
24
|
+
name: "TableCellItem",
|
25
|
+
componentName: "ContainerItem",
|
26
|
+
mixins: [i18n, refMixin],
|
27
|
+
components: {
|
28
|
+
...FieldComponents,
|
29
|
+
},
|
30
|
+
props: {
|
31
|
+
widget: Object,
|
32
|
+
|
33
|
+
rowIndex: Number,
|
34
|
+
colIndex: Number,
|
35
|
+
},
|
36
|
+
inject: ['refList', 'globalModel'],
|
37
|
+
computed: {
|
38
|
+
customClass() {
|
39
|
+
return this.widget.options.customClass || ''
|
40
|
+
},
|
41
|
+
|
42
|
+
},
|
43
|
+
created() {
|
44
|
+
/* tableCell不生成组件引用,故无须调用initRefList!! */
|
45
|
+
//this.initRefList()
|
46
|
+
},
|
47
|
+
methods: {
|
48
|
+
|
49
|
+
}
|
50
|
+
}
|
51
|
+
</script>
|
52
|
+
|
53
|
+
<style lang="scss" scoped>
|
54
|
+
td.table-cell {
|
55
|
+
display: table-cell;
|
56
|
+
height: 36px;
|
57
|
+
//border: 1px dashed #336699;
|
58
|
+
border: 1px solid #e5e5e5;
|
59
|
+
}
|
60
|
+
|
61
|
+
</style>
|
@@ -0,0 +1,65 @@
|
|
1
|
+
<template>
|
2
|
+
<container-item-wrapper :widget="widget">
|
3
|
+
|
4
|
+
<div :key="widget.id" class="table-container"
|
5
|
+
v-show="!widget.options.hidden">
|
6
|
+
<table :ref="widget.id" class="table-layout" :class="[customClass]">
|
7
|
+
<tbody>
|
8
|
+
<tr v-for="(row, rowIdx) in widget.rows" :key="row.id">
|
9
|
+
<template v-for="(colWidget, colIdx) in row.cols">
|
10
|
+
<table-cell-item v-if="!colWidget.merged" :widget="colWidget" :key="colIdx" :parent-list="widget.cols"
|
11
|
+
:row-index="rowIdx" :col-index="colIdx" :parent-widget="widget"></table-cell-item>
|
12
|
+
</template>
|
13
|
+
</tr>
|
14
|
+
</tbody>
|
15
|
+
</table>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
</container-item-wrapper>
|
19
|
+
</template>
|
20
|
+
|
21
|
+
<script>
|
22
|
+
import emitter from 'element-ui/lib/mixins/emitter'
|
23
|
+
import i18n from "../../../utils/i18n"
|
24
|
+
import refMixin from "../../../components/form-render/refMixin"
|
25
|
+
import ContainerItemWrapper from './container-item-wrapper'
|
26
|
+
import TableCellItem from './table-cell-item'
|
27
|
+
import containerItemMixin from "./containerItemMixin";
|
28
|
+
|
29
|
+
export default {
|
30
|
+
name: "table-item",
|
31
|
+
componentName: 'ContainerItem',
|
32
|
+
mixins: [emitter, i18n, refMixin, containerItemMixin],
|
33
|
+
components: {
|
34
|
+
ContainerItemWrapper,
|
35
|
+
TableCellItem,
|
36
|
+
},
|
37
|
+
props: {
|
38
|
+
widget: Object,
|
39
|
+
},
|
40
|
+
inject: ['refList', 'sfRefList', 'globalModel'],
|
41
|
+
created() {
|
42
|
+
this.initRefList()
|
43
|
+
},
|
44
|
+
mounted() {
|
45
|
+
|
46
|
+
},
|
47
|
+
beforeDestroy() {
|
48
|
+
this.unregisterFromRefList()
|
49
|
+
},
|
50
|
+
methods: {
|
51
|
+
|
52
|
+
},
|
53
|
+
}
|
54
|
+
</script>
|
55
|
+
|
56
|
+
<style lang="scss" scoped>
|
57
|
+
div.table-container {
|
58
|
+
table.table-layout {
|
59
|
+
width: 100%;
|
60
|
+
table-layout: fixed;
|
61
|
+
border-collapse: collapse;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
</style>
|