mirror of
https://github.com/vform666/variant-form3-vite.git
synced 2025-06-21 17:39:57 +08:00
配置build生产打包参数,未全部解决。
This commit is contained in:
@ -78,11 +78,6 @@
|
||||
|
||||
//编辑时同步数据
|
||||
this.aceEditor.getSession().on('change',(ev)=>{
|
||||
/*
|
||||
//this.$emit('update:value', this.aceEditor.getValue()) // 触发更新事件, 实现.sync双向绑定!!
|
||||
this.$emit('input', this.aceEditor.getValue())
|
||||
*/
|
||||
|
||||
this.$emit('update:modelValue', this.aceEditor.getValue())
|
||||
})
|
||||
},
|
||||
|
@ -817,12 +817,10 @@ export function createDesigner(vueInstance) {
|
||||
},
|
||||
|
||||
emitEvent(evtName, evtData) { //用于兄弟组件发射事件
|
||||
//this.vueInstance.$emit(evtName, evtData)
|
||||
eventBus.$emit(evtName, evtData)
|
||||
},
|
||||
|
||||
handleEvent(evtName, callback) { //用于兄弟组件接收事件
|
||||
//this.vueInstance.$on(evtName, (data) => callback(data))
|
||||
eventBus.$on(evtName, (data) => callback(data))
|
||||
},
|
||||
|
||||
|
@ -226,12 +226,10 @@
|
||||
},
|
||||
|
||||
mergeLeftCol() {
|
||||
//this.designer.mergeTableColumn(this.colArray, this.colIndex, true)
|
||||
this.designer.mergeTableCol(this.rowArray, this.colArray, this.rowIndex, this.colIndex, true, this.widget)
|
||||
},
|
||||
|
||||
mergeRightCol() {
|
||||
//this.designer.mergeTableColumn(this.colArray, this.colIndex, false)
|
||||
this.designer.mergeTableCol(this.rowArray, this.colArray, this.rowIndex, this.colIndex, false, this.widget)
|
||||
},
|
||||
|
||||
|
@ -88,12 +88,6 @@ export default {
|
||||
},
|
||||
|
||||
initEventHandler() {
|
||||
// eventBus.$on('setFormData', (newFormData) => {
|
||||
// console.log('formModel of globalModel----------', this.globalModel.formModel)
|
||||
// if (!this.subFormItemFlag) {
|
||||
// this.setValue(newFormData[this.field.options.name])
|
||||
// }
|
||||
// })
|
||||
this.on$('setFormData', (newFormData) => {
|
||||
console.log('formModel of globalModel----------', this.globalModel.formModel)
|
||||
if (!this.subFormItemFlag) {
|
||||
@ -101,14 +95,6 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
// eventBus.$on('field-value-changed', (values) => {
|
||||
// if (!!this.subFormItemFlag) {
|
||||
// let subFormData = this.formModel[this.subFormName]
|
||||
// this.handleOnChangeForSubForm(values[0], values[1], subFormData, this.subFormRowId)
|
||||
// } else {
|
||||
// this.handleOnChange(values[0], values[1])
|
||||
// }
|
||||
// })
|
||||
this.on$('field-value-changed', (values) => {
|
||||
if (!!this.subFormItemFlag) {
|
||||
let subFormData = this.formModel[this.subFormName]
|
||||
@ -118,12 +104,6 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
/* 监听重新加载选项事件 */
|
||||
// eventBus.$on('reloadOptionItems', (widgetNames) => {
|
||||
// if ((widgetNames.length === 0) || (widgetNames.indexOf(this.field.options.name) > -1)) {
|
||||
// this.initOptionItems(true)
|
||||
// }
|
||||
// })
|
||||
this.on$('reloadOptionItems', (widgetNames) => {
|
||||
if ((widgetNames.length === 0) || (widgetNames.indexOf(this.field.options.name) > -1)) {
|
||||
this.initOptionItems(true)
|
||||
@ -308,15 +288,11 @@ export default {
|
||||
//--------------------- 事件处理 begin ------------------//
|
||||
|
||||
emitFieldDataChange(newValue, oldValue) {
|
||||
//this.$emit('field-value-changed', [newValue, oldValue])
|
||||
//eventBus.$emit('field-value-changed', [newValue, oldValue]) //此处应该加事件触发组件判断,非本组件(其他组件)触发的事件应该跳过,否则会出现事件无限循环!!
|
||||
|
||||
this.emit$('field-value-changed', [newValue, oldValue])
|
||||
|
||||
// /* 必须用dispatch向指定父组件派发消息!! */
|
||||
/* 必须用dispatch向指定父组件派发消息!! */
|
||||
this.dispatch('VFormRender', 'fieldChange',
|
||||
[this.field.options.name, newValue, oldValue, this.subFormName, this.subFormRowIndex])
|
||||
// eventBus.$emit('fieldChange', [this.field.options.name, newValue, oldValue, this.subFormName, this.subFormRowIndex])
|
||||
},
|
||||
|
||||
syncUpdateFormModel(value) {
|
||||
@ -559,12 +535,10 @@ export default {
|
||||
},
|
||||
|
||||
setUploadHeader(name, value) {
|
||||
//this.$set(this.uploadHeaders, name, value)
|
||||
this.uploadHeaders[name] = value
|
||||
},
|
||||
|
||||
setUploadData(name, value) {
|
||||
//this.$set(this.uploadData, name, value)
|
||||
this.uploadData[name] = value
|
||||
},
|
||||
|
||||
|
@ -192,7 +192,6 @@
|
||||
return
|
||||
}
|
||||
|
||||
//eventBus.$on('setFormData', (newFormData) => {
|
||||
this.on$('setFormData', (newFormData) => {
|
||||
this.initRowIdData(false)
|
||||
this.initFieldSchemaData()
|
||||
|
@ -221,15 +221,12 @@
|
||||
}
|
||||
})
|
||||
|
||||
//this.$set(this.formDataModel, subFormName, [subFormDataRow]) //
|
||||
this.formDataModel[subFormName] = [subFormDataRow]
|
||||
} else {
|
||||
//this.$set(this.formDataModel, subFormName, []) //
|
||||
this.formDataModel[subFormName] = []
|
||||
}
|
||||
} else {
|
||||
let initialValue = this.formData[subFormName]
|
||||
//this.$set(this.formDataModel, subFormName, deepClone(initialValue))
|
||||
this.formDataModel[subFormName] = deepClone(initialValue)
|
||||
}
|
||||
} else if ((wItem.type === 'grid-col') || (wItem.type === 'table-cell')) {
|
||||
@ -247,21 +244,16 @@
|
||||
}
|
||||
} else if (!!wItem.formItemFlag) {
|
||||
if (!this.formData.hasOwnProperty(wItem.options.name)) {
|
||||
//this.formDataModel[wItem.options.name] = '' //这种写法不支持对象属性响应式更新,必须用$set方法!!
|
||||
//this.$set(this.formDataModel, wItem.options.name, wItem.options.defaultValue) //设置字段默认值
|
||||
this.formDataModel[wItem.options.name] = wItem.options.defaultValue
|
||||
} else {
|
||||
let initialValue = this.formData[wItem.options.name]
|
||||
//this.$set(this.formDataModel, wItem.options.name, deepClone(initialValue))
|
||||
this.formDataModel[wItem.options.name] = deepClone(initialValue)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
addFieldChangeEventHandler() {
|
||||
//eventBus.$off('fieldChange') //移除原有事件监听
|
||||
this.off$('fieldChange') //移除原有事件监听
|
||||
//eventBus.$on('fieldChange', (fieldName, newValue, oldValue, subFormName, subFormRowIndex) => {
|
||||
this.on$('fieldChange', (fieldName, newValue, oldValue, subFormName, subFormRowIndex) => {
|
||||
this.handleFieldDataChange(fieldName, newValue, oldValue, subFormName, subFormRowIndex)
|
||||
this.$emit('formChange', fieldName, newValue, oldValue, this.formDataModel, subFormName, subFormRowIndex)
|
||||
@ -269,9 +261,7 @@
|
||||
},
|
||||
|
||||
addFieldValidateEventHandler() {
|
||||
//eventBus.$off('fieldValidation') //移除原有事件监听
|
||||
this.off$('fieldValidation') //移除原有事件监听
|
||||
//eventBus.$on('fieldValidation', (fieldName) => {
|
||||
this.on$('fieldValidation', (fieldName) => {
|
||||
this.$refs.renderForm.validateField(fieldName)
|
||||
})
|
||||
@ -366,10 +356,8 @@
|
||||
this.clearFormDataModel() //上行代码有问题,会导致表单校验失败,故保留原对象引用只清空对象属性!!
|
||||
this.buildFormModel(newFormJsonObj.widgetList)
|
||||
|
||||
//this.$set(this.formJsonObj, 'formConfig', newFormJsonObj.formConfig)
|
||||
this.formJsonObj['formConfig'] = newFormJsonObj.formConfig
|
||||
this._provided.formConfig = newFormJsonObj.formConfig //强制更新provide的formConfig对象
|
||||
//this.$set(this.formJsonObj, 'widgetList', newFormJsonObj.widgetList)
|
||||
this.formJsonObj['widgetList'] = newFormJsonObj.widgetList
|
||||
|
||||
this.initFormObject()
|
||||
|
Reference in New Issue
Block a user