1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
| <template>
| <div class="box">
| <div class="title">
| {{ title }}
| </div>
| <div class="site-num">
| <type-num class="site-num-boxs" v-for="(item, index) in typeNumData" :key="index" :params="item"></type-num>
| </div>
| <div class="site-proportion">
| <pie-chart class="site-proportion-echarts" v-for="(item, index) in echartsData" :key="index"
| :params="item"></pie-chart>
| </div>
| </div>
| </template>
|
| <script>
| import TypeNum from './components/typeNum.vue'
| import PieChart from './components/pieChart.vue'
|
| export default {
| name: 'SiteTypeProportion',
|
| props: {
| title: {
| type: String,
| }
| },
|
| components: { TypeNum, PieChart },
|
| data () {
| return {
| publicPath: process.env.BASE_URL,
| typeNumData: [],
| echartsData: []
| }
| },
|
| mounted () {
| this.typeNumData = [
| {
| type: '已建水库',
| imgUrl: this.publicPath + 'images/水质监测站.png',
| value: 896
| },
| {
| type: '水位站点',
| imgUrl: this.publicPath + 'images/水质监测站.png',
| value: 1206
| }
| ]
|
| this.echartsData = [
| {
| type: '覆盖率',
| value: 92
| },
| {
| type: '在线率',
| value: 92
| },
| {
| type: '到报率',
| value: 92
| },
| ]
| },
| }
| </script>
|
| <style lang="scss" scoped>
| .box {
| width: 220px;
| color: #fff;
|
| .title {
| height: 36px;
| line-height: 36px;
| text-align: center;
| font-size: 18px;
| }
|
| .site-num {
| display: flex;
| justify-content: space-around;
| height: 60px;
|
| &-boxs {
| flex: 1;
| }
| }
|
| .site-proportion {
| height: 100px;
| display: flex;
|
| &-echarts {
| flex: 1;
| }
| }
| }
| </style>
|
|