import DescriptionItem from '@/components/DescriptionItem';

import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider';
import services from '@/services';
import { useRequest } from 'ahooks';
import { Flex } from 'antd';
import React from 'react';
import styles from './index.less';

const LawEnforcement: React.FC = () => {
  const { dispatch } = useGlobalModalServices();
  const commonValueStyle = {
    background: 'linear-gradient(180deg, #AAFFF6 0%, #25BBFF 100%)',
    WebkitBackgroundClip: 'text',
    WebkitTextFillColor: 'transparent',
    fontFamily: 'D-DIN',
    fontSize: '36px',
    fontWeight: 700,
    lineHeight: 1.1,
  };

  const commonLabelStyle = {
    color: '#BCCEE9',
    // fontFamily: '微软雅黑',
    fontSize: '20px',
    fontWeight: 400,
    lineHeight: 1.1,
  };

  const commonUnitStyle = {
    color: '#BCCEE9',
    // fontFamily: '微软雅黑',
    fontSize: '20px',
    fontWeight: 400,
    lineHeight: 1.1,
  };

  const { data } = useRequest(() =>
    services.DataBase.getSjdzInfoData({
      typeCode: 'zzcc-xzcf-xzcfsl',
    }),
  );
  console.log(data, '---------------');

  return (
    <div className={styles.container}>
      <Flex vertical gap={0}>
      

        <Flex justify="space-between" >
        <div
          style={{ cursor: 'pointer' }}
          onClick={() => {
            dispatch.push('AdministPunish');
          }}
        >
          <DescriptionItem
            // value={279}
            value={data?.data?.data?.records?.[0]?.xzcf ?? 0}
            name="本月行政处罚"
            unit="件"
            valueStyle={commonValueStyle}
            labelStyle={commonLabelStyle}
            unitStyle={commonUnitStyle}
            decimals={0}
          />
        </div>
          <div
            onClick={() => {
               dispatch.push('DyaPatrol',);
            }}
          >
            <DescriptionItem
              value={data?.data?.data?.records?.[0]?.rcxc ?? 0}
              name="今日日常巡查"
              unit="件"
              valueStyle={commonValueStyle}
              labelStyle={commonLabelStyle}
              unitStyle={commonUnitStyle}
              decimals={0}
            />
          </div>
         
        </Flex>
        <div
            style={{ cursor: 'pointer' ,marginTop:20}}
            onClick={() => {
              dispatch.push('AreaSynergy');
              // dispatch.push('EquipResource')
            }}
          >
            <DescriptionItem
              value={data?.data?.data?.records?.[0]?.sqxt ?? 0}
              name="本月市区协同"
              unit="件"
              valueStyle={commonValueStyle}
              labelStyle={commonLabelStyle}
              unitStyle={commonUnitStyle}
              decimals={0}
            />
          </div>
      </Flex>
    </div>
  );
};

export default LawEnforcement;
