3
3
<el-form :model =" formData" label-position =" right" label-width =" 80px" >
4
4
{ {- range .Fields} }
5
5
<el-form-item label =" { { .FieldDesc} } :" >
6
- { { if eq .FieldType " bool" - } }
7
- <el-switch active-color =" #13ce66" inactive-color =" #ff4949" active-text =" 是" inactive-text =" 否" v-model =" formData.{ { .FieldJson} } " clearable ></el-switch >
8
- { { end - } }
9
- { { if eq .FieldType " string" - } }
10
- <el-input v-model =" formData.{ { .FieldJson} } " clearable placeholder =" 请输入" />
11
- { { end - } }
12
- { { if eq .FieldType " int" - } }
13
- { { if .DictType - } }
14
- <el-select v-model =" formData.{ { .FieldJson } } " placeholder =" 请选择" clearable >
15
- <el-option v-for =" (item,key) in { { .DictType } } Options" :key =" key" :label =" item.label" :value =" item.value" ></ el-option >
16
- </el-select >
17
- { { else - } }
18
- <el-input v-model.number =" formData.{ { .FieldJson } } " clearable placeholder =" 请输入" />
19
- { { end - } }
20
- { { end - } }
21
- { { if eq .FieldType " time.Time" } }
22
- <el-date-picker type =" date" placeholder =" 选择日期" v-model =" formData.{ { .FieldJson } } " clearable ></el-date-picker >
23
- { { end - } }
24
- { { if eq .FieldType " float64" } }
25
- <el-input-number v-model =" formData.{ { .FieldJson } } " :precision =" 2" clearable ></el-input-number >
26
- { { end - } }
6
+ { {- if eq .FieldType " bool" } }
7
+ <el-switch active-color =" #13ce66" inactive-color =" #ff4949" active-text =" 是" inactive-text =" 否" v-model =" formData.{ { .FieldJson} } " clearable ></el-switch >
8
+ { {- end } }
9
+ { {- if eq .FieldType " string" } }
10
+ <el-input v-model =" formData.{ { .FieldJson} } " clearable placeholder =" 请输入" />
11
+ { {- end } }
12
+ { {- if eq .FieldType " int" } }
13
+ { {- if .DictType } }
14
+ <el-select v-model =" formData.{ { .FieldJson } } " placeholder =" 请选择" clearable >
15
+ <el-option v-for =" (item,key) in { { .DictType } } Options" :key =" key" :label =" item.label" :value =" item.value" / >
16
+ </el-select >
17
+ { {- else } }
18
+ <el-input v-model.number =" formData.{ { .FieldJson } } " clearable placeholder =" 请输入" />
19
+ { {- end } }
20
+ { {- end } }
21
+ { {- if eq .FieldType " time.Time" } }
22
+ <el-date-picker type =" date" placeholder =" 选择日期" v-model =" formData.{ { .FieldJson } } " clearable ></el-date-picker >
23
+ { {- end } }
24
+ { {- if eq .FieldType " float64" } }
25
+ <el-input-number v-model =" formData.{ { .FieldJson } } " :precision =" 2" clearable ></el-input-number >
26
+ { {- end } }
27
27
</el-form-item >
28
- { { end - } }
28
+ { {- end } }
29
29
<el-form-item >
30
30
<el-button size =" mini" type =" primary" @click =" save" >保存</el-button >
31
31
<el-button size =" mini" type =" primary" @click =" back" >返回</el-button >
32
32
</el-form-item >
33
33
</el-form >
34
- </div >
34
+ </div >
35
35
</template >
36
36
37
37
<script >
@@ -47,29 +47,29 @@ export default {
47
47
data() {
48
48
return {
49
49
type: ' ' ,
50
- { { range .Fields} }
50
+ { { - range .Fields} }
51
51
{ { - if .DictType } }
52
52
{ { .DictType } } Options: [],
53
- { { end - } }
54
- { { end - } }
53
+ { { - end } }
54
+ { { - end } }
55
55
formData: {
56
- { { range .Fields} }
57
- { { - if eq .FieldType " bool" - } }
58
- { { .FieldJson} } : false ,
59
- { { end - } }
60
- { { - if eq .FieldType " string" - } }
61
- { { .FieldJson} } : ' ' ,
62
- { { end - } }
63
- { { - if eq .FieldType " int" - } }
64
- { { .FieldJson} } : 0,
65
- { { end - } }
66
- { { - if eq .FieldType " time.Time" - } }
67
- { { .FieldJson} } : new Date(),
68
- { { end - } }
69
- { { - if eq .FieldType " float64" - } }
70
- { { .FieldJson} } : 0,
71
- { { end - } }
72
- { { end } }
56
+ { { - range .Fields} }
57
+ { { - if eq .FieldType " bool" } }
58
+ { { .FieldJson} } : false ,
59
+ { { - end } }
60
+ { { - if eq .FieldType " string" } }
61
+ { { .FieldJson} } : ' ' ,
62
+ { { - end } }
63
+ { { - if eq .FieldType " int" } }
64
+ { { .FieldJson} } : 0,
65
+ { { - end } }
66
+ { { - if eq .FieldType " time.Time" } }
67
+ { { .FieldJson} } : new Date(),
68
+ { { - end } }
69
+ { { - if eq .FieldType " float64" } }
70
+ { { .FieldJson} } : 0,
71
+ { { - end } }
72
+ { { - end } }
73
73
}
74
74
}
75
75
} ,
@@ -84,10 +84,10 @@ export default {
84
84
} else {
85
85
this.type = ' create'
86
86
}
87
- { { range .Fields - } }
87
+ { { - range .Fields } }
88
88
{ { - if .DictType } }
89
- await this.getDict(" { { .DictType} } " )
90
- { { end - } }
89
+ await this.getDict(' { { .DictType} } ' )
90
+ { { - end } }
91
91
{ { - end } }
92
92
} ,
93
93
methods: {
@@ -119,4 +119,4 @@ export default {
119
119
</script >
120
120
121
121
<style >
122
- </style >
122
+ </style >
0 commit comments