49 lines
1.0 KiB
Plaintext
49 lines
1.0 KiB
Plaintext
import { FormSchema } from '@/components/Form/index';
|
|
import { getLayoutAllList } from '@/api/content/layout';
|
|
export const loadSelectData = async(res)=> {
|
|
//这里可以进行数据转换处理
|
|
return (await getLayoutAllList({ ...res })).map((item, index) => {
|
|
return {
|
|
...item,
|
|
label:item.description,
|
|
value:item.id,
|
|
index,
|
|
};
|
|
});
|
|
}
|
|
export const schemas: FormSchema[] = [
|
|
{
|
|
name: 'layoutId',
|
|
component: 'BasicSelect',
|
|
label: '页面布局',
|
|
componentProps: {
|
|
placeholder: '请选择页面布局',
|
|
clearable: true,
|
|
block:true,
|
|
request: loadSelectData,
|
|
onChange: (e: any) => {
|
|
console.log(e);
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'type',
|
|
component: 'Select',
|
|
label: '页面类型',
|
|
componentProps: {
|
|
placeholder: '请选择页面类型',
|
|
clearable: true,
|
|
options: [
|
|
{
|
|
label: 'CMS文章',
|
|
value: '1',
|
|
},
|
|
{
|
|
label: '通知公告',
|
|
value: '2',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
];
|