parent
dd801e871d
commit
daf943e4ab
|
@ -353,8 +353,17 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
emitAppendButtonClick() {
|
emitAppendButtonClick() {
|
||||||
|
if (!!this.designState) { //设计状态不触发点击事件
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!!this.field.options.onAppendButtonClick) {
|
||||||
|
let customFn = new Function(this.field.options.onAppendButtonClick)
|
||||||
|
customFn.call(this)
|
||||||
|
} else {
|
||||||
/* 必须调用mixins中的dispatch方法逐级向父组件发送消息!! */
|
/* 必须调用mixins中的dispatch方法逐级向父组件发送消息!! */
|
||||||
this.dispatch('VFormRender', 'appendButtonClick', [this]);
|
this.dispatch('VFormRender', 'appendButtonClick', [this])
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
handleOnChange(val, oldVal) { //自定义onChange事件
|
handleOnChange(val, oldVal) { //自定义onChange事件
|
||||||
|
@ -564,7 +573,39 @@ export default {
|
||||||
*/
|
*/
|
||||||
isSubFormItem() {
|
isSubFormItem() {
|
||||||
return !!this.parentWidget ? this.parentWidget.type === 'sub-form' : false
|
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 ------------------//
|
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@
|
||||||
|
|
||||||
docUrl: 'https://www.vform666.com/document.html',
|
docUrl: 'https://www.vform666.com/document.html',
|
||||||
gitUrl: 'https://github.com/vform666/variant-form',
|
gitUrl: 'https://github.com/vform666/variant-form',
|
||||||
chatUrl: 'https://www.vform666.com/chat-group.html',
|
chatUrl: 'https://www.vform666.com/pages/chat-group/',
|
||||||
subScribeUrl: 'https://www.vform666.com/subscribe.html',
|
subScribeUrl: 'https://www.vform666.com/subscribe.html',
|
||||||
|
|
||||||
scrollerHeight: 0,
|
scrollerHeight: 0,
|
||||||
|
|
|
@ -121,6 +121,7 @@ const EVENT_PROPERTIES = {
|
||||||
'onUploadError' : 'onUploadError-editor',
|
'onUploadError' : 'onUploadError-editor',
|
||||||
'onFileRemove' : 'onFileRemove-editor',
|
'onFileRemove' : 'onFileRemove-editor',
|
||||||
'onValidate' : 'onValidate-editor',
|
'onValidate' : 'onValidate-editor',
|
||||||
|
'onAppendButtonClick': 'onAppendButtonClick-editor',
|
||||||
|
|
||||||
//容器
|
//容器
|
||||||
'onSubFormRowAdd' : 'onSubFormRowAdd-editor',
|
'onSubFormRowAdd' : 'onSubFormRowAdd-editor',
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
<el-dialog :title="i18nt('designer.toolbar.preview')" :visible.sync="showPreviewDialogFlag" v-if="showPreviewDialogFlag"
|
<el-dialog :title="i18nt('designer.toolbar.preview')" :visible.sync="showPreviewDialogFlag" v-if="showPreviewDialogFlag"
|
||||||
:show-close="true" :close-on-click-modal="false" :close-on-press-escape="false" center v-dialog-drag
|
:show-close="true" :close-on-click-modal="false" :close-on-press-escape="false" center v-dialog-drag
|
||||||
:destroy-on-close="true" class="small-padding-dialog" width="75%"
|
:destroy-on-close="true" :append-to-body="true" class="small-padding-dialog" width="75%"
|
||||||
:fullscreen="(layoutType === 'H5') || (layoutType === 'Pad')">
|
:fullscreen="(layoutType === 'H5') || (layoutType === 'Pad')">
|
||||||
<div>
|
<div>
|
||||||
<div class="form-render-wrapper" :class="[layoutType === 'H5' ? 'h5-layout' : (layoutType === 'Pad' ? 'pad-layout' : '')]">
|
<div class="form-render-wrapper" :class="[layoutType === 'H5' ? 'h5-layout' : (layoutType === 'Pad' ? 'pad-layout' : '')]">
|
||||||
|
|
|
@ -142,6 +142,7 @@ export const basicFields = [
|
||||||
onFocus: '',
|
onFocus: '',
|
||||||
onBlur: '',
|
onBlur: '',
|
||||||
onValidate: '',
|
onValidate: '',
|
||||||
|
onAppendButtonClick: '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -181,6 +181,38 @@ export default {
|
||||||
// //TODO:
|
// //TODO:
|
||||||
// },
|
// },
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态增加自定义css样式
|
||||||
|
* @param className
|
||||||
|
*/
|
||||||
|
addCssClass(className) {
|
||||||
|
if (!this.widget.options.customClass) {
|
||||||
|
this.widget.options.customClass = [className]
|
||||||
|
} else {
|
||||||
|
this.widget.options.customClass.push(className)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态移除自定义css样式
|
||||||
|
* @param className
|
||||||
|
*/
|
||||||
|
removeCssClass(className) {
|
||||||
|
if (!this.widget.options.customClass) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let foundIdx = -1
|
||||||
|
this.widget.options.customClass.map((cc, idx) => {
|
||||||
|
if (cc === className) {
|
||||||
|
foundIdx = idx
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (foundIdx > -1) {
|
||||||
|
this.widget.options.customClass.splice(foundIdx, 1)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
@ -481,7 +481,6 @@
|
||||||
|
|
||||||
// 通知SubForm组件:表单数据更新事件!!
|
// 通知SubForm组件:表单数据更新事件!!
|
||||||
this.broadcast('ContainerItem', 'setFormData', this.formDataModel)
|
this.broadcast('ContainerItem', 'setFormData', this.formDataModel)
|
||||||
|
|
||||||
// 通知FieldWidget组件:表单数据更新事件!!
|
// 通知FieldWidget组件:表单数据更新事件!!
|
||||||
this.broadcast('FieldWidget', 'setFormData', this.formDataModel)
|
this.broadcast('FieldWidget', 'setFormData', this.formDataModel)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue