mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
65ac422ed6
* 补充容错 * fix: form 中 name 关联顶层数据初始化失效 * 更新 examples * 文档调整 * 删除多余的文档, 调整 schema * schema 调整 * schema 调整 * control 类型容器 control 改成 body * 修复一个选项加载的bug * form 注册直接用 type
92 lines
2.2 KiB
JavaScript
92 lines
2.2 KiB
JavaScript
export default {
|
|
title: 'Test 信息:${page}',
|
|
body: {
|
|
type: 'crud',
|
|
api: '/api/sample',
|
|
syncLocation: false,
|
|
title: null,
|
|
columns: [
|
|
{
|
|
name: 'id',
|
|
label: 'ID',
|
|
width: 20
|
|
},
|
|
{
|
|
name: 'engine',
|
|
label: 'Rendering engine',
|
|
sortable: true
|
|
},
|
|
{
|
|
name: 'grade',
|
|
type: 'map',
|
|
label: 'Rendering engine',
|
|
map: {
|
|
'A': "<span class='label label-info'>A</span>",
|
|
'B': "<span class='label label-success'>B</span>",
|
|
'C': "<span class='label label-primary'>C</span>",
|
|
'X': "<span class='label label-danger'>X</span>",
|
|
'*': 'Unkown'
|
|
}
|
|
},
|
|
{
|
|
type: 'operation',
|
|
label: '操作',
|
|
width: 200,
|
|
buttons: [
|
|
{
|
|
type: 'button-group',
|
|
buttons: [
|
|
{
|
|
type: 'button',
|
|
label: '查看',
|
|
actionType: 'dialog',
|
|
dialog: {
|
|
disabled: true,
|
|
body: {
|
|
type: 'form',
|
|
body: [
|
|
{
|
|
name: 'engine',
|
|
label: 'Rendering engine',
|
|
type: 'static'
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
type: 'button',
|
|
label: '编辑',
|
|
actionType: 'dialog',
|
|
dialog: {
|
|
body: {
|
|
api: '/api/sample/$id',
|
|
type: 'form',
|
|
body: [
|
|
{
|
|
name: 'engine',
|
|
label: 'Rendering engine',
|
|
type: 'text'
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
type: 'button',
|
|
label: '删除',
|
|
level: 'danger',
|
|
actionType: 'ajax',
|
|
confirmText: '确定?',
|
|
api: 'delete:/api/sample/$id'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
};
|