Loading...
Loading...
Compare original and translation side by side
.page.yml.page.amis.json.page.yml.page.amis.json.page.yml.page.amis.json.page.yml.page.amis.jsonsteedos-packages/
└── my-package/
└── main/default/
└── pages/
├── sales_dashboard.page.yml # Page metadata
├── sales_dashboard.page.amis.json # Amis UI schema
├── order_report.page.yml
└── order_report.page.amis.jsonsteedos-packages/
└── my-package/
└── main/default/
└── pages/
├── sales_dashboard.page.yml # 页面元数据
├── sales_dashboard.page.amis.json # Amis UI schema
├── order_report.page.yml
└── order_report.page.amis.jsonundefinedundefinedundefinedundefined// pages/sales_dashboard.page.amis.json
{
"type": "page",
"title": "Sales Dashboard",
"body": [
{
"type": "service",
"api": "/api/v4/stats/sales-summary",
"body": [
{
"type": "tpl",
"tpl": "<h2>Total Sales: ¥${total}</h2>"
}
]
}
]
}// pages/sales_dashboard.page.amis.json
{
"type": "page",
"title": "Sales Dashboard",
"body": [
{
"type": "service",
"api": "/api/v4/stats/sales-summary",
"body": [
{
"type": "tpl",
"tpl": "<h2>Total Sales: ¥${total}</h2>"
}
]
}
]
}| Property | Type | Required | Description |
|---|---|---|---|
| string | Yes | Unique page name |
| string | Yes | Display label |
| string | Yes | ⚠️ MUST be one of: |
| string | Yes | ⚠️ MUST be |
| boolean | Yes | Enable/disable page |
| boolean | No | Lock from editing |
| string | No | Associated object (for record/list types) |
| array | No | Desktop/mobile display settings |
| array | No | Widget configurations |
| 属性 | 类型 | 必填 | 描述 |
|---|---|---|---|
| string | 是 | 唯一页面名称 |
| string | 是 | 显示标签 |
| string | 是 | ⚠️ 必须为以下值之一: |
| string | 是 | ⚠️ 必须为 |
| boolean | 是 | 启用/禁用页面 |
| boolean | 否 | 锁定页面防止编辑 |
| string | 否 | 关联对象(适用于record/list类型页面) |
| array | 否 | 桌面/移动端显示设置 |
| array | 否 | 组件配置 |
apprecordlistapprecordlistpageAssignments:
- type: orgDefault
page: sales_dashboard
desktop: true
mobile: falsepageAssignments:
- type: orgDefault
page: sales_dashboard
desktop: true
mobile: false// Service - load data from API
{ "type": "service", "api": "/api/endpoint", "body": [...] }
// CRUD - data table with paging
{ "type": "crud", "api": "/api/v4/orders", "columns": [...] }
// Chart - ECharts integration
{ "type": "chart", "api": "/api/stats", "config": {...} }
// Form - input form with submit
{ "type": "form", "api": "post:/api/endpoint", "body": [...] }
// Tabs - tabbed navigation
{ "type": "tabs", "tabs": [...] }
// Grid - responsive layout
{ "type": "grid", "columns": [...] }
// Template - HTML template with data binding
{ "type": "tpl", "tpl": "<div>${variable}</div>" }// Service - 从API加载数据
{ "type": "service", "api": "/api/endpoint", "body": [...] }
// CRUD - 带分页的数据表格
{ "type": "crud", "api": "/api/v4/orders", "columns": [...] }
// Chart - ECharts集成
{ "type": "chart", "api": "/api/stats", "config": {...} }
// Form - 带提交功能的输入表单
{ "type": "form", "api": "post:/api/endpoint", "body": [...] }
// Tabs - 标签页导航
{ "type": "tabs", "tabs": [...] }
// Grid - 响应式布局
{ "type": "grid", "columns": [...] }
// Template - 带数据绑定的HTML模板
{ "type": "tpl", "tpl": "<div>${variable}</div>" }name: sales_dashboard
label: Sales Dashboard
type: app
render_engine: amis
is_active: true{
"type": "page",
"title": "Sales Dashboard",
"body": [
{
"type": "service",
"api": "/api/v4/stats/sales-summary",
"body": [
{
"type": "grid",
"columns": [
{
"type": "card",
"className": "bg-blue-50",
"body": {
"type": "tpl",
"tpl": "<div class=\"p-4\"><div class=\"text-gray-600\">Today's Sales</div><div class=\"text-3xl font-bold text-blue-600\">¥${today_sales}</div></div>"
}
},
{
"type": "card",
"className": "bg-green-50",
"body": {
"type": "tpl",
"tpl": "<div class=\"p-4\"><div class=\"text-gray-600\">This Month</div><div class=\"text-3xl font-bold text-green-600\">¥${month_sales}</div></div>"
}
}
]
}
]
},
{
"type": "grid",
"className": "mt-4",
"columns": [
{
"lg": 8,
"md": 12,
"body": {
"type": "card",
"header": { "title": "Sales Trend" },
"body": {
"type": "chart",
"api": "/api/v4/stats/sales-trend",
"config": {
"xAxis": { "type": "category" },
"yAxis": { "type": "value" },
"series": [{ "type": "line", "smooth": true }]
}
}
}
},
{
"lg": 4,
"md": 12,
"body": {
"type": "card",
"header": { "title": "Top Products" },
"body": {
"type": "chart",
"api": "/api/v4/stats/top-products",
"config": {
"series": [{ "type": "pie", "radius": ["40%", "70%"] }]
}
}
}
}
]
},
{
"type": "card",
"className": "mt-4",
"header": { "title": "Recent Orders" },
"body": {
"type": "crud",
"api": "/api/v4/orders?$top=10&$orderby=created desc",
"syncLocation": false,
"columns": [
{ "name": "order_number", "label": "Order #" },
{ "name": "customer__expand.name", "label": "Customer" },
{ "name": "total_amount", "label": "Amount", "type": "number" },
{ "name": "status", "label": "Status" }
]
}
}
]
}name: sales_dashboard
label: Sales Dashboard
type: app
render_engine: amis
is_active: true{
"type": "page",
"title": "Sales Dashboard",
"body": [
{
"type": "service",
"api": "/api/v4/stats/sales-summary",
"body": [
{
"type": "grid",
"columns": [
{
"type": "card",
"className": "bg-blue-50",
"body": {
"type": "tpl",
"tpl": "<div class=\"p-4\"><div class=\"text-gray-600\">Today's Sales</div><div class=\"text-3xl font-bold text-blue-600\">¥${today_sales}</div></div>"
}
},
{
"type": "card",
"className": "bg-green-50",
"body": {
"type": "tpl",
"tpl": "<div class=\"p-4\"><div class=\"text-gray-600\">This Month</div><div class=\"text-3xl font-bold text-green-600\">¥${month_sales}</div></div>"
}
}
]
}
]
},
{
"type": "grid",
"className": "mt-4",
"columns": [
{
"lg": 8,
"md": 12,
"body": {
"type": "card",
"header": { "title": "Sales Trend" },
"body": {
"type": "chart",
"api": "/api/v4/stats/sales-trend",
"config": {
"xAxis": { "type": "category" },
"yAxis": { "type": "value" },
"series": [{ "type": "line", "smooth": true }]
}
}
}
},
{
"lg": 4,
"md": 12,
"body": {
"type": "card",
"header": { "title": "Top Products" },
"body": {
"type": "chart",
"api": "/api/v4/stats/top-products",
"config": {
"series": [{ "type": "pie", "radius": ["40%", "70%"] }]
}
}
}
}
]
},
{
"type": "card",
"className": "mt-4",
"header": { "title": "Recent Orders" },
"body": {
"type": "crud",
"api": "/api/v4/orders?$top=10&$orderby=created desc",
"syncLocation": false,
"columns": [
{ "name": "order_number", "label": "Order #" },
{ "name": "customer__expand.name", "label": "Customer" },
{ "name": "total_amount", "label": "Amount", "type": "number" },
{ "name": "status", "label": "Status" }
]
}
}
]
}name: order_report
label: Order Report
type: app
render_engine: amis
is_active: true{
"type": "page",
"title": "Order Report",
"body": [
{
"type": "form",
"mode": "horizontal",
"wrapWithPanel": false,
"target": "report-table",
"submitOnChange": true,
"body": [
{
"type": "input-date-range",
"name": "date_range",
"label": "Date Range"
},
{
"type": "select",
"name": "status",
"label": "Status",
"options": [
{ "label": "All", "value": "" },
{ "label": "Draft", "value": "draft" },
{ "label": "Approved", "value": "approved" },
{ "label": "Completed", "value": "completed" }
],
"clearable": true
}
]
},
{
"type": "crud",
"name": "report-table",
"className": "mt-4",
"api": "/api/v4/orders?$filter=status eq '${status}'",
"syncLocation": false,
"columns": [
{ "name": "order_number", "label": "Order #" },
{ "name": "customer__expand.name", "label": "Customer" },
{ "name": "total_amount", "label": "Amount" },
{ "name": "status", "label": "Status" },
{ "name": "created", "label": "Date", "type": "datetime" }
]
}
]
}name: order_report
label: Order Report
type: app
render_engine: amis
is_active: true{
"type": "page",
"title": "Order Report",
"body": [
{
"type": "form",
"mode": "horizontal",
"wrapWithPanel": false,
"target": "report-table",
"submitOnChange": true,
"body": [
{
"type": "input-date-range",
"name": "date_range",
"label": "Date Range"
},
{
"type": "select",
"name": "status",
"label": "Status",
"options": [
{ "label": "All", "value": "" },
{ "label": "Draft", "value": "draft" },
{ "label": "Approved", "value": "approved" },
{ "label": "Completed", "value": "completed" }
],
"clearable": true
}
]
},
{
"type": "crud",
"name": "report-table",
"className": "mt-4",
"api": "/api/v4/orders?$filter=status eq '${status}'",
"syncLocation": false,
"columns": [
{ "name": "order_number", "label": "Order #" },
{ "name": "customer__expand.name", "label": "Customer" },
{ "name": "total_amount", "label": "Amount" },
{ "name": "status", "label": "Status" },
{ "name": "created", "label": "Date", "type": "datetime" }
]
}
]
}// Record detail service - loads and displays a single record
{ "type": "steedos-record-service", "objectApiName": "orders", "recordId": "${recordId}" }
// Record detail header
{ "type": "steedos-record-detail-header" }
// Object list view
{ "type": "steedos-object-listview", "objectApiName": "orders", "listName": "all" }// 记录详情服务 - 加载并显示单个记录
{ "type": "steedos-record-service", "objectApiName": "orders", "recordId": "${recordId}" }
// 记录详情头部
{ "type": "steedos-record-detail-header" }
// 对象列表视图
{ "type": "steedos-object-listview", "objectApiName": "orders", "listName": "all" }.page.yml.page.amis.jsonserviceapigridlgmd_mobiledashboard_mobile.page.yml.page.yml.page.amis.jsonserviceapilgmdgrid_mobiledashboard_mobile.page.yml