gen : upgrade gen
This commit is contained in:
1 parent
80ef9e46ab
commit
89fe63c915
3 files changed
+31
-6
No files matched your search
@@ -168,8 +168,15 @@ func genTableInit(tablesList []string, i int, c *gin.Context) (tools.SysTables,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains(dbcolumn[i].ColumnType, "int") {
|
if strings.Contains(dbcolumn[i].ColumnType, "int") {
|
||||||
column.GoType = "int"
|
if strings.Contains(dbcolumn[i].ColumnKey, "PR") {
|
||||||
|
column.GoType = "int"
|
||||||
|
} else {
|
||||||
|
column.GoType = "string"
|
||||||
|
}
|
||||||
column.HtmlType = "input"
|
column.HtmlType = "input"
|
||||||
|
} else if strings.Contains(dbcolumn[i].ColumnType, "timestamp") {
|
||||||
|
column.GoType = "time.Time"
|
||||||
|
column.HtmlType = "datetime"
|
||||||
} else {
|
} else {
|
||||||
column.GoType = "string"
|
column.GoType = "string"
|
||||||
column.HtmlType = "input"
|
column.HtmlType = "input"
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ func CustomError(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
c.Status(statusCode)
|
c.Status(statusCode)
|
||||||
fmt.Println(
|
fmt.Println(
|
||||||
time.Now().Format("\n 2006-01-02 15:04:05.9999"),
|
time.Now().Format("2006-01-02 15:04:05.9999"),
|
||||||
"[ERROR]",
|
"[ERROR]",
|
||||||
c.Request.Method,
|
c.Request.Method,
|
||||||
c.Request.URL,
|
c.Request.URL,
|
||||||
|
|||||||
@@ -132,10 +132,14 @@
|
|||||||
<el-input v-model="form.{{.JsonField}}" placeholder="{{.ColumnComment}}"
|
<el-input v-model="form.{{.JsonField}}" placeholder="{{.ColumnComment}}"
|
||||||
{{if eq .IsEdit "false" -}}:disabled="isEdit" {{- end}}/>
|
{{if eq .IsEdit "false" -}}:disabled="isEdit" {{- end}}/>
|
||||||
{{- else if eq "select" .HtmlType -}}
|
{{- else if eq "select" .HtmlType -}}
|
||||||
<el-select
|
<el-select v-model="form.{{.JsonField}}"
|
||||||
v-model="form.{{.JsonField}}" {{if eq .IsEdit "false" -}} :disabled="isEdit" {{- end }}>
|
placeholder="请选择" {{if eq .IsEdit "false" -}} :disabled="isEdit" {{- end }}>
|
||||||
<el-option label="demo1" value="demo1"/>
|
<el-option
|
||||||
<el-option label="demo2" value="demo2"/>
|
v-for="dict in {{.JsonField}}Options"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="dict.dictValue"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
{{- else if eq "radio" .HtmlType -}}
|
{{- else if eq "radio" .HtmlType -}}
|
||||||
<el-radio-group v-model="form.{{.JsonField}}">
|
<el-radio-group v-model="form.{{.JsonField}}">
|
||||||
@@ -145,6 +149,20 @@
|
|||||||
:label="dict.dictValue"
|
:label="dict.dictValue"
|
||||||
>{{"{{"}} dict.dictLabel {{"}}"}}</el-radio>
|
>{{"{{"}} dict.dictLabel {{"}}"}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
{{- else if eq "datetime" .HtmlType -}}
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.{{.JsonField}}"
|
||||||
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="选择日期">
|
||||||
|
</el-date-picker>
|
||||||
|
{{- else if eq "textarea" .HtmlType -}}
|
||||||
|
<el-input
|
||||||
|
v-model="form.{{.JsonField}}"
|
||||||
|
type="textarea"
|
||||||
|
:rows="2"
|
||||||
|
placeholder="请输入内容">
|
||||||
|
</el-input>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
Reference in new issue
Block a user