@@ -13,6 +13,7 @@ import (
13
13
"github.com/GoAdminGroup/go-admin/plugins/admin/modules"
14
14
form2 "github.com/GoAdminGroup/go-admin/plugins/admin/modules/form"
15
15
"github.com/GoAdminGroup/go-admin/template/types/form"
16
+ "github.com/GoAdminGroup/go-admin/template/types/table"
16
17
"html"
17
18
"html/template"
18
19
"strconv"
@@ -325,6 +326,9 @@ type Field struct {
325
326
Filterable bool
326
327
Hide bool
327
328
329
+ EditType table.Type
330
+ EditOptions []map [string ]string
331
+
328
332
FieldDisplay
329
333
}
330
334
@@ -409,6 +413,7 @@ func (i *InfoPanel) AddField(head, field string, typeName db.DatabaseType) *Info
409
413
TypeName : typeName ,
410
414
Sortable : false ,
411
415
EditAble : false ,
416
+ EditType : table .Text ,
412
417
FieldDisplay : FieldDisplay {
413
418
Display : func (value FieldModel ) interface {} {
414
419
return value .Value
@@ -438,8 +443,16 @@ func (i *InfoPanel) FieldSortable() *InfoPanel {
438
443
return i
439
444
}
440
445
441
- func (i * InfoPanel ) FieldEditAble () * InfoPanel {
446
+ func (i * InfoPanel ) FieldEditOptions (options []map [string ]string ) * InfoPanel {
447
+ i .FieldList [i .curFieldListIndex ].EditOptions = options
448
+ return i
449
+ }
450
+
451
+ func (i * InfoPanel ) FieldEditAble (editType ... table.Type ) * InfoPanel {
442
452
i .FieldList [i .curFieldListIndex ].EditAble = true
453
+ if len (editType ) > 0 {
454
+ i .FieldList [i .curFieldListIndex ].EditType = editType [0 ]
455
+ }
443
456
return i
444
457
}
445
458
@@ -762,7 +775,7 @@ func (f *FormPanel) FieldSubstr(start int, end int) *FormPanel {
762
775
return f
763
776
}
764
777
765
- func (f * FormPanel ) FieldToTitle () * FormPanel {
778
+ func (f * FormPanel ) FieldToTitlCustomJse () * FormPanel {
766
779
f .FieldList [f .curFieldListIndex ].DisplayProcessChains = f .FieldList [f .curFieldListIndex ].AddToTitle ()
767
780
return f
768
781
}
0 commit comments