ca124469 by renchao@pashanhoo.com

Merge branch 'dev'

2 parents 498c2c0b 3d92380f
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2024-01-17 09:26:42
* @LastEditTime: 2024-01-17 10:33:10
-->
<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 = '';
......@@ -558,7 +644,14 @@
// bdcdyh
this.bdcdyh = this.bdcqz.bdcdyh.slice(0, 6) + ' ' + this.bdcqz.bdcdyh.slice(6, 12) + ' ' +
this.bdcqz.bdcdyh.slice(12, 19) + ' ' + this.bdcqz.bdcdyh.slice(19, this.bdcqz.bdcdyh.length)
// 保存当前字体设置
const originalFont = context.font;
// 设置新的字体大小
context.font = '16px 楷体'; // 替换为你想要的字体和大小
// 绘制 bdcdyh
context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373);
// 恢复原始字体设置
context.font = originalFont;
// qlqtzk
const maxWidth = 290; // 最大宽度限制
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : [];
......@@ -581,18 +674,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:32: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) => {
......@@ -568,11 +568,18 @@
})
}
// bdcdyh
this.bdcdyh = this.bdcqz.bdcdyh.slice(0, 6) + ' ' + this.bdcqz.bdcdyh.slice(6, 12) + ' ' +
this.bdcqz.bdcdyh.slice(12, 19) + ' ' + this.bdcqz.bdcdyh.slice(19, this.bdcqz.bdcdyh.length)
// context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373);
// 保存当前字体设置
const originalFont = context.font;
// 设置新的字体大小
context.font = '16px 楷体'; // 替换为你想要的字体和大小
// 绘制 bdcdyh
context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373);
// 恢复原始字体设置
context.font = originalFont;
// qlqtzk
const maxWidth = 295; // 最大宽度限制
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : [];
......@@ -594,18 +601,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)));
}
}
}
......