修复了自动化代码公用字典出现多次创建字典相关代码的bug
This commit is contained in:
蒋吉兆
2021-11-14 22:38:13 +08:00
parent cd41d3b5c7
commit 3a017741d2
4 changed files with 24 additions and 16 deletions

View File

@@ -49,10 +49,8 @@ export default {
data() {
return {
type: '',
{{- range .Fields}}
{{- if .DictType }}
{{ .DictType }}Options: [],
{{- end }}
{{- range $index, $element := .DictTypes}}
{{ $element }}Options: [],
{{- end }}
formData: {
{{- range .Fields}}
@@ -86,10 +84,8 @@ export default {
} else {
this.type = 'create'
}
{{- range .Fields }}
{{- if .DictType }}
await this.getDict('{{.DictType}}')
{{- end }}
{{- range $index, $element := .DictTypes }}
await this.getDict('{{$element}}')
{{- end }}
},
methods: {

View File

@@ -144,10 +144,8 @@ export default {
type: '',
deleteVisible: false,
multipleSelection: [],
{{- range .Fields}}
{{- if .DictType }}
{{ .DictType }}Options: [],
{{- end }}
{{- range $index, $element := .DictTypes }}
{{ $element }}Options: [],
{{- end }}
formData: {
{{- range .Fields}}
@@ -172,10 +170,8 @@ export default {
},
async created() {
await this.getTableData()
{{- range .Fields }}
{{- if .DictType }}
await this.getDict('{{.DictType}}')
{{- end }}
{{- range $index, $element := .DictTypes }}
await this.getDict('{{$element}}')
{{- end }}
},
methods: {