本文档由 石墨办公 提供。
JSON结构type ColumnItem struct {
Name string `json:"name"` // 列名称
Type string `json:"type"` // 列类型
TypeOptions interface{} `json:"props"` // 列属性
GUID string `json:"guid"` // 列GUID
}SingleLineTextLongTexttype LongTextOptions struct {
EnableRichText bool `json:"enableRichText"` //是否开启富文本
}SingleChoicetype ChoiceOptions struct {
ChoiceOrder []string `json:"choiceOrder" mapstructure:"choiceOrder"` //选项guid列表
Choices map[string]*ChoiceMeta `json:"choices" mapstructure:"choices"` //选项信息
DisableColors bool `json:"disableColors" mapstructure:"disableColors"` //是否开启颜色标签
AllowAutoAdd bool `json:"allowAutoAdd" mapstructure:"allowAutoAdd"` //允许填写时新增选项
DefaultChoices []string `json:"defaultChoices" mapstructure:"defaultChoices"` //默认选项
}
type ChoiceMeta struct {
ID string `json:"guid" mapstructure:"guid"` //选项guid
Style *ChoiceStyle `json:"style"` //选项样式
Name string `json:"name"` //选项名称
Hidden bool `json:"hidden"` //是否隐藏
StatusType tablepb.StatusType `json:"statusType"` //状态类型
Locked bool `json:"locked"` //是否锁定
}
type ChoiceStyle struct {
Color string `json:"color"` //颜色
Background string `json:"background"` //背景
}color :whiteColor | blackColorwhiteColor = cssVars.gray.gray0blackColor = cssVars.transparency.transparency120background :#F9D7D7 | #F9DDCD | #FAEDBF | #DDF1C7 | #D3EDE3 | #CBE8F6 | #D1E2FD | #E1D9F6 | #F7D9E9 | #E7E7E7
#F3AEAE | #F4BB9C | #F6DB80 | #BBE290 | #A8DAC8 | #98D2ED | #A2C5FB | #C3B3EC | #EEB4D4 | #CFCFCF
#E85E5E | #E97839 | #EDB800 | #77C621 | #51B691 | #31A5DB | #468CF8 | #8767DA | #DE69A9 | #A0A0A0
#A80000 | #C76000 | #BF9500 | #549717 | #1B928A | #1085BC | #0065CF | #6614BD | #A60D75 | #666666MultipleChoiceCascadetype MultiDropdownOptions struct {
Levels []string `json:"levels" mapstructure:"levels"` //层级列表
Display string `json:"display" mapstructure:"display"` //展示方式
DisableColors bool `json:"disableColors" mapstructure:"disableColors"`//是否禁用颜色
DropdownList []*DropdownList `json:"dropdownList" mapstructure:"dropdownList"` //下拉选项树
}
type DropdownList struct {
Guid string `json:"guid" mapstructure:"guid"` //选项guid
Name string `json:"name" mapstructure:"name"` //选项名称
Style *ChoiceStyle `json:"style" mapstructure:"style"` //选项样式
Children []*DropdownList `json:"children" mapstructure:"children"` //子选项
}Numbertype NumberOptions struct {
Precision int32 `json:"precision"` //精度
HasThousandSeparator *bool `json:"hasThousandSeparator"` //是否开启千分位
}Percenttype PercentOptions struct {
Precision int32 `json:"precision"` //精度
ShowProgressBar bool `json:"showProgressBar"` //是否显示进度条
}Ratetype Rating struct {
Count int32 `json:"count"` //评分总数
Icon string `json:"icon"` //评分图标
Color []string `json:"color"` //评分颜色(前端未使用字段)
}icon :'star' | 'flame' | 'heart' | 'honor' | 'stone'CheckBoxtype CheckBoxOptions struct {
ShowLineThrough bool `json:"showLineThrough"` //是否开启勾选后改记录显示中划线
Shape *CheckBoxShapeOptions `json:"shape"` //复选框样式
}
type CheckBoxShapeOptions struct {
Type string `json:"type"` //类型
Color string `json:"color"` //颜色
}type :'check' | 'star' | 'close'color :无固定枚举,前端类型为 string;默认值来自 cssVars.colors?.text?.secondary || cssVars.text.secondary。LinkAttachmentFormulatype FormulaOptions struct {
FormulaText string `json:"formula" mapstructure:"formula"` //公式内容
Format *string `json:"format,omitempty" mapstructure:"format"`//展示格式
Error *string `json:"error,omitempty"` //错误信息
ShowProgressBar bool `json:"showProgressBar"` //是否显示进度条
}format生成方法 :#,##0.00_DateFormats0.00%@DateFormats 可选值为:yyyy/M/d HH:mm:ss
yyyy/M/d
yyyy/MM/dd
yyyy-M-d
y年M月d日 EEEE
M-d
M月d日
yyyy年M月
M月
EEEE
EEE
M-d-yyyy
M/d/yyyy
H:mm
HH:mm
H:mm:ss
HH:mm:ss
H:mm bbb
H:mm:ss bbb
MMM d
MMM d, yyyyAutoNumbertype AutoNumberOptions struct {
AutoType AutoType `json:"type" mapstructure:"type"` //自 动编号类型:increment/custom
Rules []*Rules `json:"rules" mapstructure:"rules"` //自定义编号规则
}
type Rules struct {
RuleType RuleType `json:"type" mapstructure:"type"` //规则类型:auto/date/text
Digit int64 `json:"digit" mapstructure:"digit"` //自增位数
Format string `json:"format" mapstructure:"format"` //日期格式
Text string `json:"text" mapstructure:"text"` //固定文本
}ReferenceRecordtype ReferenceRecordOptions struct {
ForeignTableGUID string `json:"tableGuid" mapstructure:"tableGuid"` //引用的表guid
ForeignBaseGUID string `json:"baseGuid,omitempty" mapstructure:"baseGuid"` //引用的文件guid,空表示同文件
ForeignTableColumnGUID string `json:"foreignTableColumnGuid,omitempty" mapstructure:"foreignTableColumnGuid"` //引用表的双向关联列guid
ForeignViewGUID string `json:"refViewGuid,omitempty" mapstructure:"refViewGuid"` //引用表视图guid
ReferenceView bool `json:"isRefToView" mapstructure:"isRefToView"` //是否关联引用表视图
IsMultiple bool `json:"isMultiple" mapstructure:"isMultiple"` //是否允许引用多行
Error *string `json:"error,omitempty" mapstructure:"error"` //错误信息
}RefRecordRollUptype RefRecordRollUpOptions struct {
ForeignTableColumnGUID string `json:"foreignRefFieldGuid" mapstructure:"foreignRefFieldGuid"` //引用表中参与公式计算的列guid
RelationColumnGUID string `json:"refFieldGuid" mapstructure:"refFieldGuid"` //本表关联引用列guid
FormulaText string `json:"formula" mapstructure:"formula"` //公式内容
Format *string `json:"format,omitempty" mapstructure:"format"` //展示格式
Error *string `json:"error,omitempty" mapstructure:"error"` //错误信息
ShowProgressBar bool `json:"showProgressBar"` //是否显示进度条
}Collaboratortype CollaboratorOptions struct {
IsMultiple bool `json:"isMultiple"` //是否允许多选
IsNotify bool `json:"isNotify"` //是否通知联系人
AssignedToMe bool `json:"assignedToMe"` //是否分配给我(已废弃字段)
}FirstModifiedByLastModifiedByDatetype DateOptions struct {
DateFormat string `json:"dateFormat,omitempty"` //日期格式
TimeFormat string `json:"timeFormat,omitempty"` //时间格式
AutoFill bool `json:"isAutoFill"` //是否自动填充
}FirstModifiedAttype ModifiedOptions struct {
DateFormat string `json:"dateFormat" mapstructure:"dateFormat"` //日期格式
TimeFormat string `json:"timeFormat,omitempty" mapstructure:"timeFormat"` //时间格式
RefGuids []string `json:"fieldGuids" mapstructure:"fieldGuids"` //跟踪字段guid列表
Error string `json:"error,omitempty" mapstructure:"error"` //错误信息
}LastModifiedAt