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 columnsDataPreview: BasicColumn[] = [
  {
    title: '机构',
    dataIndex: 'streetname',
    width: 120,
  },{
    title: '无人机发现数量',
    dataIndex: 'allCount',
    width: 120,
  },{
    title: '外业图斑核查情况',
    children:[
      {
        title: '完成外业核查数量',
        dataIndex: 'handleStatus',
        width: 120,
      },{
        title: '24h内未核查',
        dataIndex: 'notDealHour24',
        width: 120,
      }
    ]
  },{
    title: '下发疑似图斑类型',
    dataIndex: '',
    children:[
      {
        title: '房屋翻新',
        dataIndex: 'typeFanxinCount',
        width: 120,
      },{
        title: '房屋加盖',
        dataIndex: 'typeJiagaiCount',
        width: 120,
      },{
        title: '房屋翻建',
        dataIndex: 'typeFanjianCount',
        width: 120,
      },{
        title: '存量建设',
        dataIndex: 'typeCunliangCount',
        width: 120,
      },{
        title: '推土',
        dataIndex: 'typeTuituCount',
        width: 120,
      },{
        title: '其他',
        dataIndex: 'typeOtherCount',
        width: 120,
      }
    ]
  },{
    title: '图斑判定',
    dataIndex:"1",
    children:[
      {
        title: '合法',
        dataIndex: 'illegal0Count',
        width: 120,
      },{
        title: '违法',
        dataIndex: 'illegal1Count',
        width: 120,
      },{
        title: '伪变化',
        dataIndex: 'illegal2Count',
        width: 120,
      }
    ]
  },{
    title: '新增违法图斑整改情况',
    dataIndex: '2',
    children:[
      {
        title: '外业核实后确定违法数',
        dataIndex: 'illegal1Count1',
        width: 120,
      },{
        title: '违法面积',
        dataIndex: 'illegalHandleAreaList',
        width: 120,
      },{
        title: '整改销号数',
        dataIndex: 'illegalHandle2Status',
        width: 120,
      },{
        title: '销号面积',
        dataIndex: 'illegalHandle2AreaList',
        width: 120,
      },{
        title: '尚未整改宗数',
        dataIndex: 'illegalHandle01Status',
        width: 120,
      },{
        title: '未整改面积',
        dataIndex: 'illegalHandle01AreaList',
        width: 120,
      }
    ]
  },{
    title: '违法图斑整改进度情况',
    children:[
      {
        title: '3日内未整改完成',
        dataIndex: 'notComplete3',
      },{
        title: '7日内未整改完成',
        dataIndex: 'notComplete7',
      },{
        title: '30日内未整改完成',
        dataIndex: 'notComplete30',
      },{
        title: '30日以上未整改完成',
        dataIndex: 'notComplete30More',
      }
    ]
  },{
    title: '百分制考核计分',
    dataIndex: 'handle_status_name',
    children:[
      {
        title: '24h外业核查计分',
        dataIndex: 'beginTime',
        width: 120,
      },{
        title: '整改进度计分',
        dataIndex: 'beginTime',
        width: 120,
      }
    ]
  },
  {
    title: '备注',
    dataIndex: 'mask',
  }
];

export const columns: BasicColumn[] = [
  {
    title: '机构',
    dataIndex: 'streetname',
    width: 120,
  },{
    title: '无人机发现数量',
    dataIndex: 'allCount',
    width: 120,
  },{
    title: '外业图斑核查情况',
    children:[
      {
        title: '完成外业核查数量',
        dataIndex: 'handleStatus',
        width: 120,
      },{
        title: '24h内未核查',
        dataIndex: 'notDealHour24',
        width: 120,
      }
    ]
  },{
    title: '下发疑似图斑类型',
    dataIndex: '',
    children:[
      {
        title: '房屋翻新',
        dataIndex: 'typeFanxinCount',
        width: 120,
      },{
        title: '房屋加盖',
        dataIndex: 'typeJiagaiCount',
        width: 120,
      },{
        title: '房屋翻建',
        dataIndex: 'typeFanjianCount',
        width: 120,
      },{
        title: '存量建设',
        dataIndex: 'typeCunliangCount',
        width: 120,
      },{
        title: '推土',
        dataIndex: 'typeTuituCount',
        width: 120,
      },{
        title: '其他',
        dataIndex: 'typeOtherCount',
        width: 120,
      }
    ]
  },{
    title: '图斑判定',
    dataIndex:"1",
    children:[
      {
        title: '合法',
        dataIndex: 'illegal0Count',
        width: 120,
      },{
        title: '违法',
        dataIndex: 'illegal1Count',
        width: 120,
      },{
        title: '伪变化',
        dataIndex: 'illegal2Count',
        width: 120,
      }
    ]
  },{
    title: '新增违法图斑整改情况',
    dataIndex: '2',
    children:[
      {
        title: '外业核实后确定违法数',
        dataIndex: 'illegal1Count1',
        width: 120,
      },{
        title: '违法面积',
        dataIndex: 'illegalHandleAreaList',
        width: 120,
      },{
        title: '整改销号数',
        dataIndex: 'illegalHandle2Status',
        width: 120,
      },{
        title: '销号面积',
        dataIndex: 'illegalHandle2AreaList',
        width: 120,
      },{
        title: '尚未整改宗数',
        dataIndex: 'illegalHandle01Status',
        width: 120,
      },{
        title: '未整改面积',
        dataIndex: 'illegalHandle01AreaList',
        width: 120,
      }
    ]
  },{
    title: '违法图斑整改进度情况',
    children:[
      {
        title: '3日内未整改完成',
        dataIndex: 'notComplete3',
      },{
        title: '7日内未整改完成',
        dataIndex: 'notComplete7',
      },{
        title: '30日内未整改完成',
        dataIndex: 'notComplete30',
      },{
        title: '30日以上未整改完成',
        dataIndex: 'notComplete30More',
      }
    ]
  },{
    title: '百分制考核计分',
    dataIndex: 'handle_status_name',
    children:[
      {
        title: '24h外业核查计分',
        dataIndex: 'beginTime',
        width: 120,
      },{
        title: '整改进度计分',
        dataIndex: 'beginTime',
        width: 120,
      }
    ]
  },
  {
    title: '备注',
    dataIndex: 'mask',
  }
];

export const searchFormSchema: FormSchema[] = [
  // {
  //   field: 'key',
  //   label: '关键字段',
  //   component: 'Input',
  //   colProps: { span: 6 },
  // },
  {
    field: '[identification_start_time, identification_end_time]',
    label: '日期范围',
    component: 'RangePicker',
    colProps: { span: 8 },
    componentProps: {
      format: 'YYYY-MM-DD',
      placeholder: ['开始日期', '结束日期'],
    },
  },
 
];



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