Yansen 2 gadus atpakaļ
vecāks
revīzija
5959b514c9

+ 1
- 0
package.json Parādīt failu

@@ -13,6 +13,7 @@
13 13
     "@ant-design/pro-components": "^2.3.13",
14 14
     "@zjxpcyc/react-tiny-store": "^2.0.1",
15 15
     "antd": "^4.23.4",
16
+    "echarts": "^5.4.0",
16 17
     "react": "18.1.0",
17 18
     "react-dom": "18.1.0",
18 19
     "react-helmet": "^6.1.0",

+ 25
- 0
pnpm-lock.yaml Parādīt failu

@@ -8,6 +8,7 @@ specifiers:
8 8
   '@vitejs/plugin-react': ^2.0.0
9 9
   '@zjxpcyc/react-tiny-store': ^2.0.1
10 10
   antd: ^4.23.4
11
+  echarts: ^5.4.0
11 12
   less: ^4.1.3
12 13
   react: 18.1.0
13 14
   react-dom: 18.1.0
@@ -22,6 +23,7 @@ dependencies:
22 23
   '@ant-design/pro-components': registry.npmmirror.com/@ant-design/pro-components/2.3.13_4ahbtacxshq5zvmbq25uec6w6a
23 24
   '@zjxpcyc/react-tiny-store': registry.npmmirror.com/@zjxpcyc/react-tiny-store/2.0.1
24 25
   antd: registry.npmmirror.com/antd/4.23.4_ef5jwxihqo6n7gxfmzogljlgcm
26
+  echarts: registry.npmmirror.com/echarts/5.4.0
25 27
   react: registry.npmmirror.com/react/18.1.0
26 28
   react-dom: registry.npmmirror.com/react-dom/18.1.0_react@18.1.0
27 29
   react-helmet: registry.npmmirror.com/react-helmet/6.1.0_react@18.1.0
@@ -1191,6 +1193,15 @@ packages:
1191 1193
       tslib: registry.npmmirror.com/tslib/2.4.0
1192 1194
     dev: true
1193 1195
 
1196
+  registry.npmmirror.com/echarts/5.4.0:
1197
+    resolution: {integrity: sha512-uPsO9VRUIKAdFOoH3B0aNg7NRVdN7aM39/OjovjO9MwmWsAkfGyeXJhK+dbRi51iDrQWliXV60/XwLA7kg3z0w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/echarts/-/echarts-5.4.0.tgz}
1198
+    name: echarts
1199
+    version: 5.4.0
1200
+    dependencies:
1201
+      tslib: registry.npmmirror.com/tslib/2.3.0
1202
+      zrender: registry.npmmirror.com/zrender/5.4.0
1203
+    dev: false
1204
+
1194 1205
   registry.npmmirror.com/electron-to-chromium/1.4.211:
1195 1206
     resolution: {integrity: sha512-BZSbMpyFQU0KBJ1JG26XGeFI3i4op+qOYGxftmZXFZoHkhLgsSv4DHDJfl8ogII3hIuzGt51PaZ195OVu0yJ9A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.211.tgz}
1196 1207
     name: electron-to-chromium
@@ -2866,6 +2877,12 @@ packages:
2866 2877
     version: 1.0.6
2867 2878
     dev: false
2868 2879
 
2880
+  registry.npmmirror.com/tslib/2.3.0:
2881
+    resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz}
2882
+    name: tslib
2883
+    version: 2.3.0
2884
+    dev: false
2885
+
2869 2886
   registry.npmmirror.com/tslib/2.4.0:
2870 2887
     resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/tslib/-/tslib-2.4.0.tgz}
2871 2888
     name: tslib
@@ -2972,3 +2989,11 @@ packages:
2972 2989
     dependencies:
2973 2990
       loose-envify: registry.npmmirror.com/loose-envify/1.4.0
2974 2991
     dev: false
2992
+
2993
+  registry.npmmirror.com/zrender/5.4.0:
2994
+    resolution: {integrity: sha512-rOS09Z2HSVGFs2dn/TuYk5BlCaZcVe8UDLLjj1ySYF828LATKKdxuakSZMvrDz54yiKPDYVfjdKqcX8Jky3BIA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/zrender/-/zrender-5.4.0.tgz}
2995
+    name: zrender
2996
+    version: 5.4.0
2997
+    dependencies:
2998
+      tslib: registry.npmmirror.com/tslib/2.3.0
2999
+    dev: false

+ 81
- 0
src/components/chart/index.jsx Parādīt failu

@@ -0,0 +1,81 @@
1
+import React, { useRef, useEffect } from 'react';
2
+
3
+// 引入 echarts 核心模块,核心模块提供了 echarts 使用必须要的接口。
4
+import * as echarts from 'echarts/core';
5
+// 引入图表,图表后缀都为 Chart
6
+import {
7
+  BarChart,
8
+  PieChart,
9
+  LineChart,
10
+  GaugeChart,
11
+  RadarChart,
12
+  PictorialBarChart,
13
+} from 'echarts/charts';
14
+// 引入提示框,标题,直角坐标系,数据集,内置数据转换器组件,组件后缀都为 Component
15
+import {
16
+  TitleComponent,
17
+  TooltipComponent,
18
+  ToolboxComponent,
19
+  GridComponent,
20
+  DatasetComponent,
21
+  LegendComponent,
22
+  DataZoomComponent,
23
+  TransformComponent,
24
+  VisualMapComponent,
25
+} from 'echarts/components';
26
+// 标签自动布局,全局过渡动画等特性
27
+import { LabelLayout, UniversalTransition } from 'echarts/features';
28
+// 引入 Canvas 渲染器,注意引入 CanvasRenderer 或者 SVGRenderer 是必须的一步
29
+import { CanvasRenderer } from 'echarts/renderers';
30
+
31
+// 注册必须的组件
32
+echarts.use([
33
+  TitleComponent,
34
+  TooltipComponent,
35
+  ToolboxComponent,
36
+  GridComponent,
37
+  DatasetComponent,
38
+  LegendComponent,
39
+  DataZoomComponent,
40
+  TransformComponent,
41
+  VisualMapComponent,
42
+  BarChart,
43
+  PieChart,
44
+  LineChart,
45
+  GaugeChart,
46
+  RadarChart,
47
+  PictorialBarChart,
48
+  LabelLayout,
49
+  UniversalTransition,
50
+  CanvasRenderer
51
+]);
52
+
53
+export default (props) => {
54
+  const { className, style, option } = props;
55
+
56
+  const domRef = useRef();
57
+  const chartRef = useRef();
58
+
59
+  useEffect(() => {
60
+    if (!chartRef.current) {
61
+      chartRef.current = echarts.init(domRef.current);
62
+    }
63
+
64
+    const resize = () => {
65
+      const t = setTimeout(() => {
66
+        clearTimeout(t);
67
+        chartRef.current.resize();
68
+      }, 100);
69
+    };
70
+
71
+    chartRef.current.setOption(option);
72
+    resize();
73
+
74
+    window.addEventListener('resize', resize);    
75
+    return () => window.removeEventListener('resize', resize);
76
+  }, [option]);
77
+
78
+  return (
79
+    <div className={className} style={style} ref={domRef}></div>
80
+  )
81
+}

+ 0
- 47
src/pages/Home.jsx Parādīt failu

@@ -1,47 +0,0 @@
1
-import React from 'react';
2
-import { Row, Col, Card, Space, Statistic } from 'antd';
3
-import { ArrowDownOutlined, ArrowUpOutlined, LikeOutlined } from '@ant-design/icons';
4
-import Container from '@/components/page/Container';
5
-
6
-export default (props) => {
7
-  return (
8
-    <Container>
9
-      <Row gutter={24}>
10
-        <Col span={6}>
11
-          <Card>
12
-            <Statistic title="Feedback" value={1128} prefix={<LikeOutlined />} />
13
-          </Card>
14
-        </Col>
15
-        <Col span={6}>
16
-          <Card>
17
-            <Statistic title="Unmerged" value={93} suffix="/ 100" />
18
-          </Card>
19
-        </Col>
20
-        <Col span={6}>
21
-          <Card>
22
-            <Statistic
23
-              title="Active"
24
-              value={11.28}
25
-              precision={2}
26
-              valueStyle={{ color: '#3f8600' }}
27
-              prefix={<ArrowUpOutlined />}
28
-              suffix="%"
29
-            />
30
-          </Card>
31
-        </Col>
32
-        <Col span={6}>
33
-          <Card>
34
-            <Statistic
35
-              title="Idle"
36
-              value={9.3}
37
-              precision={2}
38
-              valueStyle={{ color: '#cf1322' }}
39
-              prefix={<ArrowDownOutlined />}
40
-              suffix="%"
41
-            />
42
-          </Card>
43
-        </Col>
44
-      </Row>
45
-    </Container>
46
-  )
47
-}

+ 191
- 0
src/pages/sample/home/components/AreaChart.jsx Parādīt failu

@@ -0,0 +1,191 @@
1
+import React from 'react';
2
+import { Card } from 'antd';
3
+import * as echarts from 'echarts/core';
4
+import Chart from '@/components/chart';
5
+
6
+export default (props) => {
7
+  const option = {
8
+    color: ['#80FFA5', '#00DDFF', '#37A2FF', '#FF0087', '#FFBF00'],
9
+    // title: {
10
+    //   text: 'Gradient Stacked Area Chart'
11
+    // },
12
+    tooltip: {
13
+      trigger: 'axis',
14
+      axisPointer: {
15
+        type: 'cross',
16
+        label: {
17
+          backgroundColor: '#6a7985'
18
+        }
19
+      }
20
+    },
21
+    legend: {
22
+      data: ['Line 1', 'Line 2', 'Line 3', 'Line 4', 'Line 5']
23
+    },
24
+    grid: {
25
+      left: '3%',
26
+      right: '4%',
27
+      bottom: '3%',
28
+      containLabel: true
29
+    },
30
+    xAxis: [
31
+      {
32
+        type: 'category',
33
+        boundaryGap: false,
34
+        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
35
+      }
36
+    ],
37
+    yAxis: [
38
+      {
39
+        type: 'value'
40
+      }
41
+    ],
42
+    series: [
43
+      {
44
+        name: 'Line 1',
45
+        type: 'line',
46
+        stack: 'Total',
47
+        smooth: true,
48
+        lineStyle: {
49
+          width: 0
50
+        },
51
+        showSymbol: false,
52
+        areaStyle: {
53
+          opacity: 0.8,
54
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
55
+            {
56
+              offset: 0,
57
+              color: 'rgb(128, 255, 165)'
58
+            },
59
+            {
60
+              offset: 1,
61
+              color: 'rgb(1, 191, 236)'
62
+            }
63
+          ])
64
+        },
65
+        emphasis: {
66
+          focus: 'series'
67
+        },
68
+        data: [140, 232, 101, 264, 90, 340, 250]
69
+      },
70
+      {
71
+        name: 'Line 2',
72
+        type: 'line',
73
+        stack: 'Total',
74
+        smooth: true,
75
+        lineStyle: {
76
+          width: 0
77
+        },
78
+        showSymbol: false,
79
+        areaStyle: {
80
+          opacity: 0.8,
81
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
82
+            {
83
+              offset: 0,
84
+              color: 'rgb(0, 221, 255)'
85
+            },
86
+            {
87
+              offset: 1,
88
+              color: 'rgb(77, 119, 255)'
89
+            }
90
+          ])
91
+        },
92
+        emphasis: {
93
+          focus: 'series'
94
+        },
95
+        data: [120, 282, 111, 234, 220, 340, 310]
96
+      },
97
+      {
98
+        name: 'Line 3',
99
+        type: 'line',
100
+        stack: 'Total',
101
+        smooth: true,
102
+        lineStyle: {
103
+          width: 0
104
+        },
105
+        showSymbol: false,
106
+        areaStyle: {
107
+          opacity: 0.8,
108
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
109
+            {
110
+              offset: 0,
111
+              color: 'rgb(55, 162, 255)'
112
+            },
113
+            {
114
+              offset: 1,
115
+              color: 'rgb(116, 21, 219)'
116
+            }
117
+          ])
118
+        },
119
+        emphasis: {
120
+          focus: 'series'
121
+        },
122
+        data: [320, 132, 201, 334, 190, 130, 220]
123
+      },
124
+      {
125
+        name: 'Line 4',
126
+        type: 'line',
127
+        stack: 'Total',
128
+        smooth: true,
129
+        lineStyle: {
130
+          width: 0
131
+        },
132
+        showSymbol: false,
133
+        areaStyle: {
134
+          opacity: 0.8,
135
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
136
+            {
137
+              offset: 0,
138
+              color: 'rgb(255, 0, 135)'
139
+            },
140
+            {
141
+              offset: 1,
142
+              color: 'rgb(135, 0, 157)'
143
+            }
144
+          ])
145
+        },
146
+        emphasis: {
147
+          focus: 'series'
148
+        },
149
+        data: [220, 402, 231, 134, 190, 230, 120]
150
+      },
151
+      {
152
+        name: 'Line 5',
153
+        type: 'line',
154
+        stack: 'Total',
155
+        smooth: true,
156
+        lineStyle: {
157
+          width: 0
158
+        },
159
+        showSymbol: false,
160
+        label: {
161
+          show: true,
162
+          position: 'top'
163
+        },
164
+        areaStyle: {
165
+          opacity: 0.8,
166
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
167
+            {
168
+              offset: 0,
169
+              color: 'rgb(255, 191, 0)'
170
+            },
171
+            {
172
+              offset: 1,
173
+              color: 'rgb(224, 62, 76)'
174
+            }
175
+          ])
176
+        },
177
+        emphasis: {
178
+          focus: 'series'
179
+        },
180
+        data: [220, 302, 181, 234, 210, 290, 150]
181
+      }
182
+    ]
183
+  };
184
+  
185
+
186
+  return (
187
+    <Card title='Gradient Stacked Area Chart'>
188
+      <Chart option={option} style={props.style}></Chart>
189
+    </Card>
190
+  )
191
+}

+ 44
- 0
src/pages/sample/home/components/Banner.jsx Parādīt failu

@@ -0,0 +1,44 @@
1
+import React from 'react';
2
+import { Row, Col, Card, Statistic } from 'antd';
3
+import { ArrowDownOutlined, ArrowUpOutlined, LikeOutlined } from '@ant-design/icons';
4
+
5
+export default (props) => {
6
+  return (
7
+    <Row gutter={24}>
8
+      <Col span={6}>
9
+        <Card>
10
+          <Statistic title="Feedback" value={1128} prefix={<LikeOutlined />} />
11
+        </Card>
12
+      </Col>
13
+      <Col span={6}>
14
+        <Card>
15
+          <Statistic title="Unmerged" value={93} suffix="/ 100" />
16
+        </Card>
17
+      </Col>
18
+      <Col span={6}>
19
+        <Card>
20
+          <Statistic
21
+            title="Active"
22
+            value={11.28}
23
+            precision={2}
24
+            valueStyle={{ color: '#3f8600' }}
25
+            prefix={<ArrowUpOutlined />}
26
+            suffix="%"
27
+          />
28
+        </Card>
29
+      </Col>
30
+      <Col span={6}>
31
+        <Card>
32
+          <Statistic
33
+            title="Idle"
34
+            value={9.3}
35
+            precision={2}
36
+            valueStyle={{ color: '#cf1322' }}
37
+            prefix={<ArrowDownOutlined />}
38
+            suffix="%"
39
+          />
40
+        </Card>
41
+      </Col>
42
+    </Row>
43
+  )
44
+}

+ 37
- 0
src/pages/sample/home/components/BarChart.jsx Parādīt failu

@@ -0,0 +1,37 @@
1
+import React from 'react';
2
+import { Card } from 'antd';
3
+import Chart from '@/components/chart';
4
+
5
+export default (props) => {
6
+
7
+  const option = {
8
+    legend: {},
9
+    tooltip: {},
10
+    dataset: {
11
+      source: [
12
+        ['product', '2015', '2016', '2017'],
13
+        ['Matcha Latte', 43.3, 85.8, 93.7],
14
+        ['Milk Tea', 83.1, 73.4, 55.1],
15
+        ['Cheese Cocoa', 86.4, 65.2, 82.5],
16
+        ['Walnut Brownie', 72.4, 53.9, 39.1]
17
+      ]
18
+    },
19
+    xAxis: { type: 'category' },
20
+    yAxis: {},
21
+    grid: {
22
+      left: '3%',
23
+      right: '4%',
24
+      bottom: '3%',
25
+      containLabel: true
26
+    },
27
+    // Declare several bar series, each will be mapped
28
+    // to a column of dataset.source by default.
29
+    series: [{ type: 'bar' }, { type: 'bar' }, { type: 'bar' }]
30
+  };
31
+
32
+  return (
33
+    <Card title='Bar Chart'>
34
+      <Chart option={option} style={props.style}></Chart>
35
+    </Card>
36
+  )
37
+}

+ 112
- 0
src/pages/sample/home/components/PictorialBar.jsx Parādīt failu

@@ -0,0 +1,112 @@
1
+import React from 'react';
2
+import { Card } from 'antd';
3
+import * as echarts from 'echarts/core';
4
+import Chart from '@/components/chart';
5
+
6
+
7
+export default (props) => {
8
+  let category = [];
9
+  let dottedBase = +new Date();
10
+  let lineData = [];
11
+  let barData = [];
12
+  for (let i = 0; i < 20; i++) {
13
+    let date = new Date((dottedBase += 3600 * 24 * 1000));
14
+    category.push(
15
+      [date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-')
16
+    );
17
+    let b = Math.random() * 200;
18
+    let d = Math.random() * 200;
19
+    barData.push(b);
20
+    lineData.push(d + b);
21
+  }
22
+
23
+  const option = {
24
+    backgroundColor: '#0f375f',
25
+    tooltip: {
26
+      trigger: 'axis',
27
+      axisPointer: {
28
+        type: 'shadow'
29
+      }
30
+    },
31
+    legend: {
32
+      data: ['line', 'bar'],
33
+      textStyle: {
34
+        color: '#ccc'
35
+      }
36
+    },
37
+    xAxis: {
38
+      data: category,
39
+      axisLine: {
40
+        lineStyle: {
41
+          color: '#ccc'
42
+        }
43
+      }
44
+    },
45
+    yAxis: {
46
+      splitLine: { show: false },
47
+      axisLine: {
48
+        lineStyle: {
49
+          color: '#ccc'
50
+        }
51
+      }
52
+    },
53
+    series: [
54
+      {
55
+        name: 'line',
56
+        type: 'line',
57
+        smooth: true,
58
+        showAllSymbol: true,
59
+        symbol: 'emptyCircle',
60
+        symbolSize: 15,
61
+        data: lineData
62
+      },
63
+      {
64
+        name: 'bar',
65
+        type: 'bar',
66
+        barWidth: 10,
67
+        itemStyle: {
68
+          borderRadius: 5,
69
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
70
+            { offset: 0, color: '#14c8d4' },
71
+            { offset: 1, color: '#43eec6' }
72
+          ])
73
+        },
74
+        data: barData
75
+      },
76
+      {
77
+        name: 'line',
78
+        type: 'bar',
79
+        barGap: '-100%',
80
+        barWidth: 10,
81
+        itemStyle: {
82
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
83
+            { offset: 0, color: 'rgba(20,200,212,0.5)' },
84
+            { offset: 0.2, color: 'rgba(20,200,212,0.2)' },
85
+            { offset: 1, color: 'rgba(20,200,212,0)' }
86
+          ])
87
+        },
88
+        z: -12,
89
+        data: lineData
90
+      },
91
+      {
92
+        name: 'dotted',
93
+        type: 'pictorialBar',
94
+        symbol: 'rect',
95
+        itemStyle: {
96
+          color: '#0f375f'
97
+        },
98
+        symbolRepeat: true,
99
+        symbolSize: [12, 4],
100
+        symbolMargin: 1,
101
+        z: -10,
102
+        data: lineData
103
+      }
104
+    ]
105
+  };
106
+
107
+  return (
108
+    <Card title='Pictorial Chart'>
109
+      <Chart option={option} style={props.style}></Chart>
110
+    </Card>
111
+  )
112
+}

+ 48
- 0
src/pages/sample/home/components/PieChart.jsx Parādīt failu

@@ -0,0 +1,48 @@
1
+import React from 'react';
2
+import { Card } from 'antd';
3
+import Chart from '@/components/chart';
4
+
5
+export default (props) => {
6
+
7
+  const option = {
8
+    // title: {
9
+    //   text: 'Referer of a Website',
10
+    //   subtext: 'Fake Data',
11
+    //   left: 'center'
12
+    // },
13
+    tooltip: {
14
+      trigger: 'item'
15
+    },
16
+    legend: {
17
+      orient: 'vertical',
18
+      left: 'left'
19
+    },
20
+    series: [
21
+      {
22
+        name: 'Access From',
23
+        type: 'pie',
24
+        radius: '50%',
25
+        data: [
26
+          { value: 1048, name: 'Search Engine' },
27
+          { value: 735, name: 'Direct' },
28
+          { value: 580, name: 'Email' },
29
+          { value: 484, name: 'Union Ads' },
30
+          { value: 300, name: 'Video Ads' }
31
+        ],
32
+        emphasis: {
33
+          itemStyle: {
34
+            shadowBlur: 10,
35
+            shadowOffsetX: 0,
36
+            shadowColor: 'rgba(0, 0, 0, 0.5)'
37
+          }
38
+        }
39
+      }
40
+    ]
41
+  };
42
+
43
+  return (
44
+    <Card title='Basic Pie Chart'>
45
+      <Chart option={option} style={props.style}></Chart>
46
+    </Card>
47
+  )
48
+}

+ 48
- 0
src/pages/sample/home/components/RadarChart.jsx Parādīt failu

@@ -0,0 +1,48 @@
1
+import React from 'react';
2
+import { Card } from 'antd';
3
+import Chart from '@/components/chart';
4
+
5
+export default (props) => {
6
+
7
+  const option = {
8
+    // title: {
9
+    //   text: 'Basic Radar Chart'
10
+    // },
11
+    legend: {
12
+      data: ['Allocated Budget', 'Actual Spending']
13
+    },
14
+    radar: {
15
+      // shape: 'circle',
16
+      indicator: [
17
+        { name: 'Sales', max: 6500 },
18
+        { name: 'Administration', max: 16000 },
19
+        { name: 'Information Technology', max: 30000 },
20
+        { name: 'Customer Support', max: 38000 },
21
+        { name: 'Development', max: 52000 },
22
+        { name: 'Marketing', max: 25000 }
23
+      ]
24
+    },
25
+    series: [
26
+      {
27
+        name: 'Budget vs spending',
28
+        type: 'radar',
29
+        data: [
30
+          {
31
+            value: [4200, 3000, 20000, 35000, 50000, 18000],
32
+            name: 'Allocated Budget'
33
+          },
34
+          {
35
+            value: [5000, 14000, 28000, 26000, 42000, 21000],
36
+            name: 'Actual Spending'
37
+          }
38
+        ]
39
+      }
40
+    ]
41
+  };
42
+
43
+  return (
44
+    <Card title='Basic Radar Chart'>
45
+      <Chart option={option} style={props.style}></Chart>
46
+    </Card>
47
+  )
48
+}

+ 41
- 0
src/pages/sample/home/index.jsx Parādīt failu

@@ -0,0 +1,41 @@
1
+import React from 'react';
2
+import { Row, Col, Card, Space, Statistic } from 'antd';
3
+import Container from '@/components/page/Container';
4
+import Banner from './components/Banner';
5
+import AreaChart from './components/AreaChart';
6
+import BarChart from './components/BarChart';
7
+import PictorialBar from './components/PictorialBar';
8
+import RadarChart from './components/RadarChart';
9
+import PieChart from './components/PieChart';
10
+
11
+export default (props) => {
12
+
13
+  const chartStyle = {
14
+    height: '360px',
15
+    width: '100%',
16
+  }
17
+
18
+  return (
19
+    <Container>
20
+      <Banner />
21
+
22
+      <Row gutter={24} style={{ marginTop: '24px' }}>
23
+        <Col span={18}>
24
+          <AreaChart style={chartStyle}/>
25
+        </Col>
26
+        <Col span={6}>
27
+          <RadarChart style={chartStyle}/>
28
+        </Col>
29
+      </Row>
30
+
31
+      <Row gutter={24} style={{ marginTop: '24px' }}>
32
+        <Col span={6}>
33
+          <PieChart style={chartStyle}/>
34
+        </Col>
35
+        <Col span={18}>
36
+          <BarChart style={chartStyle}/>
37
+        </Col>
38
+      </Row>
39
+    </Container>
40
+  )
41
+}

+ 1
- 1
src/routes/routes.jsx Parādīt failu

@@ -1,7 +1,7 @@
1 1
 import AuthLayout from "@/layouts/AuthLayout";
2
-import Home from "@/pages/Home";
3 2
 import Login from '@/pages/login';
4 3
 import Page404 from '@/pages/404';
4
+import Home from "@/pages/sample/home";
5 5
 import BasicForm from '@/pages/sample/form';
6 6
 import BasicTable from '@/pages/sample/table';
7 7