feat(pdf-import): 분석 신뢰도 게이팅 + 저신뢰 확인 메시지(ko/ja)
- analyzePdfAndApply에서 confidence < 0.6이면 반영 전 useSwal confirm으로 사용자 확인 - pdf.import.confirm.low.confidence 메시지 키 ko/ja 추가 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0418dd84ee
commit
761c42a637
@ -44,6 +44,8 @@ const PDF_PAGE_MODE = {
|
|||||||
SPECIFY: 'specify',
|
SPECIFY: 'specify',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const PDF_CONFIDENCE_THRESHOLD = 0.6 // 이 값 미만이면 반영 전 사용자 확인
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 지붕 레이아웃
|
* 지붕 레이아웃
|
||||||
*/
|
*/
|
||||||
@ -189,6 +191,18 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof payload.confidence === 'number' && payload.confidence < PDF_CONFIDENCE_THRESHOLD) {
|
||||||
|
const proceed = await new Promise((resolve) => {
|
||||||
|
swalFire({
|
||||||
|
text: getMessage('pdf.import.confirm.low.confidence', [Math.round(payload.confidence * 100)]),
|
||||||
|
type: 'confirm',
|
||||||
|
confirmFn: () => resolve(true),
|
||||||
|
denyFn: () => resolve(false),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
if (!proceed) return false
|
||||||
|
}
|
||||||
|
|
||||||
const applied = await applyOuterline(payload.outerline, { unit: payload.unit || 'mm' })
|
const applied = await applyOuterline(payload.outerline, { unit: payload.unit || 'mm' })
|
||||||
if (!applied) {
|
if (!applied) {
|
||||||
swalFire({ text: getMessage('pdf.import.error.apply'), type: 'alert' })
|
swalFire({ text: getMessage('pdf.import.error.apply'), type: 'alert' })
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
"pdf.import.button.analyzing": "解析中...",
|
"pdf.import.button.analyzing": "解析中...",
|
||||||
"pdf.import.success": "外壁線をキャンバスに反映しました。",
|
"pdf.import.success": "外壁線をキャンバスに反映しました。",
|
||||||
"pdf.import.confirm.overwrite": "既存の外壁線があります。新しい外壁線で上書きしますか?",
|
"pdf.import.confirm.overwrite": "既存の外壁線があります。新しい外壁線で上書きしますか?",
|
||||||
|
"pdf.import.confirm.low.confidence": "図面の認識信頼度が低いです({0}%)。それでも外壁線を反映しますか?ページを指定して再度お試しいただくこともできます。",
|
||||||
"pdf.import.error.network": "ネットワークエラーで解析リクエストに失敗しました。",
|
"pdf.import.error.network": "ネットワークエラーで解析リクエストに失敗しました。",
|
||||||
"pdf.import.error.analyze": "PDF 解析に失敗しました。",
|
"pdf.import.error.analyze": "PDF 解析に失敗しました。",
|
||||||
"pdf.import.error.no.floorplan": "平面図を認識できませんでした。別の PDF で再度お試しください。",
|
"pdf.import.error.no.floorplan": "平面図を認識できませんでした。別の PDF で再度お試しください。",
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
"pdf.import.button.analyzing": "분석 중...",
|
"pdf.import.button.analyzing": "분석 중...",
|
||||||
"pdf.import.success": "외곽선이 캔버스에 반영되었습니다.",
|
"pdf.import.success": "외곽선이 캔버스에 반영되었습니다.",
|
||||||
"pdf.import.confirm.overwrite": "기존 외곽선이 있습니다. 새 외곽선으로 덮어쓰시겠습니까?",
|
"pdf.import.confirm.overwrite": "기존 외곽선이 있습니다. 새 외곽선으로 덮어쓰시겠습니까?",
|
||||||
|
"pdf.import.confirm.low.confidence": "도면 인식 신뢰도가 낮습니다({0}%). 그래도 외곽선을 반영하시겠습니까? 페이지를 직접 지정해 다시 시도할 수도 있습니다.",
|
||||||
"pdf.import.error.network": "네트워크 오류로 분석 요청에 실패했습니다.",
|
"pdf.import.error.network": "네트워크 오류로 분석 요청에 실패했습니다.",
|
||||||
"pdf.import.error.analyze": "PDF 분석에 실패했습니다.",
|
"pdf.import.error.analyze": "PDF 분석에 실패했습니다.",
|
||||||
"pdf.import.error.no.floorplan": "평면도를 인식하지 못했습니다. 다른 PDF 로 다시 시도해 주세요.",
|
"pdf.import.error.no.floorplan": "평면도를 인식하지 못했습니다. 다른 PDF 로 다시 시도해 주세요.",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user