perf: 调整首页的国内外占比显示

feature/2.0-sales-trade
Lei OT 2 years ago
parent 94b05c9f7c
commit fd76e36cd1

@ -84,7 +84,12 @@ export default observer((props) => {
tooltip: {
customItems: (originalItems) => {
// process originalItems,
return originalItems.map((ele) => ({ ...ele, value: dataFieldAlias[ele.name]?.formatter(Number(ele.value)), name: dataFieldAlias[ele.name]?.alias || ele.name }));
const _items = originalItems.map((ele) => ({
...ele,
value: dataFieldAlias[ele.name]?.formatter(Number(ele.value)),
name: dataFieldAlias[ele.name]?.alias || ele.name,
}));
return _items;
},
},
}, extProps);

@ -23,7 +23,7 @@ export default observer((props) => {
appendPadding: 10,
// angleField: 'value',
// colorField: 'type',
radius: 0.7,
radius: 0.8,
innerRadius: 0.65,
label: {
type: 'inner',
@ -36,6 +36,9 @@ export default observer((props) => {
fontSize: 14,
},
},
legend: {
position: 'top',
},
interactions: [{ type: 'element-selected' }, { type: 'element-active' }, { type: 'pie-statistic-active' }],
statistic: {
title: {

@ -118,12 +118,12 @@ class Trade {
if (json.errcode === 0) {
const sortResult = json.result1.sort(sortBy('groupDateVal'));
const groupsData = sortResult.reduce((r, v) => {
if (v.groupsLabel ) { // && ['91001', '91006'].includes(v.groupsKey)
if (v.groupsLabel ) {
(r[v.groupsLabel] || (r[v.groupsLabel] = [])).push(v);
}
return r;
}, {});
const summaryData = Object.keys(groupsData).map(groupsKey => {
const summaryData = Object.keys(groupsData).sort().map(groupsKey => {
return ['ConfirmOrder', 'SumOrder', 'SumML', 'transactions', 'SumPersonNum'].reduce(
(r, skey) => ({ ...r, [skey]: groupsData[groupsKey].reduce((a, c) => a + c[skey], 0) }),
groupsData[groupsKey]?.[0] || {}

@ -222,16 +222,17 @@ export default observer(() => {
<Spin spinning={BuData.loading}>
<Row gutter={layoutProps3.gutter}>
<Col {...layoutProps3}>
{overviewFlag ? (
<><Donut {...{angleField: 'SumML', colorField: 'groupsLabel'}} title={formValues.DepartmentList?.label} dataSource={sideData.yearData} /></>
{/* {overviewFlag ? (
<>
<Bullet {...BUConfig} dataSource={BuData?.dataSource || []} />
<h3 style={{ textAlign: 'center' }}>{`各事业部总业绩`}</h3>
</>
) : (
<><Donut {...{angleField: 'SumML', colorField: 'groupsLabel'}} title={formValues.DepartmentList?.label} dataSource={sideData.yearData} /></>
)}
)} */}
</Col>
{Object.keys(sideData.dataSource).map((key) => (
{Object.keys(sideData.dataSource).sort().map((key) => (
<Col {...layoutProps3} key={key}>
<Waterfall key={key} {...WaterfallConfig} title={key} dataSource={sideData.dataSource[key]} line={summaryData.kpi} />
<h3 style={{ textAlign: 'center' }}>{`${key}每月业绩`}</h3>

Loading…
Cancel
Save