diff --git a/src/components/form-designer/form-widget/container-widget/tab-widget.vue b/src/components/form-designer/form-widget/container-widget/tab-widget.vue index d00dfd2..eb4c131 100644 --- a/src/components/form-designer/form-widget/container-widget/tab-widget.vue +++ b/src/components/form-designer/form-widget/container-widget/tab-widget.vue @@ -112,6 +112,10 @@ .form-widget-list { min-height: 28px; } + + :deep(.el-tabs__content) { + min-height: 28px; + } } .tab-container.selected { diff --git a/src/components/form-designer/form-widget/field-widget/fieldMixin.js b/src/components/form-designer/form-widget/field-widget/fieldMixin.js index 9fef1ec..90177d0 100644 --- a/src/components/form-designer/form-widget/field-widget/fieldMixin.js +++ b/src/components/form-designer/form-widget/field-widget/fieldMixin.js @@ -364,8 +364,17 @@ export default { }, emitAppendButtonClick() { - /* 必须调用mixins中的dispatch方法逐级向父组件发送消息!! */ - this.dispatch('VFormRender', 'appendButtonClick', [this]); + if (!!this.designState) { //设计状态不触发点击事件 + return + } + + if (!!this.field.options.onAppendButtonClick) { + let customFn = new Function(this.field.options.onAppendButtonClick) + customFn.call(this) + } else { + /* 必须调用mixins中的dispatch方法逐级向父组件发送消息!! */ + this.dispatch('VFormRender', 'appendButtonClick', [this]) + } }, handleOnChange(val, oldVal) { //自定义onChange事件 @@ -568,6 +577,46 @@ export default { this.customToolbar = customToolbar }, + /** + * 是否子表单内嵌的组件 + * @returns {boolean} + */ + isSubFormItem() { + return !!this.parentWidget ? this.parentWidget.type === 'sub-form' : false + }, + + /** + * 动态增加自定义css样式 + * @param className + */ + addCssClass(className) { + if (!this.field.options.customClass) { + this.field.options.customClass = [className] + } else { + this.field.options.customClass.push(className) + } + }, + + /** + * 动态移除自定义css样式 + * @param className + */ + removeCssClass(className) { + if (!this.field.options.customClass) { + return + } + + let foundIdx = -1 + this.field.options.customClass.map((cc, idx) => { + if (cc === className) { + foundIdx = idx + } + }) + if (foundIdx > -1) { + this.field.options.customClass.splice(foundIdx, 1) + } + }, + //--------------------- 以上为组件支持外部调用的API方法 end ------------------// } diff --git a/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue b/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue index 3caaa99..5b60d9c 100644 --- a/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue +++ b/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue @@ -22,10 +22,10 @@
diff --git a/src/components/form-designer/index.vue b/src/components/form-designer/index.vue index 94ddcfa..2402ca0 100644 --- a/src/components/form-designer/index.vue +++ b/src/components/form-designer/index.vue @@ -138,7 +138,7 @@ docUrl: 'https://www.vform666.com/document3.html', gitUrl: 'https://github.com/vform666/variant-form3-vite', - chatUrl: 'https://www.vform666.com/chat-group.html', + chatUrl: 'https://www.vform666.com/pages/chat-group/', subScribeUrl: 'https://www.vform666.com/pages/pro/', scrollerHeight: 0, diff --git a/src/components/form-designer/setting-panel/property-editor/event-handler/onAppendButtonClick-editor.vue b/src/components/form-designer/setting-panel/property-editor/event-handler/onAppendButtonClick-editor.vue new file mode 100644 index 0000000..99c7cf9 --- /dev/null +++ b/src/components/form-designer/setting-panel/property-editor/event-handler/onAppendButtonClick-editor.vue @@ -0,0 +1,30 @@ + +