style:证书预览
Showing
1 changed file
with
44 additions
and
20 deletions
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,28 +202,51 @@ | ... | @@ -201,28 +202,51 @@ |
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); // 每行文本的垂直位置 |
209 | let currentLine = ''; | 210 | // let currentLine = ''; |
210 | let arr = []; | 211 | // let arr = []; |
211 | for (let word of line) { | 212 | // for (let word of line) { |
212 | const testLine = currentLine + word; | 213 | // const testLine = currentLine + word; |
213 | const lineWidth = context.measureText(testLine).width; | 214 | // const lineWidth = context.measureText(testLine).width; |
214 | if (lineWidth <= maxWidth) { | 215 | // if (lineWidth <= maxWidth) { |
215 | currentLine = testLine; | 216 | // currentLine = testLine; |
216 | } else { | 217 | // } else { |
217 | arr.push(currentLine); | 218 | // arr.push(currentLine); |
218 | currentLine = word; | 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) { | ||
229 | let currentLine = ''; | ||
230 | let arr = []; | ||
231 | for (let word of lines[i]) { | ||
232 | const testLine = currentLine + word; | ||
233 | const lineWidth = context.measureText(testLine).width; | ||
234 | if (lineWidth <= maxWidth) { | ||
235 | currentLine = testLine; | ||
236 | } else { | ||
237 | arr.push(currentLine); | ||
238 | currentLine = word; | ||
239 | } | ||
219 | } | 240 | } |
241 | arr.push(currentLine); | ||
242 | arr.forEach((line, index) => { | ||
243 | context.fillText(line, 129, 490 + (28 * (i - 1)) + (index * 14)); // 调整行高 | ||
244 | }) | ||
245 | } else { | ||
246 | context.fillText(lines[i] ? lines[i] : '', 129, 495 + (30 * (i - 1))); | ||
220 | } | 247 | } |
221 | arr.push(currentLine); | 248 | } |
222 | arr.forEach((line, index) => { | 249 | |
223 | context.fillText(line, 129, y + (index * 20)); // 调整行高 | ||
224 | }) | ||
225 | }) | ||
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); // 每行文本的垂直位置 | ... | ... |
-
Please register or sign in to post a comment