Merge branch 'dev'
Showing
2 changed files
with
90 additions
and
78 deletions
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2024-01-22 16:34:15 | 4 | * @LastEditTime: 2024-01-24 17:33:35 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div> | 7 | <div> |
... | @@ -538,48 +538,55 @@ | ... | @@ -538,48 +538,55 @@ |
538 | context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180); | 538 | context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180); |
539 | // context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); | 539 | // context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); |
540 | // 权利人 | 540 | // 权利人 |
541 | let qlrlines = this.bdcqz.qlr ? this.bdcqz.qlr.split(' ') : []; | 541 | let qlrlines = this.bdcqz.qlr |
542 | if (getByteLen(this.bdcqz.qlr) >= 34) { | 542 | if (getByteLen(this.bdcqz.qlr) > 36) { |
543 | qlrlines.forEach((line, index) => { | 543 | let currentLine = ''; |
544 | let currentLine = ''; | 544 | let arr = []; |
545 | let arr = []; | 545 | for (let word of qlrlines) { |
546 | for (let word of line) { | 546 | const testLine = currentLine + word; |
547 | const testLine = currentLine + word; | 547 | const lineWidth = context.measureText(testLine).width; |
548 | const lineWidth = context.measureText(testLine).width; | 548 | if (lineWidth <= 295) { |
549 | if (lineWidth <= 295) { | 549 | currentLine = testLine; |
550 | currentLine = testLine; | 550 | } else { |
551 | } else { | 551 | arr.push(currentLine); |
552 | arr.push(currentLine); | 552 | currentLine = word; |
553 | currentLine = word; | ||
554 | } | ||
555 | } | 553 | } |
556 | arr.push(currentLine); | 554 | } |
557 | arr.forEach((line, index) => { | 555 | arr.push(currentLine); // 将最后一行添加到数组 |
558 | context.fillText(line, 775, 218 + (index * 20)); // 调整行高 | 556 | // 绘制所有行 |
559 | }) | 557 | for (let i = 0; i < arr.length; i++) { |
560 | }) | 558 | context.fillText(arr[i], 775, 218 + i * 20); // lineHeight 为行高 |
559 | } | ||
561 | } else { | 560 | } else { |
562 | qlrlines.forEach((line, index) => { | 561 | context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); |
563 | let currentLine = ''; | ||
564 | let arr = []; | ||
565 | for (let word of line) { | ||
566 | const testLine = currentLine + word; | ||
567 | const lineWidth = context.measureText(testLine).width; | ||
568 | if (lineWidth <= 295) { | ||
569 | currentLine = testLine; | ||
570 | } else { | ||
571 | arr.push(currentLine); | ||
572 | currentLine = word; | ||
573 | } | ||
574 | } | ||
575 | arr.push(currentLine); | ||
576 | arr.forEach((line, index) => { | ||
577 | context.fillText(line, 775, 228 + (index * 20)); // 调整行高 | ||
578 | }) | ||
579 | }) | ||
580 | } | 562 | } |
581 | // 义务人 | 563 | // 义务人 |
582 | context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275); | 564 | // context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275); |
565 | |||
566 | let ywrlines = this.bdcqz.ywr | ||
567 | if (getByteLen(this.bdcqz.ywr) > 36) { | ||
568 | let currentLine = ''; | ||
569 | let arr = []; | ||
570 | for (let word of ywrlines) { | ||
571 | const testLine = currentLine + word; | ||
572 | const lineWidth = context.measureText(testLine).width; | ||
573 | if (lineWidth <= 295) { | ||
574 | currentLine = testLine; | ||
575 | } else { | ||
576 | arr.push(currentLine); | ||
577 | currentLine = word; | ||
578 | } | ||
579 | } | ||
580 | arr.push(currentLine); // 将最后一行添加到数组 | ||
581 | // 绘制所有行 | ||
582 | for (let i = 0; i < arr.length; i++) { | ||
583 | context.fillText(arr[i], 775, 268 + i * 20); // lineHeight 为行高 | ||
584 | } | ||
585 | } else { | ||
586 | context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275); | ||
587 | } | ||
588 | |||
589 | |||
583 | let lines2 = this.bdcqz.zl ? this.bdcqz.zl.split(' ') : []; | 590 | let lines2 = this.bdcqz.zl ? this.bdcqz.zl.split(' ') : []; |
584 | if (getByteLen(this.bdcqz.zl) > 37) { | 591 | if (getByteLen(this.bdcqz.zl) > 37) { |
585 | lines2.forEach((line, index) => { | 592 | lines2.forEach((line, index) => { | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2024-01-23 11:07:58 | 4 | * @LastEditTime: 2024-01-24 17:29:20 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="text-align: center;"> | 7 | <div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="text-align: center;"> |
... | @@ -460,49 +460,54 @@ | ... | @@ -460,49 +460,54 @@ |
460 | context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180); | 460 | context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180); |
461 | // context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); | 461 | // context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); |
462 | // 权利人 | 462 | // 权利人 |
463 | let qlrlines = this.bdcqz.qlr ? this.bdcqz.qlr.split(' ') : []; | 463 | let qlrlines = this.bdcqz.qlr |
464 | if (getByteLen(this.bdcqz.qlr) >= 34) { | 464 | if (getByteLen(this.bdcqz.qlr) > 36) { |
465 | qlrlines.forEach((line, index) => { | 465 | let currentLine = ''; |
466 | let currentLine = ''; | 466 | let arr = []; |
467 | let arr = []; | 467 | for (let word of qlrlines) { |
468 | for (let word of line) { | 468 | const testLine = currentLine + word; |
469 | const testLine = currentLine + word; | 469 | const lineWidth = context.measureText(testLine).width; |
470 | const lineWidth = context.measureText(testLine).width; | 470 | if (lineWidth <= 295) { |
471 | if (lineWidth <= 295) { | 471 | currentLine = testLine; |
472 | currentLine = testLine; | 472 | } else { |
473 | } else { | 473 | arr.push(currentLine); |
474 | arr.push(currentLine); | 474 | currentLine = word; |
475 | currentLine = word; | ||
476 | } | ||
477 | } | 475 | } |
478 | arr.push(currentLine); | 476 | } |
479 | arr.forEach((line, index) => { | 477 | arr.push(currentLine); // 将最后一行添加到数组 |
480 | context.fillText(line, 775, 218 + (index * 20)); // 调整行高 | 478 | // 绘制所有行 |
481 | }) | 479 | for (let i = 0; i < arr.length; i++) { |
482 | }) | 480 | context.fillText(arr[i], 775, 218 + i * 20); // lineHeight 为行高 |
481 | } | ||
483 | } else { | 482 | } else { |
484 | qlrlines.forEach((line, index) => { | 483 | context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); |
485 | let currentLine = ''; | ||
486 | let arr = []; | ||
487 | for (let word of line) { | ||
488 | const testLine = currentLine + word; | ||
489 | const lineWidth = context.measureText(testLine).width; | ||
490 | if (lineWidth <= 295) { | ||
491 | currentLine = testLine; | ||
492 | } else { | ||
493 | arr.push(currentLine); | ||
494 | currentLine = word; | ||
495 | } | ||
496 | } | ||
497 | arr.push(currentLine); | ||
498 | arr.forEach((line, index) => { | ||
499 | context.fillText(line, 775, 228 + (index * 20)); // 调整行高 | ||
500 | }) | ||
501 | }) | ||
502 | } | 484 | } |
503 | 485 | ||
504 | // 义务人 | 486 | // 义务人 |
505 | context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275); | 487 | // context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275); |
488 | let ywrlines = this.bdcqz.ywr | ||
489 | if (getByteLen(this.bdcqz.ywr) > 36) { | ||
490 | let currentLine = ''; | ||
491 | let arr = []; | ||
492 | for (let word of ywrlines) { | ||
493 | const testLine = currentLine + word; | ||
494 | const lineWidth = context.measureText(testLine).width; | ||
495 | if (lineWidth <= 295) { | ||
496 | currentLine = testLine; | ||
497 | } else { | ||
498 | arr.push(currentLine); | ||
499 | currentLine = word; | ||
500 | } | ||
501 | } | ||
502 | arr.push(currentLine); // 将最后一行添加到数组 | ||
503 | // 绘制所有行 | ||
504 | for (let i = 0; i < arr.length; i++) { | ||
505 | context.fillText(arr[i], 775, 268 + i * 20); // lineHeight 为行高 | ||
506 | } | ||
507 | } else { | ||
508 | context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275); | ||
509 | } | ||
510 | |||
506 | // context.fillText(this.bdcqz.zl ? this.bdcqz.zl : '', 775, 325); | 511 | // context.fillText(this.bdcqz.zl ? this.bdcqz.zl : '', 775, 325); |
507 | 512 | ||
508 | let lines2 = this.bdcqz.zl ? this.bdcqz.zl.split(' ') : []; | 513 | let lines2 = this.bdcqz.zl ? this.bdcqz.zl.split(' ') : []; | ... | ... |
-
Please register or sign in to post a comment