6d92b7a2 by renchao@pashanhoo.com

style:证书预览

1 parent e561d58c
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-08-25 10:44:31
* @LastEditTime: 2023-08-25 12:21:10
-->
<template>
<div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="height:720px;text-align: center;">
......@@ -22,6 +22,7 @@
<script>
import { datas } from "../../javascript/zsyl.js";
import { getSlsqBdcqzList } from "@/api/bdcqz.js"
import { log } from 'bpmn-js-token-simulation';
export default {
name: "zsyl",
props: {
......@@ -201,14 +202,33 @@
})
}
// context.fillText(this.bdcqz.syqx ? this.bdcqz.syqx : '', 129, 429);
// qlqtzk
const maxWidth = 330; // 最大宽度限制
// 权利其他状态
const maxWidth = 332; // 最大宽度限制
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : [];
lines.forEach((line, index) => {
const y = 463 + (index * 40); // 每行文本的垂直位置
// lines.forEach((line, index) => {
// const y = 463 + (index * 33); // 每行文本的垂直位置
// let currentLine = '';
// let arr = [];
// for (let word of line) {
// const testLine = currentLine + word;
// const lineWidth = context.measureText(testLine).width;
// if (lineWidth <= maxWidth) {
// currentLine = testLine;
// } else {
// arr.push(currentLine);
// currentLine = word;
// }
// }
// arr.push(currentLine);
// arr.forEach((line, index) => {
// context.fillText(line, 129, y + (index * 17)); // 调整行高
// })
// })
for (let i = 0; i < lines.length; i++) {
if (getByteLen(lines[i]) > 41) {
let currentLine = '';
let arr = [];
for (let word of line) {
for (let word of lines[i]) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= maxWidth) {
......@@ -220,9 +240,13 @@
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 129, y + (index * 20)); // 调整行高
})
context.fillText(line, 129, 490 + (28 * (i - 1)) + (index * 14)); // 调整行高
})
} else {
context.fillText(lines[i] ? lines[i] : '', 129, 495 + (30 * (i - 1)));
}
}
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n') : [];
lines1.forEach((line, index) => {
const y = 100 + (index * 30); // 每行文本的垂直位置
......