import { BasicColumn, FormSchema } from '@/components/Table';
import dayjs from 'dayjs';
import { getLoad } from '@/api/sys/sysDataItemDetail';

// 无人机发现违法行为情况统计明细表-table
export const columns: BasicColumn[] = [
  {
    title: 'countyid',
    dataIndex: '县区id',
    ifShow: false,
  },
  {
    title: '县区',
    dataIndex: 'countyname',
    width: 100,
    fixed: 'left',
  },
  {
    title: '下发问题',
    children: [
      {
        title: '宗数',
        dataIndex: 'xftbzs',
        width: 90,
      },
      {
        title: '耕地面积',
        dataIndex: 'xfgdmj',
        width: 90,
      },
    ],
  },
  {
    title: '产业类',
    children: [
      {
        title: '填报完成',
        children: [
          {
            title: '宗数',
            dataIndex: 'cytbzs',
            width: 90,
          },
          {
            title: '耕地面积',
            dataIndex: 'cytbgdmj',
            width: 90,
          },
        ]
      },
      {
        title: '整改完成',
        children: [
          {
            title: '宗数',
            dataIndex: 'cyzgzs',
            width: 90,
          },
          {
            title: '耕地面积',
            dataIndex: 'cyzggdmj',
            width: 90,
          },
        ]
      },
      {
        title: '处罚完成',
        children: [
          {
            title: '宗数',
            dataIndex: 'cycfzs',
            width: 90,
          },
          {
            title: '耕地面积',
            dataIndex: 'cycfgdmj',
            width: 90,
          },
        ]
      },
    ],
  },
  {
    title: '公共管理服务类',
    children: [
      {
        title: '填报完成',
        children: [
          {
            title: '宗数',
            dataIndex: 'ggtbzs',
            width: 90,
          },
          {
            title: '耕地面积',
            dataIndex: 'ggtbgdmj',
            width: 90,
          },
        ],
      },
      {
        title: '整改完成',
        children: [
          {
            title: '宗数',
            dataIndex: 'ggzgzs',
            width: 90,
          },
          {
            title: '耕地面积',
            dataIndex: 'ggzggdmj',
            width: 90,
          },
        ],
      },
      {
        title: '处罚完成',
        children: [
          {
            title: '宗数',
            dataIndex: 'ggcfzs',
            width: 90,
          },
          {
            title: '耕地面积',
            dataIndex: 'ggcfgdmj',
            width: 90,
          },
        ],
      },
    ],
  },
  {
    title: '设施农业类',
    children: [
      {
        title: '填报完成',
        children: [
          {
            title: '宗数',
            dataIndex: 'sstbzs',
            width: 90,
          },
          {
            title: '耕地面积',
            dataIndex: 'sstbgdmj',
            width: 90,
          },
        ],
      },
      {
        title: '整改完成',
       children: [
          {
            title: '宗数',
            dataIndex: 'sszgzs',
            width: 90,
          },
          {
            title: '耕地面积',
            dataIndex: 'sszggdmj',
            width: 90,
          },
        ],
      },
    ],
  },
];

// 无人机发现违法行为情况统计明细表-搜索
export const searchFormSchema: FormSchema[] = [
  {
    field: '[startTime, endTime]',
    label: '日期范围',
    component: 'RangePicker',
    colProps: { span: 8 },
    componentProps: {
      format: 'YYYY-MM-DD',
      // picker: 'month',
      placeholder: ['开始日期', '结束日期'],
      defaultValue: [dayjs(dayjs().add(-1, 'day'), 'YYYY-MM-DD'), dayjs(dayjs().add(-1, 'day'), 'YYYY-MM-DD')]
    },
  },
  // {
  //   field: 'tubanlaiyuan',
  //   label: '线索来源',
  //   component: 'ApiSelect',
  //   colProps: { span: 5 },
  //   componentProps: ({ formModel }) => {
  //     return {
  //       api: getLoad,
  //       params: { code: 'xcsjtbly' },
  //       // 接口参数
  //       resultField: 'result',
  //       labelField: 'itemName',
  //       valueField: 'itemValue',
  //       mode: 'multiple',
  //       maxTagCount: 1
  //     };
  //   },
  // },
];
