Просмотр исходного кода

Merge branch 'master' of http://git.ycjcjy.com/civilized_city/pc-admin

Yansen 2 лет назад
Родитель
Сommit
57d8c2026c

+ 74
- 0
src/pages/home/components/AssignedCharts.jsx Просмотреть файл

@@ -0,0 +1,74 @@
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
+    title: {
9
+      text: '上报统计'
10
+    },
11
+    tooltip: {
12
+      trigger: 'axis',
13
+      axisPointer: {
14
+        type: 'cross',
15
+        label: {
16
+          backgroundColor: '#0A9071'
17
+        }
18
+      }
19
+    },
20
+    grid: {
21
+      left: '3%',
22
+      bottom: '3%',
23
+      width: '90%',
24
+      containLabel: true
25
+    },
26
+    xAxis: [
27
+      {
28
+        type: 'category',
29
+        boundaryGap: false,
30
+        data: ['12/01', '12/02', '12/03', '12/04', '12/05', '12/06', '12/07']
31
+      }
32
+    ],
33
+    yAxis: [
34
+      {
35
+        type: 'value',
36
+        minInterval: 1
37
+      }
38
+    ],
39
+    series: [
40
+      {
41
+        type: 'line',
42
+        stack: 'Total',
43
+        smooth: true,
44
+        lineStyle: {
45
+          width: 0
46
+        },
47
+        showSymbol: false,
48
+        areaStyle: {
49
+          opacity: 1,
50
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1.1, [
51
+            {
52
+              offset: 0,
53
+              color: '#0A9071'
54
+            },
55
+            {
56
+              offset: 1,
57
+              color: '#FFF'
58
+            }
59
+          ])
60
+        },
61
+        emphasis: {
62
+          focus: 'series'
63
+        },
64
+        data: [1.8, 3.3, 1.9, 2.9, 2.1, 1.5, 2.3]
65
+      }
66
+    ]
67
+  };
68
+
69
+  return (
70
+    <Card title="上报统计">
71
+      <Chart option={option} style={props.style}></Chart>
72
+    </Card>
73
+  )
74
+}

+ 30
- 0
src/pages/home/components/Banner.jsx Просмотреть файл

@@ -0,0 +1,30 @@
1
+import React from 'react';
2
+import { UserOutlined } from '@ant-design/icons';
3
+import { Row, Col, Card, Statistic, Space } from 'antd';
4
+
5
+export default (props) => {
6
+  return (
7
+    <Row gutter={24}>
8
+      <Col span={6}>
9
+        <Card>
10
+          <Statistic prefix={<UserOutlined />} title="注册用户" value={580239} />
11
+        </Card>
12
+      </Col>
13
+      <Col span={6}>
14
+        <Card>
15
+          <Statistic prefix={<UserOutlined />} title="待处理问题单数" value={580239} />
16
+        </Card>
17
+      </Col>
18
+      <Col span={6}>
19
+        <Card>
20
+          <Statistic prefix={<UserOutlined />} title="待处理中问题单数" value={580239} />
21
+        </Card>
22
+      </Col>
23
+      <Col span={6}>
24
+        <Card>
25
+          <Statistic prefix={<UserOutlined />} title="已办结问题单数" value={580239} />
26
+        </Card>
27
+      </Col>
28
+    </Row>
29
+  )
30
+}

+ 67
- 0
src/pages/home/components/EscalationCharts.jsx Просмотреть файл

@@ -0,0 +1,67 @@
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
+
8
+  const option = {
9
+    title: {
10
+      text: '交办统计'
11
+    },
12
+    tooltip: {
13
+      trigger: 'axis',
14
+      axisPointer: {
15
+        type: 'cross',
16
+        label: {
17
+          backgroundColor: '#F772D1'
18
+        }
19
+      }
20
+    },
21
+    grid: {
22
+      left: '3%',
23
+      bottom: '3%',
24
+      width: '90%',
25
+      containLabel: true
26
+    },
27
+    xAxis: [
28
+      {
29
+        type: 'category',
30
+        boundaryGap: false,
31
+        data: ['已处理', '未处理', '逾期'],
32
+        boundaryGap: true,
33
+        name: '状态',
34
+        axisTick: {
35
+          alignWithLabel: true,
36
+        }
37
+      }
38
+    ],
39
+    yAxis: [
40
+      {
41
+        type: 'value',
42
+        minInterval: 1,
43
+        name: '交办次数'
44
+      }
45
+    ],
46
+    series: [
47
+      {
48
+        type: 'bar',
49
+        barWidth: '15%',
50
+        itemStyle: {
51
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
52
+            { offset: 0, color: '#F772D1' },
53
+            { offset: 0.5, color: '#C872F2' },
54
+            { offset: 1, color: '#E5BEF8' }
55
+          ])
56
+        },
57
+        data: [2, 3, 1]
58
+      }
59
+    ]
60
+  };
61
+
62
+  return (
63
+    <Card title="时间维度">
64
+      <Chart option={option} style={props.style}></Chart>
65
+    </Card>
66
+  )
67
+}

+ 66
- 0
src/pages/home/components/ProblemCharts.jsx Просмотреть файл

@@ -0,0 +1,66 @@
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
+
8
+  const option = {
9
+    title: {
10
+      text: '问题分类'
11
+    },
12
+    tooltip: {
13
+      trigger: 'axis',
14
+      axisPointer: {
15
+        type: 'cross',
16
+        label: {
17
+          backgroundColor: '#FB9900'
18
+        }
19
+      }
20
+    },
21
+    grid: {
22
+      left: '3%',
23
+      bottom: '3%',
24
+      width: '90%',
25
+      containLabel: true
26
+    },
27
+    xAxis: [
28
+      {
29
+        type: 'category',
30
+        data: ['公益宣传', '环境卫生', '基础设施', '文明素养', '公共秩序', '其他'],
31
+        // boundaryGap: true,
32
+        axisTick: {
33
+          alignWithLabel: true,
34
+        },
35
+        axisLabel: {
36
+          interval: 0,
37
+        }
38
+      }
39
+    ],
40
+    yAxis: [
41
+      {
42
+        type: 'value',
43
+        minInterval: 1
44
+      }
45
+    ],
46
+    series: [
47
+      {
48
+        type: 'bar',
49
+        barWidth: '20%',
50
+        itemStyle: {
51
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
52
+            { offset: 0, color: '#FB9900' },
53
+            { offset: 1, color: '#FFD38F' }
54
+          ])
55
+        },
56
+        data: [2, 1, 2, 3, 2, 1]
57
+      }
58
+    ]
59
+  };
60
+
61
+  return (
62
+    <Card>
63
+      <Chart option={option} style={props.style}></Chart>
64
+    </Card>
65
+  )
66
+}

+ 66
- 0
src/pages/home/components/SpotCharts.jsx Просмотреть файл

@@ -0,0 +1,66 @@
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
+
8
+  const option = {
9
+    title: {
10
+      text: '点位分类'
11
+    },
12
+    tooltip: {
13
+      trigger: 'axis',
14
+      axisPointer: {
15
+        type: 'cross',
16
+        label: {
17
+          backgroundColor: '#FB9900'
18
+        }
19
+      }
20
+    },
21
+    grid: {
22
+      left: '3%',
23
+      bottom: '3%',
24
+      width: '90%',
25
+      containLabel: true
26
+    },
27
+    xAxis: [
28
+      {
29
+        type: 'category',
30
+        data: ['公益宣传', '环境卫生', '基础设施', '文明素养', '公共秩序', '其他'],
31
+        // boundaryGap: true,
32
+        axisTick: {
33
+          alignWithLabel: true,
34
+        },
35
+        axisLabel: {
36
+          interval: 0,
37
+        }
38
+      }
39
+    ],
40
+    yAxis: [
41
+      {
42
+        type: 'value',
43
+        minInterval: 1
44
+      }
45
+    ],
46
+    series: [
47
+      {
48
+        type: 'bar',
49
+        barWidth: '20%',
50
+        itemStyle: {
51
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
52
+            { offset: 0, color: '#FB9900' },
53
+            { offset: 1, color: '#FFD38F' }
54
+          ])
55
+        },
56
+        data: [2, 1, 2, 3, 2, 1]
57
+      }
58
+    ]
59
+  };
60
+
61
+  return (
62
+    <Card>
63
+      <Chart option={option} style={props.style}></Chart>
64
+    </Card>
65
+  )
66
+}

+ 41
- 0
src/pages/home/index.jsx Просмотреть файл

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

+ 0
- 8
src/pages/index.jsx Просмотреть файл

@@ -1,8 +0,0 @@
1
-import React from 'react'
2
-
3
-export default (props) => {
4
-  return (
5
-    <div></div>
6
-  )
7
-}
8
-

+ 1
- 1
src/routes/routes.jsx Просмотреть файл

@@ -23,7 +23,7 @@ import CheckList from '@/pages/check';
23 23
 import CheckEdit from '@/pages/check/Edit';
24 24
 import OrgList from "@/pages/org/index";
25 25
 
26
-import Index from '@/pages/index';
26
+import Index from '@/pages/home/index';
27 27
 
28 28
 import PositionList from "@/pages/position/list";
29 29
 import PositionEdit from "@/pages/position/edit";