Quellcode durchsuchen

2022-12-16 update

1. 调整rateAnalysis scatterSingleChart组件 调用接口数据
2. 修复htmlToPdf 的scroll函数中 对添加image定位不正确的问题
moccus vor 2 Jahren
Ursprung
Commit
d73cba0ada

+ 13 - 14
src/pages/dataAnalysis/rateAnalysis/components/scatterSingleChart.vue

@@ -49,15 +49,15 @@ const option = computed({
 		return {
 			tooltip: {
 				position: 'top',
-				formatter: function (params) {
-					return (
-						params.value[2] +
-						' commits in ' +
-						params.value[0] +
-						' of ' +
-						params.value[1]
-					);
-				}
+				// formatter: function (params) {
+				// 	return (
+				// 		params.value[2] +
+				// 		' commits in ' +
+				// 		params.value[0] +
+				// 		' of ' +
+				// 		params.value[1]
+				// 	);
+				// }
 			},
 			title: {
 				text: props.title || '',
@@ -66,11 +66,10 @@ const option = computed({
 				left: '5%',
 			},
 			grid: {
-				top: 40,
-				left: 2,
-				bottom: 10,
-				right: 20,
-				containLabel: true
+				top: 80,
+				left: 40,
+				right: 40,
+				bottom: 40,
 			},
 			xAxis: props.xAxis || [],
 			//  {

Datei-Diff unterdrückt, da er zu groß ist
+ 51 - 49
src/pages/dataAnalysis/rateAnalysis/index.vue


+ 5 - 1
src/tools/htmlToPdf.js

@@ -119,7 +119,11 @@ const scrollToPDF = (ele, pdfName, call = () => {}) => {
                     pdf.addPage()
                     addPos = 0  // 填充下一页后, 设置当前元素填充位置为 新页的top为0
                 }else{
-                    addPos = pageHeight // 如果不大于页面高度  则当前元素填充位置为一个元素高度
+                    if(position<pageHeight){  //如果剩余position小于一个pageHeight 则addPos等于pageHeight
+                        addPos = pageHeight
+                    }else{
+                        addPos = position
+                    }
                 }
             }
             pdf.addImage(pageData, 'JPEG', 0, addPos, 592.28, pageHeight)