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

export const formSchemas: FormSchema[] = [
  // {
  //   label: '组织',
  //   field: 'organizationId',
  //   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',
  },
  {
    label: '小区地址',
    field: 'address',
    component: 'Input',
  },
  // {
  //   label: '行政区域',
  //   field: 'areaCode',
  //   component: 'Input',
  // },
];

export const columns: BasicColumn[] = [
  {
    title: '主键id',
    dataIndex: 'id',
    ifShow: false,
  },
  // {
  //   title: '组织',
  //   dataIndex: 'organizationId',
  // },
  {
    title: '小区编号',
    dataIndex: 'code',
  },
  {
    title: '小区名称',
    dataIndex: 'name',
  },
  {
    title: '小区地址',
    dataIndex: 'address',
  },
  {
    title: '行政区域',
    dataIndex: 'areaCode',
  },
  {
    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: 'name',
    required: true,
    component: 'Input',
  },
  {
    label: '小区地址',
    field: 'address',
    required: true,
    component: 'Input',
  },
  {
    label: '行政区域',
    field: 'areaCode',
    required: false,
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    required: true,
    component: 'Input',
  },
];
