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[] = [
  {
    field: 'layoutId',
    component: 'BasicSelect',
    label: '页面布局',
    componentProps: {
      placeholder: '请选择页面布局',
      clearable: true,
      block: true,
      request: loadSelectData,
    },
  },
  {
    field: 'type',
    component: 'NSelect',
    label: '页面类型',
    componentProps: {
      placeholder: '请选择页面类型',
      clearable: true,
      options: [
        {
          label: 'CMS文章',
          value: '1',
        },
        {
          label: '通知公告',
          value: '2',
        },
      ],
    },
  },
];
