import { FormSchema } from '@/components/Form/index';
import { getRoleAllList } from '@/api/system/role';
export const loadSelectData = async (res) => {
  //这里可以进行数据转换处理
  return (await getRoleAllList({ ...res })).map((item, index) => {
    return {
      ...item,
      label: item.name,
      value: item.id,
      index,
    };
  });
};
export const schemas: FormSchema[] = [
  {
    name: 'realname',
    component: 'Input',
    label: '用户名',
    componentProps: {
      placeholder: '请输入用户名',
    },
  },
  {
    name: 'status',
    component: 'Select',
    label: '状态',
    componentProps: {
      placeholder: '请选择状态',
      clearable: true,
      options: [
        {
          label: '正常',
          value: '1',
        },
        {
          label: '禁用',
          value: '2',
        },
      ],
    },
  },
];
