|
|
@ -2,7 +2,7 @@ import { listTreeUsingGet } from '@/services/pop-b2b2c/pbcCategoryController';
|
|
|
|
import { dashboardUsingPost } from '@/services/pop-b2b2c/pbcUserRecordLogController';
|
|
|
|
import { dashboardUsingPost } from '@/services/pop-b2b2c/pbcUserRecordLogController';
|
|
|
|
import { Bar, Pie } from '@ant-design/plots';
|
|
|
|
import { Bar, Pie } from '@ant-design/plots';
|
|
|
|
import { PageContainer, ProCard, ProForm, ProFormCascader, ProFormGroup, ProFormInstance, ProFormRadio } from '@ant-design/pro-components';
|
|
|
|
import { PageContainer, ProCard, ProForm, ProFormCascader, ProFormGroup, ProFormInstance, ProFormRadio } from '@ant-design/pro-components';
|
|
|
|
import { Card, Col, Row, Spin, Statistic } from 'antd';
|
|
|
|
import { Card, Col, Radio, RadioChangeEvent, Row, Spin, Statistic } from 'antd';
|
|
|
|
import React, { useEffect, useRef, useState } from 'react';
|
|
|
|
import React, { useEffect, useRef, useState } from 'react';
|
|
|
|
|
|
|
|
|
|
|
|
const Welcome: React.FC = () => {
|
|
|
|
const Welcome: React.FC = () => {
|
|
|
@ -35,7 +35,6 @@ const Welcome: React.FC = () => {
|
|
|
|
label: {
|
|
|
|
label: {
|
|
|
|
autoRotate: false,
|
|
|
|
autoRotate: false,
|
|
|
|
formatter: (value: any) => {
|
|
|
|
formatter: (value: any) => {
|
|
|
|
console.log(value)
|
|
|
|
|
|
|
|
return value.length > 10 ? value.substring(0,10) + '...' : value;
|
|
|
|
return value.length > 10 ? value.substring(0,10) + '...' : value;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -57,14 +56,10 @@ const Welcome: React.FC = () => {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const getData = () => {
|
|
|
|
const getData = (type: number) => {
|
|
|
|
const param = ref.current?.getFieldsValue()
|
|
|
|
if (type) {
|
|
|
|
if (param) {
|
|
|
|
|
|
|
|
if (param.pbcCategoryType && param.pbcCategoryType.length > 0) {
|
|
|
|
|
|
|
|
param.pbcCategoryType = param.pbcCategoryType[param.pbcCategoryType.length - 1]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
handleLoadChange(true)
|
|
|
|
handleLoadChange(true)
|
|
|
|
dashboardUsingPost(param).then(res => {
|
|
|
|
dashboardUsingPost({ pbcQueryType: type }).then(res => {
|
|
|
|
handleLoadChange(false)
|
|
|
|
handleLoadChange(false)
|
|
|
|
if (res.retcode && res.data) {
|
|
|
|
if (res.retcode && res.data) {
|
|
|
|
setPbcRegisterStatical(res.data.pbcRegisterStaticalVO)
|
|
|
|
setPbcRegisterStatical(res.data.pbcRegisterStaticalVO)
|
|
|
@ -90,7 +85,6 @@ const Welcome: React.FC = () => {
|
|
|
|
value: res.data.pbcVisitStaticalVO.pbcLinkNumber || 0
|
|
|
|
value: res.data.pbcVisitStaticalVO.pbcLinkNumber || 0
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
]
|
|
|
|
console.log(arr)
|
|
|
|
|
|
|
|
setData2(arr)
|
|
|
|
setData2(arr)
|
|
|
|
setData3((res.data.pbcProductViewStaticalVO.pbcProductViewRank || []).map((e: any) => {
|
|
|
|
setData3((res.data.pbcProductViewStaticalVO.pbcProductViewRank || []).map((e: any) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -112,7 +106,7 @@ const Welcome: React.FC = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
getData()
|
|
|
|
getData(1)
|
|
|
|
}, [])
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
@ -123,39 +117,12 @@ const Welcome: React.FC = () => {
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<ProCard style={{ marginBottom: 12 }} bodyStyle={{ padding: '10px 24px' }}>
|
|
|
|
<ProCard style={{ marginBottom: 12 }} bodyStyle={{ padding: '10px 24px' }}>
|
|
|
|
<ProForm
|
|
|
|
<Radio.Group
|
|
|
|
layout="inline"
|
|
|
|
optionType='button'
|
|
|
|
formRef={ref}
|
|
|
|
buttonStyle='solid'
|
|
|
|
initialValues={{
|
|
|
|
defaultValue={1}
|
|
|
|
pbcQueryType: 1,
|
|
|
|
onChange={({ target: { value } }: RadioChangeEvent) => {
|
|
|
|
pbcCategoryType: null
|
|
|
|
getData(value)
|
|
|
|
}}
|
|
|
|
|
|
|
|
submitter={{
|
|
|
|
|
|
|
|
searchConfig: {
|
|
|
|
|
|
|
|
submitText: '查询',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
submitButtonProps: {
|
|
|
|
|
|
|
|
loading: loading,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
resetButtonProps: {
|
|
|
|
|
|
|
|
style: {
|
|
|
|
|
|
|
|
display: 'none',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
onFinish={async (values) => {
|
|
|
|
|
|
|
|
console.log(values)
|
|
|
|
|
|
|
|
getData()
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<ProFormGroup size="small">
|
|
|
|
|
|
|
|
<ProFormRadio.Group
|
|
|
|
|
|
|
|
colon={false}
|
|
|
|
|
|
|
|
name="pbcQueryType"
|
|
|
|
|
|
|
|
label=" "
|
|
|
|
|
|
|
|
radioType="button"
|
|
|
|
|
|
|
|
fieldProps={{
|
|
|
|
|
|
|
|
buttonStyle: "solid"
|
|
|
|
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
options={[
|
|
|
|
options={[
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -168,24 +135,6 @@ const Welcome: React.FC = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]}
|
|
|
|
]}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<ProFormCascader
|
|
|
|
|
|
|
|
colon={false}
|
|
|
|
|
|
|
|
name="pbcCategoryType"
|
|
|
|
|
|
|
|
label=" "
|
|
|
|
|
|
|
|
placeholder="请选择商品类别"
|
|
|
|
|
|
|
|
fieldProps={{
|
|
|
|
|
|
|
|
fieldNames: { label: 'pbcCategoryName', value: 'pbcId', children: 'children' }
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
request={async () => {
|
|
|
|
|
|
|
|
const msg = await listTreeUsingGet({ type: 2 });
|
|
|
|
|
|
|
|
if (msg.retcode && msg.data) {
|
|
|
|
|
|
|
|
return msg.data;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return [];
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</ProFormGroup>
|
|
|
|
|
|
|
|
</ProForm>
|
|
|
|
|
|
|
|
</ProCard>
|
|
|
|
</ProCard>
|
|
|
|
<Spin spinning={loading}>
|
|
|
|
<Spin spinning={loading}>
|
|
|
|
<Row style={{ marginBottom: 12 }} gutter={16}>
|
|
|
|
<Row style={{ marginBottom: 12 }} gutter={16}>
|
|
|
|