-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
G
committed
Dec 20, 2023
1 parent
0fcd283
commit 3b42a98
Showing
17 changed files
with
505 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import ReactECharts from 'echarts-for-react'; | ||
|
||
export interface ChartsProp { | ||
option: any; | ||
} | ||
|
||
const BaseCharts = (prop: ChartsProp) => ( | ||
<ReactECharts opts={{ renderer: 'svg' }} style={{ height: '100px' }} option={prop} /> | ||
); | ||
|
||
export default BaseCharts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
import { createStyles } from 'antd-style'; | ||
|
||
const useStyles = createStyles(() => { | ||
return { | ||
'span.icon-btn': { | ||
display: 'flex', | ||
alignItems: 'center', | ||
cursor: 'pointer', | ||
marginLeft: '10px', | ||
}, | ||
'.ant-upload-drag': { | ||
height: 'auto', | ||
}, | ||
'list-upload': { | ||
'.ant-upload': { width: '100%' }, | ||
'.ant-btn': { display: 'block', margin: '0 auto 8px' }, | ||
}, | ||
}; | ||
}); | ||
const useStyles = createStyles(() => ({ | ||
'span.icon-btn': { | ||
display: 'flex', | ||
alignItems: 'center', | ||
cursor: 'pointer', | ||
marginLeft: '10px', | ||
}, | ||
'.ant-upload-drag': { | ||
height: 'auto', | ||
}, | ||
'list-upload': { | ||
'.ant-upload': { width: '100%' }, | ||
'.ant-btn': { display: 'block', margin: '0 auto 8px' }, | ||
}, | ||
})); | ||
export default useStyles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,212 @@ | ||
import { Col, Typography } from 'antd'; | ||
import { useTheme } from 'antd-style'; | ||
import classNames from 'classnames'; | ||
import { useEffect, useState } from 'react'; | ||
import CountUp from 'react-countup'; | ||
import { BaseCard } from 'ui'; | ||
|
||
import SvgIcon from '@/components/SvgIcon'; | ||
|
||
import ChartsCard from './ChartsCard'; | ||
import useStyles from './styles'; | ||
|
||
const { Text, Title } = Typography; | ||
|
||
export const AnalyzeCard = () => { | ||
const { styles } = useStyles(); | ||
const token = useTheme(); | ||
const [loading, setLoading] = useState(true); | ||
useEffect(() => { | ||
setTimeout(() => { | ||
setLoading(false); | ||
}, 1500); | ||
}, []); | ||
return ( | ||
<> | ||
<Col span={8}> | ||
<BaseCard loading={loading}> | ||
<div className={classNames(styles.flex)}> | ||
<div className='card-left'> | ||
<Text strong>活跃用户数量</Text> | ||
<Title className='count' level={5} style={{ margin: '8px 0' }}> | ||
<SvgIcon size={20} style={{ marginRight: '4px', color: token.colorPrimary }} name='solar'></SvgIcon> | ||
+2.6% | ||
</Title> | ||
<Title level={2} style={{ margin: 0 }}> | ||
<CountUp start={0} end={122} duration={3} /> | ||
</Title> | ||
</div> | ||
<div className='card-right'> | ||
<ChartsCard | ||
loading={loading} | ||
options={{ | ||
tooltip: { | ||
trigger: 'axis', | ||
axisPointer: { | ||
type: 'shadow', | ||
}, | ||
}, | ||
grid: { | ||
left: '30%', | ||
right: '0%', | ||
bottom: '0%', | ||
top: '40%', | ||
containLabel: true, | ||
}, | ||
xAxis: [ | ||
{ | ||
show: false, | ||
type: 'category', | ||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], | ||
}, | ||
], | ||
yAxis: [ | ||
{ | ||
show: false, | ||
type: 'value', | ||
}, | ||
], | ||
series: [ | ||
{ | ||
name: 'Direct', | ||
type: 'bar', | ||
barWidth: '40%', | ||
itemStyle: { | ||
color: token.colorPrimary, | ||
}, | ||
data: [10, 52, 200, 334, 390, 330, 220], | ||
}, | ||
], | ||
}} | ||
></ChartsCard> | ||
</div> | ||
</div> | ||
</BaseCard> | ||
</Col> | ||
<Col span={8}> | ||
<BaseCard loading={loading}> | ||
<div className={classNames(styles.flex)}> | ||
<div className='card-left'> | ||
<Text strong>总下载量</Text> | ||
<Title className='count' level={5} style={{ margin: '8px 0' }}> | ||
<SvgIcon | ||
size={20} | ||
style={{ marginRight: '4px', color: token.colorError, transform: 'rotate(180deg)' }} | ||
name='solar' | ||
></SvgIcon> | ||
-2.6% | ||
</Title> | ||
<Title level={2} style={{ margin: 0 }}> | ||
<CountUp start={0} end={1322} duration={3} /> | ||
</Title> | ||
</div> | ||
<div className='card-right'> | ||
<ChartsCard | ||
loading={loading} | ||
options={{ | ||
tooltip: { | ||
trigger: 'axis', | ||
axisPointer: { | ||
type: 'shadow', | ||
}, | ||
}, | ||
grid: { | ||
left: '30%', | ||
right: '0%', | ||
bottom: '0%', | ||
top: '40%', | ||
containLabel: true, | ||
}, | ||
xAxis: [ | ||
{ | ||
show: false, | ||
type: 'category', | ||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], | ||
}, | ||
], | ||
yAxis: [ | ||
{ | ||
show: false, | ||
type: 'value', | ||
}, | ||
], | ||
series: [ | ||
{ | ||
name: 'Direct', | ||
type: 'bar', | ||
barWidth: '40%', | ||
itemStyle: { | ||
color: token.colorPrimary, | ||
}, | ||
data: [200, 334, 390, 30, 120, 132, 220], | ||
}, | ||
], | ||
}} | ||
></ChartsCard> | ||
</div> | ||
</div> | ||
</BaseCard> | ||
</Col> | ||
<Col span={8}> | ||
<BaseCard loading={loading}> | ||
<div className={classNames(styles.flex)}> | ||
<div className='card-left'> | ||
<Text strong>总安装数量</Text> | ||
<Title className='count' level={5} style={{ margin: '8px 0' }}> | ||
<SvgIcon size={20} style={{ marginRight: '4px', color: token.colorPrimary }} name='solar'></SvgIcon> | ||
+5.6% | ||
</Title> | ||
<Title level={2} style={{ margin: 0 }}> | ||
<CountUp start={0} end={12322} duration={3} /> | ||
</Title> | ||
</div> | ||
<div className='card-right'> | ||
<ChartsCard | ||
loading={loading} | ||
options={{ | ||
tooltip: { | ||
trigger: 'axis', | ||
axisPointer: { | ||
type: 'shadow', | ||
}, | ||
}, | ||
grid: { | ||
left: '30%', | ||
right: '0%', | ||
bottom: '0%', | ||
top: '40%', | ||
containLabel: true, | ||
}, | ||
xAxis: [ | ||
{ | ||
show: false, | ||
type: 'category', | ||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], | ||
}, | ||
], | ||
yAxis: [ | ||
{ | ||
show: false, | ||
type: 'value', | ||
}, | ||
], | ||
series: [ | ||
{ | ||
name: 'Direct', | ||
type: 'bar', | ||
barWidth: '40%', | ||
itemStyle: { | ||
color: token.colorPrimary, | ||
}, | ||
data: [10, 52, 100, 34, 90, 100, 120], | ||
}, | ||
], | ||
}} | ||
></ChartsCard> | ||
</div> | ||
</div> | ||
</BaseCard> | ||
</Col> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.