total.vue
10.3 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<template>
<view class="ComCss">
<u-navbar v-if="!$isDing" class="navBarCss" title="数据统计" leftIconSize="0"
:titleStyle="{'fontSize':'36rpx','color':'#333333','fontWeight':'700'}" safeAreaInsetTop placeholder />
<view class="bigCardCss">
<view class="titleCss">
本财年报告已上报数
</view>
<view class="numCss">
{{statistics.totalNum}}
</view>
</view>
<view class="flexCss">
<view class="cardCss">
<view class="titleCss">
待开发居民用户
</view>
<view class="numCss">
{{statistics.resident}}
</view>
</view>
<view class="cardCss">
<view class="titleCss">
待开发商业用户
</view>
<view class="numCss">
{{statistics.business}}
</view>
</view>
<view class="cardCss">
<view class="titleCss">
待开发工业用户
</view>
<view class="numCss">
{{statistics.industry}}
</view>
</view>
</view>
<view class="charCardCss">
<view class="charTitleCss">
本财年市场摸底分析
</view>
<view class="charbox">
<echarts class="pie-chart" :option="pieOption" canvasId="pie1"></echarts>
</view>
</view>
<view class="charCardCss">
<view class="charTitleCss">
待开发用户池数据分析
</view>
<view class="charbox">
<echarts class="pie-chart" :option="pieOption2" canvasId="pie2"></echarts>
</view>
</view>
<!-- <view class="charCardCss">
<view class="charTitleCss">
近4年待开发用户池数据情况
</view>
<view class="charbox">
<echarts class="line-chart" :option="lineOption" canvasId="line"></echarts>
</view>
</view> -->
</view>
</template>
<script>
import {
getStatisticsReport,
getStatisticsPool,
getStatisticsLogin
} from '@/api/total.js'
export default {
components: {},
props: {
},
data() {
return {
pieOption: {},
pieOption2: {},
lineOption: {},
fiscalYear: "",
statistics: {
totalNum: "",
resident: "",
business: "",
industry: ""
},
data1: [],
data2: [],
data3: [],
total1: 0,
total2: 0,
}
},
mounted() {
},
computed: {
},
onLoad() {
this.initData()
},
methods: {
async initData() {
this.fiscalYear = this.$u.timeFormat("", 'yyyy');
await getStatisticsReport(this.fiscalYear).then(res => {
if (res.code === 200) {
let data = res.data;
this.statistics.totalNum = data.pass + data.revise;
this.data1 = [{
value: data.submit,
name: '待申报'
},
{
value: data.review,
name: '待评审'
},
{
value: data.revise,
name: '待修改'
},
{
value: data.pass,
name: '已通过'
},
{
value: data.unCreate,
name: '未创建'
},
]
this.total1 = data.total
console.log("报告", this.data1);
}
})
await getStatisticsPool().then(res => {
if (res.code === 200) {
let data = res.data;
this.statistics.resident = data.resident;
this.statistics.business = data.commerce;
this.statistics.industry = data.industry;
this.data2 = [{
value: data.resident,
name: '待开发居民用户数'
},
{
value: data.commerce,
name: '待开发商业用户数'
},
{
value: data.industry,
name: '待开发工业用户数'
},
]
this.total2 = data.total
}
})
this.refreshData()
},
refreshData() {
let that = this;
this.pieOption = {
tooltip: {
trigger: 'item'
},
legend: {
top: 'middle',
right: '10%',
orient: 'vertical',
itemWidth: 8,
itemGap: 14,
icon: 'circle',
data: this.data1.map(item => item.name)
},
color: ['#5875EB', '#FFA500', '#E74C3C', '#15C2C3', '#666666'],
series: [{
name: '摸底分析',
type: 'pie',
right: 100,
radius: ['65%', '80%'],
avoidLabelOverlap: false,
label: {
position: 'outer',
alignTo: 'edge',
margin: 0,
normal: {
show: true,
position: 'center',
color: '#4c4a4a',
formatter: '{total|' + this.total1 + '}' + '\n\r' + '{active|总预算主体数}',
rich: {
total: {
fontSize: 20,
fontFamily: '微软雅黑',
color: '#45496a'
},
active: {
fontSize: 14,
fontFamily: '苹方 中等',
color: '#999',
lineHeight: 30
}
}
},
emphasis: { //中间文字显示
show: true
}
},
labelLine: {
show: true
},
data: this.data1
}]
};
this.pieOption2 = {
tooltip: {
trigger: 'item'
},
legend: {
orient: 'vertical',
y: 'center',
right: 10,
itemWidth: 8,
itemGap: 14,
icon: 'circle',
align: 'left',
data: this.data2.map(item => item.name)
},
color: ['#15C2C3', '#5875EB', '#E74C3C' ],
series: [{
name: '待开发用户池数据分析',
type: 'pie',
right: 100,
radius: ['65%', '80%'],
avoidLabelOverlap: false,
label: {
position: 'outer',
alignTo: 'edge',
margin: 0,
normal: {
show: true,
position: 'center',
color: '#4c4a4a',
formatter: '{total|' + this.total2 + '}' + '\n\r' + '{active|总待开发用户数}',
rich: {
total: {
fontSize: 20,
fontFamily: '微软雅黑',
color: '#45496a'
},
active: {
fontSize: 14,
fontFamily: '苹方 中等',
color: '#999',
lineHeight: 30
}
}
},
emphasis: { //中间文字显示
show: true
}
},
labelLine: {
show: true
},
data: this.data2
}]
};
this.lineOption = {
// title: {
// text: 'Stacked Line'
// },
tooltip: {
trigger: 'axis'
},
legend: {
right: 10,
top: '10%',
icon: 'roundRect',
itemWidth: 10,
itemHeight: 2,
itemGap: 20,
data: ['民居用户', '商业用户', '工业用户']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: true,
data: ['2020财年', '2021财年', '2021财年', '2023财年']
},
yAxis: {
type: 'value'
},
series: [{
name: '民居用户',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '商业用户',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: '工业用户',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410]
},
]
}
}
}
}
</script>
<style lang="scss" scoped>
.ComCss {
background: #f2f4f3;
padding: 0 0 10rpx 0;
}
.bigCardCss {
margin: 20rpx 20rpx 0rpx 20rpx;
padding: 40rpx 25rpx;
height: 177rpx;
border-radius: 20rpx;
background-color: #ffffff;
box-sizing: border-box;
}
.cardCss {
width: 220rpx;
margin: 20rpx 0rpx;
padding: 40rpx 25rpx;
border-radius: 20rpx;
background-color: #ffffff;
box-sizing: border-box;
}
.titleCss {
background-color: rgba(255, 255, 255, 0);
box-sizing: border-box;
font-family: '苹方 中等', '苹方', sans-serif;
color: #45496a;
text-align: left;
line-height: normal;
font-size: 24rpx;
}
.numCss {
margin-top: 17rpx;
background-color: rgba(255, 255, 255, 0);
box-sizing: border-box;
font-family: '苹方 中等', '苹方', sans-serif;
color: #cf000d;
text-align: left;
line-height: normal;
font-size: 34rpx;
}
.flexCss {
display: flex;
justify-content: space-around;
}
.charCardCss {
margin: 0rpx 24rpx 20rpx 24rpx;
height: 486rpx;
padding: 16rpx 2rpx 20rpx 20rpx;
border-radius: 20rpx;
background-color: #ffffff;
box-sizing: border-box;
}
.charTitleCss {
height: 40rpx;
margin: 32rpx 0rpx 0rpx 30rpx;
background-color: rgba(255, 255, 255, 0);
box-sizing: border-box;
font-family: '苹方 中等', '苹方', sans-serif;
color: #45496a;
text-align: left;
line-height: normal;
font-size: 30rpx;
}
.charbox {
width: 100%;
height: 400rpx;
}
.charCss {}
</style>