import services from '@/services';
import { useRequest } from 'ahooks';
import { Descriptions } from 'antd';
import dayjs from 'dayjs';
import { useMemo } from 'react';
import styles from './inedx.less';
const AreaSynergyDetails = (props: any) => {
  const { data } = useRequest(
    () =>
      services.DataBase.getSjdzInfoData({
        typeCode: 'zzcc-sqxt-fylb',
        params: {
          dwId: props?.dwId,
        },
      }),
    {
      refreshDeps: [props?.dwId],
    },
  );
  console.log(data);

  const items = useMemo(() => {
    return [
      {
        key: '1',
        label: '事件编号',
        children: (
          <span>{data?.data?.data?.records?.[0]?.list?.[0]?.caseNo}</span>
        ),
      },
      {
        key: '2',
        label: '事件大类',
        children: (
          <span>{data?.data?.data?.records?.[0]?.list?.[0]?.eventType}</span>
        ),
      },
      
      {
        key: '52',
        label: '所属区域',
        children: (
          <span>{data?.data?.data?.records?.[0]?.list?.[0]?.areaName}</span>
        ),
      },
      {
        key: '53',
        label: '事件来源',
        children: (
          <span>{data?.data?.data?.records?.[0]?.list?.[0]?.sjly}</span>
        ),
      },
     
      {
        key: '11',
        label: '发现时间',
        children: (
          <span>
            {dayjs(
              data?.data?.data?.records?.[0]?.list?.[0]?.caseTime,
            )?.format('YYYY-MM-DD HH:mm:ss')}
          </span>
        ),
      },
      {
        key: '6',
        label: '上报时间',
        children: (
          <span>
            {dayjs(
              data?.data?.data?.records?.[0]?.list?.[0]?.reportTime,
            )?.format('YYYY-MM-DD HH:mm:ss')}
          </span>
        ),
      },
      {
        key: '7',
        label: '交办时间',
        children: <span>
        {dayjs(
          data?.data?.data?.records?.[0]?.list?.[0]?.caseTime,
        )?.format('YYYY-MM-DD HH:mm:ss')}
      </span>,
      },
      {
        key: '8',
        label: '办理时限',
        children: (
          <span>
            {dayjs(
              data?.data?.data?.records?.[0]?.list?.[0]?.limitedTime,
            )?.format('YYYY-MM-DD HH:mm:ss')}
          </span>
        ),
      },
      {
        key: '9',
        label: '完结时间',
        children: <span>
        {dayjs(
          data?.data?.data?.records?.[0]?.list?.[0]?.reportTime,
        )?.format('YYYY-MM-DD HH:mm:ss')}
      </span>,
      },

      {
        key: '11',
        label: '是否超时',
        children: (
          <span>{data?.data?.data?.records?.[0]?.list?.[0]?.isOverdue}</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: 170,
        }}
        contentStyle={{
          color: '#fff',
          fontSize: 18,
        }}
      />
    </div>
  );
};
export default AreaSynergyDetails;
