代码拉取完成,页面将自动刷新
同步操作将从 go-admin/go-admin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package datamodel
import (
"github.com/chenhg5/go-admin/plugins/admin/models"
"github.com/chenhg5/go-admin/template/types"
)
func GetAuthorsTable() (authorsTable models.Table) {
authorsTable.Info.FieldList = []types.FieldStruct{
{
Head: "ID",
Field: "id",
TypeName: "int",
Sortable: true,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
{
Head: "First Name",
Field: "first_name",
TypeName: "varchar",
Sortable: false,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
{
Head: "Last Name",
Field: "last_name",
TypeName: "varchar",
Sortable: false,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
{
Head: "Email",
Field: "email",
TypeName: "varchar",
Sortable: false,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
{
Head: "Birthdate",
Field: "birthdate",
TypeName: "date",
Sortable: false,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
{
Head: "Added",
Field: "added",
TypeName: "timestamp",
Sortable: false,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
}
authorsTable.Info.Table = "authors"
authorsTable.Info.Title = "Authors"
authorsTable.Info.Description = "Authors"
authorsTable.Form.FormList = []types.FormStruct{
{
Head: "ID",
Field: "id",
TypeName: "int",
Default: "",
Editable: false,
FormType: "default",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "First Name",
Field: "first_name",
TypeName: "varchar",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "Name",
Field: "name",
TypeName: "varchar",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "Description",
Field: "description",
TypeName: "varchar",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "Email",
Field: "email",
TypeName: "varchar",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "Birthdate",
Field: "birthdate",
TypeName: "date",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "Added",
Field: "added",
TypeName: "timestamp",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
}
authorsTable.Form.Table = "authors"
authorsTable.Form.Title = "Authors"
authorsTable.Form.Description = "Authors"
authorsTable.ConnectionDriver = "mysql"
return
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。