fix: plt/print preview window stacking

This commit is contained in:
hyper
2026-03-31 17:28:46 +08:00
parent 246d983ad2
commit 18ea01b904
2 changed files with 23 additions and 17 deletions
+4 -1
View File
@@ -1,4 +1,5 @@
import { createSignal, For, Show, createMemo } from 'solid-js';
import { Portal } from 'solid-js/web';
import { parsePlt, extractCutPaths } from '../../plotcutter/parser';
import { generateTravelPaths, travelPathsToSvg } from '../../plotcutter/layout';
import type { CardPath } from '../../plotcutter/types';
@@ -91,7 +92,8 @@ export function PltPreview(props: PltPreviewProps) {
};
return (
<div class="fixed inset-0 bg-black/50 z-50 overflow-auto">
<Portal>
<div class="fixed inset-0 bg-black/50 z-[60] overflow-auto">
<div class="min-h-screen py-20 px-4">
{/* 头部控制栏 */}
<div class="fixed top-4 left-1/2 -translate-x-1/2 bg-white shadow-lg rounded-lg px-4 py-3 flex items-center gap-4 z-50">
@@ -224,5 +226,6 @@ export function PltPreview(props: PltPreviewProps) {
</div>
</div>
</div>
</Portal>
);
}
+4 -1
View File
@@ -1,4 +1,5 @@
import { createSignal, For, Show } from 'solid-js';
import { Portal } from 'solid-js/web';
import type { DeckStore } from './hooks/deckStore';
import { usePageLayout } from './hooks/usePageLayout';
import { usePDFExport, type ExportOptions } from './hooks/usePDFExport';
@@ -60,8 +61,9 @@ export function PrintPreview(props: PrintPreviewProps) {
};
return (
<Portal>
<Show when={!showPltPreview()} fallback={<PltPreview pltCode={pltCode()} onClose={handleClosePltPreview} />}>
<div class="fixed inset-0 bg-black/50 z-50 overflow-auto">
<div class="fixed inset-0 bg-black/50 z-[60] overflow-auto">
<div class="min-h-screen py-20 px-4">
<PrintPreviewHeader
store={store}
@@ -197,5 +199,6 @@ export function PrintPreview(props: PrintPreviewProps) {
</div>
</div>
</Show>
</Portal>
);
}