feat:update template
This commit is contained in:
1 parent
485110f214
commit
caab6097b8
2 files changed
+12
-5
No files matched your search
@@ -183,7 +183,7 @@
|
|||||||
isEdit: false,
|
isEdit: false,
|
||||||
// 类型数据字典
|
// 类型数据字典
|
||||||
typeOptions: [],
|
typeOptions: [],
|
||||||
list{{.ClassName}}: [],
|
{{.ModuleName}}List: [],
|
||||||
{{range .Columns}}
|
{{range .Columns}}
|
||||||
{{- if ne .DictType "" -}}
|
{{- if ne .DictType "" -}}
|
||||||
{{.JsonField}}Options: [],
|
{{.JsonField}}Options: [],
|
||||||
@@ -222,11 +222,13 @@
|
|||||||
this.getList()
|
this.getList()
|
||||||
{{range .Columns}}
|
{{range .Columns}}
|
||||||
{{- if ne .DictType "" -}}
|
{{- if ne .DictType "" -}}
|
||||||
|
|
||||||
this.getDicts('{{.DictType}}').then(response => {
|
this.getDicts('{{.DictType}}').then(response => {
|
||||||
this.{{.JsonField}}Options = response.data
|
this.{{.JsonField}}Options = response.data
|
||||||
})
|
})
|
||||||
|
|
||||||
|
{{ end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end }}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询参数列表 */
|
/** 查询参数列表 */
|
||||||
@@ -256,8 +258,7 @@
|
|||||||
{{- else if eq .GoField "UpdateBy" -}}
|
{{- else if eq .GoField "UpdateBy" -}}
|
||||||
{{- else if eq .GoField "CreateBy" -}}
|
{{- else if eq .GoField "CreateBy" -}}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{.JsonField}}:
|
{{.JsonField}}: undefined,
|
||||||
undefined,
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -269,7 +270,7 @@
|
|||||||
{{.JsonField}}Format(row) {
|
{{.JsonField}}Format(row) {
|
||||||
return this.selectDictLabel(this.{{.JsonField}}Options, row.{{.JsonField}})
|
return this.selectDictLabel(this.{{.JsonField}}Options, row.{{.JsonField}})
|
||||||
},
|
},
|
||||||
{{- end -}}
|
{{ end -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ func GetCurrentTime() time.Time {
|
|||||||
return time.Now()
|
return time.Now()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FormatTimeStr(timeStr string) (string, error) {
|
||||||
|
loc, _ := time.LoadLocation("Local")
|
||||||
|
theTime, err := time.ParseInLocation("2006-01-02T15:04:05.000Z", timeStr, loc)
|
||||||
|
return theTime.Format("2006/01/02 15:04:05"), err
|
||||||
|
}
|
||||||
|
|
||||||
func StructToJsonStr(e interface{}) (string, error) {
|
func StructToJsonStr(e interface{}) (string, error) {
|
||||||
if b, err := json.Marshal(e); err == nil {
|
if b, err := json.Marshal(e); err == nil {
|
||||||
return string(b), err
|
return string(b), err
|
||||||
|
|||||||
Reference in new issue
Block a user