2021-04-21 00:08:16 +08:00
|
|
|
|
export default {
|
|
|
|
|
title: '带边栏联动',
|
|
|
|
|
aside: {
|
|
|
|
|
type: 'nav',
|
2021-04-21 00:22:18 +08:00
|
|
|
|
name: 'nav',
|
2021-04-21 00:08:16 +08:00
|
|
|
|
stacked: true,
|
2021-04-21 00:22:18 +08:00
|
|
|
|
source:
|
2021-04-21 08:45:25 +08:00
|
|
|
|
'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/options/nav?parentId=${value}&waitSeconds=2'
|
2021-04-21 00:08:16 +08:00
|
|
|
|
},
|
|
|
|
|
toolbar: [
|
|
|
|
|
{
|
|
|
|
|
type: 'button',
|
2021-04-21 00:22:18 +08:00
|
|
|
|
actionType: 'reload',
|
|
|
|
|
label: 'Reload Nav',
|
2021-04-21 00:08:16 +08:00
|
|
|
|
primary: true,
|
2021-04-21 00:22:18 +08:00
|
|
|
|
target: 'nav'
|
2021-04-21 00:08:16 +08:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
body: {
|
|
|
|
|
type: 'crud',
|
|
|
|
|
draggable: true,
|
|
|
|
|
api: {
|
|
|
|
|
url: '/api/sample',
|
|
|
|
|
sendOn: 'this.cat'
|
|
|
|
|
},
|
|
|
|
|
filter: {
|
|
|
|
|
title: '条件搜索',
|
|
|
|
|
submitText: '',
|
2021-06-07 10:09:55 +08:00
|
|
|
|
body: [
|
2021-04-21 00:08:16 +08:00
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2021-04-21 00:08:16 +08:00
|
|
|
|
name: 'keywords',
|
|
|
|
|
placeholder: '通过关键字搜索',
|
|
|
|
|
addOn: {
|
|
|
|
|
label: '搜索',
|
|
|
|
|
type: 'submit'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'plain',
|
|
|
|
|
text: '这里的表单项可以配置多个'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
bulkActions: [
|
|
|
|
|
{
|
|
|
|
|
label: '批量删除',
|
|
|
|
|
actionType: 'ajax',
|
|
|
|
|
api: 'delete:/api/sample/$ids',
|
|
|
|
|
confirmText: '确定要批量删除?'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '批量修改',
|
|
|
|
|
actionType: 'dialog',
|
|
|
|
|
dialog: {
|
|
|
|
|
title: '批量编辑',
|
|
|
|
|
name: 'sample-bulk-edit',
|
|
|
|
|
body: {
|
|
|
|
|
type: 'form',
|
|
|
|
|
api: '/api/sample/bulkUpdate2',
|
2021-06-07 10:09:55 +08:00
|
|
|
|
body: [
|
2021-04-21 00:08:16 +08:00
|
|
|
|
{
|
|
|
|
|
type: 'hidden',
|
|
|
|
|
name: 'ids'
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2021-04-21 00:08:16 +08:00
|
|
|
|
name: 'engine',
|
|
|
|
|
label: 'Engine'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
quickSaveApi: '/api/sample/bulkUpdate',
|
|
|
|
|
quickSaveItemApi: '/api/sample/$id',
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
name: 'id',
|
|
|
|
|
label: 'ID',
|
|
|
|
|
width: 20,
|
|
|
|
|
sortable: true,
|
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'engine',
|
|
|
|
|
label: 'Rendering engine',
|
|
|
|
|
sortable: true,
|
|
|
|
|
searchable: true,
|
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'browser',
|
|
|
|
|
label: 'Browser',
|
|
|
|
|
sortable: true,
|
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'platform',
|
|
|
|
|
label: 'Platform(s)',
|
|
|
|
|
sortable: true,
|
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'version',
|
|
|
|
|
label: 'Engine version',
|
|
|
|
|
quickEdit: true,
|
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'grade',
|
|
|
|
|
label: 'CSS grade',
|
|
|
|
|
quickEdit: {
|
|
|
|
|
mode: 'inline',
|
|
|
|
|
type: 'select',
|
|
|
|
|
options: ['A', 'B', 'C', 'D', 'X'],
|
|
|
|
|
saveImmediately: true
|
|
|
|
|
},
|
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'operation',
|
|
|
|
|
label: '操作',
|
|
|
|
|
width: 130,
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
type: 'button',
|
|
|
|
|
icon: 'fa fa-eye',
|
|
|
|
|
actionType: 'dialog',
|
|
|
|
|
dialog: {
|
|
|
|
|
title: '查看',
|
|
|
|
|
body: {
|
|
|
|
|
type: 'form',
|
2021-06-07 10:09:55 +08:00
|
|
|
|
body: [
|
2021-04-21 00:08:16 +08:00
|
|
|
|
{
|
|
|
|
|
type: 'static',
|
|
|
|
|
name: 'engine',
|
|
|
|
|
label: 'Engine'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'static',
|
|
|
|
|
name: 'browser',
|
|
|
|
|
label: 'Browser'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'static',
|
|
|
|
|
name: 'platform',
|
|
|
|
|
label: 'Platform(s)'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'static',
|
|
|
|
|
name: 'version',
|
|
|
|
|
label: 'Engine version'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'static',
|
|
|
|
|
name: 'grade',
|
|
|
|
|
label: 'CSS grade'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'html',
|
|
|
|
|
html:
|
|
|
|
|
'<p>添加其他 <span>Html 片段</span> 需要支持变量替换(todo).</p>'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'button',
|
|
|
|
|
icon: 'fa fa-pencil',
|
|
|
|
|
actionType: 'dialog',
|
|
|
|
|
dialog: {
|
|
|
|
|
title: '编辑',
|
|
|
|
|
body: {
|
|
|
|
|
type: 'form',
|
|
|
|
|
name: 'sample-edit-form',
|
|
|
|
|
api: '/api/sample/$id',
|
2021-06-07 10:09:55 +08:00
|
|
|
|
body: [
|
2021-04-21 00:08:16 +08:00
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2021-04-21 00:08:16 +08:00
|
|
|
|
name: 'engine',
|
|
|
|
|
label: 'Engine',
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2021-04-21 00:08:16 +08:00
|
|
|
|
name: 'browser',
|
|
|
|
|
label: 'Browser',
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2021-04-21 00:08:16 +08:00
|
|
|
|
name: 'platform',
|
|
|
|
|
label: 'Platform(s)',
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2021-04-21 00:08:16 +08:00
|
|
|
|
name: 'version',
|
|
|
|
|
label: 'Engine version'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2021-04-21 00:08:16 +08:00
|
|
|
|
name: 'grade',
|
|
|
|
|
label: 'CSS grade'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'button',
|
|
|
|
|
icon: 'fa fa-times text-danger',
|
|
|
|
|
actionType: 'ajax',
|
|
|
|
|
confirmText: '您确认要删除?',
|
|
|
|
|
api: 'delete:/api/sample/$id'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
toggled: true
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
};
|