Browse Source

自动生成bug-01

master
xuhuajiao 3 years ago
parent
commit
04aadca687
  1. 32
      src/views/components/category/PreviewForm.vue

32
src/views/components/category/PreviewForm.vue

@ -129,6 +129,8 @@ export default {
setParentsId: null,
result: null,
autoMatic: null,
autoEditString: [],
isAutoLastString: null,
normalizer(node) {
if (node.childMenus == null || node.childMenus === 'null') {
delete node.childMenus
@ -216,7 +218,20 @@ export default {
}
this.formPreviewData.map(item => {
if (item.isAutomatic) {
this.$set(this.addOrUpdateForm, item.fieldName, string)
this.autoEditString = []
this.autoEditString.push(this.addOrUpdateForm[item.fieldName])
console.log('autoEditString', this.autoEditString)
console.log(this.autoEditString[0].lastIndexOf('-'))
this.isAutoLastString = this.autoEditString[0].substring(this.autoEditString[0].lastIndexOf('-') + 1)
console.log('autoEditString', this.isAutoLastString)
let lastString
if (this.isAutoLastString) {
lastString = string + this.isAutoLastString
} else {
lastString = string
}
this.$set(this.addOrUpdateForm, item.fieldName, lastString)
}
})
})
@ -225,7 +240,7 @@ export default {
FetchNoFormatField() {
getNoFormatField({ categoryId: this.selectedCategory.id }).then(res => {
this.autoMatic = res
this.handleAuto()
// this.handleAuto()
})
},
//
@ -260,9 +275,13 @@ export default {
}
this.handlerIsRepeat(params, item)
}
if (!item.isAutomatic) {
const index = this.autoMatic.findIndex(i => item.fieldName === i.fieldName)
if (index !== -1) {
this.handleAuto()
}
}
},
// tree - open
openTree(item) {
@ -284,7 +303,10 @@ export default {
}
this.handlerIsRepeat(params, this.treeCurrentFiled)
}
const index = this.autoMatic.findIndex(i => this.treeCurrentFiled.fieldName === i.fieldName)
if (index !== -1) {
this.handleAuto()
}
},
// popover - table
clickRowHandler(row) {
@ -298,7 +320,11 @@ export default {
}
this.$refs.popoverTable.clearSelection()
this.popoverVisible = false
const index = this.autoMatic.findIndex(i => this.currentFieldName === i.fieldName)
if (index !== -1) {
this.handleAuto()
}
},
// popover -
handleCurrentFieldName(item) {
@ -384,7 +410,7 @@ export default {
'parentsId': this.setParentsId,
'jsonString': JSON.stringify(this.addOrUpdateForm)
}
// console.log(this.addOrUpdateForm)
console.log(this.addOrUpdateForm)
edit(params).then(res => {
if (res) {
this.$message.success(res)

Loading…
Cancel
Save