12a05c3b by renchao@pashanhoo.com

style:证书预览

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