package base

import (
	"git.fsdpf.net/go/contracts/res_type"
)

type PrintTemplateField struct {
	Uuid              string                    `db:"uuid"`
	PrintTemplateUuid string                    `db:"print_template_uuid"` // 所属打印模板UUID
	Label             res_type.ResFieldByString `db:"label"`               // 字段标签
	Code              string                    `db:"code"`                // 字段名称
	CodeResource      string                    `db:"codeResource"`        // 字段所属资源
	Category          string                    `db:"category"`            // 字段控件类型
	Alias             string                    `db:"alias"`               // 字段别名
	IsExpr            bool                      `db:"isExpr"`              // 字段名是否为SQL表达式
	FieldDataType     string                    `db:"fieldDataType"`       // 字段数据类型
	WidgetByJs        string                    `db:"widgetByJs"`          // 前端数据渲染控件
	WidgetByJsSetting res_type.ResFieldByMap    `db:"widgetByJsSetting"`   // 前端数据渲染控件设置参数
	UpdatedAt         string                    `db:"updated_at"`
	CreatedAt         string                    `db:"created_at"`
}

type GetPrintTemplateFields func(uuid string) []PrintTemplateField