import { BasicColumn, FormSchema } from '@/components/Table';
import { h } from 'vue';
import { Switch, Tag } from 'ant-design-vue';
import { setRoleStatus } from '@/api/demo/system';
import { useMessage } from '@/hooks/web/useMessage';

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

export const searchFormSchema: FormSchema[] = [
  {
    field: 'dateType',
    component: 'Select',
    label: '时间',
    defaultValue: 1,
    componentProps: {
      options: [
        {
          label: '本月',
          value: 1,
        },
        {
          label: '本周',
          value: 2,
        },
        {
          label: '本日',
          value: 3,
        },
      ],
    },
    colProps: { span: 8 },
  },
  {
    field: 'type',
    component: 'Select',
    label: '类型',
    // defaultValue: 1,
    componentProps: {
      options: [
        {
          label: '个人',
          value: 1,
        },
        {
          label: '组',
          value: 2,
        },
      ],
    },
    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 },
      ],
    },
  },
];
