|
@@ -655,146 +655,257 @@ export default {
|
|
|
const drawLineData=JSON.parse(item.drawLineData);
|
|
const drawLineData=JSON.parse(item.drawLineData);
|
|
|
console.log("打印drawLineData",drawLineData);
|
|
console.log("打印drawLineData",drawLineData);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- // for(var j=0;j<drawLineData.length;j++)
|
|
|
|
|
- // {
|
|
|
|
|
- // var drawItem=drawLineData[j];
|
|
|
|
|
-
|
|
|
|
|
- // console.log("打印drawItem",drawItem);
|
|
|
|
|
- // // 扣分点 加分点 标记// 1:文字 (扣分留痕 显示扣分信息) 2:划线 3:波浪线 4:画笔 5:评语
|
|
|
|
|
- // if(drawItem.drawType==1)
|
|
|
|
|
- // {
|
|
|
|
|
-
|
|
|
|
|
- // const fontSize = Math.max(12, 40 * this.zoomRate* this.scale); // 最小字体12px,基础字体16px
|
|
|
|
|
- // ctx.font = `${fontSize}px Arial`; // 让文字大小跟随缩放
|
|
|
|
|
- // // ctx.font = '30px Arial';
|
|
|
|
|
- // ctx.fillStyle = '#D81E06';
|
|
|
|
|
- // ctx.textAlign = 'center';
|
|
|
|
|
- // ctx.textBaseline = 'middle';
|
|
|
|
|
- // if(drawItem.type=='reduce')
|
|
|
|
|
- // {
|
|
|
|
|
- // ctx.fillText('-'+drawItem.score,(drawItem.x + blockPoint.x) * this.zoomRate * this.scale, (drawItem.y + blockPoint.y) * this.zoomRate * this.scale);
|
|
|
|
|
- // }
|
|
|
|
|
- // if(drawItem.type=='bonus')
|
|
|
|
|
- // {
|
|
|
|
|
- // ctx.fillText('+'+drawItem.score, (drawItem.x + blockPoint.x) * this.zoomRate * this.scale, (drawItem.y + blockPoint.y) * this.zoomRate * this.scale);
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if(blockList.length>0)
|
|
|
|
|
+ {
|
|
|
|
|
+ //跨页的
|
|
|
|
|
+ blockList.forEach((blockItem,index) => {
|
|
|
|
|
+ console.log("打印blockItem",blockItem);
|
|
|
|
|
+ if(blockItem.page==this.currentPage)
|
|
|
|
|
+ {
|
|
|
|
|
+ drawLineData.forEach((drawlineItem,drawIndex) => {
|
|
|
|
|
+ let findIndex=this.FindBlockIndex(drawlineItem,blockList);
|
|
|
|
|
+ console.log("打印drawIndex",drawIndex);
|
|
|
|
|
+ console.log("打印findIndex",findIndex);
|
|
|
|
|
+
|
|
|
|
|
+ let drawItem=drawlineItem;
|
|
|
|
|
+ if(findIndex==index)
|
|
|
|
|
+ {
|
|
|
|
|
+ drawItem=this.FindTargetObj(drawlineItem,blockList);
|
|
|
|
|
+ blockPoint=blockList[findIndex];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ console.log("打印blockPoint",blockPoint);
|
|
|
|
|
+ console.log("打印drawItem",drawItem);
|
|
|
|
|
+ // 计算通用的缩放因子,避免重复计算
|
|
|
|
|
+ const zoomScale = zoomRate * scale;
|
|
|
|
|
+ const offsetX = blockPoint.x * zoomScale;
|
|
|
|
|
+ const offsetY = blockPoint.y * zoomScale;
|
|
|
|
|
+ // 扣分点 加分点 标记// 1:文字 (扣分留痕 显示扣分信息) 2:划线 3:波浪线 4:画笔 5:评语
|
|
|
|
|
+ switch(drawItem.drawType) {
|
|
|
|
|
+ case 1: {
|
|
|
|
|
+ // 文字类型(扣分点/加分点标记)
|
|
|
|
|
+ const fontSize = Math.max(12, 40 * zoomScale);
|
|
|
|
|
+ ctx.font = `${fontSize}px Arial`;
|
|
|
|
|
+ ctx.fillStyle = '#D81E06';
|
|
|
|
|
+ ctx.textAlign = 'center';
|
|
|
|
|
+ ctx.textBaseline = 'middle';
|
|
|
|
|
+
|
|
|
|
|
+ const x = drawItem.x * zoomScale + offsetX;
|
|
|
|
|
+ const y = drawItem.y * zoomScale + offsetY;
|
|
|
|
|
+
|
|
|
|
|
+ if(drawItem.type==='reduce') {
|
|
|
|
|
+ ctx.fillText('-'+drawItem.score, x, y);
|
|
|
|
|
+ } else if(drawItem.type==='bonus') {
|
|
|
|
|
+ ctx.fillText('+'+drawItem.score, x, y);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ case 2: {
|
|
|
|
|
+ // 绘制横线
|
|
|
|
|
+ console.log("打印需要减去的高度",jHeight);
|
|
|
|
|
+ jHeight=0;
|
|
|
|
|
+ console.log("打印blockList",blockList);
|
|
|
|
|
+ const coords = {
|
|
|
|
|
+ x: this.GetInteger(drawItem.x * zoomScale + offsetX),
|
|
|
|
|
+ y: this.GetInteger(drawItem.y * zoomScale + offsetY - jHeight * zoomScale),
|
|
|
|
|
+ endX: this.GetInteger(drawItem.endX * zoomScale + offsetX),
|
|
|
|
|
+ endY: this.GetInteger(drawItem.endY * zoomScale + offsetY - jHeight * zoomScale)
|
|
|
|
|
+ };
|
|
|
|
|
+ this.DrawHorizontalLine(coords.x, coords.y, coords.endX, coords.endY,ctx);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ case 3: {
|
|
|
|
|
+ // 绘制波浪线
|
|
|
|
|
+ const coords = {
|
|
|
|
|
+ startX: parseFloat((drawItem.x * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
+ startY: parseFloat((drawItem.y * zoomScale + offsetY).toFixed(2)),
|
|
|
|
|
+ endX: parseFloat((drawItem.endX * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
+ endY: parseFloat((drawItem.endY * zoomScale + offsetY).toFixed(2))
|
|
|
|
|
+ };
|
|
|
|
|
+ this.DrawWaveLine(coords.startX, coords.startY, coords.endX, coords.endY,ctx);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ case 4:
|
|
|
|
|
+ // 绘制画笔数据
|
|
|
|
|
+ this.DrawPenLine(drawItem,blockPoint,zoomRate,scale,ctx);
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ case 5: {
|
|
|
|
|
+ // 绘制评语
|
|
|
|
|
+ const coords = {
|
|
|
|
|
+ x: parseFloat((drawItem.x * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
+ y: parseFloat((drawItem.y * zoomScale + offsetY).toFixed(2))
|
|
|
|
|
+ };
|
|
|
|
|
+ this.DrawText(coords.x, coords.y, drawItem.text,ctx);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ console.warn('未知的绘图类型:', drawItem.drawType);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // }
|
|
|
|
|
- // else if(drawItem.drawType==2)
|
|
|
|
|
- // {
|
|
|
|
|
- // //绘制横线
|
|
|
|
|
- // console.log("打印需要减去的高度",jHeight);
|
|
|
|
|
- // jHeight=0;
|
|
|
|
|
- // console.log("打印blockList",blockList);
|
|
|
|
|
- // let drawX=this.GetInteger((drawItem.x+ blockPoint.x)* this.zoomRate * this.scale);
|
|
|
|
|
- // let drawY=this.GetInteger((drawItem.y+blockPoint.y - jHeight)* this.zoomRate * this.scale);
|
|
|
|
|
- // let drawEndX=this.GetInteger((drawItem.endX+ blockPoint.x)* this.zoomRate * this.scale);
|
|
|
|
|
- // let drawEndY=this.GetInteger((drawItem.endY+blockPoint.y - jHeight)* this.zoomRate * this.scale);
|
|
|
|
|
- // this.DrawHorizontalLine(drawX,drawY,drawEndX,drawEndY);
|
|
|
|
|
- // // this.DrawHorizontalLine((drawItem.x+ blockPoint.x)* this.zoomRate * this.scale, (drawItem.y+blockPoint.y)* this.zoomRate * this.scale,(drawItem.endX+ blockPoint.x)* this.zoomRate * this.scale, (drawItem.endY+blockPoint.y)* this.zoomRate * this.scale);
|
|
|
|
|
-
|
|
|
|
|
- // }
|
|
|
|
|
- // else if(drawItem.drawType==3)
|
|
|
|
|
- // {
|
|
|
|
|
- // //绘制波浪线
|
|
|
|
|
- // let startX=parseFloat(((drawItem.x + blockPoint.x)* this.zoomRate * this.scale).toFixed(2));
|
|
|
|
|
- // let startY=parseFloat(((drawItem.y + blockPoint.y)* this.zoomRate * this.scale).toFixed(2));
|
|
|
|
|
- // let endX=parseFloat(((drawItem.endX + blockPoint.x)* this.zoomRate * this.scale).toFixed(2));
|
|
|
|
|
- // let endY=parseFloat(((drawItem.endY +blockPoint.y)* this.zoomRate * this.scale).toFixed(2));
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ for(const [index, drawItem] of drawLineData.entries()) {
|
|
|
|
|
+ console.log("打印drawItem",drawItem);
|
|
|
|
|
+ // 计算通用的缩放因子,避免重复计算
|
|
|
|
|
+ const zoomScale = zoomRate * scale;
|
|
|
|
|
+ const offsetX = blockPoint.x * zoomScale;
|
|
|
|
|
+ const offsetY = blockPoint.y * zoomScale;
|
|
|
|
|
|
|
|
- // this.DrawWaveLine(startX, startY,endX, endY);
|
|
|
|
|
- // }
|
|
|
|
|
- // else if(drawItem.drawType==4)
|
|
|
|
|
- // {
|
|
|
|
|
- // //绘制画笔数据
|
|
|
|
|
- // // console.log("打印画笔数据",drawItem);
|
|
|
|
|
- // this.DrawPenLine(drawItem,blockPoint);
|
|
|
|
|
- // }
|
|
|
|
|
- // else if(drawItem.drawType==5)
|
|
|
|
|
- // {
|
|
|
|
|
- // //绘制评语
|
|
|
|
|
- // let startX=parseFloat(((drawItem.x + blockPoint.x)* this.zoomRate * this.scale).toFixed(2));
|
|
|
|
|
- // let startY=parseFloat(((drawItem.y + blockPoint.y)* this.zoomRate * this.scale).toFixed(2));
|
|
|
|
|
- // // console.log("打印绘制评语数据",drawItem);
|
|
|
|
|
- // this.DrawText(startX,startY,drawItem.text);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- for(const [index, drawItem] of drawLineData.entries()) {
|
|
|
|
|
- console.log("打印drawItem",drawItem);
|
|
|
|
|
- // 计算通用的缩放因子,避免重复计算
|
|
|
|
|
- const zoomScale = zoomRate * scale;
|
|
|
|
|
- const offsetX = blockPoint.x * zoomScale;
|
|
|
|
|
- const offsetY = blockPoint.y * zoomScale;
|
|
|
|
|
-
|
|
|
|
|
- // 扣分点 加分点 标记// 1:文字 (扣分留痕 显示扣分信息) 2:划线 3:波浪线 4:画笔 5:评语
|
|
|
|
|
- switch(drawItem.drawType) {
|
|
|
|
|
- case 1: {
|
|
|
|
|
- // 文字类型(扣分点/加分点标记)
|
|
|
|
|
- const fontSize = Math.max(12, 40 * zoomScale);
|
|
|
|
|
- ctx.font = `${fontSize}px Arial`;
|
|
|
|
|
- ctx.fillStyle = '#D81E06';
|
|
|
|
|
- ctx.textAlign = 'center';
|
|
|
|
|
- ctx.textBaseline = 'middle';
|
|
|
|
|
|
|
+ // 扣分点 加分点 标记// 1:文字 (扣分留痕 显示扣分信息) 2:划线 3:波浪线 4:画笔 5:评语
|
|
|
|
|
+ switch(drawItem.drawType) {
|
|
|
|
|
+ case 1: {
|
|
|
|
|
+ // 文字类型(扣分点/加分点标记)
|
|
|
|
|
+ const fontSize = Math.max(12, 40 * zoomScale);
|
|
|
|
|
+ ctx.font = `${fontSize}px Arial`;
|
|
|
|
|
+ ctx.fillStyle = '#D81E06';
|
|
|
|
|
+ ctx.textAlign = 'center';
|
|
|
|
|
+ ctx.textBaseline = 'middle';
|
|
|
|
|
+
|
|
|
|
|
+ const x = drawItem.x * zoomScale + offsetX;
|
|
|
|
|
+ const y = drawItem.y * zoomScale + offsetY;
|
|
|
|
|
+
|
|
|
|
|
+ if(drawItem.type==='reduce') {
|
|
|
|
|
+ ctx.fillText('-'+drawItem.score, x, y);
|
|
|
|
|
+ } else if(drawItem.type==='bonus') {
|
|
|
|
|
+ ctx.fillText('+'+drawItem.score, x, y);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- const x = drawItem.x * zoomScale + offsetX;
|
|
|
|
|
- const y = drawItem.y * zoomScale + offsetY;
|
|
|
|
|
|
|
+ case 2: {
|
|
|
|
|
+ // 绘制横线
|
|
|
|
|
+ console.log("打印需要减去的高度",jHeight);
|
|
|
|
|
+ jHeight=0;
|
|
|
|
|
+ console.log("打印blockList",blockList);
|
|
|
|
|
+ const coords = {
|
|
|
|
|
+ x: this.GetInteger(drawItem.x * zoomScale + offsetX),
|
|
|
|
|
+ y: this.GetInteger(drawItem.y * zoomScale + offsetY - jHeight * zoomScale),
|
|
|
|
|
+ endX: this.GetInteger(drawItem.endX * zoomScale + offsetX),
|
|
|
|
|
+ endY: this.GetInteger(drawItem.endY * zoomScale + offsetY - jHeight * zoomScale)
|
|
|
|
|
+ };
|
|
|
|
|
+ this.DrawHorizontalLine(coords.x, coords.y, coords.endX, coords.endY,ctx);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if(drawItem.type==='reduce') {
|
|
|
|
|
- ctx.fillText('-'+drawItem.score, x, y);
|
|
|
|
|
- } else if(drawItem.type==='bonus') {
|
|
|
|
|
- ctx.fillText('+'+drawItem.score, x, y);
|
|
|
|
|
|
|
+ case 3: {
|
|
|
|
|
+ // 绘制波浪线
|
|
|
|
|
+ const coords = {
|
|
|
|
|
+ startX: parseFloat((drawItem.x * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
+ startY: parseFloat((drawItem.y * zoomScale + offsetY).toFixed(2)),
|
|
|
|
|
+ endX: parseFloat((drawItem.endX * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
+ endY: parseFloat((drawItem.endY * zoomScale + offsetY).toFixed(2))
|
|
|
|
|
+ };
|
|
|
|
|
+ this.DrawWaveLine(coords.startX, coords.startY, coords.endX, coords.endY,ctx);
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
- break;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ case 4:
|
|
|
|
|
+ // 绘制画笔数据
|
|
|
|
|
+ this.DrawPenLine(drawItem,blockPoint,zoomRate,scale,ctx);
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ case 5: {
|
|
|
|
|
+ // 绘制评语
|
|
|
|
|
+ const coords = {
|
|
|
|
|
+ x: parseFloat((drawItem.x * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
+ y: parseFloat((drawItem.y * zoomScale + offsetY).toFixed(2))
|
|
|
|
|
+ };
|
|
|
|
|
+ this.DrawText(coords.x, coords.y, drawItem.text,ctx);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ console.warn('未知的绘图类型:', drawItem.drawType);
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // for(const [index, drawItem] of drawLineData.entries()) {
|
|
|
|
|
+ // console.log("打印drawItem",drawItem);
|
|
|
|
|
+ // // 计算通用的缩放因子,避免重复计算
|
|
|
|
|
+ // const zoomScale = zoomRate * scale;
|
|
|
|
|
+ // const offsetX = blockPoint.x * zoomScale;
|
|
|
|
|
+ // const offsetY = blockPoint.y * zoomScale;
|
|
|
|
|
+
|
|
|
|
|
+ // // 扣分点 加分点 标记// 1:文字 (扣分留痕 显示扣分信息) 2:划线 3:波浪线 4:画笔 5:评语
|
|
|
|
|
+ // switch(drawItem.drawType) {
|
|
|
|
|
+ // case 1: {
|
|
|
|
|
+ // // 文字类型(扣分点/加分点标记)
|
|
|
|
|
+ // const fontSize = Math.max(12, 40 * zoomScale);
|
|
|
|
|
+ // ctx.font = `${fontSize}px Arial`;
|
|
|
|
|
+ // ctx.fillStyle = '#D81E06';
|
|
|
|
|
+ // ctx.textAlign = 'center';
|
|
|
|
|
+ // ctx.textBaseline = 'middle';
|
|
|
|
|
+
|
|
|
|
|
+ // const x = drawItem.x * zoomScale + offsetX;
|
|
|
|
|
+ // const y = drawItem.y * zoomScale + offsetY;
|
|
|
|
|
+
|
|
|
|
|
+ // if(drawItem.type==='reduce') {
|
|
|
|
|
+ // ctx.fillText('-'+drawItem.score, x, y);
|
|
|
|
|
+ // } else if(drawItem.type==='bonus') {
|
|
|
|
|
+ // ctx.fillText('+'+drawItem.score, x, y);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- case 2: {
|
|
|
|
|
- // 绘制横线
|
|
|
|
|
- console.log("打印需要减去的高度",jHeight);
|
|
|
|
|
- jHeight=0;
|
|
|
|
|
- console.log("打印blockList",blockList);
|
|
|
|
|
- const coords = {
|
|
|
|
|
- x: this.GetInteger(drawItem.x * zoomScale + offsetX),
|
|
|
|
|
- y: this.GetInteger(drawItem.y * zoomScale + offsetY - jHeight * zoomScale),
|
|
|
|
|
- endX: this.GetInteger(drawItem.endX * zoomScale + offsetX),
|
|
|
|
|
- endY: this.GetInteger(drawItem.endY * zoomScale + offsetY - jHeight * zoomScale)
|
|
|
|
|
- };
|
|
|
|
|
- this.DrawHorizontalLine(coords.x, coords.y, coords.endX, coords.endY);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // case 2: {
|
|
|
|
|
+ // // 绘制横线
|
|
|
|
|
+ // console.log("打印需要减去的高度",jHeight);
|
|
|
|
|
+ // jHeight=0;
|
|
|
|
|
+ // console.log("打印blockList",blockList);
|
|
|
|
|
+ // const coords = {
|
|
|
|
|
+ // x: this.GetInteger(drawItem.x * zoomScale + offsetX),
|
|
|
|
|
+ // y: this.GetInteger(drawItem.y * zoomScale + offsetY - jHeight * zoomScale),
|
|
|
|
|
+ // endX: this.GetInteger(drawItem.endX * zoomScale + offsetX),
|
|
|
|
|
+ // endY: this.GetInteger(drawItem.endY * zoomScale + offsetY - jHeight * zoomScale)
|
|
|
|
|
+ // };
|
|
|
|
|
+ // this.DrawHorizontalLine(coords.x, coords.y, coords.endX, coords.endY);
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- case 3: {
|
|
|
|
|
- // 绘制波浪线
|
|
|
|
|
- const coords = {
|
|
|
|
|
- startX: parseFloat((drawItem.x * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
- startY: parseFloat((drawItem.y * zoomScale + offsetY).toFixed(2)),
|
|
|
|
|
- endX: parseFloat((drawItem.endX * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
- endY: parseFloat((drawItem.endY * zoomScale + offsetY).toFixed(2))
|
|
|
|
|
- };
|
|
|
|
|
- this.DrawWaveLine(coords.startX, coords.startY, coords.endX, coords.endY);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // case 3: {
|
|
|
|
|
+ // // 绘制波浪线
|
|
|
|
|
+ // const coords = {
|
|
|
|
|
+ // startX: parseFloat((drawItem.x * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
+ // startY: parseFloat((drawItem.y * zoomScale + offsetY).toFixed(2)),
|
|
|
|
|
+ // endX: parseFloat((drawItem.endX * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
+ // endY: parseFloat((drawItem.endY * zoomScale + offsetY).toFixed(2))
|
|
|
|
|
+ // };
|
|
|
|
|
+ // this.DrawWaveLine(coords.startX, coords.startY, coords.endX, coords.endY);
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- case 4:
|
|
|
|
|
- // 绘制画笔数据
|
|
|
|
|
- this.DrawPenLine(drawItem,blockPoint);
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ // case 4:
|
|
|
|
|
+ // // 绘制画笔数据
|
|
|
|
|
+ // this.DrawPenLine(drawItem,blockPoint);
|
|
|
|
|
+ // break;
|
|
|
|
|
|
|
|
- case 5: {
|
|
|
|
|
- // 绘制评语
|
|
|
|
|
- const coords = {
|
|
|
|
|
- x: parseFloat((drawItem.x * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
- y: parseFloat((drawItem.y * zoomScale + offsetY).toFixed(2))
|
|
|
|
|
- };
|
|
|
|
|
- this.DrawText(coords.x, coords.y, drawItem.text);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // case 5: {
|
|
|
|
|
+ // // 绘制评语
|
|
|
|
|
+ // const coords = {
|
|
|
|
|
+ // x: parseFloat((drawItem.x * zoomScale + offsetX).toFixed(2)),
|
|
|
|
|
+ // y: parseFloat((drawItem.y * zoomScale + offsetY).toFixed(2))
|
|
|
|
|
+ // };
|
|
|
|
|
+ // this.DrawText(coords.x, coords.y, drawItem.text);
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- default:
|
|
|
|
|
- console.warn('未知的绘图类型:', drawItem.drawType);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // default:
|
|
|
|
|
+ // console.warn('未知的绘图类型:', drawItem.drawType);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -805,6 +916,76 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ //寻找对象在数组中的索引
|
|
|
|
|
+ FindBlockIndex(targetObj,arr)
|
|
|
|
|
+ {
|
|
|
|
|
+ // 累计高度,用来确定对象位于哪个区间
|
|
|
|
|
+ let cumulativeHeight = 0;
|
|
|
|
|
+
|
|
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
|
|
+ const item = arr[i];
|
|
|
|
|
+ if(targetObj.drawType==4)
|
|
|
|
|
+ {
|
|
|
|
|
+ //画笔判断
|
|
|
|
|
+ if (targetObj.drawlineData[0].y >= cumulativeHeight && targetObj.drawlineData[0].y < cumulativeHeight + item.h) {
|
|
|
|
|
+
|
|
|
|
|
+ return i; // 返回匹配的索引
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ // 检查目标对象的y值是否在当前区间的范围内
|
|
|
|
|
+ if (targetObj.y >= cumulativeHeight && targetObj.y < cumulativeHeight + item.h) {
|
|
|
|
|
+ return i; // 返回匹配的索引
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 累计高度,为下一个区间的起始位置
|
|
|
|
|
+ cumulativeHeight += item.h;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return -1; // 如果没有找到匹配的区间,返回-1
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ //寻找对象在数组中的对象
|
|
|
|
|
+ FindTargetObj(targetObj,arr)
|
|
|
|
|
+ {
|
|
|
|
|
+ // 累计高度,用来确定对象位于哪个区间
|
|
|
|
|
+ let cumulativeHeight = 0;
|
|
|
|
|
+
|
|
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
|
|
+ const item = arr[i];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 判断画笔
|
|
|
|
|
+ if(targetObj.drawType==4)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ if (targetObj.drawlineData[0].y >= cumulativeHeight && targetObj.drawlineData[0].y < cumulativeHeight + item.h) {
|
|
|
|
|
+
|
|
|
|
|
+ targetObj.drawlineData.forEach((item,index) => {
|
|
|
|
|
+ item.y=item.y-cumulativeHeight;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ // 检查目标对象的y值是否在当前区间的范围内
|
|
|
|
|
+ if (targetObj.y >= cumulativeHeight && targetObj.y < cumulativeHeight + item.h) {
|
|
|
|
|
+ targetObj.y=targetObj.y-cumulativeHeight;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 累计高度,为下一个区间的起始位置
|
|
|
|
|
+ cumulativeHeight += item.h;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return targetObj;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
//初始数据加载
|
|
//初始数据加载
|