12a05c3b by renchao@pashanhoo.com

style:证书预览

1 parent 0ff98b06
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-06 15:30:05
* @LastEditTime: 2023-09-06 15:41:50
-->
<template>
<div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="height:720px;text-align: center;">
......@@ -206,17 +206,16 @@
}
// context.fillText(this.bdcqz.syqx ? this.bdcqz.syqx : '', 129, 429);
// 权利其他状态
const maxWidth = 332; // 最大宽度限制
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : [];
for (let i = 0; i < lines.length; i++) {
let num = Math.ceil(getByteLen(lines[i]) / 41)
if (getByteLen(lines[i]) > 41) {
let num = Math.ceil(getByteLen(lines[i]) / 40)
if (getByteLen(lines[i]) > 40) {
let currentLine = '';
let arr = [];
for (let word of lines[i]) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= maxWidth) {
if (lineWidth <= 323) {
currentLine = testLine;
} else {
arr.push(currentLine);
......@@ -226,11 +225,11 @@
arr.push(currentLine);
if (i > 0) {
arr.forEach((line, index) => {
context.fillText(line, 129, 480 + (26 * (i - 1)) + 5 * num + (index * 13)); // 调整行高
context.fillText(line, 129, 480 + (26 * (i - 1)) + 4 * num + (index * 13)); // 调整行高
})
} else {
arr.forEach((line, index) => {
context.fillText(line, 129, 480 + (26 * (i - 1)) + (index * 13)); // 调整行高
context.fillText(line, 129, 490 + (26 * (i - 1)) + (index * 13)); // 调整行高
})
}
} else {
......