Merge branch 'dev'
Showing
2 changed files
with
115 additions
and
15 deletions
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2024-01-17 09:26:42 | 4 | * @LastEditTime: 2024-01-17 10:33:10 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div> | 7 | <div> |
... | @@ -510,11 +510,97 @@ | ... | @@ -510,11 +510,97 @@ |
510 | context.fillText(this.bdcqz.sxqc ? this.bdcqz.sxqc : '', 750, 125); | 510 | context.fillText(this.bdcqz.sxqc ? this.bdcqz.sxqc : '', 750, 125); |
511 | context.fillText(this.bdcqz.sxh ? this.bdcqz.sxh : '', 960, 123); | 511 | context.fillText(this.bdcqz.sxh ? this.bdcqz.sxh : '', 960, 123); |
512 | context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180); | 512 | context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180); |
513 | context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); | 513 | // context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); |
514 | // 义务人 | 514 | // 义务人 |
515 | context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275); | 515 | // context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275); |
516 | |||
517 | // 权利人 | ||
518 | let qlrlines = this.bdcqz.qlr ? this.bdcqz.qlr.split(' ') : []; | ||
519 | if (getByteLen(this.bdcqz.qlr) > 37) { | ||
520 | qlrlines.forEach((line, index) => { | ||
521 | let currentLine = ''; | ||
522 | let arr = []; | ||
523 | for (let word of line) { | ||
524 | const testLine = currentLine + word; | ||
525 | const lineWidth = context.measureText(testLine).width; | ||
526 | if (lineWidth <= 295) { | ||
527 | currentLine = testLine; | ||
528 | } else { | ||
529 | arr.push(currentLine); | ||
530 | currentLine = word; | ||
531 | } | ||
532 | } | ||
533 | arr.push(currentLine); | ||
534 | arr.forEach((line, index) => { | ||
535 | context.fillText(line, 775, 218 + (index * 20)); // 调整行高 | ||
536 | }) | ||
537 | }) | ||
538 | } else { | ||
539 | qlrlines.forEach((line, index) => { | ||
540 | let currentLine = ''; | ||
541 | let arr = []; | ||
542 | for (let word of line) { | ||
543 | const testLine = currentLine + word; | ||
544 | const lineWidth = context.measureText(testLine).width; | ||
545 | if (lineWidth <= 295) { | ||
546 | currentLine = testLine; | ||
547 | } else { | ||
548 | arr.push(currentLine); | ||
549 | currentLine = word; | ||
550 | } | ||
551 | } | ||
552 | arr.push(currentLine); | ||
553 | arr.forEach((line, index) => { | ||
554 | context.fillText(line, 775, 228 + (index * 20)); // 调整行高 | ||
555 | }) | ||
556 | }) | ||
557 | } | ||
558 | // 义务人 | ||
559 | let ywrlines = this.bdcqz.ywr ? this.bdcqz.ywr.split(' ') : []; | ||
560 | if (getByteLen(this.bdcqz.ywr) > 37) { | ||
561 | ywrlines.forEach((line, index) => { | ||
562 | let currentLine = ''; | ||
563 | let arr = []; | ||
564 | for (let word of line) { | ||
565 | const testLine = currentLine + word; | ||
566 | const lineWidth = context.measureText(testLine).width; | ||
567 | if (lineWidth <= 295) { | ||
568 | currentLine = testLine; | ||
569 | } else { | ||
570 | arr.push(currentLine); | ||
571 | currentLine = word; | ||
572 | } | ||
573 | } | ||
574 | arr.push(currentLine); | ||
575 | arr.forEach((line, index) => { | ||
576 | context.fillText(line, 775, 265 + (index * 20)); // 调整行高 | ||
577 | }) | ||
578 | }) | ||
579 | } else { | ||
580 | ywrlines.forEach((line, index) => { | ||
581 | let currentLine = ''; | ||
582 | let arr = []; | ||
583 | for (let word of line) { | ||
584 | const testLine = currentLine + word; | ||
585 | const lineWidth = context.measureText(testLine).width; | ||
586 | if (lineWidth <= 295) { | ||
587 | currentLine = testLine; | ||
588 | } else { | ||
589 | arr.push(currentLine); | ||
590 | currentLine = word; | ||
591 | } | ||
592 | } | ||
593 | arr.push(currentLine); | ||
594 | arr.forEach((line, index) => { | ||
595 | context.fillText(line, 775, 275 + (index * 20)); // 调整行高 | ||
596 | }) | ||
597 | }) | ||
598 | } | ||
599 | |||
600 | |||
601 | |||
516 | let lines2 = this.bdcqz.zl ? this.bdcqz.zl.split(' ') : []; | 602 | let lines2 = this.bdcqz.zl ? this.bdcqz.zl.split(' ') : []; |
517 | if (getByteLen(this.bdcqz.zl) >= 39) { | 603 | if (getByteLen(this.bdcqz.zl) > 37) { |
518 | lines2.forEach((line, index) => { | 604 | lines2.forEach((line, index) => { |
519 | const y = 315 + (index * 20); // 每行文本的垂直位置 | 605 | const y = 315 + (index * 20); // 每行文本的垂直位置 |
520 | let currentLine = ''; | 606 | let currentLine = ''; |
... | @@ -558,7 +644,14 @@ | ... | @@ -558,7 +644,14 @@ |
558 | // bdcdyh | 644 | // bdcdyh |
559 | this.bdcdyh = this.bdcqz.bdcdyh.slice(0, 6) + ' ' + this.bdcqz.bdcdyh.slice(6, 12) + ' ' + | 645 | this.bdcdyh = this.bdcqz.bdcdyh.slice(0, 6) + ' ' + this.bdcqz.bdcdyh.slice(6, 12) + ' ' + |
560 | this.bdcqz.bdcdyh.slice(12, 19) + ' ' + this.bdcqz.bdcdyh.slice(19, this.bdcqz.bdcdyh.length) | 646 | this.bdcqz.bdcdyh.slice(12, 19) + ' ' + this.bdcqz.bdcdyh.slice(19, this.bdcqz.bdcdyh.length) |
647 | // 保存当前字体设置 | ||
648 | const originalFont = context.font; | ||
649 | // 设置新的字体大小 | ||
650 | context.font = '16px 楷体'; // 替换为你想要的字体和大小 | ||
651 | // 绘制 bdcdyh | ||
561 | context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373); | 652 | context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373); |
653 | // 恢复原始字体设置 | ||
654 | context.font = originalFont; | ||
562 | // qlqtzk | 655 | // qlqtzk |
563 | const maxWidth = 290; // 最大宽度限制 | 656 | const maxWidth = 290; // 最大宽度限制 |
564 | let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : []; | 657 | let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : []; |
... | @@ -581,18 +674,18 @@ | ... | @@ -581,18 +674,18 @@ |
581 | arr.push(currentLine); | 674 | arr.push(currentLine); |
582 | if (i > 0) { | 675 | if (i > 0) { |
583 | arr.forEach((line, index) => { | 676 | arr.forEach((line, index) => { |
584 | context.fillText(line, 770, 438 + (23 * (i - 1)) + 5 * num + (index * 16)); // 调整行高 | 677 | context.fillText(line, 770, 438 + (24 * (i - 1)) + 5 * num + (index * 17)); // 调整行高 |
585 | }) | 678 | }) |
586 | } else { | 679 | } else { |
587 | arr.forEach((line, index) => { | 680 | arr.forEach((line, index) => { |
588 | context.fillText(line, 770, 438 + (23 * (i - 1)) + (index * 16)); // 调整行高 | 681 | context.fillText(line, 770, 438 + (24 * (i - 1)) + (index * 17)); // 调整行高 |
589 | }) | 682 | }) |
590 | } | 683 | } |
591 | } else { | 684 | } else { |
592 | if (i > 0) { | 685 | if (i > 0) { |
593 | context.fillText(lines[i] ? lines[i] : '', 770, 447 + 6 * num + (23 * (i - 1))); | 686 | context.fillText(lines[i] ? lines[i] : '', 770, 447 + 6 * num + (25 * (i - 1))); |
594 | } else { | 687 | } else { |
595 | context.fillText(lines[i] ? lines[i] : '', 770, 447 + (23 * (i - 1))); | 688 | context.fillText(lines[i] ? lines[i] : '', 770, 447 + (25 * (i - 1))); |
596 | } | 689 | } |
597 | } | 690 | } |
598 | } | 691 | } | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2024-01-17 09:35:40 | 4 | * @LastEditTime: 2024-01-17 10:32:29 |
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;"> |
... | @@ -438,7 +438,7 @@ | ... | @@ -438,7 +438,7 @@ |
438 | context.fillText(this.bdcqz.sxh ? this.bdcqz.sxh : '', 960, 123); | 438 | context.fillText(this.bdcqz.sxh ? this.bdcqz.sxh : '', 960, 123); |
439 | context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180); | 439 | context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180); |
440 | // context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); | 440 | // context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); |
441 | 441 | // 权利人 | |
442 | let qlrlines = this.bdcqz.qlr ? this.bdcqz.qlr.split(' ') : []; | 442 | let qlrlines = this.bdcqz.qlr ? this.bdcqz.qlr.split(' ') : []; |
443 | if (getByteLen(this.bdcqz.qlr) > 37) { | 443 | if (getByteLen(this.bdcqz.qlr) > 37) { |
444 | qlrlines.forEach((line, index) => { | 444 | qlrlines.forEach((line, index) => { |
... | @@ -568,11 +568,18 @@ | ... | @@ -568,11 +568,18 @@ |
568 | }) | 568 | }) |
569 | } | 569 | } |
570 | 570 | ||
571 | |||
572 | // bdcdyh | 571 | // bdcdyh |
573 | this.bdcdyh = this.bdcqz.bdcdyh.slice(0, 6) + ' ' + this.bdcqz.bdcdyh.slice(6, 12) + ' ' + | 572 | this.bdcdyh = this.bdcqz.bdcdyh.slice(0, 6) + ' ' + this.bdcqz.bdcdyh.slice(6, 12) + ' ' + |
574 | this.bdcqz.bdcdyh.slice(12, 19) + ' ' + this.bdcqz.bdcdyh.slice(19, this.bdcqz.bdcdyh.length) | 573 | this.bdcqz.bdcdyh.slice(12, 19) + ' ' + this.bdcqz.bdcdyh.slice(19, this.bdcqz.bdcdyh.length) |
574 | // context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373); | ||
575 | // 保存当前字体设置 | ||
576 | const originalFont = context.font; | ||
577 | // 设置新的字体大小 | ||
578 | context.font = '16px 楷体'; // 替换为你想要的字体和大小 | ||
579 | // 绘制 bdcdyh | ||
575 | context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373); | 580 | context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373); |
581 | // 恢复原始字体设置 | ||
582 | context.font = originalFont; | ||
576 | // qlqtzk | 583 | // qlqtzk |
577 | const maxWidth = 295; // 最大宽度限制 | 584 | const maxWidth = 295; // 最大宽度限制 |
578 | let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : []; | 585 | let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : []; |
... | @@ -594,18 +601,18 @@ | ... | @@ -594,18 +601,18 @@ |
594 | arr.push(currentLine); | 601 | arr.push(currentLine); |
595 | if (i > 0) { | 602 | if (i > 0) { |
596 | arr.forEach((line, index) => { | 603 | arr.forEach((line, index) => { |
597 | context.fillText(line, 770, 428 + (25 * (i - 1)) + 5 * num + (index * 15)); // 调整行高 | 604 | context.fillText(line, 770, 438 + (24 * (i - 1)) + 5 * num + (index * 17)); // 调整行高 |
598 | }) | 605 | }) |
599 | } else { | 606 | } else { |
600 | arr.forEach((line, index) => { | 607 | arr.forEach((line, index) => { |
601 | context.fillText(line, 770, 435 + (25 * (i - 1)) + (index * 14)); // 调整行高 | 608 | context.fillText(line, 770, 438 + (24 * (i - 1)) + (index * 17)); // 调整行高 |
602 | }) | 609 | }) |
603 | } | 610 | } |
604 | } else { | 611 | } else { |
605 | if (i > 0) { | 612 | if (i > 0) { |
606 | context.fillText(lines[i] ? lines[i] : '', 770, 440 + 5 * num + (24 * (i - 1))); | 613 | context.fillText(lines[i] ? lines[i] : '', 770, 447 + 6 * num + (25 * (i - 1))); |
607 | } else { | 614 | } else { |
608 | context.fillText(lines[i] ? lines[i] : '', 770, 440 + (24 * (i - 1))); | 615 | context.fillText(lines[i] ? lines[i] : '', 770, 447 + (25 * (i - 1))); |
609 | } | 616 | } |
610 | } | 617 | } |
611 | } | 618 | } | ... | ... |
-
Please register or sign in to post a comment