@svadmin/lite 0.26.0 → 0.30.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.
- package/dist/components/LiteAbacPolicyMatrix.svelte +128 -0
- package/dist/components/LiteAbacPolicyMatrix.svelte.d.ts +16 -0
- package/dist/components/LiteAnnouncementBanner.svelte +88 -0
- package/dist/components/LiteAnnouncementBanner.svelte.d.ts +12 -0
- package/dist/components/LiteApiPlayground.svelte +103 -0
- package/dist/components/LiteApiPlayground.svelte.d.ts +10 -0
- package/dist/components/LiteApprovalChainBuilder.svelte +120 -0
- package/dist/components/LiteApprovalChainBuilder.svelte.d.ts +15 -0
- package/dist/components/LiteAsyncExportModal.svelte +113 -0
- package/dist/components/LiteAsyncExportModal.svelte.d.ts +14 -0
- package/dist/components/LiteAuditTrailInspector.svelte +166 -0
- package/dist/components/LiteAuditTrailInspector.svelte.d.ts +23 -0
- package/dist/components/LiteBillingInvoiceDrawer.svelte +100 -0
- package/dist/components/LiteBillingInvoiceDrawer.svelte.d.ts +16 -0
- package/dist/components/LiteChartAnnotationOverlay.svelte +101 -0
- package/dist/components/LiteChartAnnotationOverlay.svelte.d.ts +16 -0
- package/dist/components/LiteColumnMappingTable.svelte +105 -0
- package/dist/components/LiteColumnMappingTable.svelte.d.ts +14 -0
- package/dist/components/LiteContextMenu.svelte +114 -0
- package/dist/components/LiteContextMenu.svelte.d.ts +18 -0
- package/dist/components/LiteDashboardGridLayout.svelte +108 -0
- package/dist/components/LiteDashboardGridLayout.svelte.d.ts +16 -0
- package/dist/components/LiteDashboardLayoutStorage.svelte +88 -0
- package/dist/components/LiteDashboardLayoutStorage.svelte.d.ts +16 -0
- package/dist/components/LiteDataImportDropzone.svelte +89 -0
- package/dist/components/LiteDataImportDropzone.svelte.d.ts +10 -0
- package/dist/components/LiteDataLineageGraph.svelte +100 -0
- package/dist/components/LiteDataLineageGraph.svelte.d.ts +15 -0
- package/dist/components/LiteDataMaskPolicyEngine.svelte +131 -0
- package/dist/components/LiteDataMaskPolicyEngine.svelte.d.ts +16 -0
- package/dist/components/LiteDataScreenContainer.svelte +34 -0
- package/dist/components/LiteDataScreenContainer.svelte.d.ts +9 -0
- package/dist/components/LiteDualApprovalGate.svelte +58 -0
- package/dist/components/LiteDualApprovalGate.svelte.d.ts +11 -0
- package/dist/components/LiteElectronicSealStamp.svelte +56 -0
- package/dist/components/LiteElectronicSealStamp.svelte.d.ts +9 -0
- package/dist/components/LiteEnvVariableEditor.svelte +114 -0
- package/dist/components/LiteEnvVariableEditor.svelte.d.ts +15 -0
- package/dist/components/LiteFormulaField.svelte +44 -0
- package/dist/components/LiteFormulaField.svelte.d.ts +11 -0
- package/dist/components/LiteGeoScatterMap.svelte +117 -0
- package/dist/components/LiteGeoScatterMap.svelte.d.ts +16 -0
- package/dist/components/LiteHmacSignatureCalculator.svelte +84 -0
- package/dist/components/LiteHmacSignatureCalculator.svelte.d.ts +10 -0
- package/dist/components/LiteImportPreviewValidator.svelte +136 -0
- package/dist/components/LiteImportPreviewValidator.svelte.d.ts +16 -0
- package/dist/components/LiteJsonViewer.svelte +88 -0
- package/dist/components/LiteJsonViewer.svelte.d.ts +9 -0
- package/dist/components/LiteKeyboardShortcutsModal.svelte +56 -0
- package/dist/components/LiteKeyboardShortcutsModal.svelte.d.ts +13 -0
- package/dist/components/LiteKpiCard.svelte +169 -0
- package/dist/components/LiteKpiCard.svelte.d.ts +25 -0
- package/dist/components/LiteLiveStreamLogViewer.svelte +84 -0
- package/dist/components/LiteLiveStreamLogViewer.svelte.d.ts +14 -0
- package/dist/components/LiteOmnibarCommandPalette.svelte +111 -0
- package/dist/components/LiteOmnibarCommandPalette.svelte.d.ts +15 -0
- package/dist/components/LitePeriodComparisonCard.svelte +60 -0
- package/dist/components/LitePeriodComparisonCard.svelte.d.ts +11 -0
- package/dist/components/LitePermissionSimulator.svelte +90 -0
- package/dist/components/LitePermissionSimulator.svelte.d.ts +14 -0
- package/dist/components/LitePivotMatrix.svelte +138 -0
- package/dist/components/LitePivotMatrix.svelte.d.ts +18 -0
- package/dist/components/LitePlanUsageQuotaBar.svelte +96 -0
- package/dist/components/LitePlanUsageQuotaBar.svelte.d.ts +15 -0
- package/dist/components/LiteQueryAiExplainer.svelte +85 -0
- package/dist/components/LiteQueryAiExplainer.svelte.d.ts +10 -0
- package/dist/components/LiteResultPage.svelte +135 -0
- package/dist/components/LiteResultPage.svelte.d.ts +17 -0
- package/dist/components/LiteScheduledJobManager.svelte +116 -0
- package/dist/components/LiteScheduledJobManager.svelte.d.ts +16 -0
- package/dist/components/LiteScreenAntiLeakGuard.svelte +56 -0
- package/dist/components/LiteScreenAntiLeakGuard.svelte.d.ts +8 -0
- package/dist/components/LiteSecureDataExporter.svelte +101 -0
- package/dist/components/LiteSecureDataExporter.svelte.d.ts +12 -0
- package/dist/components/LiteSensitiveDataMask.svelte +34 -2
- package/dist/components/LiteSensitiveDataMask.svelte.d.ts +1 -2
- package/dist/components/LiteSqlConsole.svelte +128 -0
- package/dist/components/LiteSqlConsole.svelte.d.ts +16 -0
- package/dist/components/LiteStepWizard.svelte +98 -0
- package/dist/components/LiteStepWizard.svelte.d.ts +16 -0
- package/dist/components/LiteSystemCapacityForecastCard.svelte +88 -0
- package/dist/components/LiteSystemCapacityForecastCard.svelte.d.ts +11 -0
- package/dist/components/LiteSystemHealthCheckDashboard.svelte +142 -0
- package/dist/components/LiteSystemHealthCheckDashboard.svelte.d.ts +18 -0
- package/dist/components/LiteTableAggregationFooter.svelte +76 -0
- package/dist/components/LiteTableAggregationFooter.svelte.d.ts +14 -0
- package/dist/components/LiteTenantContextSwitcher.svelte +173 -0
- package/dist/components/LiteTenantContextSwitcher.svelte.d.ts +27 -0
- package/dist/components/LiteTenantQuotasMatrix.svelte +117 -0
- package/dist/components/LiteTenantQuotasMatrix.svelte.d.ts +17 -0
- package/dist/components/LiteTextDiffViewer.svelte +111 -0
- package/dist/components/LiteTextDiffViewer.svelte.d.ts +10 -0
- package/dist/components/LiteThreadedCommentDrawer.svelte +60 -0
- package/dist/components/LiteThreadedCommentDrawer.svelte.d.ts +15 -0
- package/dist/components/LiteTierFeatureComparison.svelte +97 -0
- package/dist/components/LiteTierFeatureComparison.svelte.d.ts +18 -0
- package/dist/components/LiteUnsavedChangesGuard.svelte +53 -0
- package/dist/components/LiteUnsavedChangesGuard.svelte.d.ts +10 -0
- package/dist/components/LiteWatermarkContainer.svelte +58 -0
- package/dist/components/LiteWatermarkContainer.svelte.d.ts +9 -0
- package/dist/components/LiteWebhookSimulator.svelte +120 -0
- package/dist/components/LiteWebhookSimulator.svelte.d.ts +11 -0
- package/dist/components/LiteWorkflowNodeInspector.svelte +79 -0
- package/dist/components/LiteWorkflowNodeInspector.svelte.d.ts +11 -0
- package/dist/components/LiteWorkflowStepper.svelte +56 -0
- package/dist/components/LiteWorkflowStepper.svelte.d.ts +14 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.js +61 -0
- package/package.json +2 -2
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export interface AbacPolicyRule {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
resource: string;
|
|
6
|
+
effect: 'allow' | 'mask' | 'require_mfa' | 'deny';
|
|
7
|
+
priority: number;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
title?: string;
|
|
13
|
+
rules?: AbacPolicyRule[];
|
|
14
|
+
class?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let {
|
|
18
|
+
title = '企业级 ABAC 访问控制策略矩阵 (SSR 静态列表)',
|
|
19
|
+
rules = [
|
|
20
|
+
{ id: 'r1', name: '财务大额调拨审批放行', resource: 'TreasuryPayment', effect: 'allow', priority: 100, enabled: true },
|
|
21
|
+
{ id: 'r2', name: '普通专员薪酬资产脱敏', resource: 'EmployeeCompensation', effect: 'mask', priority: 85, enabled: true },
|
|
22
|
+
{ id: 'r3', name: '非工作时段审计库阻断', resource: 'AuditArchiveStore', effect: 'deny', priority: 95, enabled: true },
|
|
23
|
+
{ id: 'r4', name: '大批量导出强制提权', resource: 'BatchDataExport', effect: 'require_mfa', priority: 90, enabled: true },
|
|
24
|
+
],
|
|
25
|
+
class: className = '',
|
|
26
|
+
}: Props = $props();
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<div
|
|
30
|
+
class="lite-abac-matrix {className}"
|
|
31
|
+
data-svadmin-component="LiteAbacPolicyMatrix"
|
|
32
|
+
role="region"
|
|
33
|
+
aria-label="ABAC Policy Matrix"
|
|
34
|
+
>
|
|
35
|
+
<header class="lite-abac-header">
|
|
36
|
+
<div class="lite-abac-title-row">
|
|
37
|
+
<span class="lite-abac-icon">🛡️</span>
|
|
38
|
+
<h4 class="lite-abac-title">{title}</h4>
|
|
39
|
+
</div>
|
|
40
|
+
<span class="lite-abac-count">共 {rules.length} 条策略规则</span>
|
|
41
|
+
</header>
|
|
42
|
+
|
|
43
|
+
<div class="lite-abac-table-wrap">
|
|
44
|
+
<table class="lite-abac-table">
|
|
45
|
+
<thead>
|
|
46
|
+
<tr>
|
|
47
|
+
<th>规则名称</th>
|
|
48
|
+
<th>目标资源</th>
|
|
49
|
+
<th>裁决效应</th>
|
|
50
|
+
<th>优先级</th>
|
|
51
|
+
<th>状态</th>
|
|
52
|
+
</tr>
|
|
53
|
+
</thead>
|
|
54
|
+
<tbody>
|
|
55
|
+
{#each rules as r (r.id)}
|
|
56
|
+
<tr>
|
|
57
|
+
<td class="lite-r-name">{r.name}</td>
|
|
58
|
+
<td class="font-mono text-muted">{r.resource}</td>
|
|
59
|
+
<td>
|
|
60
|
+
<span
|
|
61
|
+
class="lite-r-effect"
|
|
62
|
+
class:lite-eff-allow={r.effect === 'allow'}
|
|
63
|
+
class:lite-eff-mask={r.effect === 'mask'}
|
|
64
|
+
class:lite-eff-mfa={r.effect === 'require_mfa'}
|
|
65
|
+
class:lite-eff-deny={r.effect === 'deny'}
|
|
66
|
+
>
|
|
67
|
+
{r.effect}
|
|
68
|
+
</span>
|
|
69
|
+
</td>
|
|
70
|
+
<td class="font-mono">{r.priority}</td>
|
|
71
|
+
<td>
|
|
72
|
+
<span class="lite-status-txt">{r.enabled ? '已启用' : '已停用'}</span>
|
|
73
|
+
</td>
|
|
74
|
+
</tr>
|
|
75
|
+
{/each}
|
|
76
|
+
</tbody>
|
|
77
|
+
</table>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<style>
|
|
82
|
+
.lite-abac-matrix {
|
|
83
|
+
border: 1px solid #e5e6eb;
|
|
84
|
+
border-radius: 6px;
|
|
85
|
+
background: #ffffff;
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
}
|
|
89
|
+
.lite-abac-header {
|
|
90
|
+
display: flex;
|
|
91
|
+
justify-content: space-between;
|
|
92
|
+
align-items: center;
|
|
93
|
+
padding: 10px 14px;
|
|
94
|
+
background: #f7f8fa;
|
|
95
|
+
border-bottom: 1px solid #e5e6eb;
|
|
96
|
+
}
|
|
97
|
+
.lite-abac-title-row { display: flex; align-items: center; }
|
|
98
|
+
.lite-abac-icon { font-size: 14px; margin-right: 6px; }
|
|
99
|
+
.lite-abac-title { margin: 0; font-size: 13px; font-weight: 600; color: #1d2129; }
|
|
100
|
+
.lite-abac-count { font-size: 11px; color: #86909c; }
|
|
101
|
+
.lite-abac-table-wrap { overflow-x: auto; }
|
|
102
|
+
.lite-abac-table {
|
|
103
|
+
width: 100%;
|
|
104
|
+
border-collapse: collapse;
|
|
105
|
+
font-size: 12px;
|
|
106
|
+
text-align: left;
|
|
107
|
+
}
|
|
108
|
+
.lite-abac-table th, .lite-abac-table td {
|
|
109
|
+
padding: 8px 12px;
|
|
110
|
+
border-bottom: 1px solid #f2f3f5;
|
|
111
|
+
}
|
|
112
|
+
.lite-abac-table th { background: #fafafa; font-weight: 600; color: #4e5969; font-size: 11px; }
|
|
113
|
+
.font-mono { font-family: monospace; font-size: 11px; }
|
|
114
|
+
.text-muted { color: #86909c; }
|
|
115
|
+
.lite-r-name { font-weight: 500; color: #1d2129; }
|
|
116
|
+
.lite-r-effect {
|
|
117
|
+
font-size: 10px;
|
|
118
|
+
font-weight: 600;
|
|
119
|
+
padding: 1px 5px;
|
|
120
|
+
border-radius: 2px;
|
|
121
|
+
text-transform: uppercase;
|
|
122
|
+
}
|
|
123
|
+
.lite-eff-allow { background: #e8ffea; color: #00b42a; }
|
|
124
|
+
.lite-eff-mask { background: #e8f3ff; color: #165dff; }
|
|
125
|
+
.lite-eff-mfa { background: #fff7e8; color: #ff7d00; }
|
|
126
|
+
.lite-eff-deny { background: #ffece8; color: #f53f3f; }
|
|
127
|
+
.lite-status-txt { font-size: 11px; color: #4e5969; }
|
|
128
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AbacPolicyRule {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
resource: string;
|
|
5
|
+
effect: 'allow' | 'mask' | 'require_mfa' | 'deny';
|
|
6
|
+
priority: number;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
title?: string;
|
|
11
|
+
rules?: AbacPolicyRule[];
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const LiteAbacPolicyMatrix: import("svelte").Component<Props, {}, "">;
|
|
15
|
+
type LiteAbacPolicyMatrix = ReturnType<typeof LiteAbacPolicyMatrix>;
|
|
16
|
+
export default LiteAbacPolicyMatrix;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
type BannerTone = 'info' | 'warning' | 'error' | 'success';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
message: string;
|
|
6
|
+
tone?: BannerTone;
|
|
7
|
+
countdownText?: string;
|
|
8
|
+
actionText?: string;
|
|
9
|
+
actionHref?: string;
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
message,
|
|
15
|
+
tone = 'warning',
|
|
16
|
+
countdownText,
|
|
17
|
+
actionText,
|
|
18
|
+
actionHref,
|
|
19
|
+
class: className = '',
|
|
20
|
+
}: Props = $props();
|
|
21
|
+
|
|
22
|
+
const iconChar = $derived.by(() => {
|
|
23
|
+
switch (tone) {
|
|
24
|
+
case 'info':
|
|
25
|
+
return 'ℹ';
|
|
26
|
+
case 'success':
|
|
27
|
+
return '✓';
|
|
28
|
+
case 'error':
|
|
29
|
+
return '✕';
|
|
30
|
+
case 'warning':
|
|
31
|
+
default:
|
|
32
|
+
return '⚠';
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<aside
|
|
38
|
+
class="lite-announcement-banner lite-banner-{tone} {className}"
|
|
39
|
+
data-svadmin-component="LiteAnnouncementBanner"
|
|
40
|
+
role="alert"
|
|
41
|
+
>
|
|
42
|
+
<div class="lite-banner-body">
|
|
43
|
+
<span class="lite-banner-icon" aria-hidden="true">{iconChar}</span>
|
|
44
|
+
<span class="lite-banner-message">{message}</span>
|
|
45
|
+
|
|
46
|
+
{#if countdownText}
|
|
47
|
+
<span class="lite-banner-countdown">{countdownText}</span>
|
|
48
|
+
{/if}
|
|
49
|
+
|
|
50
|
+
{#if actionText}
|
|
51
|
+
{#if actionHref}
|
|
52
|
+
<a href={actionHref} class="lite-banner-action">{actionText}</a>
|
|
53
|
+
{:else}
|
|
54
|
+
<span class="lite-banner-action">{actionText}</span>
|
|
55
|
+
{/if}
|
|
56
|
+
{/if}
|
|
57
|
+
</div>
|
|
58
|
+
</aside>
|
|
59
|
+
|
|
60
|
+
<style>
|
|
61
|
+
.lite-announcement-banner {
|
|
62
|
+
padding: 8px 16px;
|
|
63
|
+
border-bottom: 1px solid transparent;
|
|
64
|
+
font-size: 13px;
|
|
65
|
+
box-sizing: border-box;
|
|
66
|
+
}
|
|
67
|
+
.lite-banner-info { background: #e8f3ff; color: #165dff; border-color: #bedaff; }
|
|
68
|
+
.lite-banner-warning { background: #fff7e8; color: #d46b08; border-color: #ffd591; }
|
|
69
|
+
.lite-banner-error { background: #fff1f0; color: #cf1322; border-color: #ffa39e; }
|
|
70
|
+
.lite-banner-success { background: #e8ffea; color: #00b42a; border-color: #aff0b5; }
|
|
71
|
+
.lite-banner-body { display: flex; align-items: center; flex-wrap: wrap; }
|
|
72
|
+
.lite-banner-body > * + * { margin-left: 8px; }
|
|
73
|
+
.lite-banner-icon { font-weight: 700; font-size: 14px; }
|
|
74
|
+
.lite-banner-message { font-weight: 500; flex: 1; min-width: 200px; }
|
|
75
|
+
.lite-banner-countdown {
|
|
76
|
+
font-family: monospace;
|
|
77
|
+
font-size: 11px;
|
|
78
|
+
padding: 2px 6px;
|
|
79
|
+
border-radius: 4px;
|
|
80
|
+
background: rgba(0, 0, 0, 0.05);
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
}
|
|
83
|
+
.lite-banner-action {
|
|
84
|
+
text-decoration: underline;
|
|
85
|
+
font-weight: 600;
|
|
86
|
+
color: inherit;
|
|
87
|
+
}
|
|
88
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type BannerTone = 'info' | 'warning' | 'error' | 'success';
|
|
2
|
+
interface Props {
|
|
3
|
+
message: string;
|
|
4
|
+
tone?: BannerTone;
|
|
5
|
+
countdownText?: string;
|
|
6
|
+
actionText?: string;
|
|
7
|
+
actionHref?: string;
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const LiteAnnouncementBanner: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type LiteAnnouncementBanner = ReturnType<typeof LiteAnnouncementBanner>;
|
|
12
|
+
export default LiteAnnouncementBanner;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
4
|
+
url?: string;
|
|
5
|
+
curl?: string;
|
|
6
|
+
responseStatus?: number;
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
method = 'GET',
|
|
12
|
+
url = '/api/v1/orders',
|
|
13
|
+
curl = 'curl -X GET "/api/v1/orders"',
|
|
14
|
+
responseStatus = 200,
|
|
15
|
+
class: className = '',
|
|
16
|
+
}: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<div
|
|
20
|
+
class="lite-api-playground {className}"
|
|
21
|
+
data-svadmin-component="LiteApiPlayground"
|
|
22
|
+
role="region"
|
|
23
|
+
aria-label="API Playground"
|
|
24
|
+
>
|
|
25
|
+
<header class="lite-api-header">
|
|
26
|
+
<span class="lite-api-title">API 调试工作台 (SSR 静态探针)</span>
|
|
27
|
+
<span class="lite-api-method lite-method-{method.toLowerCase()}">{method}</span>
|
|
28
|
+
</header>
|
|
29
|
+
|
|
30
|
+
<div class="lite-api-body">
|
|
31
|
+
<div class="lite-api-request-bar">
|
|
32
|
+
<span class="lite-api-method-badge">{method}</span>
|
|
33
|
+
<code class="lite-api-url">{url}</code>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="lite-api-curl-box">
|
|
37
|
+
<span class="lite-curl-label">终端 cURL 命令:</span>
|
|
38
|
+
<pre class="lite-curl-code"><code>{curl}</code></pre>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
{#if responseStatus}
|
|
42
|
+
<div class="lite-api-res-badge">
|
|
43
|
+
<span>预估状态: HTTP {responseStatus} OK</span>
|
|
44
|
+
</div>
|
|
45
|
+
{/if}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
.lite-api-playground {
|
|
51
|
+
border: 1px solid #e5e6eb;
|
|
52
|
+
border-radius: 6px;
|
|
53
|
+
background: #ffffff;
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
}
|
|
57
|
+
.lite-api-header {
|
|
58
|
+
display: flex;
|
|
59
|
+
justify-content: space-between;
|
|
60
|
+
align-items: center;
|
|
61
|
+
padding: 8px 12px;
|
|
62
|
+
background: #f7f8fa;
|
|
63
|
+
border-bottom: 1px solid #e5e6eb;
|
|
64
|
+
}
|
|
65
|
+
.lite-api-title { font-weight: 600; color: #1d2129; }
|
|
66
|
+
.lite-api-method { font-size: 11px; font-family: monospace; font-weight: 700; }
|
|
67
|
+
.lite-method-get { color: #165dff; }
|
|
68
|
+
.lite-method-post { color: #00b42a; }
|
|
69
|
+
.lite-api-body { padding: 12px; }
|
|
70
|
+
.lite-api-request-bar {
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
padding: 6px 10px;
|
|
74
|
+
background: #f7f8fa;
|
|
75
|
+
border: 1px solid #e5e6eb;
|
|
76
|
+
border-radius: 4px;
|
|
77
|
+
font-family: monospace;
|
|
78
|
+
}
|
|
79
|
+
.lite-api-method-badge { font-weight: 700; color: #165dff; }
|
|
80
|
+
.lite-api-url { color: #1d2129; word-break: break-all; }
|
|
81
|
+
.lite-api-curl-box { margin-top: 10px; }
|
|
82
|
+
.lite-curl-label { color: #86909c; font-size: 11px; }
|
|
83
|
+
.lite-curl-code {
|
|
84
|
+
margin: 4px 0 0;
|
|
85
|
+
padding: 8px;
|
|
86
|
+
background: #f7f8fa;
|
|
87
|
+
border: 1px solid #e5e6eb;
|
|
88
|
+
border-radius: 4px;
|
|
89
|
+
font-family: monospace;
|
|
90
|
+
font-size: 11px;
|
|
91
|
+
color: #1d2129;
|
|
92
|
+
white-space: pre-wrap;
|
|
93
|
+
}
|
|
94
|
+
.lite-api-res-badge {
|
|
95
|
+
margin-top: 10px;
|
|
96
|
+
padding: 4px 8px;
|
|
97
|
+
border-radius: 4px;
|
|
98
|
+
background: #e8ffea;
|
|
99
|
+
color: #00b42a;
|
|
100
|
+
font-family: monospace;
|
|
101
|
+
font-weight: 600;
|
|
102
|
+
}
|
|
103
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
3
|
+
url?: string;
|
|
4
|
+
curl?: string;
|
|
5
|
+
responseStatus?: number;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteApiPlayground: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteApiPlayground = ReturnType<typeof LiteApiPlayground>;
|
|
10
|
+
export default LiteApiPlayground;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface ApprovalNode {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
approver: string;
|
|
6
|
+
status: 'passed' | 'current' | 'pending';
|
|
7
|
+
mode?: 'serial' | 'parallel';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
title?: string;
|
|
12
|
+
nodes?: ApprovalNode[];
|
|
13
|
+
class?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
title = '业务审批流链条',
|
|
18
|
+
nodes = [
|
|
19
|
+
{ id: 'n1', title: '发起申请', approver: '经办人 (王立)', status: 'passed' },
|
|
20
|
+
{ id: 'n2', title: '部门负责人初审', approver: '业务主管 (张明)', status: 'passed' },
|
|
21
|
+
{ id: 'n3', title: '财务合规复核', approver: '财务审计组', status: 'current', mode: 'parallel' },
|
|
22
|
+
{ id: 'n4', title: '总经理终审', approver: '决策层审批人', status: 'pending' }
|
|
23
|
+
],
|
|
24
|
+
class: className = '',
|
|
25
|
+
}: Props = $props();
|
|
26
|
+
|
|
27
|
+
function getNodeStyle(st: string): { badge: string; color: string; bg: string } {
|
|
28
|
+
switch (st) {
|
|
29
|
+
case 'passed': return { badge: '✓ 已通过', color: '#00b42a', bg: '#e8ffea' };
|
|
30
|
+
case 'current': return { badge: '● 进行中', color: '#165dff', bg: '#e8f3ff' };
|
|
31
|
+
default: return { badge: '○ 待审批', color: '#86909c', bg: '#f2f3f5' };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<div
|
|
37
|
+
class="lite-approval-chain {className}"
|
|
38
|
+
data-svadmin-component="LiteApprovalChainBuilder"
|
|
39
|
+
role="region"
|
|
40
|
+
aria-label="Approval Chain"
|
|
41
|
+
>
|
|
42
|
+
<header class="lite-chain-header">
|
|
43
|
+
<h4 class="lite-chain-title">{title}</h4>
|
|
44
|
+
<span class="lite-chain-total">{nodes.length} 级审批节点</span>
|
|
45
|
+
</header>
|
|
46
|
+
|
|
47
|
+
<div class="lite-chain-list">
|
|
48
|
+
{#each nodes as node, idx (node.id)}
|
|
49
|
+
{@const st = getNodeStyle(node.status)}
|
|
50
|
+
<div class="lite-chain-step">
|
|
51
|
+
<div class="lite-step-index">{idx + 1}</div>
|
|
52
|
+
<div class="lite-step-content">
|
|
53
|
+
<div class="lite-step-top">
|
|
54
|
+
<span class="lite-step-name">{node.title}</span>
|
|
55
|
+
<span class="lite-step-badge" style="color: {st.color}; background: {st.bg};">
|
|
56
|
+
{st.badge}
|
|
57
|
+
</span>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="lite-step-approver">
|
|
60
|
+
审批人: {node.approver}
|
|
61
|
+
{#if node.mode === 'parallel'}
|
|
62
|
+
<span class="lite-step-mode">或签 / 会签</span>
|
|
63
|
+
{/if}
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
{/each}
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<style>
|
|
72
|
+
.lite-approval-chain {
|
|
73
|
+
border: 1px solid #e5e6eb;
|
|
74
|
+
border-radius: 6px;
|
|
75
|
+
background: #ffffff;
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
}
|
|
79
|
+
.lite-chain-header {
|
|
80
|
+
display: flex;
|
|
81
|
+
justify-content: space-between;
|
|
82
|
+
align-items: center;
|
|
83
|
+
padding: 10px 14px;
|
|
84
|
+
background: #f7f8fa;
|
|
85
|
+
border-bottom: 1px solid #e5e6eb;
|
|
86
|
+
}
|
|
87
|
+
.lite-chain-title { margin: 0; font-size: 13px; font-weight: 600; color: #1d2129; }
|
|
88
|
+
.lite-chain-total { font-size: 11px; color: #86909c; }
|
|
89
|
+
.lite-chain-list { padding: 12px 14px; }
|
|
90
|
+
.lite-chain-step {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: flex-start;
|
|
93
|
+
padding-bottom: 12px;
|
|
94
|
+
margin-bottom: 12px;
|
|
95
|
+
border-bottom: 1px dashed #e5e6eb;
|
|
96
|
+
}
|
|
97
|
+
.lite-chain-step:last-child {
|
|
98
|
+
border-bottom: none;
|
|
99
|
+
padding-bottom: 0;
|
|
100
|
+
margin-bottom: 0;
|
|
101
|
+
}
|
|
102
|
+
.lite-step-index {
|
|
103
|
+
width: 20px;
|
|
104
|
+
height: 20px;
|
|
105
|
+
border-radius: 50%;
|
|
106
|
+
background: #165dff;
|
|
107
|
+
color: #ffffff;
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
font-size: 11px;
|
|
112
|
+
font-weight: 700;
|
|
113
|
+
}
|
|
114
|
+
.lite-step-content { flex: 1; }
|
|
115
|
+
.lite-step-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
|
|
116
|
+
.lite-step-name { font-weight: 600; color: #1d2129; font-size: 12px; }
|
|
117
|
+
.lite-step-badge { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; }
|
|
118
|
+
.lite-step-approver { font-size: 11px; color: #4e5969; }
|
|
119
|
+
.lite-step-mode { font-size: 10px; color: #86909c; margin-left: 6px; background: #f2f3f5; padding: 1px 4px; border-radius: 2px; }
|
|
120
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface ApprovalNode {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
approver: string;
|
|
5
|
+
status: 'passed' | 'current' | 'pending';
|
|
6
|
+
mode?: 'serial' | 'parallel';
|
|
7
|
+
}
|
|
8
|
+
interface Props {
|
|
9
|
+
title?: string;
|
|
10
|
+
nodes?: ApprovalNode[];
|
|
11
|
+
class?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const LiteApprovalChainBuilder: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type LiteApprovalChainBuilder = ReturnType<typeof LiteApprovalChainBuilder>;
|
|
15
|
+
export default LiteApprovalChainBuilder;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface ExportCol {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
open?: boolean;
|
|
9
|
+
action?: string;
|
|
10
|
+
resourceName?: string;
|
|
11
|
+
columns?: ExportCol[];
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
open = true,
|
|
17
|
+
action = '/api/export',
|
|
18
|
+
resourceName = 'Records',
|
|
19
|
+
columns = [],
|
|
20
|
+
class: className = '',
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
{#if open}
|
|
25
|
+
<section
|
|
26
|
+
class="lite-export-modal {className}"
|
|
27
|
+
data-svadmin-component="LiteAsyncExportModal"
|
|
28
|
+
aria-label="Export {resourceName}"
|
|
29
|
+
>
|
|
30
|
+
<header class="lite-export-header">
|
|
31
|
+
<h3 class="lite-export-title">Export {resourceName}</h3>
|
|
32
|
+
</header>
|
|
33
|
+
|
|
34
|
+
<form method="POST" action={action} class="lite-export-form">
|
|
35
|
+
<div class="lite-export-group">
|
|
36
|
+
<label for="lite-export-filename">File Name</label>
|
|
37
|
+
<input type="text" id="lite-export-filename" name="filename" value="{resourceName}-Export" />
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="lite-export-group">
|
|
41
|
+
<span class="lite-export-label">Format</span>
|
|
42
|
+
<div class="lite-export-radios">
|
|
43
|
+
<label><input type="radio" name="format" value="xlsx" checked /> Excel (.xlsx)</label>
|
|
44
|
+
<label><input type="radio" name="format" value="csv" /> CSV (.csv)</label>
|
|
45
|
+
<label><input type="radio" name="format" value="json" /> JSON (.json)</label>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
{#if columns.length > 0}
|
|
50
|
+
<div class="lite-export-group">
|
|
51
|
+
<span class="lite-export-label">Columns</span>
|
|
52
|
+
<div class="lite-export-columns">
|
|
53
|
+
{#each columns as col (col.key)}
|
|
54
|
+
<label class="lite-export-col-item">
|
|
55
|
+
<input type="checkbox" name="columns" value={col.key} checked />
|
|
56
|
+
<span>{col.label}</span>
|
|
57
|
+
</label>
|
|
58
|
+
{/each}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
{/if}
|
|
62
|
+
|
|
63
|
+
<div class="lite-export-actions">
|
|
64
|
+
<button type="submit" class="lite-export-submit">Start Export</button>
|
|
65
|
+
</div>
|
|
66
|
+
</form>
|
|
67
|
+
</section>
|
|
68
|
+
{/if}
|
|
69
|
+
|
|
70
|
+
<style>
|
|
71
|
+
.lite-export-modal {
|
|
72
|
+
border: 1px solid #e5e6eb;
|
|
73
|
+
border-radius: 8px;
|
|
74
|
+
padding: 16px;
|
|
75
|
+
background: #ffffff;
|
|
76
|
+
max-width: 480px;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
}
|
|
79
|
+
.lite-export-header { margin-bottom: 12px; }
|
|
80
|
+
.lite-export-title { margin: 0; font-size: 15px; color: #1d2129; font-weight: 600; }
|
|
81
|
+
.lite-export-group { margin-bottom: 12px; font-size: 13px; }
|
|
82
|
+
.lite-export-group label, .lite-export-label { display: block; margin-bottom: 4px; font-weight: 500; color: #4e5969; }
|
|
83
|
+
.lite-export-group input[type="text"] {
|
|
84
|
+
width: 100%;
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
padding: 6px 10px;
|
|
87
|
+
border: 1px solid #e5e6eb;
|
|
88
|
+
border-radius: 4px;
|
|
89
|
+
}
|
|
90
|
+
.lite-export-radios { display: flex; margin-top: 4px; }
|
|
91
|
+
.lite-export-radios > * + * { margin-left: 12px; }
|
|
92
|
+
.lite-export-columns {
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-wrap: wrap;
|
|
95
|
+
max-height: 140px;
|
|
96
|
+
overflow-y: auto;
|
|
97
|
+
padding: 6px;
|
|
98
|
+
background: #f7f8fa;
|
|
99
|
+
border-radius: 4px;
|
|
100
|
+
}
|
|
101
|
+
.lite-export-col-item { display: flex; align-items: center; width: 50%; font-size: 12px; }
|
|
102
|
+
.lite-export-col-item > * + * { margin-left: 6px; }
|
|
103
|
+
.lite-export-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
|
|
104
|
+
.lite-export-submit {
|
|
105
|
+
padding: 7px 16px;
|
|
106
|
+
background: #165dff;
|
|
107
|
+
color: #ffffff;
|
|
108
|
+
border: 0;
|
|
109
|
+
border-radius: 4px;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
font-weight: 500;
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface ExportCol {
|
|
2
|
+
key: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
interface Props {
|
|
6
|
+
open?: boolean;
|
|
7
|
+
action?: string;
|
|
8
|
+
resourceName?: string;
|
|
9
|
+
columns?: ExportCol[];
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const LiteAsyncExportModal: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type LiteAsyncExportModal = ReturnType<typeof LiteAsyncExportModal>;
|
|
14
|
+
export default LiteAsyncExportModal;
|