tong hace 4 años
padre
commit
8442b8c3da
Se han modificado 1 ficheros con 11 adiciones y 14 borrados
  1. 11 14
      pages/me/Statistical-task/index.vue

+ 11 - 14
pages/me/Statistical-task/index.vue

@@ -51,6 +51,7 @@
 		data() {
 			return {
 				orderList: [],
+				data: '',
 				cWidth: '',
 				cHeight: '',
 				pixelRatio: 1,
@@ -89,9 +90,6 @@
 						console.log(res)
 						this.orderList = res.data.data
 						this.getPieData()
-
-
-						// this.showPie('mouthPie0',monthPie);
 					}).catch(err => {
 						console.log(err)
 					})
@@ -117,11 +115,10 @@
 							name: '',
 							percent: '',
 							format: (val) => {
-								console.log(val)
-								// return val.toFixed(0) + ''
+								console.log(val * 100)
+								console.log((val * 100).toFixed())
 								return (val * 100).toFixed()+"%"
 							}
-
 						}
 						let quarterObj = {
 							data: null,
@@ -134,27 +131,26 @@
 							}
 						}
 						monthObj.data = this.orderList[i].storeMonthList[j].data
-						monthObj.name = this.orderList[i].storeMonthList[j].name
+						this.data = this.orderList[i].storeMonthList[j].data
+						console.log(this.orderList[i].storeMonthList[j].data)
+						monthObj.name = this.orderList[i].storeMonthList[j].name+":"+this.orderList[i].storeMonthList[j].data
 						monthObj.percent = this.orderList[i].storeMonthList[j].percent
 						quarterObj.data = this.orderList[i].storeQuarterList[j].data
-						quarterObj.name = this.orderList[i].storeQuarterList[j].name
+						quarterObj.name = this.orderList[i].storeQuarterList[j].name+":"+this.orderList[i].storeQuarterList[j].data
 						quarterObj.percent = this.orderList[i].storeQuarterList[j].percent
 						quarterPie.series.push(quarterObj)
 						monthPie.series.push(monthObj)
-						
 					}
 					this.showPie(`mouthPie${i}`, monthPie);
 					this.showPie(`quarterPie${i}`, quarterPie)
 				}
 			},
 			showPie(canvasId, chartData) {
-				console.log('88888')
-				console.log(canvasId, chartData)
 				canvasObj[canvasId] = new uCharts({
 					$this: _self,
 					canvasId: canvasId,
 					type: 'ring',
-					fontSize: 11,
+					fontSize: 8,
 					padding: [5, 5, 5, 5],
 					legend: {
 						show: true,
@@ -177,7 +173,7 @@
 					subtitle: {
 						name: chartData.series[0].percent,
 						color: '#7cb5ec',
-						fontSize: 12 * _self.pixelRatio,
+						fontSize: 13 * _self.pixelRatio,
 					},
 					title: {
 						name: '已完成',
@@ -195,9 +191,10 @@
 			},
 			touchPie(e, id) {
 				console.log(e, id)
+				console.log(id)
 				canvasObj[id].showToolTip(e, {
 					format: function(item) {
-						return item.name + ':' + item.data
+						return item.name
 					}
 				});
 			},