master
Joe 1 year ago
parent 1949fe8682
commit 33bb19826a

@ -96,6 +96,9 @@ const TableList: React.FC<{}> = () => {
title: '注册日期', title: '注册日期',
dataIndex: 'pbcCreateAt', dataIndex: 'pbcCreateAt',
hideInTable: true, hideInTable: true,
fieldProps:{
maxDate: moment()
},
valueType: 'dateRange' valueType: 'dateRange'
}, },
{ {

@ -77,6 +77,9 @@ import moment from 'moment';
title: '访问时间', title: '访问时间',
dataIndex: 'pbcCreateAt', dataIndex: 'pbcCreateAt',
hideInTable: true, hideInTable: true,
fieldProps:{
maxDate: moment()
},
valueType: 'dateRange' valueType: 'dateRange'
}, },
]; ];

@ -73,6 +73,9 @@ const TableList: React.FC<{}> = () => {
title: '扫码时间', title: '扫码时间',
dataIndex: 'pbcCreateAt', dataIndex: 'pbcCreateAt',
valueType: 'dateRange', valueType: 'dateRange',
fieldProps:{
maxDate: moment()
},
hideInTable: true hideInTable: true
}, },
]; ];

@ -2,11 +2,11 @@ import { dashboardUsingPost, exportDashboardDetailUsingPost } from '@/services/p
import { Bar, Pie, WordCloud, WordCloudConfig } from '@ant-design/plots'; import { Bar, Pie, WordCloud, WordCloudConfig } from '@ant-design/plots';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { PageContainer, ProCard, ProForm, ProFormDateRangePicker, ProFormGroup, ProFormInstance, ProFormRadio } from '@ant-design/pro-components'; import { PageContainer, ProCard, ProForm, ProFormDateRangePicker, ProFormGroup, ProFormInstance, ProFormRadio } from '@ant-design/pro-components';
import { Button, Card, Col, DatePickerProps, message, Row, Spin, Statistic } from 'antd'; import { Button, Card, Col, message, Row, Spin, Statistic } from 'antd';
import React, { useEffect, useRef, useState } from 'react'; import React, { useEffect, useRef, useState } from 'react';
import { querySearchKeyRankUsingPost } from '@/services/pop-b2b2c/pbcSearchKeyController';
import { history, Link } from '@umijs/max'; import { history, Link } from '@umijs/max';
import Constants from '@/constants'; import Constants from '@/constants';
import { disabledDate } from '@/utils/utils';
const handleExport = async (values?: API.PbcDashBoardDTO) => { const handleExport = async (values?: API.PbcDashBoardDTO) => {
@ -52,6 +52,7 @@ const Welcome: React.FC = () => {
}); });
const [pbcInteractStatical, setPbcInteractStatical] = useState<API.PbcInteractStaticalVO>({ const [pbcInteractStatical, setPbcInteractStatical] = useState<API.PbcInteractStaticalVO>({
pbcColectNumber: 0, pbcColectNumber: 0,
pbcNewGoodsViewNumber: 0,
pbcViewTotalNumber: 0 pbcViewTotalNumber: 0
}); });
@ -116,6 +117,7 @@ const Welcome: React.FC = () => {
setData1((res.data.pbcBusinessViewStaticalVO.pbcBusinessRankList || []).map((e: any) => { setData1((res.data.pbcBusinessViewStaticalVO.pbcBusinessRankList || []).map((e: any) => {
return { return {
label: e.pbcBusinessName, label: e.pbcBusinessName,
pbcBusinessId: e.pbcBusinessId,
value: e.pbcBusinessVisitCount value: e.pbcBusinessVisitCount
} }
})) }))
@ -136,13 +138,15 @@ const Welcome: React.FC = () => {
setData2(arr) setData2(arr)
setData3((res.data.pbcProductViewStaticalVO.pbcProductViewRank || []).map((e: any) => { setData3((res.data.pbcProductViewStaticalVO.pbcProductViewRank || []).map((e: any) => {
return { return {
label: e.pbcProductName, label: e.businessName + '-' + e.pbcProductName,
pbcProductId: e.pbcProductId,
value: e.pbcProductVisitCount value: e.pbcProductVisitCount
} }
})) }))
setData4((res.data.pbcProductCollectStaticalVO.pbcProductCollectViewRank || []).map((e: any) => { setData4((res.data.pbcProductCollectStaticalVO.pbcProductCollectViewRank || []).map((e: any) => {
return { return {
label: e.pbcProductName, label: e.businessName + '-' + e.pbcProductName,
pbcProductId: e.pbcProductId,
value: e.pbcProductCollectCount value: e.pbcProductCollectCount
} }
})) }))
@ -151,23 +155,9 @@ const Welcome: React.FC = () => {
}).catch(() => { }).catch(() => {
handleLoadChange(true) handleLoadChange(true)
}) })
querySearchKeyRankUsingPost(param).then(res => {
if (res.retcode) {
}
})
} }
} }
const disabledDate: DatePickerProps['disabledDate'] = (current, { from }) => {
if (from) {
return Math.abs(current.diff(from, 'months')) >= 3;
}
return false;
};
useEffect(() => { useEffect(() => {
getData() getData()
}, []) }, [])
@ -271,8 +261,9 @@ const Welcome: React.FC = () => {
</Col> </Col>
<Col span={8}> <Col span={8}>
<Card title="互动情况" bodyStyle={{ display: 'flex', justifyContent: 'space-between' }} bordered={false}> <Card title="互动情况" bodyStyle={{ display: 'flex', justifyContent: 'space-between' }} bordered={false}>
<Statistic title="浏览总数" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={pbcInteractStatical.pbcViewTotalNumber || 0} /> <Statistic title="浏览数" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={pbcInteractStatical.pbcViewTotalNumber || 0} />
<Statistic title="收藏总数" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={pbcInteractStatical.pbcColectNumber || 0} /> <Statistic title="新增商品浏览数" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={pbcInteractStatical.pbcNewGoodsViewNumber || 0} />
<Statistic title="收藏数" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={pbcInteractStatical.pbcColectNumber || 0} />
</Card> </Card>
</Col> </Col>
</Row> </Row>
@ -281,7 +272,17 @@ const Welcome: React.FC = () => {
<Card title="商户浏览量排行" extra={ <Card title="商户浏览量排行" extra={
<Link to="/dashboard/business-views">{'更多>>'}</Link> <Link to="/dashboard/business-views">{'更多>>'}</Link>
} bordered={false}> } bordered={false}>
<Bar {...config} data={data1} /> <Bar {...config} data={data1} onReady={(plot) => {
plot.on('plot:click', (evt: { x: any; y: any; }) => {
const { x, y } = evt;
const tooltipData = plot.chart.getTooltipItems({ x, y });
let id = ""
if (tooltipData && tooltipData.length > 0) {
id = tooltipData[0].data.pbcBusinessId
}
history.push(`/business/detail/${id}?isEdit=0`)
});
}} />
</Card> </Card>
</Col> </Col>
<Col span={12}> <Col span={12}>
@ -312,12 +313,32 @@ const Welcome: React.FC = () => {
<Row style={{ marginBottom: 12 }} gutter={16}> <Row style={{ marginBottom: 12 }} gutter={16}>
<Col span={12}> <Col span={12}>
<Card title="商品浏览次数排行榜" bordered={false}> <Card title="商品浏览次数排行榜" bordered={false}>
<Bar {...config} data={data3} /> <Bar {...config} data={data3} onReady={(plot) => {
plot.on('plot:click', (evt: { x: any; y: any; }) => {
const { x, y } = evt;
const tooltipData = plot.chart.getTooltipItems({ x, y });
let id = ""
if (tooltipData && tooltipData.length > 0) {
id = tooltipData[0].data.pbcProductId
}
history.push('/product/detail/' + id)
});
}} />
</Card> </Card>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Card title="商品收藏次数排行榜" bordered={false}> <Card title="商品收藏次数排行榜" bordered={false}>
<Bar {...config} data={data4} /> <Bar {...config} data={data4} onReady={(plot) => {
plot.on('plot:click', (evt: { x: any; y: any; }) => {
const { x, y } = evt;
const tooltipData = plot.chart.getTooltipItems({ x, y });
let id = ""
if (tooltipData && tooltipData.length > 0) {
id = tooltipData[0].data.pbcProductId
}
history.push('/product/detail/' + id)
});
}} />
</Card> </Card>
</Col> </Col>
</Row> </Row>

@ -103,6 +103,9 @@ const TableList: React.FC<{}> = () => {
{ {
title: '创建日期', title: '创建日期',
dataIndex: 'pbcCreateAt', dataIndex: 'pbcCreateAt',
fieldProps:{
maxDate: moment()
},
valueType: 'dateRange', valueType: 'dateRange',
}, },
{ {

@ -82,6 +82,9 @@ const TableList: React.FC<{}> = () => {
title: '创建日期', title: '创建日期',
dataIndex: 'pbcCreateAt', dataIndex: 'pbcCreateAt',
hideInTable: true, hideInTable: true,
fieldProps:{
maxDate: moment()
},
valueType: 'dateRange' valueType: 'dateRange'
}, },
{ {

@ -1,3 +1,4 @@
import { DatePickerProps } from 'antd';
import { parse } from 'querystring'; import { parse } from 'querystring';
const reg = const reg =
@ -19,6 +20,14 @@ export const removeUndefinedKey = (obj: any) => {
return obj; return obj;
}; };
export const disabledDate: DatePickerProps['disabledDate'] = (current, { from }) => {
if (from) {
return Math.abs(current.diff(from, 'months')) >= 3;
}
return false;
};
/* /*
* *
*javascript *javascript

Loading…
Cancel
Save