From 969ecbb0f3f10cb3d6683a39380ef75f48ae0539 Mon Sep 17 00:00:00 2001 From: v-yanxingshuai1 Date: Fri, 19 Sep 2025 15:19:24 +0800 Subject: [PATCH] =?UTF-8?q?operation=5Ftranslate=20=E5=9C=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=94=9F=E6=88=90=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=8E=B7=E5=8F=96=E5=88=B0comment=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/admin/modules/table/generators.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/admin/modules/table/generators.go b/plugins/admin/modules/table/generators.go index 51ade3d44..1fc943d76 100644 --- a/plugins/admin/modules/table/generators.go +++ b/plugins/admin/modules/table/generators.go @@ -45,7 +45,6 @@ func NewSystemTable(conn db.Connection, c *config.Config) *SystemTable { return &SystemTable{conn: conn, c: c} } - var filterType = types.FilterType{NoIcon: true, HeadWidth: 4, InputWidth: 8} func (s *SystemTable) GetManagerTable(ctx *context.Context) (managerTable Table) { @@ -1415,7 +1414,7 @@ func (s *SystemTable) GetGenerateForm(ctx *context.Context) (generateTool Table) connName = ctx.FormValue("conn") driver = s.c.Databases[connName].Driver conn = db.GetConnectionFromService(services.Get(driver)) - columnsModel, _ = db.WithDriverAndConnection(connName, conn).Table(tableName).ShowColumns() + columnsModel, _ = db.WithDriverAndConnection(connName, conn).Table(tableName).ShowColumnsWithComment(conn.GetConfig(connName).Name) fieldField = "Field" typeField = "Type" @@ -1442,7 +1441,12 @@ func (s *SystemTable) GetGenerateForm(ctx *context.Context) (generateTool Table) for i, model := range columnsModel { typeName := getType(model[typeField].(string)) - headName[i] = cases.Title(textLang.Und).String(model[fieldField].(string)) + comment, _ := model["Comment"].(string) + if comment != "" { + headName[i] = comment + } else { + headName[i] = cases.Title(textLang.Und).String(model[fieldField].(string)) + } fieldName[i] = model[fieldField].(string) dbTypeList[i] = typeName formTypeList[i] = form.GetFormTypeFromFieldType(db.DT(strings.ToUpper(typeName)),