diff options
| author | kiman Kim <94714426+rlaks5757@users.noreply.github.com> | 2025-04-02 13:45:49 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-02 13:45:49 +0900 |
| commit | df6a532921c6c39f68923237d261a1abd6a105ef (patch) | |
| tree | 71d5aeb2ddcbc4c82e17ea38f082e410711c2655 /components/documents | |
| parent | 4b2d468701ab069fdc2347f345da56abe37c70be (diff) | |
| parent | d8a70fa8802ad066fee68aca54df7fa41461a841 (diff) | |
Merge pull request #7 from DTS-Development/feature/kiman
vendor-document-viewer select row μμ
Diffstat (limited to 'components/documents')
| -rw-r--r-- | components/documents/StageList.tsx | 9 | ||||
| -rw-r--r-- | components/documents/view-document-dialog.tsx | 36 |
2 files changed, 21 insertions, 24 deletions
diff --git a/components/documents/StageList.tsx b/components/documents/StageList.tsx index 6df448df..8d82b741 100644 --- a/components/documents/StageList.tsx +++ b/components/documents/StageList.tsx @@ -55,14 +55,12 @@ interface Version { approvedDate: string | null DocumentSubmitDate: Date attachments: Attachment[] - selected?: boolean; + selected?: boolean } export default function StageList({ document }: StageListProps) { const [versions, setVersions] = useState<Version[]>([]) -console.log(versions) - const [stageOptions, setStageOptions] = useState<string[]>([]) const [isLoading, setIsLoading] = useState<boolean>(false) @@ -130,7 +128,7 @@ console.log(versions) } } - const selectItems = useMemo(() => { + const selectItems = useMemo(() => { return versions.filter(c => c.selected && c.attachments && c.attachments.length > 0) }, [versions]) @@ -142,9 +140,8 @@ console.log(versions) Document: {document.docNumber} {document.title} </h2> - <div className="flex flex-row gap-2"> - {selectItems.length > 0 && <ViewDocumentDialog versions={versions}/>} + {selectItems.length > 0 && <ViewDocumentDialog versions={selectItems}/>} <AddDocumentDialog diff --git a/components/documents/view-document-dialog.tsx b/components/documents/view-document-dialog.tsx index bd802b77..162079ad 100644 --- a/components/documents/view-document-dialog.tsx +++ b/components/documents/view-document-dialog.tsx @@ -18,27 +18,27 @@ interface Attachment { } interface Version { - id: number; - stage: string; - revision: string; - uploaderType: string; - uploaderName: string | null; - comment: string | null; - status: string | null; - planDate: string | null; - actualDate: string | null; - approvedDate: string | null; - DocumentSubmitDate: Date; - attachments: Attachment[]; - selected?: boolean; + id: number + stage: string + revision: string + uploaderType: string + uploaderName: string | null + comment: string | null + status: string | null + planDate: string | null + actualDate: string | null + approvedDate: string | null + DocumentSubmitDate: Date + attachments: Attachment[] + selected?: boolean } type ViewDocumentDialogProps = { - versions: Version[]; -}; + versions: Version[] +} export function ViewDocumentDialog({ versions }: ViewDocumentDialogProps) { - const [open, setOpen] = React.useState(false); + const [open, setOpen] = React.useState(false) return ( <> @@ -101,7 +101,7 @@ const DocumentViewer: React.FC<{ requestAnimationFrame(() => { if (viewer.current) { import("@pdftron/webviewer").then(({ default: WebViewer }) => { - console.log(isCancelled.current); + console.log(isCancelled.current) if (isCancelled.current) { console.log("π WebViewer μ΄κΈ°ν μ·¨μλ¨ (Dialog λ«ν)"); @@ -185,7 +185,7 @@ const DocumentViewer: React.FC<{ if (tabIds.length > 0) { await UI.TabManager.setActiveTab(tabIds[0]); - } + } setFileSetLoading(false); } |
