6d92b7a2 by renchao@pashanhoo.com

style:证书预览

1 parent e561d58c
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-08-25 10:44:31 4 * @LastEditTime: 2023-08-25 12:21:10
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;">
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
22 <script> 22 <script>
23 import { datas } from "../../javascript/zsyl.js"; 23 import { datas } from "../../javascript/zsyl.js";
24 import { getSlsqBdcqzList } from "@/api/bdcqz.js" 24 import { getSlsqBdcqzList } from "@/api/bdcqz.js"
25 import { log } from 'bpmn-js-token-simulation';
25 export default { 26 export default {
26 name: "zsyl", 27 name: "zsyl",
27 props: { 28 props: {
...@@ -201,14 +202,33 @@ ...@@ -201,14 +202,33 @@
201 }) 202 })
202 } 203 }
203 // context.fillText(this.bdcqz.syqx ? this.bdcqz.syqx : '', 129, 429); 204 // context.fillText(this.bdcqz.syqx ? this.bdcqz.syqx : '', 129, 429);
204 // qlqtzk 205 // 权利其他状态
205 const maxWidth = 330; // 最大宽度限制 206 const maxWidth = 332; // 最大宽度限制
206 let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : []; 207 let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : [];
207 lines.forEach((line, index) => { 208 // lines.forEach((line, index) => {
208 const y = 463 + (index * 40); // 每行文本的垂直位置 209 // const y = 463 + (index * 33); // 每行文本的垂直位置
210 // let currentLine = '';
211 // let arr = [];
212 // for (let word of line) {
213 // const testLine = currentLine + word;
214 // const lineWidth = context.measureText(testLine).width;
215 // if (lineWidth <= maxWidth) {
216 // currentLine = testLine;
217 // } else {
218 // arr.push(currentLine);
219 // currentLine = word;
220 // }
221 // }
222 // arr.push(currentLine);
223 // arr.forEach((line, index) => {
224 // context.fillText(line, 129, y + (index * 17)); // 调整行高
225 // })
226 // })
227 for (let i = 0; i < lines.length; i++) {
228 if (getByteLen(lines[i]) > 41) {
209 let currentLine = ''; 229 let currentLine = '';
210 let arr = []; 230 let arr = [];
211 for (let word of line) { 231 for (let word of lines[i]) {
212 const testLine = currentLine + word; 232 const testLine = currentLine + word;
213 const lineWidth = context.measureText(testLine).width; 233 const lineWidth = context.measureText(testLine).width;
214 if (lineWidth <= maxWidth) { 234 if (lineWidth <= maxWidth) {
...@@ -220,9 +240,13 @@ ...@@ -220,9 +240,13 @@
220 } 240 }
221 arr.push(currentLine); 241 arr.push(currentLine);
222 arr.forEach((line, index) => { 242 arr.forEach((line, index) => {
223 context.fillText(line, 129, y + (index * 20)); // 调整行高 243 context.fillText(line, 129, 490 + (28 * (i - 1)) + (index * 14)); // 调整行高
224 })
225 }) 244 })
245 } else {
246 context.fillText(lines[i] ? lines[i] : '', 129, 495 + (30 * (i - 1)));
247 }
248 }
249
226 let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n') : []; 250 let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n') : [];
227 lines1.forEach((line, index) => { 251 lines1.forEach((line, index) => {
228 const y = 100 + (index * 30); // 每行文本的垂直位置 252 const y = 100 + (index * 30); // 每行文本的垂直位置
......