Prechádzať zdrojové kódy

Merge branch 'develop' of http://git.zanxiangnet.com/wjx/ad-manage

wjx 1 deň pred
rodič
commit
7dc21b3cbe

+ 40 - 2
src/pages/launchSystemV3/monitorEWList/astraGroupHourEle.tsx

@@ -1,8 +1,9 @@
 import { useAjax } from '@/Hook/useAjax';
 import { getLocalCsgroupDayHourListApi } from '@/services/adqV3/monitorEWList';
-import { Modal, Statistic, Table } from 'antd';
+import { Modal, Statistic, Table, Typography } from 'antd';
 import React, { useEffect, useState } from 'react';
 import '../tencentAdPutIn/index.less';
+const  { Text } = Typography;
 
 interface AstraGroupHourProps {
     localCsgroupName: string;
@@ -11,7 +12,7 @@ interface AstraGroupHourProps {
         localCsgroupId: number;
     }
 }
-const AstraGroupHourEle: React.FC<AstraGroupHourProps> = ({localCsgroupName, data}) => {
+const AstraGroupHourEle: React.FC<AstraGroupHourProps> = ({ localCsgroupName, data }) => {
 
     /***************************************/
     const [visible, setVisible] = useState<boolean>(false);
@@ -116,6 +117,43 @@ const AstraGroupHourEle: React.FC<AstraGroupHourProps> = ({localCsgroupName, dat
                         },
                     }
                 ]}
+                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 (
+                        <Table.Summary fixed='top'>
+                            <Table.Summary.Row>
+                                <Table.Summary.Cell index={0} align="center"><Text strong>总计</Text></Table.Summary.Cell>
+                                <Table.Summary.Cell index={1} align="center">--</Table.Summary.Cell>
+                                <Table.Summary.Cell index={2} align="right">
+                                    <Text strong>{totalCost}</Text>
+                                </Table.Summary.Cell>
+                                <Table.Summary.Cell index={3} align="right">
+                                    <Text strong>{totalScanFollowCount}</Text>
+                                </Table.Summary.Cell>
+                                <Table.Summary.Cell index={4} align="right">
+                                    <Text strong>{totalScanFollowUserCount}</Text>
+                                </Table.Summary.Cell>
+                                <Table.Summary.Cell index={5} align="right">
+                                    <Text strong>{totalAddUserCount}</Text>
+                                </Table.Summary.Cell>
+                                <Table.Summary.Cell index={6} align="center">--</Table.Summary.Cell>
+                            </Table.Summary.Row>
+                        </Table.Summary>
+                    );
+                }}
+                sticky
                 size='small'
                 bordered
                 rowKey={'id'}

+ 5 - 5
src/pages/launchSystemV3/monitorEWList/astraSupport‌.tsx

@@ -21,11 +21,11 @@ const AstraSupport: React.FC = () => {
     /*******************************************/
 
     useEffect(() => {
-        // getCorpWechatAll.run({}).then((res) => {
-        //     if (res && res.length > 0) {
-        //         setCorpWechatList(res.map((item: { corpName: string; localCorpId: string; }) => ({ label: item.corpName, value: item.localCorpId })));
-        //     }
-        // })
+        getCorpWechatAll.run({}).then((res) => {
+            if (res && res.length > 0) {
+                setCorpWechatList(res.map((item: { corpName: string; localCorpId: string; }) => ({ label: item.corpName, value: item.localCorpId })));
+            }
+        })
     }, [])
 
     useEffect(() => {

+ 32 - 4
src/pages/launchSystemV3/monitorEWList/astraSupport‌Hour.tsx

@@ -1,8 +1,9 @@
 import { useAjax } from '@/Hook/useAjax';
 import { getCorpUserDayHourListApi } from '@/services/adqV3/monitorEWList';
-import { Modal, Table } from 'antd';
+import { Modal, Table, Typography } from 'antd';
 import React, { useEffect, useState } from 'react';
 import '../tencentAdPutIn/index.less';
+const  { Text } = Typography;
 
 interface AstraSupportHourProps {
     corpName: string;
@@ -82,7 +83,7 @@ const AstraSupportHour: React.FC<AstraSupportHourProps> = ({ corpName, corpUserN
                         align: 'right',
                         render(value) {
                             return <span style={{ fontSize: 12 }}>{value}</span>
-                        },
+                        }
                     },
                     {
                         title: '数据更新时间',
@@ -93,14 +94,41 @@ const AstraSupportHour: React.FC<AstraSupportHourProps> = ({ corpName, corpUserN
                         align: 'center',
                         render(value) {
                             return <span style={{ fontSize: 12 }}>{value}</span>
-                        },
+                        }
                     }
                 ]}
                 size='small'
                 bordered
                 rowKey={'id'}
+                sticky
                 loading={getCorpUserDayHourList.loading}
-                scroll={{ x: 750 }}
+                scroll={{ x: 700, y: 450 }}
+                pagination={false}
+                summary={pageData => {
+                    let totalBorrow = 0;
+                    let totalRepayment = 0;
+
+                    pageData.forEach(({ addUserCount, outUserCount }) => {
+                        totalBorrow += addUserCount;
+                        totalRepayment += outUserCount;
+                    });
+
+                    return (
+                        <Table.Summary fixed='top'>
+                            <Table.Summary.Row>
+                                <Table.Summary.Cell index={0} align="center"><Text strong>总计</Text></Table.Summary.Cell>
+                                <Table.Summary.Cell index={1} align="center">--</Table.Summary.Cell>
+                                <Table.Summary.Cell index={2} align="right">
+                                    <Text strong>{totalBorrow}</Text>
+                                </Table.Summary.Cell>
+                                <Table.Summary.Cell index={3} align="right">
+                                    <Text strong>{totalRepayment}</Text>
+                                </Table.Summary.Cell>
+                                <Table.Summary.Cell index={4} align="center">--</Table.Summary.Cell>
+                            </Table.Summary.Row>
+                        </Table.Summary>
+                    );
+                }}
             />
         </Modal>}
     </>;

+ 3 - 3
src/pages/launchSystemV3/monitorEWList/tableConfig.tsx

@@ -28,7 +28,7 @@ export const CorpUserDayListTableConfig = (): ColumnsType<never> => {
             width: 100,
             ellipsis: true,
             render(value) {
-                return <span style={{ fontSize: 12 }}>{value}</span>
+                return <span style={{ fontSize: 12 }}>{value || '--'}</span>
             },
         },
         {
@@ -48,7 +48,7 @@ export const CorpUserDayListTableConfig = (): ColumnsType<never> => {
             width: 100,
             ellipsis: true,
             render(value) {
-                return <span style={{ fontSize: 12 }}>{value}</span>
+                return <span style={{ fontSize: 12 }}>{value || '--'}</span>
             },
         },
         {
@@ -68,7 +68,7 @@ export const CorpUserDayListTableConfig = (): ColumnsType<never> => {
             width: 100,
             align: 'right',
             render(value) {
-                return <span style={{ fontSize: 12 }}>{value}</span>
+                return <span style={{ fontSize: 12, color: (value >= 60 && value < 100) ? 'orange' : value > 100 ? 'red' : '#000000D9' }}>{value}</span>
             },
         },
         {