import { useAjax } from '@/Hook/useAjax'; import { getLocalCsgroupDayHourListApi } from '@/services/adqV3/monitorEWList'; import { Modal, Statistic, Table, Typography } from 'antd'; import React, { useEffect, useState } from 'react'; import '../tencentAdPutIn/index.less'; const { Text } = Typography; interface AstraGroupHourProps { localCsgroupName: string; data: { day: string; localCsgroupId: number; } } const AstraGroupHourEle: React.FC = ({ localCsgroupName, data }) => { /***************************************/ const [visible, setVisible] = useState(false); const getLocalCsgroupDayHourList = useAjax((params) => getLocalCsgroupDayHourListApi(params)) /***************************************/ useEffect(() => { if (visible) { getLocalCsgroupDayHourList.run(data) } }, [data, visible]); return
setVisible(true)}>小时数据 {visible && {data.day}_{localCsgroupName} 小时数据} open={visible} onCancel={() => setVisible(false)} footer={null} className='modalResetCss' width={800} > {value} }, }, { title: '小时', dataIndex: 'hour', key: 'hour', width: 80, ellipsis: true, align: 'center', render(value) { return {value} }, }, { title: '消耗', dataIndex: 'cost', key: 'cost', width: 80, ellipsis: true, align: 'right', render(value) { return }, }, { title: '加粉次数(广告)', dataIndex: 'scanFollowCount', key: 'scanFollowCount', width: 80, ellipsis: true, align: 'right', render(value) { return {value} }, }, { title: '加粉人数(广告)', dataIndex: 'scanFollowUserCount', key: 'scanFollowUserCount', width: 80, ellipsis: true, align: 'right', render(value) { return {value} }, }, { title: '加粉人数', dataIndex: 'addUserCount', key: 'addUserCount', width: 80, ellipsis: true, align: 'right', render(value) { return {value} }, }, { title: '数据更新时间', dataIndex: 'dataTime', key: 'dataTime', width: 140, ellipsis: true, align: 'center', render(value) { return {value} }, } ]} pagination={false} summary={pageData => { let totalCost = 0; let totalScanFollowCount = 0; let totalScanFollowUserCount = 0; let totalAddUserCount = 0; pageData.forEach(({ cost, scanFollowCount, scanFollowUserCount, addUserCount }) => { totalCost += cost; totalScanFollowCount += scanFollowCount; totalScanFollowUserCount += scanFollowUserCount; totalAddUserCount += addUserCount; }); return ( 总计 -- {totalCost} {totalScanFollowCount} {totalScanFollowUserCount} {totalAddUserCount} -- ); }} sticky size='small' bordered rowKey={'id'} loading={getLocalCsgroupDayHourList.loading} scroll={{ x: 750 }} /> } ; }; export default React.memo(AstraGroupHourEle);