图表数据数量显示
Showing
3 changed files
with
81 additions
and
17 deletions
... | @@ -57,7 +57,7 @@ import efficient from "@/api/efficient"; | ... | @@ -57,7 +57,7 @@ import efficient from "@/api/efficient"; |
57 | import { getFirstDayOfSeason, timeFormat } from "@/utils/operation"; | 57 | import { getFirstDayOfSeason, timeFormat } from "@/utils/operation"; |
58 | export default { | 58 | export default { |
59 | name: "jktj", | 59 | name: "jktj", |
60 | data () { | 60 | data() { |
61 | return { | 61 | return { |
62 | // 开始日期限制 | 62 | // 开始日期限制 |
63 | pickerOptionsStart: { | 63 | pickerOptionsStart: { |
... | @@ -83,7 +83,7 @@ export default { | ... | @@ -83,7 +83,7 @@ export default { |
83 | pieChartsData: [], | 83 | pieChartsData: [], |
84 | }; | 84 | }; |
85 | }, | 85 | }, |
86 | created () {}, | 86 | created() {}, |
87 | mounted() { | 87 | mounted() { |
88 | this.getProcessCounts(); | 88 | this.getProcessCounts(); |
89 | }, | 89 | }, |
... | @@ -91,11 +91,11 @@ export default { | ... | @@ -91,11 +91,11 @@ export default { |
91 | ...mapGetters(["dicData"]), | 91 | ...mapGetters(["dicData"]), |
92 | }, | 92 | }, |
93 | methods: { | 93 | methods: { |
94 | endTimeChange(val){ | 94 | endTimeChange(val) { |
95 | this.form.endTime = timeFormat(new Date(val),true) | 95 | this.form.endTime = timeFormat(new Date(val), true); |
96 | }, | 96 | }, |
97 | //查询各区县办件数量 | 97 | //查询各区县办件数量 |
98 | async getProcessCounts () { | 98 | async getProcessCounts() { |
99 | this.pieChartsData = []; | 99 | this.pieChartsData = []; |
100 | let { result: res } = await efficient.getProcessCounts( | 100 | let { result: res } = await efficient.getProcessCounts( |
101 | this.form.startTime, | 101 | this.form.startTime, |
... | @@ -113,14 +113,15 @@ export default { | ... | @@ -113,14 +113,15 @@ export default { |
113 | groupId: item.recType, | 113 | groupId: item.recType, |
114 | }); | 114 | }); |
115 | }); | 115 | }); |
116 | res.length && this.$nextTick(() => { | 116 | res.length && |
117 | // 初始化图表 | 117 | this.$nextTick(() => { |
118 | this.echartInit(); | 118 | // 初始化图表 |
119 | this.barChartInit(res[0].recType); | 119 | this.echartInit(); |
120 | }); | 120 | this.barChartInit(res[0].recType); |
121 | }); | ||
121 | }, | 122 | }, |
122 | // 重置 | 123 | // 重置 |
123 | resetForm () { | 124 | resetForm() { |
124 | this.form = { | 125 | this.form = { |
125 | startTime: getFirstDayOfSeason(), | 126 | startTime: getFirstDayOfSeason(), |
126 | endTime: timeFormat(new Date(), true), | 127 | endTime: timeFormat(new Date(), true), |
... | @@ -128,7 +129,7 @@ export default { | ... | @@ -128,7 +129,7 @@ export default { |
128 | this.getProcessCounts(); | 129 | this.getProcessCounts(); |
129 | }, | 130 | }, |
130 | //玫瑰图初始化 | 131 | //玫瑰图初始化 |
131 | echartInit () { | 132 | echartInit() { |
132 | let _this = this; | 133 | let _this = this; |
133 | // 基于准备好的dom,初始化echarts实例 | 134 | // 基于准备好的dom,初始化echarts实例 |
134 | let myChart = this.$echarts.init(document.getElementById("myChart")); | 135 | let myChart = this.$echarts.init(document.getElementById("myChart")); |
... | @@ -189,7 +190,7 @@ export default { | ... | @@ -189,7 +190,7 @@ export default { |
189 | }); | 190 | }); |
190 | }, | 191 | }, |
191 | //柱图初始化 | 192 | //柱图初始化 |
192 | async barChartInit (recType) { | 193 | async barChartInit(recType) { |
193 | //请求recType对应业务的各区县数据 | 194 | //请求recType对应业务的各区县数据 |
194 | let { result: res } = await efficient.getProcessDays( | 195 | let { result: res } = await efficient.getProcessDays( |
195 | recType, | 196 | recType, |
... | @@ -274,19 +275,46 @@ export default { | ... | @@ -274,19 +275,46 @@ export default { |
274 | series: [ | 275 | series: [ |
275 | { | 276 | { |
276 | type: "bar", | 277 | type: "bar", |
277 | barMaxWidth: '60', | 278 | //显示数值 |
279 | itemStyle: { | ||
280 | normal: { | ||
281 | label: { | ||
282 | show: true, //开启显示 | ||
283 | position: "top", //在上方显示 | ||
284 | }, | ||
285 | }, | ||
286 | }, | ||
287 | barMaxWidth: "60", | ||
278 | name: "最短用时", | 288 | name: "最短用时", |
279 | data: dealArr.map((item) => item.minDay), | 289 | data: dealArr.map((item) => item.minDay), |
280 | }, | 290 | }, |
281 | { | 291 | { |
282 | type: "bar", | 292 | type: "bar", |
283 | barMaxWidth: '60', | 293 | //显示数值 |
294 | itemStyle: { | ||
295 | normal: { | ||
296 | label: { | ||
297 | show: true, //开启显示 | ||
298 | position: "top", //在上方显示 | ||
299 | }, | ||
300 | }, | ||
301 | }, | ||
302 | barMaxWidth: "60", | ||
284 | name: "平均用时", | 303 | name: "平均用时", |
285 | data: dealArr.map((item) => item.avgDay), | 304 | data: dealArr.map((item) => item.avgDay), |
286 | }, | 305 | }, |
287 | { | 306 | { |
288 | type: "bar", | 307 | type: "bar", |
289 | barMaxWidth: '60', | 308 | //显示数值 |
309 | itemStyle: { | ||
310 | normal: { | ||
311 | label: { | ||
312 | show: true, //开启显示 | ||
313 | position: "top", //在上方显示 | ||
314 | }, | ||
315 | }, | ||
316 | }, | ||
317 | barMaxWidth: "60", | ||
290 | name: "最长用时", | 318 | name: "最长用时", |
291 | data: dealArr.map((item) => item.maxDay), | 319 | data: dealArr.map((item) => item.maxDay), |
292 | }, | 320 | }, | ... | ... |
... | @@ -246,6 +246,15 @@ export default { | ... | @@ -246,6 +246,15 @@ export default { |
246 | { | 246 | { |
247 | name: "成功", | 247 | name: "成功", |
248 | type: "bar", | 248 | type: "bar", |
249 | //显示数值 | ||
250 | itemStyle: { | ||
251 | normal: { | ||
252 | label: { | ||
253 | show: true, //开启显示 | ||
254 | position: "top", //在上方显示 | ||
255 | }, | ||
256 | }, | ||
257 | }, | ||
249 | barMaxWidth: '60', | 258 | barMaxWidth: '60', |
250 | data: this.chartData.map((item) => { | 259 | data: this.chartData.map((item) => { |
251 | return item.success; | 260 | return item.success; |
... | @@ -254,6 +263,15 @@ export default { | ... | @@ -254,6 +263,15 @@ export default { |
254 | { | 263 | { |
255 | name: "失败", | 264 | name: "失败", |
256 | type: "bar", | 265 | type: "bar", |
266 | //显示数值 | ||
267 | itemStyle: { | ||
268 | normal: { | ||
269 | label: { | ||
270 | show: true, //开启显示 | ||
271 | position: "top", //在上方显示 | ||
272 | }, | ||
273 | }, | ||
274 | }, | ||
257 | barMaxWidth: '60', | 275 | barMaxWidth: '60', |
258 | data: this.chartData.map((item) => { | 276 | data: this.chartData.map((item) => { |
259 | return item.failure; | 277 | return item.failure; |
... | @@ -261,6 +279,15 @@ export default { | ... | @@ -261,6 +279,15 @@ export default { |
261 | }, | 279 | }, |
262 | { | 280 | { |
263 | name: "成功率", | 281 | name: "成功率", |
282 | //显示数值 | ||
283 | itemStyle: { | ||
284 | normal: { | ||
285 | label: { | ||
286 | show: true, //开启显示 | ||
287 | position: "top", //在上方显示 | ||
288 | }, | ||
289 | }, | ||
290 | }, | ||
264 | type: "line", | 291 | type: "line", |
265 | barMaxWidth: '60', | 292 | barMaxWidth: '60', |
266 | yAxisIndex: 1, | 293 | yAxisIndex: 1, | ... | ... |
... | @@ -210,9 +210,18 @@ export default { | ... | @@ -210,9 +210,18 @@ export default { |
210 | ], | 210 | ], |
211 | series: [ | 211 | series: [ |
212 | { | 212 | { |
213 | data: chartArr.map(item=>item.counts), | ||
214 | type: "bar", | 213 | type: "bar", |
214 | //显示数值 | ||
215 | itemStyle: { | ||
216 | normal: { | ||
217 | label: { | ||
218 | show: true, //开启显示 | ||
219 | position: "top", //在上方显示 | ||
220 | }, | ||
221 | }, | ||
222 | }, | ||
215 | barMaxWidth: '60', | 223 | barMaxWidth: '60', |
224 | data: chartArr.map(item=>item.counts), | ||
216 | }, | 225 | }, |
217 | ], | 226 | ], |
218 | }); | 227 | }); | ... | ... |
-
Please register or sign in to post a comment