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: '纬度',
    dataIndex: 'name',
  },
  {
    title: '签到地点',
    dataIndex: 'signAddress',
  },
  {
    title: '备注',
    dataIndex: 'remark',
  },
  {
    title: '签到时间',
    dataIndex: 'signTime',
  },
];

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',
  },
];
