|
@ -158,14 +158,34 @@ export default { |
|
|
this.FetchNoFormatField() |
|
|
this.FetchNoFormatField() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 递归查询字典名称对应的字典代码 |
|
|
|
|
|
getNode(tree, dicName) { |
|
|
|
|
|
for (let i = 0; i < tree.length; i++) { |
|
|
|
|
|
if (tree[i].dicName === dicName) { |
|
|
|
|
|
return tree[i] |
|
|
|
|
|
} else if (tree[i].childMenus) { |
|
|
|
|
|
return this.getNode(tree[i].childMenus, dicName) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
// 自动生成 |
|
|
// 自动生成 |
|
|
handleAuto() { |
|
|
handleAuto() { |
|
|
let string = '' |
|
|
let string = '' |
|
|
this.autoMatic.forEach(val => { |
|
|
|
|
|
|
|
|
this.autoMatic.forEach(async val => { |
|
|
if (!this.addOrUpdateForm[val.fieldName]) { |
|
|
if (!this.addOrUpdateForm[val.fieldName]) { |
|
|
string += '' |
|
|
string += '' |
|
|
} else { |
|
|
} else { |
|
|
string += '' + this.addOrUpdateForm[val.fieldName] + val.connector |
|
|
|
|
|
|
|
|
const fieldInfo = this.formPreviewData.find(element => element.fieldName === val.fieldName) |
|
|
|
|
|
if (fieldInfo.isInputClass === 'select' || fieldInfo.isInputClass === 'popover') { |
|
|
|
|
|
await FetchFindAllSubsetById({ id: fieldInfo.dictionaryConfigId.id }).then(res => { |
|
|
|
|
|
const option = this.getNode(res, this.addOrUpdateForm[val.fieldName]) |
|
|
|
|
|
if (option) { |
|
|
|
|
|
string += '' + option.dicCode + val.connector |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
string += '' + this.addOrUpdateForm[val.fieldName] + val.connector |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
this.formPreviewData.map(item => { |
|
|
this.formPreviewData.map(item => { |
|
|
if (item.isAutomatic) { |
|
|
if (item.isAutomatic) { |
|
@ -226,7 +246,7 @@ export default { |
|
|
// tree - select |
|
|
// tree - select |
|
|
selectTree(val) { |
|
|
selectTree(val) { |
|
|
this.addOrUpdateForm[this.treeCurrentFiled.fieldName] = val.dicName |
|
|
this.addOrUpdateForm[this.treeCurrentFiled.fieldName] = val.dicName |
|
|
this.treeName = val.dicName |
|
|
|
|
|
|
|
|
// this.treeName = val.dicName |
|
|
// 自动重复字段 - 是否重复 - treeSelect方式 |
|
|
// 自动重复字段 - 是否重复 - treeSelect方式 |
|
|
if (this.treeCurrentFiled.isRepeat) { |
|
|
if (this.treeCurrentFiled.isRepeat) { |
|
|
const params = { |
|
|
const params = { |
|
@ -358,7 +378,6 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// addOrUpdateForm[item.fieldName] = item.isDefaultValue |
|
|
|
|
|
</script> |
|
|
</script> |
|
|
<style rel="stylesheet/scss" lang="scss" scoped> |
|
|
<style rel="stylesheet/scss" lang="scss" scoped> |
|
|
.preview-content { |
|
|
.preview-content { |
|
|