ocr 및 스캐너 기능 구현
This commit is contained in:
1 parent
1dbc73312b
commit
2c64369694
24 files changed
+3556
-8
No files matched your search
@@ -4,6 +4,7 @@ import {
|
||||
diagramKindFor,
|
||||
isHwp,
|
||||
isOffice,
|
||||
toolKindFor,
|
||||
viewerKindFor,
|
||||
} from '@/config/app';
|
||||
import {
|
||||
@@ -18,6 +19,7 @@ import {
|
||||
storeHwpFile,
|
||||
} from '@/composables/useSessionLifecycle';
|
||||
import { stageDiagramFile } from '@/composables/diagramSession';
|
||||
import { stageScannerFiles } from '@/composables/scannerSession';
|
||||
import { stageViewerFiles } from '@/composables/viewerSession';
|
||||
|
||||
export function useOpenDocument() {
|
||||
@@ -37,6 +39,7 @@ export function useOpenDocument() {
|
||||
files.find(
|
||||
(candidate) =>
|
||||
viewerKindFor(candidate.name) ||
|
||||
toolKindFor(candidate.name) ||
|
||||
diagramKindFor(candidate.name) ||
|
||||
isHwp(candidate.name) ||
|
||||
isOffice(candidate.name),
|
||||
@@ -53,6 +56,14 @@ export function useOpenDocument() {
|
||||
return true;
|
||||
}
|
||||
|
||||
const toolKind = toolKindFor(file.name);
|
||||
if (toolKind === 'scanner') {
|
||||
const images = files.filter((candidate) => toolKindFor(candidate.name) === 'scanner');
|
||||
stageScannerFiles(images.length ? images : [file]);
|
||||
await router.push({ name: 'tools-scanner' });
|
||||
return true;
|
||||
}
|
||||
|
||||
const diagramKind = diagramKindFor(file.name);
|
||||
if (diagramKind) {
|
||||
stageDiagramFile(diagramKind, file);
|
||||
@@ -69,7 +80,7 @@ export function useOpenDocument() {
|
||||
|
||||
if (!isOffice(file.name)) {
|
||||
error.value =
|
||||
'지원하지 않는 형식입니다. 오피스, HWP 또는 다이어그램 파일을 선택해 주세요.';
|
||||
'지원하지 않는 형식입니다. 오피스, HWP, 다이어그램, CAD/3D 또는 이미지를 선택해 주세요.';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user