mirror of
https://github.com/vform666/variant-form3-vite.git
synced 2024-11-10 09:39:20 +08:00
修复清空设计器画布时未同步清除组件refList的错误。
This commit is contained in:
parent
299e7c7506
commit
52b3b33043
@ -92,6 +92,7 @@ export function createDesigner(vueInstance) {
|
|||||||
let modifiedFlag = false
|
let modifiedFlag = false
|
||||||
|
|
||||||
if (!!formJson && !!formJson.widgetList) {
|
if (!!formJson && !!formJson.widgetList) {
|
||||||
|
this.formWidget.clearWidgetRefList()
|
||||||
this.widgetList = formJson.widgetList
|
this.widgetList = formJson.widgetList
|
||||||
modifiedFlag = true
|
modifiedFlag = true
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,7 @@ export default {
|
|||||||
|
|
||||||
removeWidget() {
|
removeWidget() {
|
||||||
if (!!this.parentList) {
|
if (!!this.parentList) {
|
||||||
|
const widgetRefName = this.designer.selectedWidgetName
|
||||||
let nextSelected = null
|
let nextSelected = null
|
||||||
if (this.parentList.length === 1) {
|
if (this.parentList.length === 1) {
|
||||||
if (!!this.parentWidget) {
|
if (!!this.parentWidget) {
|
||||||
@ -81,10 +82,9 @@ export default {
|
|||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.parentList.splice(this.indexOfParentList, 1)
|
this.parentList.splice(this.indexOfParentList, 1)
|
||||||
//if (!!nextSelected) {
|
|
||||||
this.designer.setSelected(nextSelected)
|
this.designer.setSelected(nextSelected)
|
||||||
//}
|
|
||||||
|
|
||||||
|
this.designer.formWidget.deleteWidgetRef(widgetRefName) //删除组件ref!!!
|
||||||
this.designer.emitHistoryChange()
|
this.designer.emitHistoryChange()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -188,6 +188,7 @@
|
|||||||
|
|
||||||
removeFieldWidget() {
|
removeFieldWidget() {
|
||||||
if (!!this.parentList) {
|
if (!!this.parentList) {
|
||||||
|
const fieldRefName = this.designer.selectedWidgetName
|
||||||
let nextSelected = null
|
let nextSelected = null
|
||||||
if (this.parentList.length === 1) {
|
if (this.parentList.length === 1) {
|
||||||
if (!!this.parentWidget) {
|
if (!!this.parentWidget) {
|
||||||
@ -201,10 +202,9 @@
|
|||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.parentList.splice(this.indexOfParentList, 1)
|
this.parentList.splice(this.indexOfParentList, 1)
|
||||||
//if (!!nextSelected) {
|
|
||||||
this.designer.setSelected(nextSelected)
|
this.designer.setSelected(nextSelected)
|
||||||
//}
|
|
||||||
|
|
||||||
|
this.designer.formWidget.deleteWidgetRef(fieldRefName) //删除组件ref!!!
|
||||||
this.designer.emitHistoryChange()
|
this.designer.emitHistoryChange()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,7 @@
|
|||||||
|
|
||||||
removeFieldWidget() {
|
removeFieldWidget() {
|
||||||
if (!!this.parentList) {
|
if (!!this.parentList) {
|
||||||
|
const fieldRefName = this.designer.selectedWidgetName
|
||||||
let nextSelected = null
|
let nextSelected = null
|
||||||
if (this.parentList.length === 1) {
|
if (this.parentList.length === 1) {
|
||||||
if (!!this.parentWidget) {
|
if (!!this.parentWidget) {
|
||||||
@ -120,10 +121,9 @@
|
|||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.parentList.splice(this.indexOfParentList, 1)
|
this.parentList.splice(this.indexOfParentList, 1)
|
||||||
//if (!!nextSelected) {
|
|
||||||
this.designer.setSelected(nextSelected)
|
this.designer.setSelected(nextSelected)
|
||||||
//}
|
|
||||||
|
|
||||||
|
this.designer.formWidget.deleteWidgetRef(fieldRefName) //删除组件ref!!!
|
||||||
this.designer.emitHistoryChange()
|
this.designer.emitHistoryChange()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -184,6 +184,10 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
deleteWidgetRef(widgetRefName) {
|
||||||
|
delete this.widgetRefList[widgetRefName]
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -290,7 +290,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (modifiedFlag) {
|
if (modifiedFlag) {
|
||||||
this.$refs.formRef.clearWidgetRefList()
|
|
||||||
this.designer.emitHistoryChange()
|
this.designer.emitHistoryChange()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -305,7 +304,6 @@
|
|||||||
|
|
||||||
clearDesigner() {
|
clearDesigner() {
|
||||||
this.$refs.toolbarRef.clearFormWidget()
|
this.$refs.toolbarRef.clearFormWidget()
|
||||||
this.$refs.formRef.clearWidgetRefList()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
@ -444,6 +444,7 @@
|
|||||||
|
|
||||||
clearFormWidget() {
|
clearFormWidget() {
|
||||||
this.designer.clearDesigner()
|
this.designer.clearDesigner()
|
||||||
|
this.designer.formWidget.clearWidgetRefList()
|
||||||
},
|
},
|
||||||
|
|
||||||
previewForm() {
|
previewForm() {
|
||||||
|
@ -352,7 +352,7 @@ export function getDefaultFormConfig() {
|
|||||||
size: '',
|
size: '',
|
||||||
labelAlign: 'label-left-align',
|
labelAlign: 'label-left-align',
|
||||||
cssCode: '',
|
cssCode: '',
|
||||||
customClass: '',
|
customClass: [],
|
||||||
functions: '', //全局函数
|
functions: '', //全局函数
|
||||||
layoutType: 'PC',
|
layoutType: 'PC',
|
||||||
jsonVersion: 3,
|
jsonVersion: 3,
|
||||||
|
Loading…
Reference in New Issue
Block a user