Blame view

src/pages/OrderReport/components/OrderDualAxes.tsx 939 Bytes
zhongnanhuang authored
1
2
import { DualAxes } from '@ant-design/charts';
zhongnanhuang authored
3
4
5
6
7
8
9
const OrderDualAxes = ({ data, statisticMethod }) => {
  let yFiledString = '';
  if (statisticMethod === 'MONTH_STATISTICS') {
    yFiledString = 'curTime';
  } else {
    yFiledString = 'curMonth';
  }
zhongnanhuang authored
10
  const config = {
zhongnanhuang authored
11
12
13
14
15
16
    data: [
      data.targetAndTotalPaymentDtoList === undefined
        ? []
        : data.targetAndTotalPaymentDtoList,
      data.orderNumberDtoList === undefined ? [] : data.orderNumberDtoList,
    ],
zhongnanhuang authored
17
    xField: yFiledString,
zhongnanhuang authored
18
    yField: ['curDayTotalPayment', 'curDayTotalOrderNumber'],
zhongnanhuang authored
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
    geometryOptions: [
      {
        geometry: 'line',
        seriesField: 'type',
        lineStyle: {
          lineWidth: 3,
          lineDash: [5, 5],
        },
        smooth: true,
      },
      {
        geometry: 'line',
        seriesField: 'name',
        point: {},
      },
    ],
  };
  return <DualAxes {...config} />;
};

export default OrderDualAxes;