6b62fe64 by renchao@pashanhoo.com

style:证书预览

1 parent e817c3e3
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2024-01-17 09:26:42
* @LastEditTime: 2024-01-17 10:13:32
-->
<template>
<div>
......@@ -510,11 +510,97 @@
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);
// 义务人
context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275);
// context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275);
// 权利人
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)); // 调整行高
})
})
}
// 义务人
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)); // 调整行高
})
})
}
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 = '';
......@@ -581,18 +667,18 @@
arr.push(currentLine);
if (i > 0) {
arr.forEach((line, index) => {
context.fillText(line, 770, 438 + (23 * (i - 1)) + 5 * num + (index * 16)); // 调整行高
context.fillText(line, 770, 438 + (24 * (i - 1)) + 5 * num + (index * 17)); // 调整行高
})
} else {
arr.forEach((line, index) => {
context.fillText(line, 770, 438 + (23 * (i - 1)) + (index * 16)); // 调整行高
context.fillText(line, 770, 438 + (24 * (i - 1)) + (index * 17)); // 调整行高
})
}
} else {
if (i > 0) {
context.fillText(lines[i] ? lines[i] : '', 770, 447 + 6 * num + (23 * (i - 1)));
context.fillText(lines[i] ? lines[i] : '', 770, 447 + 6 * num + (25 * (i - 1)));
} else {
context.fillText(lines[i] ? lines[i] : '', 770, 447 + (23 * (i - 1)));
context.fillText(lines[i] ? lines[i] : '', 770, 447 + (25 * (i - 1)));
}
}
}
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2024-01-17 09:35:40
* @LastEditTime: 2024-01-17 10:17:29
-->
<template>
<div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="text-align: center;">
......@@ -438,7 +438,7 @@
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);
// 权利人
let qlrlines = this.bdcqz.qlr ? this.bdcqz.qlr.split(' ') : [];
if (getByteLen(this.bdcqz.qlr) > 37) {
qlrlines.forEach((line, index) => {
......@@ -594,18 +594,18 @@
arr.push(currentLine);
if (i > 0) {
arr.forEach((line, index) => {
context.fillText(line, 770, 428 + (25 * (i - 1)) + 5 * num + (index * 15)); // 调整行高
context.fillText(line, 770, 438 + (24 * (i - 1)) + 5 * num + (index * 17)); // 调整行高
})
} else {
arr.forEach((line, index) => {
context.fillText(line, 770, 435 + (25 * (i - 1)) + (index * 14)); // 调整行高
context.fillText(line, 770, 438 + (24 * (i - 1)) + (index * 17)); // 调整行高
})
}
} else {
if (i > 0) {
context.fillText(lines[i] ? lines[i] : '', 770, 440 + 5 * num + (24 * (i - 1)));
context.fillText(lines[i] ? lines[i] : '', 770, 447 + 6 * num + (25 * (i - 1)));
} else {
context.fillText(lines[i] ? lines[i] : '', 770, 440 + (24 * (i - 1)));
context.fillText(lines[i] ? lines[i] : '', 770, 447 + (25 * (i - 1)));
}
}
}
......