feat: update auto render
This commit is contained in:
215
config/templates.yaml
Normal file
215
config/templates.yaml
Normal file
@@ -0,0 +1,215 @@
|
||||
# 模板配置文件
|
||||
# 支持自定义模板类型和字段渲染器配置
|
||||
|
||||
# 模板定义配置
|
||||
templates:
|
||||
articles:
|
||||
name: "文章列表"
|
||||
type: "list"
|
||||
description: "技术文章列表视图"
|
||||
fields:
|
||||
id: "number"
|
||||
title: "string"
|
||||
content: "markdown"
|
||||
category: "category"
|
||||
tags: "tag"
|
||||
created_at: "time"
|
||||
config:
|
||||
page_size: 15
|
||||
show_pagination: true
|
||||
show_search: true
|
||||
show_sort: true
|
||||
|
||||
logs:
|
||||
name: "系统日志"
|
||||
type: "table"
|
||||
description: "系统日志表格视图"
|
||||
fields:
|
||||
id: "number"
|
||||
level: "tag"
|
||||
message: "string"
|
||||
timestamp: "time"
|
||||
config:
|
||||
page_size: 50
|
||||
show_filter: true
|
||||
show_export: true
|
||||
|
||||
users:
|
||||
name: "用户管理"
|
||||
type: "card"
|
||||
description: "用户卡片视图"
|
||||
fields:
|
||||
id: "number"
|
||||
username: "string"
|
||||
email: "email"
|
||||
role: "tag"
|
||||
avatar: "image"
|
||||
created_at: "time"
|
||||
config:
|
||||
page_size: 12
|
||||
show_avatar: true
|
||||
show_actions: true
|
||||
|
||||
projects:
|
||||
name: "项目管理"
|
||||
type: "timeline"
|
||||
description: "项目进度时间轴视图"
|
||||
fields:
|
||||
id: "number"
|
||||
name: "string"
|
||||
description: "markdown"
|
||||
status: "tag"
|
||||
progress: "progress"
|
||||
start_date: "time"
|
||||
end_date: "time"
|
||||
config:
|
||||
page_size: 20
|
||||
show_progress: true
|
||||
|
||||
# 模板类型配置
|
||||
template_types:
|
||||
list:
|
||||
layout: "table"
|
||||
fields:
|
||||
default: "raw"
|
||||
time: "time"
|
||||
markdown: "markdown"
|
||||
tag: "tag"
|
||||
category: "category"
|
||||
email: "email"
|
||||
image: "image"
|
||||
progress: "progress"
|
||||
options:
|
||||
striped: true
|
||||
hover: true
|
||||
border: true
|
||||
responsive: true
|
||||
|
||||
card:
|
||||
layout: "grid"
|
||||
fields:
|
||||
default: "raw"
|
||||
time: "relative"
|
||||
markdown: "excerpt"
|
||||
tag: "badge"
|
||||
category: "chip"
|
||||
email: "email"
|
||||
image: "avatar"
|
||||
progress: "circle"
|
||||
options:
|
||||
columns: "3"
|
||||
spacing: "lg"
|
||||
shadow: "md"
|
||||
|
||||
timeline:
|
||||
layout: "timeline"
|
||||
fields:
|
||||
default: "raw"
|
||||
time: "relative"
|
||||
markdown: "summary"
|
||||
tag: "status"
|
||||
category: "timeline"
|
||||
email: "link"
|
||||
image: "thumbnail"
|
||||
progress: "bar"
|
||||
options:
|
||||
direction: "vertical"
|
||||
alignment: "left"
|
||||
alternating: false
|
||||
|
||||
table:
|
||||
layout: "table"
|
||||
fields:
|
||||
default: "raw"
|
||||
time: "time"
|
||||
markdown: "preview"
|
||||
tag: "tag"
|
||||
category: "category"
|
||||
email: "link"
|
||||
image: "thumbnail"
|
||||
progress: "bar"
|
||||
options:
|
||||
striped: true
|
||||
hover: true
|
||||
border: true
|
||||
pagination: true
|
||||
export: true
|
||||
|
||||
# 字段类型配置
|
||||
field_types:
|
||||
string:
|
||||
type: "text"
|
||||
renderer: "text"
|
||||
options:
|
||||
max_length: 100
|
||||
ellipsis: true
|
||||
validation:
|
||||
required: false
|
||||
|
||||
number:
|
||||
type: "number"
|
||||
renderer: "number"
|
||||
options:
|
||||
thousand_separator: true
|
||||
validation:
|
||||
min: 0
|
||||
|
||||
time:
|
||||
type: "datetime"
|
||||
renderer: "time"
|
||||
options:
|
||||
format: "2006-01-02 15:04:05"
|
||||
relative: true
|
||||
formatting:
|
||||
locale: "zh-CN"
|
||||
|
||||
markdown:
|
||||
type: "text"
|
||||
renderer: "markdown"
|
||||
options:
|
||||
max_length: 500
|
||||
excerpt: true
|
||||
validation:
|
||||
sanitize: true
|
||||
|
||||
tag:
|
||||
type: "enum"
|
||||
renderer: "badge"
|
||||
options:
|
||||
style: "rounded"
|
||||
size: "sm"
|
||||
validation:
|
||||
allowed_values: []
|
||||
|
||||
category:
|
||||
type: "string"
|
||||
renderer: "chip"
|
||||
options:
|
||||
style: "outlined"
|
||||
size: "md"
|
||||
|
||||
email:
|
||||
type: "email"
|
||||
renderer: "link"
|
||||
options:
|
||||
mailto: true
|
||||
validation:
|
||||
email: true
|
||||
|
||||
image:
|
||||
type: "url"
|
||||
renderer: "image"
|
||||
options:
|
||||
width: 50
|
||||
height: 50
|
||||
fit: "cover"
|
||||
|
||||
progress:
|
||||
type: "number"
|
||||
renderer: "progress"
|
||||
options:
|
||||
show_percentage: true
|
||||
color: "primary"
|
||||
formatting:
|
||||
unit: "%"
|
||||
max: 100
|
||||
Reference in New Issue
Block a user