|
|
|
@ -4,7 +4,7 @@ import dayjs from 'dayjs';
|
|
|
|
|
import { PageContainer, ProCard, ProForm, ProFormDateRangePicker, ProFormGroup, ProFormInstance, ProFormRadio } from '@ant-design/pro-components';
|
|
|
|
|
import { Button, Card, Col, message, Row, Spin, Statistic } from 'antd';
|
|
|
|
|
import React, { useEffect, useRef, useState } from 'react';
|
|
|
|
|
import { history, Link } from '@umijs/max';
|
|
|
|
|
import { Access, history, useAccess } from '@umijs/max';
|
|
|
|
|
import Constants from '@/constants';
|
|
|
|
|
import { disabledDate } from '@/utils/utils';
|
|
|
|
|
|
|
|
|
@ -32,7 +32,7 @@ const handleExport = async (values?: API.PbcDashBoardDTO) => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Welcome: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
const access: any = useAccess();
|
|
|
|
|
const ref = useRef<ProFormInstance<API.PbcDashBoardDTO>>();
|
|
|
|
|
const [loading, handleLoadChange] = useState<boolean>(false);
|
|
|
|
|
const [data1, setData1] = useState<any[]>([]);
|
|
|
|
@ -247,25 +247,29 @@ const Welcome: React.FC = () => {
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<Card title="注册情况" bodyStyle={{ display: 'flex', justifyContent: 'space-between' }} bordered={false}>
|
|
|
|
|
<Statistic title="商家数" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={pbcRegisterStatical.businessNumber || 0} />
|
|
|
|
|
<Statistic title="会员数" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={pbcRegisterStatical.vipNumber || 0} />
|
|
|
|
|
<Access accessible={access.dashboardUser}>
|
|
|
|
|
<Statistic title="会员数" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={pbcRegisterStatical.vipNumber || 0} />
|
|
|
|
|
</Access>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<Card title="扫码情况" bodyStyle={{ display: 'flex', justifyContent: 'space-between' }} bordered={false}>
|
|
|
|
|
<Card title="扫码情况" bodyStyle={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }} bordered={false}>
|
|
|
|
|
<Statistic title="扫码次数" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={pbcScanCodeStatical.pbcScanNumber || 0} />
|
|
|
|
|
<Statistic title="扫码人数" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={pbcScanCodeStatical.pbcScanUserNumber || 0} />
|
|
|
|
|
<Button type='link' onClick={() => {
|
|
|
|
|
const param: any = ref.current?.getFieldsValue()
|
|
|
|
|
let startDate = param.pbcQueryType == 1 ? dayjs().format('YYYY-MM-DD') : dayjs().date(1).format('YYYY-MM-DD')
|
|
|
|
|
let endDate = dayjs().format('YYYY-MM-DD')
|
|
|
|
|
if (param.dateRange) {
|
|
|
|
|
startDate = dayjs(param.dateRange[0]).format('YYYY-MM-DD')
|
|
|
|
|
endDate = dayjs(param.dateRange[1]).format('YYYY-MM-DD')
|
|
|
|
|
}
|
|
|
|
|
history.push(`/dashboard/scan-detail?startDate=${startDate}&endDate=${endDate}`)
|
|
|
|
|
}}>
|
|
|
|
|
<Statistic title="老客扫码/新客扫码>" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={`${pbcScanCodeStatical.oldCustomerScanCount || 0}/${pbcScanCodeStatical.newCustomerScanCount || 0}`} />
|
|
|
|
|
</Button>
|
|
|
|
|
<Access accessible={access.dashboardUser}>
|
|
|
|
|
<Button type='link' onClick={() => {
|
|
|
|
|
const param: any = ref.current?.getFieldsValue()
|
|
|
|
|
let startDate = param.pbcQueryType === 1 ? dayjs().format('YYYY-MM-DD') : dayjs().date(1).format('YYYY-MM-DD')
|
|
|
|
|
let endDate = dayjs().format('YYYY-MM-DD')
|
|
|
|
|
if (param.dateRange) {
|
|
|
|
|
startDate = dayjs(param.dateRange[0]).format('YYYY-MM-DD')
|
|
|
|
|
endDate = dayjs(param.dateRange[1]).format('YYYY-MM-DD')
|
|
|
|
|
}
|
|
|
|
|
history.push(`/dashboard/scan-detail?startDate=${startDate}&endDate=${endDate}`)
|
|
|
|
|
}}>
|
|
|
|
|
<Statistic title="老客扫码/新客扫码>" valueStyle={{ color: '#3f8600', fontSize: 30 }} value={`${pbcScanCodeStatical.oldCustomerScanCount || 0}/${pbcScanCodeStatical.newCustomerScanCount || 0}`} />
|
|
|
|
|
</Button>
|
|
|
|
|
</Access>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
|
|
|
@ -281,7 +285,7 @@ const Welcome: React.FC = () => {
|
|
|
|
|
<Card title="商户浏览量排行" extra={
|
|
|
|
|
<Button type="link" onClick={() => {
|
|
|
|
|
const param: any = ref.current?.getFieldsValue()
|
|
|
|
|
let startDate = param.pbcQueryType == 1 ? dayjs().format('YYYY-MM-DD') : dayjs().date(1).format('YYYY-MM-DD')
|
|
|
|
|
let startDate = param.pbcQueryType === 1 ? dayjs().format('YYYY-MM-DD') : dayjs().date(1).format('YYYY-MM-DD')
|
|
|
|
|
let endDate = dayjs().format('YYYY-MM-DD')
|
|
|
|
|
if (param.dateRange) {
|
|
|
|
|
startDate = dayjs(param.dateRange[0]).format('YYYY-MM-DD')
|
|
|
|
@ -323,7 +327,7 @@ const Welcome: React.FC = () => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const param: any = ref.current?.getFieldsValue()
|
|
|
|
|
let startDate = param.pbcQueryType == 1 ? dayjs().format('YYYY-MM-DD') : dayjs().date(1).format('YYYY-MM-DD')
|
|
|
|
|
let startDate = param.pbcQueryType === 1 ? dayjs().format('YYYY-MM-DD') : dayjs().date(1).format('YYYY-MM-DD')
|
|
|
|
|
let endDate = dayjs().format('YYYY-MM-DD')
|
|
|
|
|
if (param.dateRange) {
|
|
|
|
|
startDate = dayjs(param.dateRange[0]).format('YYYY-MM-DD')
|
|
|
|
|