amis/examples/components/Form/Picker.jsx

1287 lines
37 KiB
React
Raw Normal View History

2019-04-30 11:11:25 +08:00
export default {
title: '表格编辑',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
mode: 'horizontal',
api: '/api/mock2/form/saveForm?waitSeconds=2',
2019-11-07 10:41:14 +08:00
actions: [
{
type: 'submit',
label: '提交',
2019-11-07 10:41:14 +08:00
primary: true
}
],
body: [
'<p>常规模式</p>',
2019-11-07 10:41:14 +08:00
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'picker',
name: 'type',
label: '单选',
2019-11-07 10:41:14 +08:00
value: 1,
inline: true,
options: [
{
label: '选项1',
2019-11-07 10:41:14 +08:00
value: 1
},
{
label: '选项2',
2019-11-07 10:41:14 +08:00
value: 2
},
{
label: '选项3',
2019-11-07 10:41:14 +08:00
value: 3
},
{
label: '选项4',
2019-11-07 10:41:14 +08:00
value: 4
}
]
},
{
type: 'picker',
name: 'type2',
label: '多选',
2019-11-07 10:41:14 +08:00
multiple: true,
options: [
{
label: '选项1',
2019-11-07 10:41:14 +08:00
value: 1
},
{
label: '选项2',
2019-11-07 10:41:14 +08:00
value: 2
},
{
label: '选项3',
2019-11-07 10:41:14 +08:00
value: 3
},
{
label: '选项4',
2019-11-07 10:41:14 +08:00
value: 4
}
]
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
'<p>Table 渲染类型</p>',
2019-11-07 10:41:14 +08:00
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'picker',
name: 'type3',
2019-11-07 10:41:14 +08:00
joinValues: true,
valueField: 'id',
labelField: 'engine',
label: '单选',
source: '/api/sample',
size: 'lg',
value: '4',
2019-11-07 10:41:14 +08:00
pickerSchema: {
mode: 'table',
name: 'thelist',
quickSaveApi: '/api/sample/bulkUpdate',
quickSaveItemApi: '/api/sample/$id',
2019-11-07 10:41:14 +08:00
draggable: true,
headerToolbar: {
wrapWithPanel: false,
type: 'form',
className: 'text-right',
target: 'thelist',
mode: 'inline',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'keywords',
2019-11-07 10:41:14 +08:00
addOn: {
type: 'submit',
label: '搜索',
level: 'primary',
icon: 'fa fa-search pull-left'
2019-11-07 10:41:14 +08:00
}
}
]
},
columns: [
2019-04-30 11:11:25 +08:00
{
name: 'engine',
label: 'Rendering engine',
2019-11-07 10:41:14 +08:00
sortable: true,
searchable: true,
type: 'text',
2019-11-07 10:41:14 +08:00
toggled: true
2019-04-30 11:11:25 +08:00
},
{
name: 'browser',
label: 'Browser',
2019-11-07 10:41:14 +08:00
sortable: true,
type: 'text',
2019-11-07 10:41:14 +08:00
toggled: true
2019-04-30 11:11:25 +08:00
},
{
name: 'platform',
label: 'Platform(s)',
2019-11-07 10:41:14 +08:00
sortable: true,
type: 'text',
2019-11-07 10:41:14 +08:00
toggled: true
2019-04-30 11:11:25 +08:00
},
{
name: 'version',
label: 'Engine version',
2019-11-07 10:41:14 +08:00
quickEdit: true,
type: 'text',
2019-11-07 10:41:14 +08:00
toggled: true
2019-04-30 11:11:25 +08:00
},
{
name: 'grade',
label: 'CSS grade',
2019-11-07 10:41:14 +08:00
quickEdit: {
mode: 'inline',
type: 'select',
options: ['A', 'B', 'C', 'D', 'X'],
2019-11-07 10:41:14 +08:00
saveImmediately: true
},
type: 'text',
2019-11-07 10:41:14 +08:00
toggled: true
2019-04-30 11:11:25 +08:00
},
{
type: 'operation',
label: '操作',
2019-11-07 10:41:14 +08:00
width: 100,
buttons: [
{
type: 'button',
icon: 'fa fa-eye',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
title: '查看',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'static',
name: 'engine',
label: 'Engine'
2019-11-07 10:41:14 +08:00
},
2019-04-30 11:11:25 +08:00
{
type: 'divider'
2019-04-30 11:11:25 +08:00
},
{
type: 'static',
name: 'browser',
label: 'Browser'
2019-04-30 11:11:25 +08:00
},
{
type: 'divider'
2019-04-30 11:11:25 +08:00
},
{
type: 'static',
name: 'platform',
label: 'Platform(s)'
2019-04-30 11:11:25 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'grade',
label: 'CSS grade'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'html',
2019-11-07 10:41:14 +08:00
html:
'<p>添加其他 <span>Html 片段</span> 需要支持变量替换todo.</p>'
2019-04-30 11:11:25 +08:00
}
2019-11-07 10:41:14 +08:00
]
}
}
},
{
type: 'button',
icon: 'fa fa-pencil',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
position: 'left',
size: 'lg',
title: '编辑',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
name: 'sample-edit-form',
api: '/api/sample/$id',
body: [
2019-04-30 11:11:25 +08:00
{
type: 'input-text',
name: 'engine',
label: 'Engine',
2019-11-07 10:41:14 +08:00
required: true
2019-04-30 11:11:25 +08:00
},
{
type: 'divider'
2019-04-30 11:11:25 +08:00
},
{
type: 'input-text',
name: 'browser',
label: 'Browser',
2019-11-07 10:41:14 +08:00
required: true
2019-04-30 11:11:25 +08:00
},
{
type: 'divider'
2019-04-30 11:11:25 +08:00
},
{
type: 'input-text',
name: 'platform',
label: 'Platform(s)',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'select',
name: 'grade',
label: 'CSS grade',
options: ['A', 'B', 'C', 'D', 'X']
2019-04-30 11:11:25 +08:00
}
2019-11-07 10:41:14 +08:00
]
}
}
},
{
type: 'button',
icon: 'fa fa-times text-danger',
actionType: 'ajax',
confirmText: '您确认要删除?',
api: 'delete:/api/sample/$id'
2019-04-30 11:11:25 +08:00
}
2019-11-07 10:41:14 +08:00
],
toggled: true
}
]
}
},
2019-04-30 11:11:25 +08:00
2019-11-07 10:41:14 +08:00
{
type: 'picker',
name: 'type4',
2019-11-07 10:41:14 +08:00
joinValues: true,
valueField: 'id',
labelField: 'engine',
label: '多选',
source: '/api/sample',
size: 'lg',
value: '4,5',
2019-11-07 10:41:14 +08:00
multiple: true,
pickerSchema: {
mode: 'table',
name: 'thelist',
quickSaveApi: '/api/sample/bulkUpdate',
quickSaveItemApi: '/api/sample/$id',
2019-11-07 10:41:14 +08:00
draggable: true,
headerToolbar: {
wrapWithPanel: false,
type: 'form',
className: 'text-right',
target: 'thelist',
mode: 'inline',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'keywords',
2019-11-07 10:41:14 +08:00
addOn: {
type: 'submit',
label: '搜索',
level: 'primary',
icon: 'fa fa-search pull-left'
2019-11-07 10:41:14 +08:00
}
}
]
},
columns: [
2019-04-30 11:11:25 +08:00
{
name: 'engine',
label: 'Rendering engine',
2019-11-07 10:41:14 +08:00
sortable: true,
searchable: true,
type: 'text',
2019-11-07 10:41:14 +08:00
toggled: true
2019-04-30 11:11:25 +08:00
},
{
name: 'browser',
label: 'Browser',
2019-11-07 10:41:14 +08:00
sortable: true,
type: 'text',
2019-11-07 10:41:14 +08:00
toggled: true
2019-04-30 11:11:25 +08:00
},
{
name: 'platform',
label: 'Platform(s)',
2019-11-07 10:41:14 +08:00
sortable: true,
type: 'text',
2019-11-07 10:41:14 +08:00
toggled: true
2019-04-30 11:11:25 +08:00
},
{
name: 'version',
label: 'Engine version',
2019-11-07 10:41:14 +08:00
quickEdit: true,
type: 'text',
2019-11-07 10:41:14 +08:00
toggled: true
2019-04-30 11:11:25 +08:00
},
{
name: 'grade',
label: 'CSS grade',
2019-11-07 10:41:14 +08:00
quickEdit: {
mode: 'inline',
type: 'select',
options: ['A', 'B', 'C', 'D', 'X'],
2019-11-07 10:41:14 +08:00
saveImmediately: true
},
type: 'text',
2019-11-07 10:41:14 +08:00
toggled: true
2019-04-30 11:11:25 +08:00
},
{
type: 'operation',
label: '操作',
2019-11-07 10:41:14 +08:00
width: 100,
buttons: [
{
type: 'button',
icon: 'fa fa-eye',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
title: '查看',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'static',
name: 'engine',
label: 'Engine'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'browser',
label: 'Browser'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'platform',
label: 'Platform(s)'
2019-04-30 11:11:25 +08:00
},
2019-11-07 10:41:14 +08:00
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'grade',
label: 'CSS grade'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'html',
2019-11-07 10:41:14 +08:00
html:
'<p>添加其他 <span>Html 片段</span> 需要支持变量替换todo.</p>'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'button',
icon: 'fa fa-pencil',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
position: 'left',
size: 'lg',
title: '编辑',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
name: 'sample-edit-form',
api: '/api/sample/$id',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'engine',
label: 'Engine',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'browser',
label: 'Browser',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'platform',
label: 'Platform(s)',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'select',
name: 'grade',
label: 'CSS grade',
options: ['A', 'B', 'C', 'D', 'X']
2019-11-07 10:41:14 +08:00
}
]
2019-04-30 11:11:25 +08:00
}
2019-11-07 10:41:14 +08:00
}
},
{
type: 'button',
icon: 'fa fa-times text-danger',
actionType: 'ajax',
confirmText: '您确认要删除?',
api: 'delete:/api/sample/$id'
2019-04-30 11:11:25 +08:00
}
2019-11-07 10:41:14 +08:00
],
toggled: true
}
]
}
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
'<p>List 渲染类型</p>',
2019-11-07 10:41:14 +08:00
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'picker',
name: 'type5',
2019-11-07 10:41:14 +08:00
joinValues: true,
valueField: 'id',
labelField: 'engine',
label: '单选',
source: '/api/sample',
size: 'lg',
value: '4',
2019-11-07 10:41:14 +08:00
pickerSchema: {
mode: 'list',
name: 'thelist',
quickSaveApi: '/api/sample/bulkUpdate',
quickSaveItemApi: '/api/sample/$id',
2019-11-07 10:41:14 +08:00
draggable: true,
headerToolbar: {
wrapWithPanel: false,
type: 'form',
className: 'text-right',
target: 'thelist',
mode: 'inline',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'keywords',
2019-11-07 10:41:14 +08:00
addOn: {
type: 'submit',
label: '搜索',
level: 'primary',
icon: 'fa fa-search pull-left'
2019-11-07 10:41:14 +08:00
}
}
]
},
listItem: {
actions: [
{
type: 'button',
icon: 'fa fa-eye',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
title: '查看',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'static',
name: 'engine',
label: 'Engine'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'browser',
label: 'Browser'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'platform',
label: 'Platform(s)'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'grade',
label: 'CSS grade'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'html',
2019-11-07 10:41:14 +08:00
html:
'<p>添加其他 <span>Html 片段</span> 需要支持变量替换todo.</p>'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'button',
icon: 'fa fa-pencil',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
title: '编辑',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
name: 'sample-edit-form',
api: '/api/sample/$id',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'engine',
label: 'Engine',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'browser',
label: 'Browser',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'platform',
label: 'Platform(s)',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'grade',
label: 'CSS grade'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'button',
icon: 'fa fa-times text-danger',
actionType: 'ajax',
confirmText: '您确认要删除?',
api: 'delete:/api/sample/$id'
2019-11-07 10:41:14 +08:00
}
],
body: [
{
name: 'engine',
label: 'Rendering engine',
2019-11-07 10:41:14 +08:00
sortable: true,
quickEdit: true,
labelClassName: 'w-sm'
2019-11-07 10:41:14 +08:00
},
{
type: 'hbox',
columns: [
{
name: 'browser',
label: 'Browser',
labelClassName: 'w-sm'
},
{
name: 'platform',
label: 'Platform(s)',
labelClassName: 'w-sm'
}
]
},
2019-11-07 10:41:14 +08:00
{
name: 'version',
label: 'Engine version',
labelClassName: 'w-sm'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'picker',
name: 'type6',
2019-11-07 10:41:14 +08:00
joinValues: true,
valueField: 'id',
labelField: 'engine',
label: '多选',
source: '/api/sample',
size: 'lg',
value: '4,5',
2019-11-07 10:41:14 +08:00
multiple: true,
pickerSchema: {
mode: 'list',
name: 'thelist',
quickSaveApi: '/api/sample/bulkUpdate',
quickSaveItemApi: '/api/sample/$id',
2019-11-07 10:41:14 +08:00
draggable: true,
headerToolbar: {
wrapWithPanel: false,
type: 'form',
className: 'text-right',
target: 'thelist',
mode: 'inline',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'keywords',
2019-11-07 10:41:14 +08:00
addOn: {
type: 'submit',
label: '搜索',
level: 'primary',
icon: 'fa fa-search pull-left'
2019-11-07 10:41:14 +08:00
}
}
]
},
listItem: {
actions: [
{
type: 'button',
icon: 'fa fa-eye',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
title: '查看',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'static',
name: 'engine',
label: 'Engine'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'browser',
label: 'Browser'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'platform',
label: 'Platform(s)'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'grade',
label: 'CSS grade'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'html',
2019-11-07 10:41:14 +08:00
html:
'<p>添加其他 <span>Html 片段</span> 需要支持变量替换todo.</p>'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'button',
icon: 'fa fa-pencil',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
title: '编辑',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
name: 'sample-edit-form',
api: '/api/sample/$id',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'engine',
label: 'Engine',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'browser',
label: 'Browser',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'platform',
label: 'Platform(s)',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'grade',
label: 'CSS grade'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'button',
icon: 'fa fa-times text-danger',
actionType: 'ajax',
confirmText: '您确认要删除?',
api: 'delete:/api/sample/$id'
2019-11-07 10:41:14 +08:00
}
],
body: [
{
name: 'engine',
label: 'Rendering engine',
2019-11-07 10:41:14 +08:00
sortable: true,
quickEdit: true,
labelClassName: 'w-sm'
2019-11-07 10:41:14 +08:00
},
{
type: 'hbox',
columns: [
{
name: 'browser',
label: 'Browser',
labelClassName: 'w-sm'
},
{
name: 'platform',
label: 'Platform(s)',
labelClassName: 'w-sm'
}
]
},
2019-11-07 10:41:14 +08:00
{
name: 'version',
label: 'Engine version',
labelClassName: 'w-sm'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
'<p>Cards 渲染类型</p>',
2019-11-07 10:41:14 +08:00
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'picker',
name: 'type7',
2019-11-07 10:41:14 +08:00
joinValues: true,
valueField: 'id',
labelField: 'engine',
label: '单选',
source: '/api/sample',
size: 'lg',
value: '4',
2019-11-07 10:41:14 +08:00
pickerSchema: {
mode: 'cards',
name: 'thelist',
quickSaveApi: '/api/sample/bulkUpdate',
quickSaveItemApi: '/api/sample/$id',
2019-11-07 10:41:14 +08:00
draggable: true,
headerToolbar: {
wrapWithPanel: false,
type: 'form',
className: 'text-right',
target: 'thelist',
mode: 'inline',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'keywords',
2019-11-07 10:41:14 +08:00
addOn: {
type: 'submit',
label: '搜索',
level: 'primary',
icon: 'fa fa-search pull-left'
2019-11-07 10:41:14 +08:00
}
}
]
},
card: {
header: {
title: '$engine',
subTitle: '$platform',
subTitlePlaceholder: '暂无说明',
2019-11-07 10:41:14 +08:00
avatar:
2019-12-24 11:25:55 +08:00
'<%= data.avatar || "https://internal-amis-res.cdn.bcebos.com/images/2019-12/1575350573496/4873dbfaf6a5.png" %>',
avatarClassName: 'pull-left thumb b-3x m-r'
2019-04-30 11:11:25 +08:00
},
2019-11-07 10:41:14 +08:00
actions: [
{
type: 'button',
label: '查看',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
title: '查看',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'static',
name: 'engine',
label: 'Engine'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'browser',
label: 'Browser'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'platform',
label: 'Platform(s)'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'grade',
label: 'CSS grade'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'html',
2019-11-07 10:41:14 +08:00
html:
'<p>添加其他 <span>Html 片段</span> 需要支持变量替换todo.</p>'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'button',
label: '编辑',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
title: '编辑',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
name: 'sample-edit-form',
api: '/api/sample/$id',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'engine',
label: 'Engine',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'browser',
label: 'Browser',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'platform',
label: 'Platform(s)',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'grade',
label: 'CSS grade'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'button',
label: '删除',
actionType: 'ajax',
confirmText: '您确认要删除?',
api: 'delete:/api/sample/$id'
2019-11-07 10:41:14 +08:00
}
],
body: [
{
name: 'engine',
label: 'engine',
2019-11-07 10:41:14 +08:00
sortable: true,
quickEdit: true
},
{
name: 'browser',
label: 'Browser'
2019-11-07 10:41:14 +08:00
},
{
name: 'platform',
label: 'Platform'
2019-11-07 10:41:14 +08:00
},
{
name: 'version',
label: 'version'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
2019-04-30 11:11:25 +08:00
2019-11-07 10:41:14 +08:00
{
type: 'picker',
name: 'type8',
2019-11-07 10:41:14 +08:00
joinValues: true,
valueField: 'id',
labelField: 'engine',
label: '多选',
source: '/api/sample',
size: 'lg',
value: '4,5',
2019-11-07 10:41:14 +08:00
multiple: true,
pickerSchema: {
mode: 'cards',
name: 'thelist',
quickSaveApi: '/api/sample/bulkUpdate',
quickSaveItemApi: '/api/sample/$id',
2019-11-07 10:41:14 +08:00
draggable: true,
headerToolbar: {
wrapWithPanel: false,
type: 'form',
className: 'text-right',
target: 'thelist',
mode: 'inline',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'keywords',
2019-11-07 10:41:14 +08:00
addOn: {
type: 'submit',
label: '搜索',
level: 'primary',
icon: 'fa fa-search pull-left'
2019-04-30 11:11:25 +08:00
}
2019-11-07 10:41:14 +08:00
}
]
},
card: {
header: {
title: '$engine',
subTitle: '$platform',
subTitlePlaceholder: '暂无说明',
2019-11-07 10:41:14 +08:00
avatar:
2019-12-24 11:25:55 +08:00
'<%= data.avatar || "https://internal-amis-res.cdn.bcebos.com/images/2019-12/1575350573496/4873dbfaf6a5.png" %>',
avatarClassName: 'pull-left thumb b-3x m-r'
2019-04-30 11:11:25 +08:00
},
2019-11-07 10:41:14 +08:00
actions: [
{
type: 'button',
label: '查看',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
title: '查看',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'static',
name: 'engine',
label: 'Engine'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'browser',
label: 'Browser'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'platform',
label: 'Platform(s)'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'static',
name: 'grade',
label: 'CSS grade'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'html',
2019-11-07 10:41:14 +08:00
html:
'<p>添加其他 <span>Html 片段</span> 需要支持变量替换todo.</p>'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'button',
label: '编辑',
actionType: 'dialog',
2019-11-07 10:41:14 +08:00
dialog: {
title: '编辑',
2019-11-07 10:41:14 +08:00
body: {
type: 'form',
name: 'sample-edit-form',
api: '/api/sample/$id',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
name: 'engine',
label: 'Engine',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'browser',
label: 'Browser',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'platform',
label: 'Platform(s)',
2019-11-07 10:41:14 +08:00
required: true
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'version',
label: 'Engine version'
2019-11-07 10:41:14 +08:00
},
{
type: 'divider'
2019-11-07 10:41:14 +08:00
},
{
type: 'input-text',
name: 'grade',
label: 'CSS grade'
2019-11-07 10:41:14 +08:00
}
]
}
}
},
{
type: 'button',
label: '删除',
actionType: 'ajax',
confirmText: '您确认要删除?',
api: 'delete:/api/sample/$id'
2019-11-07 10:41:14 +08:00
}
],
body: [
{
name: 'engine',
label: 'engine',
2019-11-07 10:41:14 +08:00
sortable: true,
quickEdit: true
},
{
name: 'browser',
label: 'Browser'
2019-11-07 10:41:14 +08:00
},
{
name: 'platform',
label: 'Platform'
2019-11-07 10:41:14 +08:00
},
{
name: 'version',
label: 'version'
2019-11-07 10:41:14 +08:00
}
]
}
}
}
]
}
2019-04-30 11:11:25 +08:00
};