style:证书预览
Showing
1 changed file
with
22 additions
and
4 deletions
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-07-14 16:05:30 | 4 | * @LastEditTime: 2023-08-02 15:33:01 |
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;"> |
... | @@ -102,7 +102,6 @@ | ... | @@ -102,7 +102,6 @@ |
102 | this.loading = false | 102 | this.loading = false |
103 | }) | 103 | }) |
104 | }, | 104 | }, |
105 | //tab表头切换方法 | ||
106 | /** | 105 | /** |
107 | * @description: tab表头切换方法 | 106 | * @description: tab表头切换方法 |
108 | * @param {*} e | 107 | * @param {*} e |
... | @@ -117,7 +116,6 @@ | ... | @@ -117,7 +116,6 @@ |
117 | this.drawTextzmImage() | 116 | this.drawTextzmImage() |
118 | } | 117 | } |
119 | }, | 118 | }, |
120 | // 不动产证书 | ||
121 | /** | 119 | /** |
122 | * @description: 不动产证书 | 120 | * @description: 不动产证书 |
123 | * @author: renchao | 121 | * @author: renchao |
... | @@ -165,7 +163,27 @@ | ... | @@ -165,7 +163,27 @@ |
165 | context.fillText(line, 138, y + (index * 20)); // 调整行高 | 163 | context.fillText(line, 138, y + (index * 20)); // 调整行高 |
166 | }) | 164 | }) |
167 | }) | 165 | }) |
168 | context.fillText(this.bdcqz.fj ? this.bdcqz.fj : '', 580, 100); | 166 | let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split(' ') : []; |
167 | lines1.forEach((line, index) => { | ||
168 | const y = 100 + (index * 37); // 每行文本的垂直位置 | ||
169 | let currentLine = ''; | ||
170 | let arr = []; | ||
171 | for (let word of line) { | ||
172 | const testLine = currentLine + word; | ||
173 | const lineWidth = context.measureText(testLine).width; | ||
174 | if (lineWidth <= 395) { | ||
175 | currentLine = testLine; | ||
176 | } else { | ||
177 | arr.push(currentLine); | ||
178 | currentLine = word; | ||
179 | } | ||
180 | } | ||
181 | arr.push(currentLine); | ||
182 | arr.forEach((line, index) => { | ||
183 | context.fillText(line, 580, y + (index * 20)); // 调整行高 | ||
184 | }) | ||
185 | }) | ||
186 | |||
169 | } | 187 | } |
170 | image.src = this.imgSrc | 188 | image.src = this.imgSrc |
171 | }, | 189 | }, | ... | ... |
-
Please register or sign in to post a comment