Skip to content

Commit

Permalink
modify cli
Browse files Browse the repository at this point in the history
  • Loading branch information
cg33 committed Sep 10, 2019
1 parent 0ef276b commit 0740c8e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions admincli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ func generateFile(table string, conn db.Connection, fieldField, typeField, packa
import (
"github.com/chenhg5/go-admin/plugins/admin/modules/table"
"github.com/chenhg5/go-admin/template/types"
"github.com/chenhg5/go-admin/template/types/form"
)
func Get` + strings.Title(table) + `Table() table.Table {
Expand Down Expand Up @@ -408,9 +409,9 @@ func Get` + strings.Title(table) + `Table() table.Table {

for _, model := range columnsModel {

formType := "text"
formType := "form.Text"
if model[fieldField].(string) == "id" {
formType = "default"
formType = "form.Default"
}

content += `{
Expand All @@ -419,7 +420,7 @@ func Get` + strings.Title(table) + `Table() table.Table {
TypeName: "` + GetType(model[typeField].(string)) + `",
Default: "",
Editable: true,
FormType: "` + formType + `",
FormType: ` + formType + `,
FilterFn: func(model types.RowModel) interface{} {
return model.Value
},
Expand Down

0 comments on commit 0740c8e

Please sign in to comment.