Explorar o código

团队版报告页面改版、canvas生成图片

htc hai 13 horas
pai
achega
e3313a0dfc
Modificáronse 2 ficheiros con 512 adicións e 482 borrados
  1. 2 17
      pagesHome/pdf.vue
  2. 510 465
      pagesHome/pdfZyb.vue

+ 2 - 17
pagesHome/pdf.vue

@@ -491,7 +491,7 @@
 
 			// --- 计算高度 ---
 			// 必须先设置字体,否则 measureText 计算不准确
-			ctx.font = 'bold 10px sans-serif';
+			ctx.font = 'bold 9px sans-serif';
 			let themeHeight = this.calculateWrappedTextHeight(ctx, item.theme, 14, leftW - 54 - 20);
 			
 			ctx.font = '8px sans-serif';
@@ -503,7 +503,7 @@
 			// --- 绘制左侧文字 ---
 			// Theme Title
 			ctx.fillStyle = dimensionData.titlecolor;
-			ctx.font = 'bold 10px sans-serif';
+			ctx.font = 'bold 9px sans-serif';
 			ctx.textAlign = 'left';
 			ctx.textBaseline = 'top';
 			this.drawWrappedTextTop(ctx, item.theme, 10, startY, 14, leftW - 54 - 20);
@@ -610,21 +610,6 @@
 			}
 			ctx.fillText(line, x, currentY);
 		},
-
-		// 辅助函数:解析 CSS linear-gradient 字符串
-		parseGradient(gradientString) {
-			const colorStops = [];
-			// 简化解析,仅适用于 "linear-gradient(90deg, #RRGGBB 0%, #RRGGBB 100%)" 格式
-			const matches = gradientString.match(/#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})\s+(\d+)%/g);
-			if (matches) {
-				matches.forEach(match => {
-					const parts = match.split(' ');
-					colorStops.push({ color: parts[0], stop: parseInt(parts[1]) / 100 });
-				});
-			}
-			return colorStops;
-		},
-		
 		calculateScaleAndPosition() {
 		    uni.getSystemInfo({
 				success: (res) => {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 510 - 465
pagesHome/pdfZyb.vue