@svadmin/ui 0.121.0 → 0.122.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.css +204 -11
- package/dist/app.theme.css +204 -11
- package/dist/components/AboutSettings.svelte +1 -1
- package/dist/components/AnnouncementBanner.svelte +314 -0
- package/dist/components/AnnouncementBanner.svelte.d.ts +45 -0
- package/dist/components/AsyncExportModal.svelte +551 -0
- package/dist/components/AsyncExportModal.svelte.d.ts +50 -0
- package/dist/components/AudioFeedbackProvider.svelte +131 -0
- package/dist/components/AudioFeedbackProvider.svelte.d.ts +11 -0
- package/dist/components/AuditLogViewer.svelte +1 -1
- package/dist/components/CanvasAnnotation.svelte +1 -1
- package/dist/components/ColumnFilterBuilder.svelte +135 -0
- package/dist/components/ColumnFilterBuilder.svelte.d.ts +20 -0
- package/dist/components/ColumnSettings.svelte +1 -1
- package/dist/components/ColumnVisibilityDrawer.svelte +541 -0
- package/dist/components/ColumnVisibilityDrawer.svelte.d.ts +16 -0
- package/dist/components/ConcurrentConflictModal.svelte +7 -7
- package/dist/components/ConversionFunnel.svelte +154 -0
- package/dist/components/ConversionFunnel.svelte.d.ts +22 -0
- package/dist/components/CronExpressionBuilder.svelte +1 -1
- package/dist/components/DecisionTable.svelte +1 -1
- package/dist/components/DevTools.svelte +1 -1
- package/dist/components/DraggableRowTable.svelte +1 -1
- package/dist/components/DualApprovalGate.svelte +418 -0
- package/dist/components/DualApprovalGate.svelte.d.ts +39 -0
- package/dist/components/EditableTable.svelte +1 -1
- package/dist/components/ExcelImportWizard.svelte +2 -2
- package/dist/components/GlobalShortcuts.svelte +1 -1
- package/dist/components/ImageCropper.svelte +1 -1
- package/dist/components/ImportWizard.svelte +1 -1
- package/dist/components/JsonSchemaForm.svelte +1 -1
- package/dist/components/JsonViewer.svelte +11 -11
- package/dist/components/KeyboardShortcutsModal.svelte +362 -0
- package/dist/components/KeyboardShortcutsModal.svelte.d.ts +22 -0
- package/dist/components/KpiCard.svelte +5 -5
- package/dist/components/MasterDetailView.svelte +1 -1
- package/dist/components/MetricGrid.svelte +2 -2
- package/dist/components/MicroAppBridge.svelte +59 -0
- package/dist/components/MicroAppBridge.svelte.d.ts +11 -0
- package/dist/components/OfflineSyncBanner.svelte +1 -1
- package/dist/components/OrgChart.svelte +1 -1
- package/dist/components/OrgTreePicker.svelte +1 -1
- package/dist/components/OtpInput.svelte +5 -5
- package/dist/components/PdfDocumentViewer.svelte +2 -2
- package/dist/components/PivotDrilldownModal.svelte +6 -6
- package/dist/components/PivotTable.svelte +1 -1
- package/dist/components/PricingCard.svelte +1 -1
- package/dist/components/PricingTable.svelte +1 -1
- package/dist/components/PrintableBill.svelte +2 -2
- package/dist/components/PrintableReportLayout.svelte +259 -0
- package/dist/components/PrintableReportLayout.svelte.d.ts +32 -0
- package/dist/components/ProSkeleton.svelte +6 -6
- package/dist/components/ResultPage.svelte +2 -2
- package/dist/components/SafeDeleteConfirm.svelte +5 -5
- package/dist/components/SankeyChart.svelte +111 -0
- package/dist/components/SankeyChart.svelte.d.ts +22 -0
- package/dist/components/SchemaVisualModeler.svelte +336 -0
- package/dist/components/SchemaVisualModeler.svelte.d.ts +17 -0
- package/dist/components/SensitiveDataMask.svelte +81 -22
- package/dist/components/SensitiveDataMask.svelte.d.ts +15 -10
- package/dist/components/SessionTimeoutGuard.svelte +154 -0
- package/dist/components/SessionTimeoutGuard.svelte.d.ts +25 -0
- package/dist/components/SignaturePad.svelte +1 -1
- package/dist/components/SliderCaptcha.svelte +1 -1
- package/dist/components/SplitPaneLayout.svelte +1 -1
- package/dist/components/SpreadsheetView.svelte +1 -1
- package/dist/components/StepForm.svelte +1 -1
- package/dist/components/StepWizard.svelte +513 -0
- package/dist/components/StepWizard.svelte.d.ts +49 -0
- package/dist/components/TableClipboardManager.svelte +307 -0
- package/dist/components/TableClipboardManager.svelte.d.ts +13 -0
- package/dist/components/TaskCenter.svelte +9 -9
- package/dist/components/TextDiffViewer.svelte +613 -0
- package/dist/components/TextDiffViewer.svelte.d.ts +39 -0
- package/dist/components/TreeTransfer.svelte +1 -1
- package/dist/components/UnsavedChangesGuard.svelte +5 -5
- package/dist/components/UsageCard.svelte +1 -1
- package/dist/components/VersionDiffViewer.svelte +1 -1
- package/dist/components/VirtualTable.svelte +1 -1
- package/dist/components/VirtualTreeSelect.svelte +1 -1
- package/dist/components/WorkflowDesigner.svelte +3 -3
- package/dist/components/WorkflowProcessCard.svelte +1 -1
- package/dist/components/WorkflowStepper.svelte +250 -0
- package/dist/components/WorkflowStepper.svelte.d.ts +27 -0
- package/dist/components/charts/GaugeChart.svelte +1 -1
- package/dist/components/useAudioAlert.d.svelte.ts +1 -0
- package/dist/components/useAudioAlert.svelte.d.ts +13 -0
- package/dist/components/useAudioAlert.svelte.js +90 -0
- package/dist/components/useHotkeys.d.svelte.ts +1 -0
- package/dist/components/useHotkeys.svelte.d.ts +44 -0
- package/dist/components/useHotkeys.svelte.js +190 -0
- package/dist/components/useMicroAppEvent.d.svelte.ts +1 -0
- package/dist/components/useMicroAppEvent.svelte.d.ts +16 -0
- package/dist/components/useMicroAppEvent.svelte.js +61 -0
- package/dist/components/usePrintExport.d.svelte.ts +1 -0
- package/dist/components/usePrintExport.svelte.d.ts +11 -0
- package/dist/components/usePrintExport.svelte.js +45 -0
- package/dist/components/useSessionTimeout.d.svelte.ts +1 -0
- package/dist/components/useSessionTimeout.svelte.d.ts +28 -0
- package/dist/components/useSessionTimeout.svelte.js +182 -0
- package/dist/components/useTableClipboard.d.svelte.ts +1 -0
- package/dist/components/useTableClipboard.svelte.d.ts +28 -0
- package/dist/components/useTableClipboard.svelte.js +116 -0
- package/dist/index.d.ts +28 -9
- package/dist/index.js +35 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
|
+
export interface MicroAppBridgeProps {
|
|
3
|
+
channel?: string | undefined;
|
|
4
|
+
allowedOrigins?: string[] | undefined;
|
|
5
|
+
appId?: string | undefined;
|
|
6
|
+
class?: string | undefined;
|
|
7
|
+
children?: Snippet | undefined;
|
|
8
|
+
}
|
|
9
|
+
declare const MicroAppBridge: import("svelte").Component<MicroAppBridgeProps, {}, "">;
|
|
10
|
+
type MicroAppBridge = ReturnType<typeof MicroAppBridge>;
|
|
11
|
+
export default MicroAppBridge;
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
{#if !isOnline || pendingMutations.length > 0}
|
|
79
79
|
<div
|
|
80
80
|
class={cn(
|
|
81
|
-
'rounded-
|
|
81
|
+
'rounded-md border shadow-xs text-xs p-3 transition-all',
|
|
82
82
|
!isOnline
|
|
83
83
|
? 'bg-warning/15 border-warning/30 text-warning-foreground'
|
|
84
84
|
: 'bg-muted/40 border-border/80 text-foreground',
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
role="button"
|
|
76
76
|
tabindex="0"
|
|
77
77
|
class={cn(
|
|
78
|
-
'group relative flex items-center gap-3 rounded-
|
|
78
|
+
'group relative flex items-center gap-3 rounded-md border border-border bg-card p-3 shadow-xs transition-all cursor-pointer',
|
|
79
79
|
'hover:border-primary/60 hover:shadow-md hover:-translate-y-0.5 select-none min-w-[200px] max-w-[260px]'
|
|
80
80
|
)}
|
|
81
81
|
onclick={() => onnodeclick?.(node)}
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
<div
|
|
134
134
|
data-svadmin-component="OrgTreePicker"
|
|
135
135
|
class={cn(
|
|
136
|
-
'flex flex-col lg:flex-row items-stretch border border-border rounded-
|
|
136
|
+
'flex flex-col lg:flex-row items-stretch border border-border rounded-md bg-card text-card-foreground shadow-xs overflow-hidden h-[540px]',
|
|
137
137
|
className,
|
|
138
138
|
)}
|
|
139
139
|
>
|
|
@@ -168,9 +168,9 @@
|
|
|
168
168
|
});
|
|
169
169
|
|
|
170
170
|
const sizeClasses = {
|
|
171
|
-
sm: 'h-
|
|
172
|
-
md: 'h-
|
|
173
|
-
lg: 'h-
|
|
171
|
+
sm: 'h-7 w-7 text-xs',
|
|
172
|
+
md: 'h-8 w-8 text-sm',
|
|
173
|
+
lg: 'h-9 w-9 text-base',
|
|
174
174
|
};
|
|
175
175
|
</script>
|
|
176
176
|
|
|
@@ -192,8 +192,8 @@
|
|
|
192
192
|
aria-label={`Digit ${index + 1} of ${length}`}
|
|
193
193
|
aria-invalid={error ? 'true' : undefined}
|
|
194
194
|
class={cn(
|
|
195
|
-
'rounded-
|
|
196
|
-
'focus:
|
|
195
|
+
'rounded-sm border text-center font-mono font-semibold transition-all outline-none',
|
|
196
|
+
'focus:border-primary focus:ring-2 focus:ring-primary/20',
|
|
197
197
|
sizeClasses[size],
|
|
198
198
|
error
|
|
199
199
|
? 'border-destructive text-destructive focus:ring-destructive'
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
|
|
119
119
|
<div
|
|
120
120
|
class={cn(
|
|
121
|
-
'flex flex-col rounded-
|
|
122
|
-
isFullscreen ? 'fixed inset-4 z-50 shadow-
|
|
121
|
+
'flex flex-col rounded-md border border-border bg-card shadow-xs text-xs overflow-hidden transition-all',
|
|
122
|
+
isFullscreen ? 'fixed inset-4 z-50 shadow-[var(--shadow-overlay)]' : 'min-h-[500px]',
|
|
123
123
|
className
|
|
124
124
|
)}
|
|
125
125
|
>
|
|
@@ -83,17 +83,17 @@
|
|
|
83
83
|
>
|
|
84
84
|
<div
|
|
85
85
|
class={cn(
|
|
86
|
-
'flex flex-col bg-card border border-border text-card-foreground shadow-
|
|
86
|
+
'flex flex-col bg-card border border-border text-card-foreground shadow-[var(--shadow-overlay)] transition-all duration-200 overflow-hidden',
|
|
87
87
|
isFullscreen
|
|
88
|
-
? 'fixed inset-2 rounded-
|
|
89
|
-
: 'w-full max-w-4xl max-h-[85vh] rounded-
|
|
88
|
+
? 'fixed inset-2 rounded-md'
|
|
89
|
+
: 'w-full max-w-4xl max-h-[85vh] rounded-md',
|
|
90
90
|
className,
|
|
91
91
|
)}
|
|
92
92
|
>
|
|
93
93
|
<!-- 弹窗顶栏 -->
|
|
94
94
|
<div class="flex items-center justify-between border-b border-border px-5 py-4 bg-muted/20">
|
|
95
95
|
<div class="flex items-center gap-2.5">
|
|
96
|
-
<div class="flex h-8 w-8 items-center justify-center rounded-
|
|
96
|
+
<div class="flex h-8 w-8 items-center justify-center rounded-sm bg-primary/10 text-primary">
|
|
97
97
|
<TableProperties size={18} />
|
|
98
98
|
</div>
|
|
99
99
|
<div>
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
|
|
177
177
|
<!-- 明细表格主体 -->
|
|
178
178
|
<div class="flex-1 overflow-auto p-4">
|
|
179
|
-
<div class="rounded-
|
|
179
|
+
<div class="rounded-md border border-border overflow-hidden">
|
|
180
180
|
<table class="w-full text-xs text-left whitespace-nowrap">
|
|
181
181
|
<thead class="bg-muted/40 border-b border-border text-muted-foreground font-semibold sticky top-0">
|
|
182
182
|
<tr>
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
</span>
|
|
218
218
|
<button
|
|
219
219
|
type="button"
|
|
220
|
-
class="px-4 py-1.5 rounded-
|
|
220
|
+
class="px-4 py-1.5 rounded-md border border-border bg-background text-xs font-medium hover:bg-muted transition-colors cursor-pointer"
|
|
221
221
|
onclick={handleClose}
|
|
222
222
|
>
|
|
223
223
|
关闭
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
}
|
|
221
221
|
</script>
|
|
222
222
|
|
|
223
|
-
<div aria-busy={effectiveLoading} class={cn('rounded-
|
|
223
|
+
<div aria-busy={effectiveLoading} class={cn('rounded-md border border-border bg-card p-4 shadow-xs text-xs space-y-3', className)}>
|
|
224
224
|
<div class="flex items-center justify-between gap-2 pb-2 border-b border-border/60">
|
|
225
225
|
<div class="font-semibold text-foreground">
|
|
226
226
|
{i18n.t('pivot.title')} <span class="text-muted-foreground font-normal">({rowLabel} × {columnLabel})</span>
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
<div
|
|
69
69
|
class={cn(
|
|
70
|
-
'relative flex flex-col rounded-
|
|
70
|
+
'relative flex flex-col rounded-md border p-6 transition-all duration-200',
|
|
71
71
|
'bg-card text-card-foreground',
|
|
72
72
|
highlighted
|
|
73
73
|
? 'border-primary shadow-lg ring-1 ring-primary'
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
|
|
122
122
|
<!-- Detailed Feature Comparison Table (Optional) -->
|
|
123
123
|
{#if comparisonGroups.length > 0}
|
|
124
|
-
<div class="overflow-x-auto rounded-
|
|
124
|
+
<div class="overflow-x-auto rounded-md border border-border bg-card p-6 shadow-sm">
|
|
125
125
|
<div class="mb-6">
|
|
126
126
|
<h3 class="text-lg font-bold tracking-tight text-foreground">Feature Comparison</h3>
|
|
127
127
|
<p class="text-sm text-muted-foreground">Compare features across all subscription plans</p>
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
|
|
57
57
|
<div class={cn('space-y-4 text-xs', className)}>
|
|
58
58
|
<!-- Print Trigger Bar (Hidden during actual print) -->
|
|
59
|
-
<div class="flex items-center justify-between p-3 rounded-
|
|
59
|
+
<div class="flex items-center justify-between p-3 rounded-md border border-border bg-card shadow-xs print:hidden">
|
|
60
60
|
<div class="text-muted-foreground">
|
|
61
61
|
Document Ready: <strong class="text-foreground">{billNumber}</strong>
|
|
62
62
|
</div>
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
</div>
|
|
68
68
|
|
|
69
69
|
<!-- Printable A4 Paper Container -->
|
|
70
|
-
<div class="rounded-
|
|
70
|
+
<div class="rounded-md border border-border bg-card p-8 shadow-xs max-w-3xl mx-auto space-y-6 print:border-none print:shadow-none print:p-0 print:m-0">
|
|
71
71
|
<!-- Header -->
|
|
72
72
|
<div class="flex items-start justify-between border-b-2 border-primary/40 pb-4">
|
|
73
73
|
<div>
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { Printer, Stamp, FileText } from '@lucide/svelte';
|
|
4
|
+
import { useTranslation } from '@svadmin/core/i18n';
|
|
5
|
+
import { cn } from '../utils.js';
|
|
6
|
+
import { Button } from './ui/button/index.js';
|
|
7
|
+
import { usePrintExport } from './usePrintExport.svelte.js';
|
|
8
|
+
|
|
9
|
+
export interface ReportSignatureItem {
|
|
10
|
+
role: string;
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
date?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ReportMetadataItem {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string | number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface PrintableReportLayoutProps {
|
|
21
|
+
title: string;
|
|
22
|
+
subtitle?: string | undefined;
|
|
23
|
+
reportNo?: string | undefined;
|
|
24
|
+
companyName?: string | undefined;
|
|
25
|
+
paperSize?: ('a4' | 'a5' | 'letter') | undefined;
|
|
26
|
+
orientation?: ('portrait' | 'landscape') | undefined;
|
|
27
|
+
watermarkText?: string | undefined;
|
|
28
|
+
showPageNumbers?: boolean | undefined;
|
|
29
|
+
showStampArea?: boolean | undefined;
|
|
30
|
+
stampText?: string | undefined;
|
|
31
|
+
metadata?: ReportMetadataItem[] | undefined;
|
|
32
|
+
signatures?: ReportSignatureItem[] | undefined;
|
|
33
|
+
class?: string | undefined;
|
|
34
|
+
actions?: Snippet | undefined;
|
|
35
|
+
header?: Snippet | undefined;
|
|
36
|
+
footer?: Snippet | undefined;
|
|
37
|
+
children?: Snippet | undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let {
|
|
41
|
+
title,
|
|
42
|
+
subtitle,
|
|
43
|
+
reportNo,
|
|
44
|
+
companyName,
|
|
45
|
+
paperSize = 'a4',
|
|
46
|
+
orientation = 'portrait',
|
|
47
|
+
watermarkText,
|
|
48
|
+
showPageNumbers = true,
|
|
49
|
+
showStampArea = true,
|
|
50
|
+
stampText,
|
|
51
|
+
metadata = [],
|
|
52
|
+
signatures = [],
|
|
53
|
+
class: className = '',
|
|
54
|
+
actions,
|
|
55
|
+
header,
|
|
56
|
+
footer,
|
|
57
|
+
children,
|
|
58
|
+
}: PrintableReportLayoutProps = $props();
|
|
59
|
+
|
|
60
|
+
const i18n = useTranslation();
|
|
61
|
+
const chinese = $derived(i18n.locale.startsWith('zh'));
|
|
62
|
+
|
|
63
|
+
let reportRootRef = $state<HTMLElement | null>(null);
|
|
64
|
+
const printTool = usePrintExport();
|
|
65
|
+
|
|
66
|
+
function handleTriggerPrint() {
|
|
67
|
+
printTool.print(reportRootRef, {
|
|
68
|
+
filename: `${title}_${reportNo ?? Date.now()}`,
|
|
69
|
+
orientation,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const resolvedCompany = $derived(companyName ?? (chinese ? '企业运营管理平台' : 'Enterprise Operations Platform'));
|
|
74
|
+
const resolvedStampText = $derived(stampText ?? (chinese ? '业务审核专用章' : 'Official Approval Seal'));
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<div
|
|
78
|
+
bind:this={reportRootRef}
|
|
79
|
+
data-svadmin-component="PrintableReportLayout"
|
|
80
|
+
data-paper-size={paperSize}
|
|
81
|
+
data-orientation={orientation}
|
|
82
|
+
class={cn(
|
|
83
|
+
'relative w-full rounded-md border border-border bg-card text-card-foreground shadow-sm p-8 print:p-0 print:border-none print:shadow-none print:bg-transparent',
|
|
84
|
+
className,
|
|
85
|
+
)}
|
|
86
|
+
>
|
|
87
|
+
<!-- Screen-Only Actions Toolbar -->
|
|
88
|
+
<div class="no-print mb-6 flex items-center justify-between border-b border-border/70 pb-4">
|
|
89
|
+
<div class="flex items-center gap-2">
|
|
90
|
+
<FileText class="h-5 w-5 text-primary" />
|
|
91
|
+
<span class="text-sm font-semibold text-foreground">
|
|
92
|
+
{chinese ? '报表打印排版预览' : 'Printable Report Preview'}
|
|
93
|
+
</span>
|
|
94
|
+
<span class="rounded bg-muted px-2 py-0.5 text-xs font-mono text-muted-foreground uppercase">
|
|
95
|
+
{paperSize} {orientation}
|
|
96
|
+
</span>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="flex items-center gap-2">
|
|
100
|
+
{#if actions}
|
|
101
|
+
{@render actions()}
|
|
102
|
+
{/if}
|
|
103
|
+
<Button
|
|
104
|
+
type="button"
|
|
105
|
+
size="sm"
|
|
106
|
+
onclick={handleTriggerPrint}
|
|
107
|
+
disabled={printTool.isPrinting}
|
|
108
|
+
class="gap-1.5"
|
|
109
|
+
>
|
|
110
|
+
<Printer class="h-4 w-4" />
|
|
111
|
+
<span>{chinese ? '打印 / 导出 PDF' : 'Print / Export PDF'}</span>
|
|
112
|
+
</Button>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<!-- Printable Paper Canvas Container -->
|
|
117
|
+
<div class="relative print:w-full space-y-6">
|
|
118
|
+
<!-- Optional Watermark Overlay -->
|
|
119
|
+
{#if watermarkText}
|
|
120
|
+
<div
|
|
121
|
+
class="pointer-events-none absolute inset-0 flex items-center justify-center overflow-hidden opacity-5 select-none print:opacity-10 z-0"
|
|
122
|
+
aria-hidden="true"
|
|
123
|
+
>
|
|
124
|
+
<span class="rotate-[-25deg] text-6xl font-black uppercase tracking-widest text-foreground">
|
|
125
|
+
{watermarkText}
|
|
126
|
+
</span>
|
|
127
|
+
</div>
|
|
128
|
+
{/if}
|
|
129
|
+
|
|
130
|
+
<!-- Header Section -->
|
|
131
|
+
<header class="relative z-10 border-b-2 border-foreground/80 pb-4">
|
|
132
|
+
{#if header}
|
|
133
|
+
{@render header()}
|
|
134
|
+
{:else}
|
|
135
|
+
<div class="flex items-start justify-between">
|
|
136
|
+
<div>
|
|
137
|
+
<div class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
138
|
+
{resolvedCompany}
|
|
139
|
+
</div>
|
|
140
|
+
<h1 class="text-2xl font-bold tracking-tight text-foreground mt-1">
|
|
141
|
+
{title}
|
|
142
|
+
</h1>
|
|
143
|
+
{#if subtitle}
|
|
144
|
+
<p class="text-xs text-muted-foreground mt-1">{subtitle}</p>
|
|
145
|
+
{/if}
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
{#if reportNo}
|
|
149
|
+
<div class="text-right">
|
|
150
|
+
<span class="block text-xs font-medium text-muted-foreground uppercase">
|
|
151
|
+
{chinese ? '单据编号' : 'Document No.'}
|
|
152
|
+
</span>
|
|
153
|
+
<span class="font-mono text-sm font-bold text-foreground">{reportNo}</span>
|
|
154
|
+
</div>
|
|
155
|
+
{/if}
|
|
156
|
+
</div>
|
|
157
|
+
{/if}
|
|
158
|
+
|
|
159
|
+
<!-- Metadata Badges Strip -->
|
|
160
|
+
{#if metadata.length > 0}
|
|
161
|
+
<div class="mt-4 grid grid-cols-2 sm:grid-cols-4 gap-3 bg-muted/40 p-3 rounded-lg border border-border/60 text-xs">
|
|
162
|
+
{#each metadata as item (item.label)}
|
|
163
|
+
<div>
|
|
164
|
+
<span class="block text-muted-foreground text-xs">{item.label}</span>
|
|
165
|
+
<span class="font-semibold text-foreground mt-0.5">{item.value}</span>
|
|
166
|
+
</div>
|
|
167
|
+
{/each}
|
|
168
|
+
</div>
|
|
169
|
+
{/if}
|
|
170
|
+
</header>
|
|
171
|
+
|
|
172
|
+
<!-- Main Content Body (Tables, grids, descriptions) -->
|
|
173
|
+
<main class="relative z-10 min-h-64 py-2">
|
|
174
|
+
{#if children}
|
|
175
|
+
{@render children()}
|
|
176
|
+
{/if}
|
|
177
|
+
</main>
|
|
178
|
+
|
|
179
|
+
<!-- Signature and Seal Section -->
|
|
180
|
+
{#if signatures.length > 0 || showStampArea}
|
|
181
|
+
<section class="page-break-avoid relative z-10 border-t border-border/80 pt-6 mt-8">
|
|
182
|
+
<div class="flex items-end justify-between gap-6">
|
|
183
|
+
<!-- Signatures Columns -->
|
|
184
|
+
<div class="grid grid-cols-2 sm:grid-cols-3 gap-6 flex-1">
|
|
185
|
+
{#each signatures as sig (sig.role)}
|
|
186
|
+
<div class="space-y-4">
|
|
187
|
+
<div class="text-xs font-semibold text-foreground">{sig.role}:</div>
|
|
188
|
+
<div class="border-b border-foreground/40 pb-1">
|
|
189
|
+
<span class="font-serif italic text-sm">{sig.name || '_______________'}</span>
|
|
190
|
+
</div>
|
|
191
|
+
<div class="text-xs text-muted-foreground font-mono">
|
|
192
|
+
{sig.date || (chinese ? '日期: ____年__月__日' : 'Date: YYYY-MM-DD')}
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
{/each}
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<!-- Electronic Seal / Stamp Area -->
|
|
199
|
+
{#if showStampArea}
|
|
200
|
+
<div class="relative flex h-28 w-28 shrink-0 items-center justify-center rounded-full border-2 border-dashed border-destructive/60 bg-destructive/5 text-destructive select-none p-2 text-center rotate-[-8deg]">
|
|
201
|
+
<div class="space-y-0.5">
|
|
202
|
+
<Stamp class="h-5 w-5 mx-auto opacity-70" />
|
|
203
|
+
<div class="text-xs font-bold leading-tight uppercase tracking-tight">
|
|
204
|
+
{resolvedStampText}
|
|
205
|
+
</div>
|
|
206
|
+
<div class="text-[8px] font-mono opacity-80">
|
|
207
|
+
SEAL VALIDATED
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
{/if}
|
|
212
|
+
</div>
|
|
213
|
+
</section>
|
|
214
|
+
{/if}
|
|
215
|
+
|
|
216
|
+
<!-- Page Numbering & Footer -->
|
|
217
|
+
<footer class="relative z-10 flex items-center justify-between border-t border-border/50 pt-3 text-xs text-muted-foreground">
|
|
218
|
+
{#if footer}
|
|
219
|
+
{@render footer()}
|
|
220
|
+
{:else}
|
|
221
|
+
<span>{chinese ? '机密文件 · 请妥善保管' : 'Confidential document - preserve carefully'}</span>
|
|
222
|
+
{#if showPageNumbers}
|
|
223
|
+
<span class="font-mono">{chinese ? '第 1 页 / 共 1 页' : 'Page 1 of 1'}</span>
|
|
224
|
+
{/if}
|
|
225
|
+
{/if}
|
|
226
|
+
</footer>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
<style>
|
|
231
|
+
@media print {
|
|
232
|
+
:global(body) {
|
|
233
|
+
background: white !important;
|
|
234
|
+
color: black !important;
|
|
235
|
+
margin: 0 !important;
|
|
236
|
+
padding: 0 !important;
|
|
237
|
+
}
|
|
238
|
+
.no-print {
|
|
239
|
+
display: none !important;
|
|
240
|
+
}
|
|
241
|
+
.page-break-avoid {
|
|
242
|
+
page-break-inside: avoid;
|
|
243
|
+
break-inside: avoid;
|
|
244
|
+
}
|
|
245
|
+
:global(table) {
|
|
246
|
+
page-break-inside: auto;
|
|
247
|
+
}
|
|
248
|
+
:global(tr) {
|
|
249
|
+
page-break-inside: avoid;
|
|
250
|
+
page-break-after: auto;
|
|
251
|
+
}
|
|
252
|
+
:global(thead) {
|
|
253
|
+
display: table-header-group;
|
|
254
|
+
}
|
|
255
|
+
:global(tfoot) {
|
|
256
|
+
display: table-footer-group;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export interface ReportSignatureItem {
|
|
3
|
+
role: string;
|
|
4
|
+
name?: string | undefined;
|
|
5
|
+
date?: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface ReportMetadataItem {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string | number;
|
|
10
|
+
}
|
|
11
|
+
export interface PrintableReportLayoutProps {
|
|
12
|
+
title: string;
|
|
13
|
+
subtitle?: string | undefined;
|
|
14
|
+
reportNo?: string | undefined;
|
|
15
|
+
companyName?: string | undefined;
|
|
16
|
+
paperSize?: ('a4' | 'a5' | 'letter') | undefined;
|
|
17
|
+
orientation?: ('portrait' | 'landscape') | undefined;
|
|
18
|
+
watermarkText?: string | undefined;
|
|
19
|
+
showPageNumbers?: boolean | undefined;
|
|
20
|
+
showStampArea?: boolean | undefined;
|
|
21
|
+
stampText?: string | undefined;
|
|
22
|
+
metadata?: ReportMetadataItem[] | undefined;
|
|
23
|
+
signatures?: ReportSignatureItem[] | undefined;
|
|
24
|
+
class?: string | undefined;
|
|
25
|
+
actions?: Snippet | undefined;
|
|
26
|
+
header?: Snippet | undefined;
|
|
27
|
+
footer?: Snippet | undefined;
|
|
28
|
+
children?: Snippet | undefined;
|
|
29
|
+
}
|
|
30
|
+
declare const PrintableReportLayout: import("svelte").Component<PrintableReportLayoutProps, {}, "">;
|
|
31
|
+
type PrintableReportLayout = ReturnType<typeof PrintableReportLayout>;
|
|
32
|
+
export default PrintableReportLayout;
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
style={`grid-template-columns: repeat(${statistic}, minmax(0, 1fr));`}
|
|
49
49
|
>
|
|
50
50
|
{#each Array(statistic) as _, idx (idx)}
|
|
51
|
-
<div class="rounded-
|
|
51
|
+
<div class="rounded-md border border-border bg-card p-4 space-y-3">
|
|
52
52
|
<div class="flex items-center justify-between">
|
|
53
53
|
<div class="h-3.5 w-20 rounded-[4px] bg-muted"></div>
|
|
54
54
|
<div class="h-4 w-4 rounded-[4px] bg-muted/70"></div>
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
|
|
63
63
|
<!-- Table Skeleton -->
|
|
64
64
|
{#if type === 'table'}
|
|
65
|
-
<div class="rounded-
|
|
65
|
+
<div class="rounded-md border border-border bg-card overflow-hidden p-4 space-y-4">
|
|
66
66
|
<!-- Table Toolbar -->
|
|
67
67
|
<div class="flex items-center justify-between gap-4 pb-2">
|
|
68
68
|
<div class="h-8 w-48 rounded-[4px] bg-muted"></div>
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
|
|
114
114
|
<!-- Descriptions Skeleton -->
|
|
115
115
|
{:else if type === 'descriptions'}
|
|
116
|
-
<div class="rounded-
|
|
116
|
+
<div class="rounded-md border border-border bg-card p-5 space-y-5">
|
|
117
117
|
<!-- Title Bar -->
|
|
118
118
|
<div class="flex items-center justify-between border-b border-border pb-3">
|
|
119
119
|
<div class="h-5 w-36 rounded-[4px] bg-muted"></div>
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
|
|
140
140
|
<!-- Form Skeleton -->
|
|
141
141
|
{:else if type === 'form'}
|
|
142
|
-
<div class="rounded-
|
|
142
|
+
<div class="rounded-md border border-border bg-card p-6 space-y-5 max-w-2xl">
|
|
143
143
|
{#each Array(rows) as _, rIdx (rIdx)}
|
|
144
144
|
<div class="space-y-2">
|
|
145
145
|
<div class="h-3.5 w-24 rounded-[4px] bg-muted"></div>
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
|
|
156
156
|
<!-- List Skeleton -->
|
|
157
157
|
{:else if type === 'list'}
|
|
158
|
-
<div class="rounded-
|
|
158
|
+
<div class="rounded-md border border-border bg-card divide-y divide-border/60">
|
|
159
159
|
{#each Array(rows) as _, rIdx (rIdx)}
|
|
160
160
|
<div class="flex items-start gap-4 p-4">
|
|
161
161
|
{#if avatar}
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
|
|
173
173
|
<!-- Result Skeleton -->
|
|
174
174
|
{:else if type === 'result'}
|
|
175
|
-
<div class="rounded-
|
|
175
|
+
<div class="rounded-md border border-border bg-card p-12 flex flex-col items-center justify-center text-center space-y-4">
|
|
176
176
|
<div class="h-18 w-18 rounded-full bg-muted/80"></div>
|
|
177
177
|
<div class="h-6 w-48 rounded-[4px] bg-muted"></div>
|
|
178
178
|
<div class="h-3.5 w-72 rounded-[4px] bg-muted/70"></div>
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
'flex flex-col items-center justify-center text-center',
|
|
111
111
|
layout === 'page'
|
|
112
112
|
? 'min-h-[50vh] py-16 px-4 w-full'
|
|
113
|
-
: 'rounded-
|
|
113
|
+
: 'rounded-md border border-border bg-card p-8 md:p-12 shadow-xs w-full',
|
|
114
114
|
className
|
|
115
115
|
)}
|
|
116
116
|
>
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
|
|
160
160
|
<!-- Related Business Information Slot -->
|
|
161
161
|
{#if children}
|
|
162
|
-
<div class="mt-8 w-full max-w-xl text-left rounded-
|
|
162
|
+
<div class="mt-8 w-full max-w-xl text-left rounded-md border border-border/80 bg-muted/20 p-5 text-sm">
|
|
163
163
|
{@render children()}
|
|
164
164
|
</div>
|
|
165
165
|
{/if}
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
>
|
|
154
154
|
<div
|
|
155
155
|
class={cn(
|
|
156
|
-
'relative w-full max-w-lg rounded-
|
|
156
|
+
'relative w-full max-w-lg rounded-md border bg-background shadow-[var(--shadow-overlay)] transition-all duration-200 overflow-hidden',
|
|
157
157
|
danger ? 'border-destructive/30' : 'border-border',
|
|
158
158
|
className
|
|
159
159
|
)}
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
<div class="flex items-center gap-3">
|
|
164
164
|
<div
|
|
165
165
|
class={cn(
|
|
166
|
-
'flex h-10 w-10 items-center justify-center rounded-
|
|
166
|
+
'flex h-10 w-10 items-center justify-center rounded-sm',
|
|
167
167
|
danger ? 'bg-destructive/10 text-destructive' : 'bg-primary/10 text-primary'
|
|
168
168
|
)}
|
|
169
169
|
>
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
<div class="p-5 space-y-4">
|
|
198
198
|
<!-- Impact Assessment Section -->
|
|
199
199
|
{#if impactList && impactList.length > 0}
|
|
200
|
-
<div class="rounded-
|
|
200
|
+
<div class="rounded-md border border-border/80 bg-muted/30 p-3.5 space-y-2.5">
|
|
201
201
|
<div class="flex items-center gap-2 text-xs font-medium text-foreground">
|
|
202
202
|
<AlertCircle class="h-3.5 w-3.5 text-destructive" />
|
|
203
203
|
<span>{t('safeDelete.impactTitle', '潜在影响面评估')}</span>
|
|
@@ -208,11 +208,11 @@
|
|
|
208
208
|
<div class="truncate mr-2">
|
|
209
209
|
<span class="font-medium text-foreground">{item.label}</span>
|
|
210
210
|
{#if item.description}
|
|
211
|
-
<p class="text-
|
|
211
|
+
<p class="text-xs text-muted-foreground truncate">{item.description}</p>
|
|
212
212
|
{/if}
|
|
213
213
|
</div>
|
|
214
214
|
{#if item.count !== undefined}
|
|
215
|
-
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-
|
|
215
|
+
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-destructive/10 text-destructive">
|
|
216
216
|
{item.count}
|
|
217
217
|
</span>
|
|
218
218
|
{/if}
|