2019-04-30 11:11:25 +08:00
|
|
|
export default {
|
2019-11-07 10:41:14 +08:00
|
|
|
type: 'page',
|
|
|
|
title: '表单选线之间的远程联动',
|
|
|
|
body: {
|
|
|
|
type: 'form',
|
|
|
|
mode: 'horizontal',
|
|
|
|
title: '',
|
|
|
|
actions: [],
|
2021-06-07 10:09:55 +08:00
|
|
|
body: [
|
2019-11-07 10:41:14 +08:00
|
|
|
'<p class="text-danger">表单选项可以设置 source 通过 API 远程拉取,同时如果 source 中有变量的话,变量值发生变化就会重新拉取,达到联动效果。</p>',
|
|
|
|
{
|
|
|
|
type: 'divider'
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
|
|
|
label: '选项1',
|
|
|
|
type: 'select',
|
|
|
|
labelClassName: 'text-muted',
|
|
|
|
name: 'a',
|
|
|
|
inline: true,
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: '选项1',
|
|
|
|
value: 1
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
|
|
|
label: '选项2',
|
|
|
|
value: 2
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
|
|
|
label: '选项3',
|
|
|
|
value: 3
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
|
|
|
label: '选项2',
|
|
|
|
type: 'select',
|
|
|
|
labelClassName: 'text-muted',
|
|
|
|
name: 'b',
|
|
|
|
inline: true,
|
|
|
|
source: '/api/mock2/options/level2?a=${a}',
|
|
|
|
initFetchOn: 'data.a'
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
|
|
|
label: '选项3',
|
|
|
|
type: 'select',
|
|
|
|
labelClassName: 'text-muted',
|
|
|
|
name: 'c',
|
|
|
|
inline: true,
|
|
|
|
visibleOn: 'data.b',
|
|
|
|
source: '/api/mock2/options/level3?b=${b}'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|