feat:update template

This commit is contained in:
zhangwenjian committed 2020-07-25 14:59:30 +08:00
1 parent 485110f214
commit caab6097b8
2 files changed
+12 -5

No files matched your search

+6 -5
View File
@@ -183,7 +183,7 @@
isEdit: false,
// 类型数据字典
typeOptions: [],
list{{.ClassName}}: [],
{{.ModuleName}}List: [],
{{range .Columns}}
{{- if ne .DictType "" -}}
{{.JsonField}}Options: [],
@@ -222,11 +222,13 @@
this.getList()
{{range .Columns}}
{{- if ne .DictType "" -}}
this.getDicts('{{.DictType}}').then(response => {
this.{{.JsonField}}Options = response.data
})
{{ end -}}
{{- end -}}
{{- end }}
},
methods: {
/** 查询参数列表 */
@@ -256,8 +258,7 @@
{{- else if eq .GoField "UpdateBy" -}}
{{- else if eq .GoField "CreateBy" -}}
{{- else }}
{{.JsonField}}:
undefined,
{{.JsonField}}: undefined,
{{- end }}
{{- end -}}
{{- end }}
@@ -269,7 +270,7 @@
{{.JsonField}}Format(row) {
return this.selectDictLabel(this.{{.JsonField}}Options, row.{{.JsonField}})
},
{{- end -}}
{{ end -}}
{{- end }}
/** 搜索按钮操作 */
+6
View File
@@ -29,6 +29,12 @@ func GetCurrentTime() time.Time {
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) {
if b, err := json.Marshal(e); err == nil {
return string(b), err