260629_01_ENH: PDF 미리보기 파일명 노출될 수 있도록 수정 및 KON용 code 조회 추가
This commit is contained in:
@@ -195,11 +195,26 @@ export function MonitoringPerformanceDetailDialog({
|
||||
|
||||
const reviewType = row?.reviewType ?? 1;
|
||||
const templateClassification = Number(String(performance?.id ?? 0).charAt(0));
|
||||
const downloadTemplate = () => downloadFromUrl(`/api/review/template/download/${reviewType}/${templateClassification}`);
|
||||
const previewTemplate = () => {
|
||||
openPreviewWindow(buildReviewTemplatePdfPreviewUrl(reviewType, templateClassification, `review-template-${reviewType}-${templateClassification}.pdf`));
|
||||
|
||||
const buildTemplateDownloadUrl = (classification: number) => `/api/review/template/download/${reviewType}/${classification}`;
|
||||
const downloadTemplate = () => downloadFromUrl(buildTemplateDownloadUrl(templateClassification));
|
||||
|
||||
const previewTemplateFile = async (classification: number) => {
|
||||
const previewWindow = window.open("about:blank", "_blank");
|
||||
if (previewWindow) previewWindow.opener = null;
|
||||
const previewUrl = buildReviewTemplatePdfPreviewUrl(reviewType, classification);
|
||||
|
||||
if (previewWindow) {
|
||||
previewWindow.location.href = previewUrl;
|
||||
return;
|
||||
}
|
||||
|
||||
openPreviewWindow(previewUrl);
|
||||
};
|
||||
|
||||
const previewTemplate = () => void previewTemplateFile(templateClassification);
|
||||
const previewEduFile = () => void previewTemplateFile(99);
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="flex max-h-[92vh] w-[calc(100vw-24px)] max-w-[430px] flex-col overflow-hidden p-0">
|
||||
@@ -229,13 +244,14 @@ export function MonitoringPerformanceDetailDialog({
|
||||
</section>
|
||||
|
||||
<section className="space-y-3 rounded-md border p-3">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<div className="font-semibold">나의 진행 상태</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<ActionButton icon="preview" onClick={previewTemplate} className="min-h-5">양식</ActionButton>
|
||||
<ActionButton icon="download" onClick={downloadTemplate} className="min-h-5">양식</ActionButton>
|
||||
<StatusPill variant={status.variant}>{status.label}</StatusPill>
|
||||
</div>
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<div className="shrink-0 font-semibold leading-6">나의 진행 상태</div>
|
||||
<StatusPill variant={status.variant}>{status.label}</StatusPill>
|
||||
</div>
|
||||
<div className="flex items-center justify-end gap-2">
|
||||
<ActionButton icon="preview" onClick={previewEduFile} className="h-8 min-h-0 shrink-0 px-2 text-xs">교육자료</ActionButton>
|
||||
<ActionButton icon="preview" onClick={previewTemplate} className="h-8 min-h-0 shrink-0 px-2 text-xs">양식</ActionButton>
|
||||
<ActionButton icon="download" onClick={downloadTemplate} className="h-8 min-h-0 shrink-0 px-2 text-xs">양식 다운로드</ActionButton>
|
||||
</div>
|
||||
{row ? (
|
||||
<MonitoringReviewActions
|
||||
|
||||
Reference in New Issue
Block a user