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: 'countyname',
    width: 120,
  },{
    title: '项目个数',
    dataIndex: 'xmcount',
    width: 120,
  },{
    title: '项目总用地面积',
    dataIndex: 'xmzydmj',
    width: 120,
  },{
    title: '按功能区分',
    children:[
      {
        title: '生产用地',
        dataIndex: 'scydmj',
        width: 120,
      },{
        title: '生成辅助用地',
        dataIndex: 'scfzydmj',
        width: 120,
      }
    ]
  },{
    title: '其中面积',
    dataIndex: '',
    children:[
      {
        title: '农用地',
        dataIndex: 'nydmj',
        width: 120,
      },{
        title: '耕地',
        dataIndex: 'gdmj',
        width: 120,
      },{
        title: '永久基本农田',
        dataIndex: 'yjjbntmj',
        width: 120,
      }
    ]
  }
];

export const columns: BasicColumn[] = [
  {
    title: '乡镇',
    dataIndex: 'countyname',
    width: 120,
  },{
    title: '项目个数',
    dataIndex: 'xmcount',
    width: 120,
  },{
    title: '项目总用地面积',
    dataIndex: 'xmzydmj',
    width: 120,
  },{
    title: '按功能区分',
    children:[
      {
        title: '生产用地',
        dataIndex: 'scydmj',
        width: 120,
      },{
        title: '生成辅助用地',
        dataIndex: 'scfzydmj',
        width: 120,
      }
    ]
  },{
    title: '其中面积',
    dataIndex: '',
    children:[
      {
        title: '农用地',
        dataIndex: 'nydmj',
        width: 120,
      },{
        title: '耕地',
        dataIndex: 'gdmj',
        width: 120,
      },{
        title: '永久基本农田',
        dataIndex: 'yjjbntmj',
        width: 120,
      }
    ]
  }
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'tubanlaiyuan',
    label: '图斑来源',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: '[startTime, endTime]',
    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 },
      ],
    },
  },
];
