26c08742 by renchao@pashanhoo.com

style:证书预览

1 parent ac7ad931
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-14 16:05:30
* @LastEditTime: 2023-08-02 15:33:01
-->
<template>
<div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="height:720px;text-align: center;">
......@@ -102,7 +102,6 @@
this.loading = false
})
},
//tab表头切换方法
/**
* @description: tab表头切换方法
* @param {*} e
......@@ -117,7 +116,6 @@
this.drawTextzmImage()
}
},
// 不动产证书
/**
* @description: 不动产证书
* @author: renchao
......@@ -165,7 +163,27 @@
context.fillText(line, 138, y + (index * 20)); // 调整行高
})
})
context.fillText(this.bdcqz.fj ? this.bdcqz.fj : '', 580, 100);
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split(' ') : [];
lines1.forEach((line, index) => {
const y = 100 + (index * 37); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 395) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 580, y + (index * 20)); // 调整行高
})
})
}
image.src = this.imgSrc
},
......