Commit b4b6aadf authored by 何乐's avatar 何乐 Committed by 陈帅

fix: different card heights in Analysis (#3386)

* fix: different card heights in Analysis

* add padding for Pie in ProportionSales

* adjust style
parent 186abaca
...@@ -144,30 +144,32 @@ class Analysis extends Component { ...@@ -144,30 +144,32 @@ class Analysis extends Component {
selectDate={this.selectDate} selectDate={this.selectDate}
/> />
</Suspense> </Suspense>
<Row gutter={24}> <div className={styles.twoColLayout}>
<Col xl={12} lg={24} md={24} sm={24} xs={24}> <Row gutter={24}>
<Suspense fallback={null}> <Col xl={12} lg={24} md={24} sm={24} xs={24}>
<TopSearch <Suspense fallback={null}>
loading={loading} <TopSearch
visitData2={visitData2} loading={loading}
selectDate={this.selectDate} visitData2={visitData2}
searchData={searchData} selectDate={this.selectDate}
dropdownGroup={dropdownGroup} searchData={searchData}
/> dropdownGroup={dropdownGroup}
</Suspense> />
</Col> </Suspense>
<Col xl={12} lg={24} md={24} sm={24} xs={24}> </Col>
<Suspense fallback={null}> <Col xl={12} lg={24} md={24} sm={24} xs={24}>
<ProportionSales <Suspense fallback={null}>
dropdownGroup={dropdownGroup} <ProportionSales
salesType={salesType} dropdownGroup={dropdownGroup}
loading={loading} salesType={salesType}
salesPieData={salesPieData} loading={loading}
handleChangeSalesType={this.handleChangeSalesType} salesPieData={salesPieData}
/> handleChangeSalesType={this.handleChangeSalesType}
</Suspense> />
</Col> </Suspense>
</Row> </Col>
</Row>
</div>
<Suspense fallback={null}> <Suspense fallback={null}>
<OfflineData <OfflineData
activeKey={activeKey} activeKey={activeKey}
......
...@@ -134,6 +134,25 @@ ...@@ -134,6 +134,25 @@
} }
} }
.twoColLayout {
.salesCard {
height: calc(100% - 24px);
}
div[class^='ant-col']:last-child {
right: 0\9;
height: 100%\9;
position: absolute\9;
}
:global {
.ant-row {
display: flex;
display: block\9;
flex-flow: row wrap;
position: relative\9;
}
}
}
.trendText { .trendText {
margin-left: 8px; margin-left: 8px;
color: @heading-color; color: @heading-color;
......
...@@ -38,24 +38,19 @@ const ProportionSales = memo( ...@@ -38,24 +38,19 @@ const ProportionSales = memo(
} }
style={{ marginTop: 24 }} style={{ marginTop: 24 }}
> >
<div <h4 style={{ marginTop: 10, marginBottom: 32 }}>
style={{ <FormattedMessage id="app.analysis.sales" defaultMessage="Sales" />
minHeight: 380, </h4>
}} <Pie
> hasLegend
<h4 style={{ marginTop: 8, marginBottom: 32 }}> subTitle={<FormattedMessage id="app.analysis.sales" defaultMessage="Sales" />}
<FormattedMessage id="app.analysis.sales" defaultMessage="Sales" /> total={() => <Yuan>{salesPieData.reduce((pre, now) => now.y + pre, 0)}</Yuan>}
</h4> data={salesPieData}
<Pie valueFormat={value => <Yuan>{value}</Yuan>}
hasLegend height={270}
subTitle={<FormattedMessage id="app.analysis.sales" defaultMessage="Sales" />} lineWidth={4}
total={() => <Yuan>{salesPieData.reduce((pre, now) => now.y + pre, 0)}</Yuan>} style={{ padding: '8px 0' }}
data={salesPieData} />
valueFormat={value => <Yuan>{value}</Yuan>}
height={248}
lineWidth={4}
/>
</div>
</Card> </Card>
) )
); );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment