test: 26项功能落地性复查(综合冒烟52项+23页巡检, 修复6处缺陷)
This commit is contained in:
@@ -243,13 +243,18 @@ async function generateCloud(mode: 'quick' | 'photo') {
|
||||
}, 1500)
|
||||
try {
|
||||
let photo_b64: string | undefined
|
||||
let rectPayload: any = null
|
||||
if (mode === 'photo') {
|
||||
photo_b64 = photoB64()
|
||||
// 附洞口坐标+照片尺寸(后端转方位描述引导 AI 装窗位置)
|
||||
if (rect.value && photo.value) {
|
||||
rectPayload = { ...rect.value, photo_w: photo.value.naturalWidth, photo_h: photo.value.naturalHeight }
|
||||
}
|
||||
}
|
||||
const d = await api<any>('post', '/api/ai-render/generate', {
|
||||
template_id: templateId.value, mode,
|
||||
style: form.ai_style, time: form.ai_time,
|
||||
scene: mode === 'photo' ? scene.value : form.scene, photo_b64,
|
||||
scene: mode === 'photo' ? scene.value : form.scene, photo_b64, rect: rectPayload,
|
||||
}, { timeout: 200000 })
|
||||
aiImage.value = `data:image/png;base64,${d.image_b64}`
|
||||
aiPrompt.value = d.prompt
|
||||
|
||||
@@ -218,8 +218,13 @@ function setBarcodeRef(el: SVGElement | null) {
|
||||
async function renderBarcodes() {
|
||||
if (!current.value) return
|
||||
await nextTick()
|
||||
// 只保留当前仍在 DOM 中的 svg(模板重建会遗留旧引用)
|
||||
const live = barcodeRefs.filter(el => el.isConnected)
|
||||
barcodeRefs.length = 0
|
||||
barcodeRefs.push(...live)
|
||||
if (!live.length) return
|
||||
const JsBarcode = (await import('jsbarcode')).default
|
||||
for (const svg of barcodeRefs) {
|
||||
for (const svg of live) {
|
||||
try { JsBarcode(svg, current.value.order_no || '0000', { format: 'CODE128', height: 44, fontSize: 13, margin: 4 }) } catch { /* 忽略 */ }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user