import { Descriptions, DescriptionsProps } from 'antd';
import styles from './inedx.less';
import { useRequest } from 'ahooks';
import services from '@/services';
import { useMemo } from 'react';
const DyaPatrolDetails = ({id}:{id:string}) => {
  const { data } = useRequest(
    () =>
      services.DataBase.getSjdzInfoData({
        typeCode: 'zzcc-rcxc-fylb',
        params: {
       zj:id
          // ...props?.searchTime,
          // wfxw:props.wfxw,
          // ssqy:props.ssqy
        },
      }),
    {
      refreshDeps: [id],
    },
  );
  const items =useMemo(()=>{
    return [
      {
        key: '1',
        label: '巡查编号',
        children: <span>{data?.data?.data?.records?.[0]?.list?.[0]?.xcbh}</span>,
      },
      {
        key: '2',
        label: '问题大类',
        children: <span>{data?.data?.data?.records?.[0]?.list?.[0]?.wtdl}</span>,
      },
      {
        key: '3',
        label: '问题小类',
        children: <span>{data?.data?.data?.records?.[0]?.list?.[0]?.wtxl}</span>,
      },
      {
        key: '4',
        label: '上报人',
        children: <span>{data?.data?.data?.records?.[0]?.list?.[0]?.sbr}</span>,
      },
      {
        key: '5',
        label: '上报部门',
        children: (
          <span>{data?.data?.data?.records?.[0]?.list?.[0]?.sbbm}</span>
        ),
      },
      {
          key: '52',
          label: '所属区域',
          children: (
            <span>{data?.data?.data?.records?.[0]?.list?.[0]?.ssqy}</span>
          ),
        },
      {
          key: '6',
          label: '发现时间',
          children: (
            <span>{data?.data?.data?.records?.[0]?.list?.[0]?.fxsj}</span>
          ),
        },
       {
          key: '7',
          label: '整改时间',
          children: (
            <span>{data?.data?.data?.records?.[0]?.list?.[0]?.zgsj}</span>
          ),
        }, 
        {
          key: '8',
          label: '提交时间',
          children: (
            <span>{data?.data?.data?.records?.[0]?.list?.[0]?.tjsj}</span>
          ),
        }, 
        {
          key: '9',
          label: '完结时间',
          children: (
            <span>{data?.data?.data?.records?.[0]?.list?.[0]?.wjsj}</span>
          ),
        }, 
    
        {
          key: '11',
          label: '事件地址',
          children: (
            <span>{data?.data?.data?.records?.[0]?.list?.[0]?.ajdz}</span>
          ),
        }, 
        
     
    ]
  },[data]) 
  return (
    <div className={styles.container}>
      <Descriptions
        items={items}
        column={1}
        labelStyle={{
          fontSize: 18,
          color: 'rgb(188, 206, 233)',
          display: 'flex',
          justifyContent: 'flex-end',
          width: 160,
        }}
        contentStyle={{
          color: '#fff',
          fontSize: 18,
        }}
      />
    </div>
  );
};
export default DyaPatrolDetails;
