06b5886c by renchao@pashanhoo.com

style:证书预览

1 parent 8affec23
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-12-18 16:00:55
* @LastEditTime: 2024-01-17 09:26:42
-->
<template>
<div>
......@@ -327,7 +327,7 @@
}
// 权利其他状态
const maxWidth = 332; // 最大宽度限制
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : [];
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : [];
for (let i = 0; i < lines.length; i++) {
let num = Math.ceil(getByteLen(lines[i]) / 37)
if (getByteLen(lines[i]) > 37) {
......@@ -362,7 +362,7 @@
}
}
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n') : [];
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n').filter(i => i && i.trim()) : [];
lines1.forEach((line, index) => {
const y = 100 + (index * 30); // 每行文本的垂直位置
let currentLine = '';
......@@ -561,7 +561,7 @@
context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373);
// qlqtzk
const maxWidth = 290; // 最大宽度限制
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : [];
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : [];
for (let i = 0; i < lines.length; i++) {
console.log(getByteLen(lines[i]));
let num = Math.ceil(getByteLen(lines[i]) / 37)
......@@ -597,7 +597,7 @@
}
}
// fj
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n') : [];
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n').filter(i => i && i.trim()) : [];
for (let i = 0; i < lines1.length; i++) {
let num = Math.ceil(getByteLen(lines1[i]) / 37)
if (getByteLen(lines1[i]) > 37) {
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-12-19 09:17:03
* @LastEditTime: 2024-01-17 09:35:40
-->
<template>
<div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="text-align: center;">
......@@ -207,8 +207,6 @@
this.bdcqz.bdcdyh.slice(12, 19) + ' ' + this.bdcqz.bdcdyh.slice(19, this.bdcqz.bdcdyh.length)
context.fillText(this.bdcdyh ? this.bdcdyh : '', 129, 223);
context.fillText(this.bdcqz.qllx ? this.bdcqz.qllx : '', 129, 263);
context.fillText(this.bdcqz.qlxz ? this.bdcqz.qlxz : '', 129, 303);
context.fillText(this.bdcqz.yt ? this.bdcqz.yt : '', 129, 346);
......@@ -256,7 +254,7 @@
})
}
// 权利其他状态
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : [];
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : [];
for (let i = 0; i < lines.length; i++) {
let num = Math.ceil(getByteLen(lines[i]) / 38)
if (getByteLen(lines[i]) > 37) {
......@@ -291,7 +289,7 @@
}
}
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n') : [];
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n').filter(i => i && i.trim()) : [];
lines1.forEach((line, index) => {
const y = 100 + (index * 30); // 每行文本的垂直位置
let currentLine = '';
......@@ -439,13 +437,96 @@
context.fillText(this.bdcqz.sxqc ? this.bdcqz.sxqc : '', 750, 125);
context.fillText(this.bdcqz.sxh ? this.bdcqz.sxh : '', 960, 123);
context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180);
context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228);
// context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228);
let qlrlines = this.bdcqz.qlr ? this.bdcqz.qlr.split(' ') : [];
if (getByteLen(this.bdcqz.qlr) > 37) {
qlrlines.forEach((line, index) => {
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 295) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 775, 218 + (index * 20)); // 调整行高
})
})
} else {
qlrlines.forEach((line, index) => {
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 295) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 775, 228 + (index * 20)); // 调整行高
})
})
}
// 义务人
context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275);
let ywrlines = this.bdcqz.ywr ? this.bdcqz.ywr.split(' ') : [];
if (getByteLen(this.bdcqz.ywr) > 37) {
ywrlines.forEach((line, index) => {
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 295) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 775, 265 + (index * 20)); // 调整行高
})
})
} else {
ywrlines.forEach((line, index) => {
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 295) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 775, 275 + (index * 20)); // 调整行高
})
})
}
// context.fillText(this.bdcqz.zl ? this.bdcqz.zl : '', 775, 325);
let lines2 = this.bdcqz.zl ? this.bdcqz.zl.split(' ') : [];
if (getByteLen(this.bdcqz.zl) >= 39) {
if (getByteLen(this.bdcqz.zl) > 37) {
lines2.forEach((line, index) => {
const y = 315 + (index * 20); // 每行文本的垂直位置
let currentLine = '';
......@@ -494,7 +575,7 @@
context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373);
// qlqtzk
const maxWidth = 295; // 最大宽度限制
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : [];
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : [];
for (let i = 0; i < lines.length; i++) {
let num = Math.ceil(getByteLen(lines[i]) / 37)
if (getByteLen(lines[i]) > 37) {
......@@ -529,7 +610,7 @@
}
}
// fj
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n') : [];
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n').filter(i => i && i.trim()) : [];
for (let i = 0; i < lines1.length; i++) {
let num = Math.ceil(getByteLen(lines1[i]) / 37)
if (getByteLen(lines1[i]) > 37) {
......