import { BasicColumn, FormSchema } from '@/components/Table';
import { getCurMonthFirstOrLast } from '@/utils/global';

export const columns: BasicColumn[] = [
  {
    title: '姓名',
    dataIndex: 'userName',
  },
  {
    title: '任务数',
    dataIndex: 'taskCount',
  },
  {
    title: '图斑数',
    dataIndex: 'tuBanCount',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: '[beginTime, endTime]',
    label: '日期范围',
    component: 'RangePicker',
    defaultValue: [getCurMonthFirstOrLast(0), getCurMonthFirstOrLast()],
    componentProps: {
      format: 'YYYY-MM-DD',
      placeholder: ['开始日期', '结束日期'],
    },
    colProps: { span: 8 },
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: '角色名称',
    required: true,
    component: 'Input',
    ifShow: false,
  },
  {
    field: 'name',
    label: '角色名称',
    required: true,
    component: 'Input',
  },
  {
    field: 'status',
    label: '状态',
    component: 'RadioButtonGroup',
    defaultValue: 0,
    componentProps: {
      options: [
        { label: '启用', value: 0 },
        { label: '停用', value: 1 },
      ],
    },
  },
];
