* 更新指定图片的URL * @param index 页面索引 * @param newUrl 新的图片URL
(index: number, newUrl: string)
| 327 | * @param newUrl 新的图片URL |
| 328 | */ |
| 329 | updateImage(index: number, newUrl: string) { |
| 330 | const image = this.images.find(img => img.index === index) |
| 331 | if (image) { |
| 332 | const wasDone = image.status === 'done' |
| 333 | // 添加时间戳避免缓存 |
| 334 | const timestamp = Date.now() |
| 335 | image.url = `${newUrl}?t=${timestamp}` |
| 336 | image.status = 'done' |
| 337 | delete image.error |
| 338 | if (!wasDone && this.progress.current < this.progress.total) { |
| 339 | this.progress.current++ |
| 340 | } |
| 341 | } |
| 342 | }, |
| 343 | |
| 344 | /** |
| 345 | * 完成图片生成流程 |
nothing calls this directly
no outgoing calls
no test coverage detected