import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Form';
import { projectInfoList } from '@/api/basicInfo/projectsInfo';

export const formSchemas: FormSchema[] = [
  // {
  //   label: '项目',
  //   field: 'projectId',
  //   component: 'ApiSelect',
  //   componentProps: {
  //     api: projectInfoList,
  //     labelField: 'name',
  //     valueField: 'id',
  //     placeholder: '请选择项目',
  //     afterFetch: (res) => {
  //       return res.rows;
  //     },
  //   },
  // },
  {
    label: '楼宇编号',
    field: 'code',
    component: 'Input',
  },
  {
    label: '楼宇名称',
    field: 'name',
    component: 'Input',
  },
];

export const columns: BasicColumn[] = [
  {
    title: '主键id',
    dataIndex: 'id',
    ifShow: false,
  },
  {
    title: '上级菜单名称',
    dataIndex: 'projectId',
    ifShow: true,
  },
  {
    title: '菜单名称',
    dataIndex: 'code',
  },
  {
    title: '请求url',
    dataIndex: 'name',
  },
  {
    title: '类型',
    dataIndex: 'remark',
  },
];

export const modalSchemas: FormSchema[] = [
  {
    label: '主键id',
    field: 'id',
    required: false,
    component: 'Input',
    show: false,
  },
  // {
  //   label: '项目',
  //   field: 'deptId',
  //   required: true,
  //   component: 'TreeSelect',
  //   helpMessage: ['注意绑定的角色要带相应的部门权限, 否则无法正常登录'],
  // },
  {
    label: '上级菜单',
    field: 'code',
    required: true,
    component: 'Input',
  },
  {
    label: '菜单名称',
    field: 'menu',
    required: true,
    component: 'Input',
  },
  {
    label: '请求url',
    field: 'url',
    required: true,
    component: 'Input',
  },
  {
    label: '图标名称',
    field: 'name',
    required: true,
    component: 'Input',
  },
  {
    label: '类型',
    field: 'type',
    required: true,
    component: 'Select',
  },
  {
    label: '拓展字段',
    field: 'remark',
    required: true,
    component: 'Input',
  },
];
