perf: 总数组件
parent
22b9cf5d7a
commit
851ad244ce
@ -0,0 +1,27 @@
|
||||
import { observer } from "mobx-react";
|
||||
import { Card, Statistic, Progress } from 'antd';
|
||||
import { ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons';
|
||||
|
||||
export default observer((props) => {
|
||||
const valueStyle = { color: props.VSrate < 0 ? '#cf1322' : '#3f8600' };
|
||||
const VSIcon = () => (props.VSrate < 0 ? <ArrowDownOutlined /> : <ArrowUpOutlined />);
|
||||
return (
|
||||
<Card>
|
||||
<Statistic
|
||||
className={'__hn-sta-wrapper'}
|
||||
valueStyle={valueStyle}
|
||||
suffix={
|
||||
props.VSrate && (
|
||||
<>
|
||||
<VSIcon />
|
||||
<span>{props.VSrate}</span>
|
||||
<span>%</span>
|
||||
</>
|
||||
)
|
||||
}
|
||||
{...props}
|
||||
/>
|
||||
{props.showProgress !== false && <Progress percent={props.KPIrate} size="small" format={(percent) => `${props.KPIrate}%`} />}
|
||||
</Card>
|
||||
);
|
||||
});
|
Loading…
Reference in New Issue