2022-03-17 20:25:51 +08:00
|
|
|
|
export default {
|
|
|
|
|
type: 'page',
|
|
|
|
|
title: '树形选择框',
|
|
|
|
|
regions: ['body', 'toolbar', 'header'],
|
|
|
|
|
body: [
|
|
|
|
|
{
|
|
|
|
|
type: 'form',
|
|
|
|
|
debug: true,
|
|
|
|
|
body: [
|
|
|
|
|
{
|
2022-04-20 15:20:42 +08:00
|
|
|
|
name: 'input-tree-clear',
|
|
|
|
|
type: 'action',
|
2022-03-17 20:25:51 +08:00
|
|
|
|
label: 'clear触发器',
|
|
|
|
|
level: 'primary',
|
|
|
|
|
className: 'mr-3',
|
|
|
|
|
onEvent: {
|
|
|
|
|
click: {
|
|
|
|
|
actions: [
|
|
|
|
|
{
|
|
|
|
|
actionType: 'clear',
|
|
|
|
|
componentId: 'input-tree-action',
|
|
|
|
|
description: '点击清空内容'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
2022-04-20 15:20:42 +08:00
|
|
|
|
name: 'input-tree-reset',
|
|
|
|
|
type: 'action',
|
2022-03-17 20:25:51 +08:00
|
|
|
|
label: 'reset触发器',
|
|
|
|
|
level: 'primary',
|
|
|
|
|
className: 'mr-3',
|
|
|
|
|
onEvent: {
|
|
|
|
|
click: {
|
|
|
|
|
actions: [
|
|
|
|
|
{
|
|
|
|
|
actionType: 'clear',
|
|
|
|
|
componentId: 'input-tree-action',
|
|
|
|
|
description: '点击清空内容'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
2022-04-20 15:20:42 +08:00
|
|
|
|
name: 'input-tree-expand',
|
|
|
|
|
type: 'action',
|
2022-04-27 20:18:29 +08:00
|
|
|
|
label: 'expand触发器(openLevel: 2)',
|
2022-03-17 20:25:51 +08:00
|
|
|
|
level: 'primary',
|
|
|
|
|
className: 'mr-3',
|
|
|
|
|
onEvent: {
|
|
|
|
|
click: {
|
|
|
|
|
actions: [
|
|
|
|
|
{
|
|
|
|
|
actionType: 'expand',
|
|
|
|
|
componentId: 'input-tree-action',
|
|
|
|
|
description: '点击展开',
|
2022-04-20 15:20:42 +08:00
|
|
|
|
args: {
|
2022-04-27 20:18:29 +08:00
|
|
|
|
openLevel: 2
|
2022-04-20 15:20:42 +08:00
|
|
|
|
}
|
2022-03-17 20:25:51 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
2022-04-20 15:20:42 +08:00
|
|
|
|
name: 'input-tree-collapse',
|
|
|
|
|
type: 'action',
|
2022-03-17 20:25:51 +08:00
|
|
|
|
label: 'collapse触发器',
|
|
|
|
|
level: 'primary',
|
|
|
|
|
className: 'mr-3',
|
|
|
|
|
onEvent: {
|
|
|
|
|
click: {
|
|
|
|
|
actions: [
|
|
|
|
|
{
|
|
|
|
|
actionType: 'collapse',
|
|
|
|
|
componentId: 'input-tree-action',
|
|
|
|
|
description: '点击收起'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'input-tree',
|
|
|
|
|
id: 'input-tree-action',
|
|
|
|
|
name: 'tree',
|
|
|
|
|
label: 'Tree',
|
|
|
|
|
creatable: true,
|
|
|
|
|
removable: true,
|
|
|
|
|
editable: true,
|
|
|
|
|
initiallyOpen: false,
|
2022-04-27 20:18:29 +08:00
|
|
|
|
unfoldedLevel: 1,
|
2022-03-17 20:25:51 +08:00
|
|
|
|
deferApi: '/api/mock2/form/deferOptions?label=${label}&waitSeconds=2',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
label: 'Folder A',
|
|
|
|
|
value: 1,
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
label: 'file A(懒加载)',
|
|
|
|
|
defer: true,
|
|
|
|
|
value: 2
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Folder B',
|
|
|
|
|
value: 3,
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
label: 'file b1',
|
|
|
|
|
value: 3.1
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'file b2',
|
|
|
|
|
value: 3.2
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'file C',
|
|
|
|
|
value: 4
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'file D',
|
|
|
|
|
value: 5
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
onEvent: {
|
|
|
|
|
change: {
|
|
|
|
|
actions: [
|
|
|
|
|
{
|
|
|
|
|
actionType: 'toast',
|
2022-04-20 15:20:42 +08:00
|
|
|
|
args: {
|
|
|
|
|
msgType: 'info',
|
2022-10-12 15:09:03 +08:00
|
|
|
|
msg: '派发change事件${tree}'
|
2022-04-20 15:20:42 +08:00
|
|
|
|
}
|
2022-03-17 20:25:51 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
add: {
|
|
|
|
|
actions: [
|
|
|
|
|
{
|
|
|
|
|
actionType: 'toast',
|
2022-05-31 15:05:54 +08:00
|
|
|
|
args: {
|
|
|
|
|
msgType: 'info',
|
2022-10-12 15:09:03 +08:00
|
|
|
|
msg: '派发add事件${tree|json}'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
actionType: 'toast',
|
|
|
|
|
args: {
|
|
|
|
|
msgType: 'info',
|
|
|
|
|
msg: '派发add事件${items|json}'
|
2022-05-31 15:05:54 +08:00
|
|
|
|
}
|
2022-03-17 20:25:51 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
edit: {
|
|
|
|
|
actions: [
|
|
|
|
|
{
|
|
|
|
|
actionType: 'toast',
|
2022-04-20 15:20:42 +08:00
|
|
|
|
args: {
|
|
|
|
|
msgType: 'info',
|
2022-10-12 15:09:03 +08:00
|
|
|
|
msg: '派发edit事件${tree|json}'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
actionType: 'toast',
|
|
|
|
|
args: {
|
|
|
|
|
msgType: 'info',
|
|
|
|
|
msg: '派发edit事件${items|json}'
|
2022-04-20 15:20:42 +08:00
|
|
|
|
}
|
2022-03-17 20:25:51 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
delete: {
|
|
|
|
|
actions: [
|
|
|
|
|
{
|
|
|
|
|
actionType: 'toast',
|
2022-04-20 15:20:42 +08:00
|
|
|
|
args: {
|
|
|
|
|
msgType: 'info',
|
2022-10-12 15:09:03 +08:00
|
|
|
|
msg: '派发delete事件${tree|json}'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
actionType: 'toast',
|
|
|
|
|
args: {
|
|
|
|
|
msgType: 'info',
|
|
|
|
|
msg: '派发delete事件${items|json}'
|
2022-04-20 15:20:42 +08:00
|
|
|
|
}
|
2022-03-17 20:25:51 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
loadFinished: {
|
|
|
|
|
actions: [
|
|
|
|
|
{
|
|
|
|
|
actionType: 'toast',
|
2022-04-20 15:20:42 +08:00
|
|
|
|
args: {
|
|
|
|
|
msgType: 'info',
|
2022-10-12 15:09:03 +08:00
|
|
|
|
msg: '派发loadFinished事件${tree|json}'
|
2022-04-20 15:20:42 +08:00
|
|
|
|
}
|
2022-03-17 20:25:51 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|