diff --git a/src/components/Charts/ChartCard/index.js b/src/components/Charts/ChartCard/index.js
index fd4426738336abac0d222451cf664f7e55c226af..04cd70c7958ac6f7b160973d55f5c9484a90b3fe 100644
--- a/src/components/Charts/ChartCard/index.js
+++ b/src/components/Charts/ChartCard/index.js
@@ -1,29 +1,45 @@
import React from 'react';
import { Card, Spin } from 'antd';
+import classNames from 'classnames';
import styles from './index.less';
const ChartCard = ({
- loading = false, contentHeight, title, action, total, footer, children, ...rest
+ loading = false, contentHeight, title, avatar, action, total, footer, children, ...rest
}) => {
const content = (
-
-
{title}
-
{action}
+
+
+ {
+ avatar
+ }
+
+
+
+ {title}
+ {action}
+
+ {
+ // eslint-disable-next-line
+ total && (
)
+ }
+
{
- // eslint-disable-next-line
- total &&
+ children && (
+
+ )
}
-
{
footer && (
-
+
{footer}
)
diff --git a/src/components/Charts/ChartCard/index.less b/src/components/Charts/ChartCard/index.less
index da65ef576dbb7952aaf90f0c35f1ee47d2fb0c2b..bdc573b1d1d947b876d58a94766b8708416af5f6 100644
--- a/src/components/Charts/ChartCard/index.less
+++ b/src/components/Charts/ChartCard/index.less
@@ -2,10 +2,32 @@
.chartCard {
position: relative;
+ .chartTop {
+ position: relative;
+ overflow: hidden;
+ width: 100%;
+ }
+ .chartTopMargin {
+ margin-bottom: 12px;
+ }
+ .chartTopHasMargin {
+ margin-bottom: 20px;
+ }
+ .metaWrap {
+ float: left;
+ }
+ .avatar {
+ position: relative;
+ top: 4px;
+ float: left;
+ margin-right: 20px;
+ img {
+ border-radius: 100%;
+ }
+ }
.meta {
color: @text-color-secondary;
font-size: @font-size-base;
- position: relative;
line-height: 22px;
height: 22px;
}
@@ -46,4 +68,7 @@
position: relative;
}
}
+ .footerMargin {
+ margin-top: 20px;
+ }
}
diff --git a/src/components/Charts/demo/chart-card.md b/src/components/Charts/demo/chart-card.md
index 424bb6f88b1bdfe52824af08fd2fc72063c22f2c..32abac47d4f552883b791bb83ae2d4e8369a2ee0 100644
--- a/src/components/Charts/demo/chart-card.md
+++ b/src/components/Charts/demo/chart-card.md
@@ -8,25 +8,46 @@ title: 图表卡片
````jsx
import { ChartCard, yuan, Field } from 'ant-design-pro/lib/Charts';
import Trend from 'ant-design-pro/lib/Trend';
-import { Tooltip, Icon } from 'antd';
+import { Row, Col, Icon, Tooltip } from 'antd';
import numeral from 'numeral';
ReactDOM.render(
-
}
- total={yuan(126560)}
- footer={}
- contentHeight={46}
- >
-
- 周同比
- 12%
-
-
- 日环比
- 11%
-
-
+
+
+ }
+ total={yuan(126560)}
+ footer={}
+ contentHeight={46}
+ >
+
+ 周同比
+ 12%
+
+
+ 日环比
+ 11%
+
+
+
+
+ }
+ action={}
+ total={yuan(126560)}
+ footer={}
+ />
+
+
+ }
+ action={}
+ total={yuan(126560)}
+ />
+
+
, mountNode);
````