smart

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.1.0

type Action struct {
	Type       string         `json:"type,omitempty"`
	Link       string         `json:"link,omitempty"`
	LinkFunc   string         `json:"link_func,omitempty"`
	Params     map[string]any `json:"params,omitempty"`
	ParamsFunc string         `json:"params_func,omitempty"`
	Script     string         `json:"script,omitempty"`
	Page       string         `json:"page,omitempty"`
	Dialog     string         `json:"dialog,omitempty"`
	External   string         `json:"external,omitempty"`
}

type AutoOption

type AutoOption struct {
	Label string `json:"label"`
	Value any    `json:"value"`
}

type Button added in v0.1.0

type Button struct {
	Icon   string  `json:"icon,omitempty"`
	Label  string  `json:"label,omitempty"`
	Title  string  `json:"title,omitempty"`
	Action *Action `json:"action,omitempty"`
}

type Chart added in v0.1.0

type Chart struct {
	Type    string           `json:"type"`
	Options map[string]any   `json:"options,omitempty"`
	Legend  bool             `json:"legend,omitempty"`
	Tooltip bool             `json:"tooltip,omitempty"`
	Time    bool             `json:"time,omitempty"`
	Radar   map[string]int64 `json:"radar,omitempty"`
}

type Column

type Column struct {
	Key      string   `json:"key,omitempty"`
	Label    string   `json:"label,omitempty"`
	Keyword  bool     `json:"keyword,omitempty"`
	Sortable bool     `json:"sortable,omitempty"`
	Filter   []Filter `json:"filter,omitempty"`
	Date     bool     `json:"date,omitempty"`
	Ellipsis bool     `json:"ellipsis,omitempty"`
	Break    bool     `json:"break,omitempty"`
	Action   *Action  `json:"action,omitempty"`
}

type Field

type Field struct {
	Key         string `json:"key"`
	Label       string `json:"label"`
	Type        string `json:"type,omitempty"` //type object array
	Default     any    `json:"default,omitempty"`
	Placeholder string `json:"placeholder,omitempty"`
	Tips        string `json:"tips,omitempty"`

	Clear    bool `json:"clear,omitempty"`
	Disabled bool `json:"disabled,omitempty"`
	Hidden   bool `json:"hidden,omitempty"`

	Array    bool    `json:"array,omitempty"`
	Children []Field `json:"children,omitempty"` //子级?

	Required bool    `json:"required,omitempty"`
	Min      float64 `json:"min,omitempty"`
	Max      float64 `json:"max,omitempty"`
	Step     float64 `json:"step,omitempty"`

	Multiple bool `json:"multiple,omitempty"`

	Auto    []AutoOption   `json:"auto,omitempty"`
	Options []SelectOption `json:"options,omitempty"`
	Tree    []TreeOption   `json:"tree,omitempty"`

	Change string `json:"change,omitempty"`

	Time       bool   `json:"time,omitempty"`
	TimeFormat string `json:"time_format,omitempty"`

	Pattern string `json:"pattern,omitempty"`

	Upload string `json:"upload,omitempty"` //上传路径
}

type Filter added in v0.1.0

type Filter struct {
	Text  string `json:"text,omitempty"`
	Value any    `json:"value,omitempty"`
}

type Form

type Form struct {
	Fields []Field `json:"fields"`
}

type Info

type Info struct {
	Items []Item `json:"items"`
}

type Item added in v0.1.0

type Item struct {
	Key     string         `json:"key"`
	Type    string         `json:"type,omitempty"` //type object array
	Label   string         `json:"label"`
	Span    int            `json:"span,omitempty"`
	Options map[string]any `json:"options,omitempty"`
	Action  *Action        `json:"action,omitempty"`
}

type Operator added in v0.1.0

type Operator struct {
	Icon     string  `json:"icon,omitempty"`
	Label    string  `json:"label,omitempty"`
	Title    string  `json:"title,omitempty"`
	Action   *Action `json:"action,omitempty"`
	Confirm  string  `json:"confirm,omitempty"`
	External bool    `json:"external,omitempty"`
}

type Page

type Page struct {
	Id       string `json:"id"`
	Title    string `json:"title"`
	Template string `json:"template"` //模板 table form info chart

	*Toolbar

	*Table
	*Form
	*Info
	*Chart

	SearchUrl  string         `json:"search_url,omitempty"` //查询URL
	SearchFunc string         `json:"search_func ,omitempty"`
	LoadUrl    string         `json:"load_url,omitempty"` //加载URL
	LoadFunc   string         `json:"load_func ,omitempty"`
	SubmitUrl  string         `json:"submit_url,omitempty"` //提交URL
	SubmitFunc string         `json:"submit_func ,omitempty"`
	Params     map[string]any `json:"params,omitempty"` //页面参数
	ParamsFunc string         `json:"params_func,omitempty"`

	Children []*Page `json:"children,omitempty"`
}

type SelectOption

type SelectOption struct {
	Label    string `json:"label"`
	Value    any    `json:"value"`
	Title    string `json:"title,omitempty"`
	Disabled bool   `json:"disabled,omitempty"`
	Hide     bool   `json:"hide,omitempty"`
	Key      any    `json:"key,omitempty"`
}

type Table

type Table struct {
	Buttons   []Button   `json:"buttons,omitempty"`
	Columns   []Column   `json:"columns,omitempty"`
	Operators []Operator `json:"operators,omitempty"`
}

type Toolbar added in v0.1.0

type Toolbar struct {
	Fields []Field `json:"fields"`
}

type TreeOption added in v0.1.0

type TreeOption struct {
	Title      string        `json:"title,omitempty"`
	Key        string        `json:"key,omitempty"`
	IsLeaf     bool          `json:"isLeaf,omitempty"`
	Selectable bool          `json:"selectable,omitempty"`
	Disabled   bool          `json:"disabled,omitempty"`
	Expanded   bool          `json:"expanded,omitempty"`
	Children   []*TreeOption `json:"children,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL