This commit is contained in:
Daniel 2025-06-11 17:39:32 +08:00
parent 23c01d0d3f
commit a72c257227
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
6 changed files with 163 additions and 272 deletions

View file

@ -16,6 +16,17 @@
package av
// Item 描述了一个项目的接口。
// 项目可以表格行、画廊卡片或其他视图类型的实体。
type Item interface {
// GetBlockValue 返回主键的值。
GetBlockValue() *Value
// GetID 返回项目的 ID。
GetID() string
}
// BaseLayout 描述了布局的基础结构。
type BaseLayout struct {
Spec int `json:"spec"` // 布局格式版本

View file

@ -112,6 +112,10 @@ type GalleryFieldValue struct {
*BaseValue
}
func (card *GalleryCard) GetID() string {
return card.ID
}
func (card *GalleryCard) GetBlockValue() (ret *Value) {
for _, v := range card.Values {
if KeyTypeBlock == v.ValueType {

View file

@ -87,6 +87,10 @@ type TableCell struct {
BgColor string `json:"bgColor"` // 单元格背景颜色
}
func (row *TableRow) GetID() string {
return row.ID
}
func (row *TableRow) GetBlockValue() (ret *Value) {
for _, cell := range row.Cells {
if KeyTypeBlock == cell.ValueType {