@svadmin/ui 0.130.0 → 0.131.1

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.
Files changed (81) hide show
  1. package/dist/app.css +318 -0
  2. package/dist/app.theme.css +318 -0
  3. package/dist/components/AboutSettings.svelte +1 -1
  4. package/dist/components/AccessRevocationMatrix.svelte +425 -0
  5. package/dist/components/AccessRevocationMatrix.svelte.d.ts +27 -0
  6. package/dist/components/AudioVisualInspector.svelte +458 -0
  7. package/dist/components/AudioVisualInspector.svelte.d.ts +53 -0
  8. package/dist/components/AuditSnapshotCapture.svelte +328 -0
  9. package/dist/components/AuditSnapshotCapture.svelte.d.ts +28 -0
  10. package/dist/components/CannedResponsePicker.svelte +257 -0
  11. package/dist/components/CannedResponsePicker.svelte.d.ts +22 -0
  12. package/dist/components/ContentModerationCenter.svelte +166 -0
  13. package/dist/components/ContentModerationCenter.svelte.d.ts +11 -0
  14. package/dist/components/ContractClauseDiffViewer.svelte +566 -0
  15. package/dist/components/ContractClauseDiffViewer.svelte.d.ts +53 -0
  16. package/dist/components/DataImportPipeline.svelte +577 -0
  17. package/dist/components/DataImportPipeline.svelte.d.ts +35 -0
  18. package/dist/components/DataRetentionPolicyEditor.svelte +455 -0
  19. package/dist/components/DataRetentionPolicyEditor.svelte.d.ts +10 -0
  20. package/dist/components/ElectronicSealInspector.svelte +450 -0
  21. package/dist/components/ElectronicSealInspector.svelte.d.ts +72 -0
  22. package/dist/components/EmployeeOffboardingAuditor.svelte +405 -0
  23. package/dist/components/EmployeeOffboardingAuditor.svelte.d.ts +39 -0
  24. package/dist/components/FieldMappingBuilder.svelte +393 -0
  25. package/dist/components/FieldMappingBuilder.svelte.d.ts +39 -0
  26. package/dist/components/FilterBuilder.svelte +50 -34
  27. package/dist/components/FilterBuilder.svelte.d.ts +2 -0
  28. package/dist/components/GatewayRouteEditor.svelte +493 -0
  29. package/dist/components/GatewayRouteEditor.svelte.d.ts +34 -0
  30. package/dist/components/I18nStudio.svelte +635 -0
  31. package/dist/components/I18nStudio.svelte.d.ts +23 -0
  32. package/dist/components/IpAccessRuleEditor.svelte +290 -0
  33. package/dist/components/IpAccessRuleEditor.svelte.d.ts +19 -0
  34. package/dist/components/IpWhitelistDrawer.svelte +94 -0
  35. package/dist/components/IpWhitelistDrawer.svelte.d.ts +10 -0
  36. package/dist/components/MediaAuthenticityAuditCard.svelte +357 -0
  37. package/dist/components/MediaAuthenticityAuditCard.svelte.d.ts +64 -0
  38. package/dist/components/PrintDocument.svelte +95 -0
  39. package/dist/components/PrintDocument.svelte.d.ts +10 -0
  40. package/dist/components/PrintPreviewModal.svelte +52 -0
  41. package/dist/components/PrintPreviewModal.svelte.d.ts +11 -0
  42. package/dist/components/PrintTemplateDesigner.svelte +280 -0
  43. package/dist/components/PrintTemplateDesigner.svelte.d.ts +11 -0
  44. package/dist/components/RateLimitPolicyPanel.svelte +369 -0
  45. package/dist/components/RateLimitPolicyPanel.svelte.d.ts +29 -0
  46. package/dist/components/SensitiveWordAuditor.svelte +368 -0
  47. package/dist/components/SensitiveWordAuditor.svelte.d.ts +9 -0
  48. package/dist/components/ServiceDeskTicketCard.svelte +297 -0
  49. package/dist/components/ServiceDeskTicketCard.svelte.d.ts +52 -0
  50. package/dist/components/ShiftScheduler.svelte +490 -0
  51. package/dist/components/ShiftScheduler.svelte.d.ts +50 -0
  52. package/dist/components/SslCertificateMonitorCard.svelte +309 -0
  53. package/dist/components/SslCertificateMonitorCard.svelte.d.ts +30 -0
  54. package/dist/components/SsoConnectionStudio.svelte +784 -0
  55. package/dist/components/SsoConnectionStudio.svelte.d.ts +44 -0
  56. package/dist/components/SsoSpMetadataPanel.svelte +44 -0
  57. package/dist/components/SsoSpMetadataPanel.svelte.d.ts +8 -0
  58. package/dist/components/StepUpAuthModal.svelte +448 -0
  59. package/dist/components/StepUpAuthModal.svelte.d.ts +26 -0
  60. package/dist/components/TrafficTopologyInspector.svelte +361 -0
  61. package/dist/components/TrafficTopologyInspector.svelte.d.ts +43 -0
  62. package/dist/components/enterprise/filter-tree.js +1 -1
  63. package/dist/components/filter-i18n.d.ts +61 -0
  64. package/dist/components/filter-i18n.js +114 -0
  65. package/dist/components/ip-access-rules.d.ts +24 -0
  66. package/dist/components/ip-access-rules.js +110 -0
  67. package/dist/components/moderation-utils.d.ts +45 -0
  68. package/dist/components/moderation-utils.js +74 -0
  69. package/dist/components/print-document.d.ts +3 -0
  70. package/dist/components/print-document.js +65 -0
  71. package/dist/components/print-utils.d.ts +44 -0
  72. package/dist/components/print-utils.js +68 -0
  73. package/dist/components/retention-utils.d.ts +31 -0
  74. package/dist/components/retention-utils.js +38 -0
  75. package/dist/components/sso-connection-presets.d.ts +2 -0
  76. package/dist/components/sso-connection-presets.js +59 -0
  77. package/dist/components/ui/sheet/sheet.svelte +3 -1
  78. package/dist/components/ui/sheet/sheet.svelte.d.ts +1 -0
  79. package/dist/index.d.ts +29 -0
  80. package/dist/index.js +44 -0
  81. package/package.json +5 -4
@@ -0,0 +1,450 @@
1
+ <script lang="ts">
2
+ import { untrack } from 'svelte';
3
+ import type { Snippet } from 'svelte';
4
+ import {
5
+ ShieldCheck,
6
+ ShieldAlert,
7
+ ShieldX,
8
+ Clock,
9
+ Building2,
10
+ Award,
11
+ ChevronDown,
12
+ ChevronUp,
13
+ Download,
14
+ RefreshCw
15
+ } from '@lucide/svelte';
16
+ import { cn } from '../utils.js';
17
+
18
+ export type SealValidationStatus = 'valid' | 'expired' | 'revoked' | 'tampered' | 'untrusted';
19
+ export type SealType = 'official' | 'contract' | 'finance' | 'legal_person' | 'custom';
20
+
21
+ export interface SealCertificateInfo {
22
+ /** 证书颁发 CA 机构,如 "中国金融认证中心 (CFCA)" */
23
+ issuer: string;
24
+ /** 证书持有人主体名称 */
25
+ subject: string;
26
+ /** 证书序列号 */
27
+ serialNumber: string;
28
+ /** 签名与加密算法,如 "SM2-with-SM3" 或 "RSA-SHA256" */
29
+ algorithm: string;
30
+ /** 有效期开始时间 */
31
+ validFrom: string;
32
+ /** 有效期截止时间 */
33
+ validTo: string;
34
+ /** SHA-256 证书指纹 */
35
+ fingerprintSha256: string;
36
+ /** 密钥用途 */
37
+ keyUsage?: string;
38
+ }
39
+
40
+ export interface SealTimestampInfo {
41
+ /** 时间戳服务机构,如 "国家授时中心 TSA" */
42
+ tsaName: string;
43
+ /** 签署存证确切时间,如 "2024-11-14 15:32:08 CST" */
44
+ stampedAt: string;
45
+ /** 时间戳令牌哈希 */
46
+ timestampTokenId: string;
47
+ /** 时间戳是否校验通过 */
48
+ verified: boolean;
49
+ }
50
+
51
+ export interface SealVerificationLog {
52
+ id: string;
53
+ step: string;
54
+ status: 'pass' | 'fail' | 'warn';
55
+ message: string;
56
+ checkedAt: string;
57
+ }
58
+
59
+ export interface ElectronicSealInfo {
60
+ id: string;
61
+ sealName: string;
62
+ sealType: SealType;
63
+ enterpriseName: string;
64
+ creditCode: string;
65
+ sealCode?: string;
66
+ signerName?: string;
67
+ signerDepartment?: string;
68
+ sealGraphicUrl?: string;
69
+ status: SealValidationStatus;
70
+ documentHashMatch: boolean;
71
+ certificate: SealCertificateInfo;
72
+ timestamp: SealTimestampInfo;
73
+ auditLogs?: SealVerificationLog[];
74
+ }
75
+
76
+ export interface ElectronicSealInspectorProps {
77
+ /** 电子印章与防伪校验数据 */
78
+ seal: ElectronicSealInfo;
79
+ /** 是否可折叠详情卡片 */
80
+ collapsible?: boolean;
81
+ /** 默认是否展开证书与审计日志 */
82
+ defaultExpanded?: boolean;
83
+ /** 验真报告导出回调 */
84
+ onExportReport?: (seal: ElectronicSealInfo) => void;
85
+ /** 重新触发验真回调 */
86
+ onRevalidate?: (sealId: string) => void | Promise<void>;
87
+ /** 自定义操作区插槽 */
88
+ actions?: Snippet | undefined;
89
+ class?: string | undefined;
90
+ }
91
+
92
+ let {
93
+ seal,
94
+ collapsible = true,
95
+ defaultExpanded = true,
96
+ onExportReport,
97
+ onRevalidate,
98
+ actions,
99
+ class: className = ''
100
+ }: ElectronicSealInspectorProps = $props();
101
+
102
+ let isExpanded = $state(untrack(() => defaultExpanded));
103
+ let isRevalidating = $state(false);
104
+ let revalidationError = $state('');
105
+ const sealTextPathId = $props.id();
106
+
107
+ async function handleRevalidate() {
108
+ if (isRevalidating || !onRevalidate) return;
109
+ isRevalidating = true;
110
+ revalidationError = '';
111
+ try {
112
+ await onRevalidate(seal.id);
113
+ } catch {
114
+ revalidationError = '验真失败,请重试。';
115
+ } finally {
116
+ isRevalidating = false;
117
+ }
118
+ }
119
+
120
+ function getStatusConfig(status: SealValidationStatus, hashMatch: boolean, timestampVerified: boolean) {
121
+ if (!hashMatch || status === 'tampered') {
122
+ return {
123
+ label: '文档已被篡改',
124
+ tone: 'danger',
125
+ desc: '数字签名与文档哈希比对不一致,正文或附件在盖章后发生变动,印章失效。',
126
+ icon: ShieldAlert,
127
+ badgeClass: 'bg-destructive/15 text-destructive border-destructive/30',
128
+ cardBorder: 'border-destructive/30'
129
+ };
130
+ }
131
+ switch (status) {
132
+ case 'valid':
133
+ if (!timestampVerified) {
134
+ return {
135
+ label: '时间戳校验未通过',
136
+ tone: 'warning',
137
+ desc: '文档哈希一致,但时间戳尚未通过可信校验,请重新验真。',
138
+ icon: ShieldAlert,
139
+ badgeClass: 'bg-warning/15 text-warning border-warning/30',
140
+ cardBorder: 'border-warning/30'
141
+ };
142
+ }
143
+ return {
144
+ label: '验真通过 · 真实有效',
145
+ tone: 'success',
146
+ desc: 'CA 机构数字证书有效,时间戳存证可信,签名文档哈希一致且未被篡改。',
147
+ icon: ShieldCheck,
148
+ badgeClass: 'bg-success/15 text-success border-success/30',
149
+ cardBorder: 'border-success/30'
150
+ };
151
+ case 'expired':
152
+ return {
153
+ label: '证书已过期',
154
+ tone: 'warning',
155
+ desc: '数字证书已超出有效截止时间,盖章当时的时间戳需进一步核验有效性。',
156
+ icon: ShieldAlert,
157
+ badgeClass: 'bg-warning/15 text-warning border-warning/30',
158
+ cardBorder: 'border-warning/30'
159
+ };
160
+ case 'revoked':
161
+ return {
162
+ label: '证书已被吊销',
163
+ tone: 'danger',
164
+ desc: '颁发 CA 机构 CRL 吊销列表中查询到该证书已被撤销,印章失效。',
165
+ icon: ShieldX,
166
+ badgeClass: 'bg-destructive/15 text-destructive border-destructive/30',
167
+ cardBorder: 'border-destructive/30'
168
+ };
169
+ default:
170
+ return {
171
+ label: '不受信任机构',
172
+ tone: 'warning',
173
+ desc: '根证书颁发机构不在权威信任链清单中,请核对自签名或第三方 CA。',
174
+ icon: ShieldAlert,
175
+ badgeClass: 'bg-warning/15 text-warning border-warning/30',
176
+ cardBorder: 'border-warning/30'
177
+ };
178
+ }
179
+ }
180
+
181
+ function getSealTypeLabel(type: SealType) {
182
+ switch (type) {
183
+ case 'official':
184
+ return '企业公章 / 法定名称章';
185
+ case 'contract':
186
+ return '合同专用章';
187
+ case 'finance':
188
+ return '财务专用章';
189
+ case 'legal_person':
190
+ return '法定代表人名章';
191
+ default:
192
+ return '业务专用电子印章';
193
+ }
194
+ }
195
+
196
+ const statusConfig = $derived(getStatusConfig(seal.status, seal.documentHashMatch, seal.timestamp.verified));
197
+ </script>
198
+
199
+ <div
200
+ class={cn(
201
+ 'flex flex-col rounded-xl border bg-card text-card-foreground shadow-sm transition-all',
202
+ statusConfig.cardBorder,
203
+ className
204
+ )}
205
+ data-svadmin-component="ElectronicSealInspector"
206
+ >
207
+ <!-- 主卡片头部 -->
208
+ <div class="flex flex-wrap items-start justify-between gap-4 p-5">
209
+ <div class="flex items-start gap-4">
210
+ <!-- 纯 SVG 矢量电子印章预览模拟器 -->
211
+ <div class="relative flex h-24 w-24 shrink-0 items-center justify-center rounded-xl border border-destructive/20 bg-destructive/5 p-2">
212
+ <svg viewBox="0 0 100 100" class="h-full w-full text-destructive select-none">
213
+ <!-- 外圆圈 -->
214
+ <circle cx="50" cy="50" r="46" fill="none" stroke="currentColor" stroke-width="2.5" opacity="0.85" />
215
+ <!-- 内同心细圈 -->
216
+ <circle cx="50" cy="50" r="43" fill="none" stroke="currentColor" stroke-width="0.8" opacity="0.6" />
217
+ <!-- 中心五角星 -->
218
+ <polygon
219
+ points="50,28 56,42 70,42 59,51 63,65 50,56 37,65 41,51 30,42 44,42"
220
+ fill="currentColor"
221
+ opacity="0.9"
222
+ />
223
+ <!-- 底部横排文字 -->
224
+ <text
225
+ x="50"
226
+ y="76"
227
+ text-anchor="middle"
228
+ font-size="7"
229
+ font-weight="bold"
230
+ fill="currentColor"
231
+ letter-spacing="0.5"
232
+ >
233
+ {getSealTypeLabel(seal.sealType).slice(0, 5)}
234
+ </text>
235
+ <!-- 环形企业名称路径 -->
236
+ <path id={sealTextPathId} d="M 12,50 A 38,38 0 1,1 88,50" fill="none" />
237
+ <text font-size="6" fill="currentColor" font-weight="600" opacity="0.85">
238
+ <textPath href={`#${sealTextPathId}`} startOffset="50%" text-anchor="middle">
239
+ {seal.enterpriseName}
240
+ </textPath>
241
+ </text>
242
+ </svg>
243
+
244
+ <!-- 角标防伪状态徽标 -->
245
+ <div class="absolute -bottom-1 -right-1 rounded-full bg-background p-0.5 shadow-xs">
246
+ {#if seal.status === 'valid' && seal.documentHashMatch && seal.timestamp.verified}
247
+ <ShieldCheck class="h-5 w-5 text-success" />
248
+ {:else}
249
+ <ShieldAlert class="h-5 w-5 text-destructive" />
250
+ {/if}
251
+ </div>
252
+ </div>
253
+
254
+ <!-- 印章名称与基础信息 -->
255
+ <div class="flex flex-col gap-1.5">
256
+ <div class="flex flex-wrap items-center gap-2">
257
+ <h3 class="text-base font-bold text-foreground">{seal.sealName}</h3>
258
+ <span class={cn('rounded border px-2 py-0.5 text-xs font-semibold', statusConfig.badgeClass)}>
259
+ {statusConfig.label}
260
+ </span>
261
+ <span class="rounded bg-muted px-2 py-0.5 text-xs text-muted-foreground">
262
+ {getSealTypeLabel(seal.sealType)}
263
+ </span>
264
+ </div>
265
+
266
+ <p class="text-xs text-muted-foreground max-w-xl leading-relaxed">
267
+ {statusConfig.desc}
268
+ </p>
269
+
270
+ <!-- 关键元数据小胶囊 -->
271
+ <div class="flex flex-wrap items-center gap-3 pt-1 text-xs text-muted-foreground">
272
+ <span class="flex items-center gap-1">
273
+ <Building2 class="h-3.5 w-3.5" />
274
+ {seal.enterpriseName}
275
+ </span>
276
+ <span>统一信用代码:<code class="font-mono text-foreground">{seal.creditCode}</code></span>
277
+ {#if seal.sealCode}
278
+ <span>印章防伪编码:<code class="font-mono text-foreground">{seal.sealCode}</code></span>
279
+ {/if}
280
+ </div>
281
+ </div>
282
+ </div>
283
+
284
+ <!-- 右上角快捷操作 -->
285
+ <div class="flex items-center gap-2">
286
+ <button
287
+ type="button"
288
+ class="flex items-center gap-1 rounded-lg border border-border bg-background px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-50"
289
+ disabled={isRevalidating || !onRevalidate}
290
+ onclick={handleRevalidate}
291
+ title="向 CA 与时间戳服务器重新发起验真"
292
+ >
293
+ <RefreshCw class={cn('h-3.5 w-3.5', isRevalidating && 'animate-spin text-primary')} />
294
+ 重新验真
295
+ </button>
296
+
297
+ {#if onExportReport}
298
+ <button
299
+ type="button"
300
+ class="flex items-center gap-1 rounded-lg border border-border bg-background px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-muted"
301
+ onclick={() => onExportReport(seal)}
302
+ title="导出防伪验真报告 PDF/存证凭据"
303
+ >
304
+ <Download class="h-3.5 w-3.5" />
305
+ 验真凭据
306
+ </button>
307
+ {/if}
308
+
309
+ {#if actions}
310
+ {@render actions()}
311
+ {/if}
312
+
313
+ {#if collapsible}
314
+ <button
315
+ type="button"
316
+ class="rounded-lg p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground"
317
+ onclick={() => (isExpanded = !isExpanded)}
318
+ aria-label={isExpanded ? '收起详情' : '展开详情'}
319
+ >
320
+ {#if isExpanded}
321
+ <ChevronUp class="h-4 w-4" />
322
+ {:else}
323
+ <ChevronDown class="h-4 w-4" />
324
+ {/if}
325
+ </button>
326
+ {/if}
327
+ </div>
328
+ </div>
329
+
330
+ {#if revalidationError}
331
+ <p role="alert" class="px-5 pb-3 text-xs text-destructive">{revalidationError}</p>
332
+ {/if}
333
+
334
+ <!-- 可折叠详细凭证区 -->
335
+ {#if isExpanded}
336
+ <div class="flex flex-col divide-y divide-border border-t border-border bg-muted/20 text-xs">
337
+ <!-- 双卡片分栏:CA 数字证书 + 可信时间戳 -->
338
+ <div class="grid grid-cols-1 gap-4 p-5 md:grid-cols-2">
339
+ <!-- CA 证书详情卡片 -->
340
+ <div class="flex flex-col gap-2.5 rounded-lg border border-border bg-card p-4">
341
+ <div class="flex items-center justify-between border-b border-border pb-2">
342
+ <span class="flex items-center gap-1.5 font-semibold text-foreground">
343
+ <Award class="h-4 w-4 text-primary" />
344
+ CA 权威机构数字证书
345
+ </span>
346
+ <span class="rounded bg-primary/10 text-primary px-1.5 py-0.2 text-[10px] font-mono">
347
+ {seal.certificate.algorithm}
348
+ </span>
349
+ </div>
350
+
351
+ <div class="grid grid-cols-1 gap-2 text-muted-foreground">
352
+ <div class="flex justify-between">
353
+ <span>颁发机构 (Issuer):</span>
354
+ <strong class="text-foreground">{seal.certificate.issuer}</strong>
355
+ </div>
356
+ <div class="flex justify-between">
357
+ <span>证书使用者 (Subject):</span>
358
+ <span class="text-foreground">{seal.certificate.subject}</span>
359
+ </div>
360
+ <div class="flex justify-between">
361
+ <span>证书序列号:</span>
362
+ <code class="font-mono text-foreground text-[11px]">{seal.certificate.serialNumber}</code>
363
+ </div>
364
+ <div class="flex justify-between">
365
+ <span>有效期限:</span>
366
+ <span class="text-foreground">{seal.certificate.validFrom} 至 {seal.certificate.validTo}</span>
367
+ </div>
368
+ <div class="flex flex-col gap-0.5 pt-1">
369
+ <span>SHA-256 指纹:</span>
370
+ <code class="break-all rounded bg-muted p-1 font-mono text-[10px] text-foreground">
371
+ {seal.certificate.fingerprintSha256}
372
+ </code>
373
+ </div>
374
+ </div>
375
+ </div>
376
+
377
+ <!-- TSA 可信时间戳卡片 -->
378
+ <div class="flex flex-col gap-2.5 rounded-lg border border-border bg-card p-4">
379
+ <div class="flex items-center justify-between border-b border-border pb-2">
380
+ <span class="flex items-center gap-1.5 font-semibold text-foreground">
381
+ <Clock class="h-4 w-4 text-success" />
382
+ 权威可信时间戳 (TSA)
383
+ </span>
384
+ <span class={cn('rounded px-1.5 py-0.2 text-[10px] font-medium border',
385
+ seal.timestamp.verified
386
+ ? 'bg-success/10 text-success border-success/20'
387
+ : 'bg-destructive/10 text-destructive border-destructive/20'
388
+ )}>
389
+ {seal.timestamp.verified ? '时间戳验真有效' : '时间戳无效'}
390
+ </span>
391
+ </div>
392
+
393
+ <div class="grid grid-cols-1 gap-2 text-muted-foreground">
394
+ <div class="flex justify-between">
395
+ <span>授时机构:</span>
396
+ <strong class="text-foreground">{seal.timestamp.tsaName}</strong>
397
+ </div>
398
+ <div class="flex justify-between">
399
+ <span>盖章存证时间:</span>
400
+ <span class="font-mono text-foreground">{seal.timestamp.stampedAt}</span>
401
+ </div>
402
+ {#if seal.signerName}
403
+ <div class="flex justify-between">
404
+ <span>经办签章人:</span>
405
+ <span class="text-foreground">{seal.signerName} {seal.signerDepartment ? `(${seal.signerDepartment})` : ''}</span>
406
+ </div>
407
+ {/if}
408
+ <div class="flex flex-col gap-0.5 pt-1">
409
+ <span>时间戳防伪令牌哈希:</span>
410
+ <code class="break-all rounded bg-muted p-1 font-mono text-[10px] text-foreground">
411
+ {seal.timestamp.timestampTokenId}
412
+ </code>
413
+ </div>
414
+ </div>
415
+ </div>
416
+ </div>
417
+
418
+ <!-- 审计校验日志链 -->
419
+ {#if seal.auditLogs && seal.auditLogs.length > 0}
420
+ <div class="p-5">
421
+ <div class="mb-3 flex items-center justify-between">
422
+ <span class="font-semibold text-foreground">防伪验真链路与合规审计日志</span>
423
+ <span class="text-muted-foreground text-[11px]">共计 {seal.auditLogs.length} 项核验点</span>
424
+ </div>
425
+
426
+ <div class="flex flex-col gap-2">
427
+ {#each seal.auditLogs as log (log.id)}
428
+ <div class="flex items-center justify-between rounded-lg border border-border bg-card p-2.5">
429
+ <div class="flex items-center gap-2.5">
430
+ {#if log.status === 'pass'}
431
+ <span class="flex h-5 w-5 items-center justify-center rounded-full bg-success/15 text-success text-xs font-bold">✓</span>
432
+ {:else if log.status === 'warn'}
433
+ <span class="flex h-5 w-5 items-center justify-center rounded-full bg-warning/15 text-warning text-xs font-bold">!</span>
434
+ {:else}
435
+ <span class="flex h-5 w-5 items-center justify-center rounded-full bg-destructive/15 text-destructive text-xs font-bold">✕</span>
436
+ {/if}
437
+ <div class="flex flex-col">
438
+ <span class="font-medium text-foreground">{log.step}</span>
439
+ <span class="text-[11px] text-muted-foreground">{log.message}</span>
440
+ </div>
441
+ </div>
442
+ <span class="font-mono text-[10px] text-muted-foreground">{log.checkedAt}</span>
443
+ </div>
444
+ {/each}
445
+ </div>
446
+ </div>
447
+ {/if}
448
+ </div>
449
+ {/if}
450
+ </div>
@@ -0,0 +1,72 @@
1
+ import type { Snippet } from 'svelte';
2
+ export type SealValidationStatus = 'valid' | 'expired' | 'revoked' | 'tampered' | 'untrusted';
3
+ export type SealType = 'official' | 'contract' | 'finance' | 'legal_person' | 'custom';
4
+ export interface SealCertificateInfo {
5
+ /** 证书颁发 CA 机构,如 "中国金融认证中心 (CFCA)" */
6
+ issuer: string;
7
+ /** 证书持有人主体名称 */
8
+ subject: string;
9
+ /** 证书序列号 */
10
+ serialNumber: string;
11
+ /** 签名与加密算法,如 "SM2-with-SM3" 或 "RSA-SHA256" */
12
+ algorithm: string;
13
+ /** 有效期开始时间 */
14
+ validFrom: string;
15
+ /** 有效期截止时间 */
16
+ validTo: string;
17
+ /** SHA-256 证书指纹 */
18
+ fingerprintSha256: string;
19
+ /** 密钥用途 */
20
+ keyUsage?: string;
21
+ }
22
+ export interface SealTimestampInfo {
23
+ /** 时间戳服务机构,如 "国家授时中心 TSA" */
24
+ tsaName: string;
25
+ /** 签署存证确切时间,如 "2024-11-14 15:32:08 CST" */
26
+ stampedAt: string;
27
+ /** 时间戳令牌哈希 */
28
+ timestampTokenId: string;
29
+ /** 时间戳是否校验通过 */
30
+ verified: boolean;
31
+ }
32
+ export interface SealVerificationLog {
33
+ id: string;
34
+ step: string;
35
+ status: 'pass' | 'fail' | 'warn';
36
+ message: string;
37
+ checkedAt: string;
38
+ }
39
+ export interface ElectronicSealInfo {
40
+ id: string;
41
+ sealName: string;
42
+ sealType: SealType;
43
+ enterpriseName: string;
44
+ creditCode: string;
45
+ sealCode?: string;
46
+ signerName?: string;
47
+ signerDepartment?: string;
48
+ sealGraphicUrl?: string;
49
+ status: SealValidationStatus;
50
+ documentHashMatch: boolean;
51
+ certificate: SealCertificateInfo;
52
+ timestamp: SealTimestampInfo;
53
+ auditLogs?: SealVerificationLog[];
54
+ }
55
+ export interface ElectronicSealInspectorProps {
56
+ /** 电子印章与防伪校验数据 */
57
+ seal: ElectronicSealInfo;
58
+ /** 是否可折叠详情卡片 */
59
+ collapsible?: boolean;
60
+ /** 默认是否展开证书与审计日志 */
61
+ defaultExpanded?: boolean;
62
+ /** 验真报告导出回调 */
63
+ onExportReport?: (seal: ElectronicSealInfo) => void;
64
+ /** 重新触发验真回调 */
65
+ onRevalidate?: (sealId: string) => void | Promise<void>;
66
+ /** 自定义操作区插槽 */
67
+ actions?: Snippet | undefined;
68
+ class?: string | undefined;
69
+ }
70
+ declare const ElectronicSealInspector: import("svelte").Component<ElectronicSealInspectorProps, {}, "">;
71
+ type ElectronicSealInspector = ReturnType<typeof ElectronicSealInspector>;
72
+ export default ElectronicSealInspector;