2019-04-30 11:11:25 +08:00
|
|
|
|
export default {
|
2019-11-07 10:41:14 +08:00
|
|
|
|
title: '增删改查示例',
|
|
|
|
|
remark: 'bla bla bla',
|
|
|
|
|
toolbar: [
|
|
|
|
|
{
|
|
|
|
|
type: 'button',
|
|
|
|
|
actionType: 'dialog',
|
|
|
|
|
label: '新增',
|
|
|
|
|
icon: 'fa fa-plus pull-left',
|
|
|
|
|
primary: true,
|
|
|
|
|
dialog: {
|
|
|
|
|
title: '新增',
|
|
|
|
|
body: {
|
|
|
|
|
type: 'form',
|
|
|
|
|
name: 'sample-edit-form',
|
|
|
|
|
api: 'post:/api/sample',
|
2021-06-07 10:09:55 +08:00
|
|
|
|
body: [
|
2019-04-30 11:11:25 +08:00
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'engine',
|
|
|
|
|
label: 'Engine',
|
|
|
|
|
required: true
|
2019-04-30 11:11:25 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2019-11-07 10:41:14 +08:00
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'browser',
|
|
|
|
|
label: 'Browser',
|
|
|
|
|
required: true
|
2019-04-30 11:11:25 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2019-11-07 10:41:14 +08:00
|
|
|
|
type: 'divider'
|
2019-04-30 11:11:25 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'platform',
|
|
|
|
|
label: 'Platform(s)',
|
|
|
|
|
required: true
|
2019-04-30 11:11:25 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2019-11-07 10:41:14 +08:00
|
|
|
|
type: 'divider'
|
2019-04-30 11:11:25 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'version',
|
|
|
|
|
label: 'Engine version'
|
2019-04-30 11:11:25 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2019-11-07 10:41:14 +08:00
|
|
|
|
type: 'divider'
|
2019-04-30 11:11:25 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'grade',
|
|
|
|
|
label: 'CSS grade'
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-11-07 10:41:14 +08:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-11-07 10:41:14 +08:00
|
|
|
|
],
|
|
|
|
|
body: {
|
|
|
|
|
type: 'crud',
|
|
|
|
|
draggable: true,
|
|
|
|
|
api: '/api/sample?waitSeconds=1',
|
2021-03-17 10:26:41 +08:00
|
|
|
|
perPage: 15,
|
2019-11-07 10:41:14 +08:00
|
|
|
|
keepItemSelectionOnPageChange: true,
|
2021-03-25 10:08:48 +08:00
|
|
|
|
maxKeepItemSelectionLength: 11,
|
2019-11-07 10:41:14 +08:00
|
|
|
|
labelTpl: '${id} ${engine}',
|
2022-03-11 17:23:02 +08:00
|
|
|
|
orderBy: 'id',
|
|
|
|
|
orderDir: 'asc',
|
2023-07-12 18:39:48 +08:00
|
|
|
|
// affixHeader: false,
|
2019-11-07 10:41:14 +08:00
|
|
|
|
filter: {
|
|
|
|
|
title: '条件搜索',
|
|
|
|
|
submitText: '',
|
2021-06-07 10:09:55 +08:00
|
|
|
|
body: [
|
2019-11-07 10:41:14 +08:00
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'keywords',
|
|
|
|
|
placeholder: '通过关键字搜索',
|
|
|
|
|
addOn: {
|
|
|
|
|
label: '搜索',
|
|
|
|
|
type: 'submit'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'plain',
|
|
|
|
|
text: '这里的表单项可以配置多个'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
bulkActions: [
|
|
|
|
|
{
|
|
|
|
|
label: '批量删除',
|
|
|
|
|
actionType: 'ajax',
|
|
|
|
|
api: 'delete:/api/sample/${ids|raw}',
|
|
|
|
|
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: [
|
2019-11-07 10:41:14 +08:00
|
|
|
|
{
|
|
|
|
|
type: 'hidden',
|
|
|
|
|
name: 'ids'
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'engine',
|
|
|
|
|
label: 'Engine'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
quickSaveApi: '/api/sample/bulkUpdate',
|
2020-09-22 19:38:33 +08:00
|
|
|
|
quickSaveItemApi: '/api/sample/$id',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
filterTogglable: true,
|
|
|
|
|
headerToolbar: [
|
|
|
|
|
'filter-toggler',
|
|
|
|
|
'bulkActions',
|
|
|
|
|
{
|
|
|
|
|
type: 'tpl',
|
|
|
|
|
tpl: '定制内容示例:当前有 ${count} 条数据。',
|
|
|
|
|
className: 'v-middle'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'link',
|
|
|
|
|
href: 'https://www.baidu.com',
|
|
|
|
|
body: '百度一下',
|
|
|
|
|
htmlTarget: '_parent',
|
|
|
|
|
className: 'v-middle'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'columns-toggler',
|
|
|
|
|
align: 'right'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'drag-toggler',
|
|
|
|
|
align: 'right'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'pagination',
|
|
|
|
|
align: 'right'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
footerToolbar: ['statistics', 'switch-per-page', 'pagination'],
|
2019-12-12 19:30:46 +08:00
|
|
|
|
// rowClassNameExpr: '<%= data.id == 1 ? "bg-success" : "" %>',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
name: 'id',
|
|
|
|
|
label: 'ID',
|
|
|
|
|
sortable: true,
|
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: true,
|
|
|
|
|
remark: 'Bla bla Bla'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'engine',
|
|
|
|
|
label: 'Rendering engine',
|
|
|
|
|
sortable: true,
|
|
|
|
|
searchable: true,
|
2021-03-12 18:58:24 +08:00
|
|
|
|
popOver: {
|
|
|
|
|
body: 'Popover 内容:${platform}',
|
|
|
|
|
trigger: 'hover'
|
|
|
|
|
},
|
|
|
|
|
popOverEnableOn: 'this.id === 1',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'browser',
|
|
|
|
|
label: 'Browser',
|
|
|
|
|
sortable: true,
|
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'platform',
|
|
|
|
|
label: 'Platform(s)',
|
|
|
|
|
popOver: {
|
2020-06-08 16:04:14 +08:00
|
|
|
|
body: 'Popover 内容:${platform}'
|
2019-11-07 10:41:14 +08:00
|
|
|
|
},
|
|
|
|
|
sortable: true,
|
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'version',
|
|
|
|
|
label: 'Engine version',
|
|
|
|
|
quickEdit: true,
|
|
|
|
|
type: 'text',
|
|
|
|
|
toggled: true,
|
|
|
|
|
filterable: {
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
label: '4',
|
|
|
|
|
value: '4'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '5',
|
|
|
|
|
value: '5'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '6',
|
|
|
|
|
value: '6'
|
|
|
|
|
}
|
|
|
|
|
]
|
2022-02-18 14:41:51 +08:00
|
|
|
|
},
|
|
|
|
|
classNameExpr: "<%= data.version < 5 ? 'bg-danger' : '' %>"
|
2019-11-07 10:41:14 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2020-07-22 14:33:06 +08:00
|
|
|
|
type: 'text',
|
2020-09-22 19:38:33 +08:00
|
|
|
|
name: 'grade',
|
|
|
|
|
label: 'CSS grade',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
quickEdit: {
|
2020-09-22 19:38:33 +08:00
|
|
|
|
saveImmediately: true,
|
|
|
|
|
mode: 'inline',
|
|
|
|
|
type: 'select',
|
|
|
|
|
options: ['A', 'B', 'C', 'D', 'X']
|
2020-07-22 14:33:06 +08:00
|
|
|
|
}
|
2019-11-07 10:41:14 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'operation',
|
|
|
|
|
label: '操作',
|
|
|
|
|
width: 100,
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
type: 'button',
|
|
|
|
|
icon: 'fa fa-eye',
|
|
|
|
|
actionType: 'dialog',
|
|
|
|
|
tooltip: '查看',
|
|
|
|
|
dialog: {
|
|
|
|
|
title: '查看',
|
|
|
|
|
body: {
|
|
|
|
|
type: 'form',
|
2021-06-07 10:09:55 +08:00
|
|
|
|
body: [
|
2019-11-07 10:41:14 +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',
|
2022-02-18 14:41:51 +08:00
|
|
|
|
html: '<p>添加其他 <span>Html 片段</span> 需要支持变量替换(todo).</p>'
|
2019-11-07 10:41:14 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'button',
|
|
|
|
|
icon: 'fa fa-pencil',
|
|
|
|
|
tooltip: '编辑',
|
|
|
|
|
actionType: 'drawer',
|
|
|
|
|
drawer: {
|
|
|
|
|
position: 'left',
|
|
|
|
|
size: 'lg',
|
|
|
|
|
title: '编辑',
|
|
|
|
|
body: {
|
|
|
|
|
type: 'form',
|
|
|
|
|
name: 'sample-edit-form',
|
|
|
|
|
api: '/api/sample/$id',
|
2021-06-07 10:09:55 +08:00
|
|
|
|
body: [
|
2019-11-07 10:41:14 +08:00
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'engine',
|
|
|
|
|
label: 'Engine',
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'browser',
|
|
|
|
|
label: 'Browser',
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'platform',
|
|
|
|
|
label: 'Platform(s)',
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
|
name: 'version',
|
|
|
|
|
label: 'Engine version'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'divider'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'select',
|
|
|
|
|
name: 'grade',
|
|
|
|
|
label: 'CSS grade',
|
|
|
|
|
options: ['A', 'B', 'C', 'D', 'X']
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'button',
|
|
|
|
|
icon: 'fa fa-times text-danger',
|
|
|
|
|
actionType: 'ajax',
|
|
|
|
|
tooltip: '删除',
|
|
|
|
|
confirmText: '您确认要删除?',
|
|
|
|
|
api: 'delete:/api/sample/$id'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
toggled: true
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
};
|