@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.
- package/dist/app.css +318 -0
- package/dist/app.theme.css +318 -0
- package/dist/components/AboutSettings.svelte +1 -1
- package/dist/components/AccessRevocationMatrix.svelte +425 -0
- package/dist/components/AccessRevocationMatrix.svelte.d.ts +27 -0
- package/dist/components/AudioVisualInspector.svelte +458 -0
- package/dist/components/AudioVisualInspector.svelte.d.ts +53 -0
- package/dist/components/AuditSnapshotCapture.svelte +328 -0
- package/dist/components/AuditSnapshotCapture.svelte.d.ts +28 -0
- package/dist/components/CannedResponsePicker.svelte +257 -0
- package/dist/components/CannedResponsePicker.svelte.d.ts +22 -0
- package/dist/components/ContentModerationCenter.svelte +166 -0
- package/dist/components/ContentModerationCenter.svelte.d.ts +11 -0
- package/dist/components/ContractClauseDiffViewer.svelte +566 -0
- package/dist/components/ContractClauseDiffViewer.svelte.d.ts +53 -0
- package/dist/components/DataImportPipeline.svelte +577 -0
- package/dist/components/DataImportPipeline.svelte.d.ts +35 -0
- package/dist/components/DataRetentionPolicyEditor.svelte +455 -0
- package/dist/components/DataRetentionPolicyEditor.svelte.d.ts +10 -0
- package/dist/components/ElectronicSealInspector.svelte +450 -0
- package/dist/components/ElectronicSealInspector.svelte.d.ts +72 -0
- package/dist/components/EmployeeOffboardingAuditor.svelte +405 -0
- package/dist/components/EmployeeOffboardingAuditor.svelte.d.ts +39 -0
- package/dist/components/FieldMappingBuilder.svelte +393 -0
- package/dist/components/FieldMappingBuilder.svelte.d.ts +39 -0
- package/dist/components/FilterBuilder.svelte +50 -34
- package/dist/components/FilterBuilder.svelte.d.ts +2 -0
- package/dist/components/GatewayRouteEditor.svelte +493 -0
- package/dist/components/GatewayRouteEditor.svelte.d.ts +34 -0
- package/dist/components/I18nStudio.svelte +635 -0
- package/dist/components/I18nStudio.svelte.d.ts +23 -0
- package/dist/components/IpAccessRuleEditor.svelte +290 -0
- package/dist/components/IpAccessRuleEditor.svelte.d.ts +19 -0
- package/dist/components/IpWhitelistDrawer.svelte +94 -0
- package/dist/components/IpWhitelistDrawer.svelte.d.ts +10 -0
- package/dist/components/MediaAuthenticityAuditCard.svelte +357 -0
- package/dist/components/MediaAuthenticityAuditCard.svelte.d.ts +64 -0
- package/dist/components/PrintDocument.svelte +95 -0
- package/dist/components/PrintDocument.svelte.d.ts +10 -0
- package/dist/components/PrintPreviewModal.svelte +52 -0
- package/dist/components/PrintPreviewModal.svelte.d.ts +11 -0
- package/dist/components/PrintTemplateDesigner.svelte +280 -0
- package/dist/components/PrintTemplateDesigner.svelte.d.ts +11 -0
- package/dist/components/RateLimitPolicyPanel.svelte +369 -0
- package/dist/components/RateLimitPolicyPanel.svelte.d.ts +29 -0
- package/dist/components/SensitiveWordAuditor.svelte +368 -0
- package/dist/components/SensitiveWordAuditor.svelte.d.ts +9 -0
- package/dist/components/ServiceDeskTicketCard.svelte +297 -0
- package/dist/components/ServiceDeskTicketCard.svelte.d.ts +52 -0
- package/dist/components/ShiftScheduler.svelte +490 -0
- package/dist/components/ShiftScheduler.svelte.d.ts +50 -0
- package/dist/components/SslCertificateMonitorCard.svelte +309 -0
- package/dist/components/SslCertificateMonitorCard.svelte.d.ts +30 -0
- package/dist/components/SsoConnectionStudio.svelte +784 -0
- package/dist/components/SsoConnectionStudio.svelte.d.ts +44 -0
- package/dist/components/SsoSpMetadataPanel.svelte +44 -0
- package/dist/components/SsoSpMetadataPanel.svelte.d.ts +8 -0
- package/dist/components/StepUpAuthModal.svelte +448 -0
- package/dist/components/StepUpAuthModal.svelte.d.ts +26 -0
- package/dist/components/TrafficTopologyInspector.svelte +361 -0
- package/dist/components/TrafficTopologyInspector.svelte.d.ts +43 -0
- package/dist/components/enterprise/filter-tree.js +1 -1
- package/dist/components/filter-i18n.d.ts +61 -0
- package/dist/components/filter-i18n.js +114 -0
- package/dist/components/ip-access-rules.d.ts +24 -0
- package/dist/components/ip-access-rules.js +110 -0
- package/dist/components/moderation-utils.d.ts +45 -0
- package/dist/components/moderation-utils.js +74 -0
- package/dist/components/print-document.d.ts +3 -0
- package/dist/components/print-document.js +65 -0
- package/dist/components/print-utils.d.ts +44 -0
- package/dist/components/print-utils.js +68 -0
- package/dist/components/retention-utils.d.ts +31 -0
- package/dist/components/retention-utils.js +38 -0
- package/dist/components/sso-connection-presets.d.ts +2 -0
- package/dist/components/sso-connection-presets.js +59 -0
- package/dist/components/ui/sheet/sheet.svelte +3 -1
- package/dist/components/ui/sheet/sheet.svelte.d.ts +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +44 -0
- package/package.json +5 -4
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ArrowRight, Sparkles, AlertCircle, CheckCircle2, RotateCcw, Link2, Eye, EyeOff } from '@lucide/svelte';
|
|
3
|
+
import { cn } from '../utils.js';
|
|
4
|
+
|
|
5
|
+
export interface SourceField {
|
|
6
|
+
name: string;
|
|
7
|
+
label?: string | undefined;
|
|
8
|
+
sample?: unknown | undefined;
|
|
9
|
+
type?: 'string' | 'number' | 'boolean' | 'date' | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface TargetField {
|
|
13
|
+
name: string;
|
|
14
|
+
label: string;
|
|
15
|
+
required?: boolean | undefined;
|
|
16
|
+
type?: 'string' | 'number' | 'boolean' | 'date' | undefined;
|
|
17
|
+
description?: string | undefined;
|
|
18
|
+
defaultValue?: unknown | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type TransformType = 'direct' | 'uppercase' | 'lowercase' | 'trim' | 'number' | 'fallback';
|
|
22
|
+
|
|
23
|
+
export interface FieldMappingRule {
|
|
24
|
+
targetField: string;
|
|
25
|
+
sourceField?: string | undefined;
|
|
26
|
+
transform?: TransformType | undefined;
|
|
27
|
+
fallbackValue?: string | undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface FieldMappingBuilderProps {
|
|
31
|
+
/** 外部源字段列表(如来自 CSV 表头或三方接口) */
|
|
32
|
+
sourceFields: SourceField[];
|
|
33
|
+
/** 本系统目标字段要求规范 */
|
|
34
|
+
targetFields: TargetField[];
|
|
35
|
+
/** 当前映射规则列表 */
|
|
36
|
+
value?: FieldMappingRule[] | undefined;
|
|
37
|
+
/** 选填源数据样本行,用于实时推演目标值 */
|
|
38
|
+
sourceSampleRows?: Record<string, unknown>[] | undefined;
|
|
39
|
+
/** 映射变更事件 */
|
|
40
|
+
onchange?: ((rules: FieldMappingRule[]) => void) | undefined;
|
|
41
|
+
/** 是否只读禁用 */
|
|
42
|
+
disabled?: boolean | undefined;
|
|
43
|
+
class?: string | undefined;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let {
|
|
47
|
+
sourceFields = [],
|
|
48
|
+
targetFields = [],
|
|
49
|
+
value,
|
|
50
|
+
sourceSampleRows = [],
|
|
51
|
+
onchange,
|
|
52
|
+
disabled = false,
|
|
53
|
+
class: className = '',
|
|
54
|
+
}: FieldMappingBuilderProps = $props();
|
|
55
|
+
|
|
56
|
+
let internalRules = $state<FieldMappingRule[]>([]);
|
|
57
|
+
let showPreview = $state(false);
|
|
58
|
+
|
|
59
|
+
// 辅助函数:标准化字段名称以进行模糊智能识别
|
|
60
|
+
function normalizeKey(str: string): string {
|
|
61
|
+
return str.toLowerCase().replace(/[-_\s]/g, '');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 初始化或当 targetFields 变动时补充未包含的目标字段
|
|
65
|
+
$effect(() => {
|
|
66
|
+
if (value && value.length > 0) {
|
|
67
|
+
internalRules = [...value];
|
|
68
|
+
} else {
|
|
69
|
+
// 默认尝试一次自动匹配
|
|
70
|
+
internalRules = targetFields.map((tf) => {
|
|
71
|
+
const normTarget = normalizeKey(tf.name);
|
|
72
|
+
const normLabel = normalizeKey(tf.label);
|
|
73
|
+
const match = sourceFields.find((sf) => {
|
|
74
|
+
const normSource = normalizeKey(sf.name);
|
|
75
|
+
const normSourceLabel = sf.label ? normalizeKey(sf.label) : '';
|
|
76
|
+
return (
|
|
77
|
+
normSource === normTarget ||
|
|
78
|
+
normSource === normLabel ||
|
|
79
|
+
(normSourceLabel && normSourceLabel === normLabel) ||
|
|
80
|
+
normSource.includes(normTarget) ||
|
|
81
|
+
normTarget.includes(normSource)
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
targetField: tf.name,
|
|
87
|
+
sourceField: match ? match.name : undefined,
|
|
88
|
+
transform: 'direct',
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
function updateRule(targetFieldName: string, patch: Partial<FieldMappingRule>) {
|
|
95
|
+
if (disabled) return;
|
|
96
|
+
const next = internalRules.map((r) => {
|
|
97
|
+
if (r.targetField === targetFieldName) {
|
|
98
|
+
return { ...r, ...patch };
|
|
99
|
+
}
|
|
100
|
+
return r;
|
|
101
|
+
});
|
|
102
|
+
internalRules = next;
|
|
103
|
+
onchange?.(next);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function handleAutoMatch() {
|
|
107
|
+
if (disabled) return;
|
|
108
|
+
const next = targetFields.map((tf) => {
|
|
109
|
+
const normTarget = normalizeKey(tf.name);
|
|
110
|
+
const normLabel = normalizeKey(tf.label);
|
|
111
|
+
const match = sourceFields.find((sf) => {
|
|
112
|
+
const normSource = normalizeKey(sf.name);
|
|
113
|
+
const normSourceLabel = sf.label ? normalizeKey(sf.label) : '';
|
|
114
|
+
return (
|
|
115
|
+
normSource === normTarget ||
|
|
116
|
+
normSource === normLabel ||
|
|
117
|
+
(normSourceLabel && normSourceLabel === normLabel) ||
|
|
118
|
+
normSource.includes(normTarget) ||
|
|
119
|
+
normTarget.includes(normSource)
|
|
120
|
+
);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
targetField: tf.name,
|
|
125
|
+
sourceField: match ? match.name : undefined,
|
|
126
|
+
transform: 'direct' as TransformType,
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
internalRules = next;
|
|
130
|
+
onchange?.(next);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function handleResetAll() {
|
|
134
|
+
if (disabled) return;
|
|
135
|
+
const next = targetFields.map((tf) => ({
|
|
136
|
+
targetField: tf.name,
|
|
137
|
+
sourceField: undefined,
|
|
138
|
+
transform: 'direct' as TransformType,
|
|
139
|
+
}));
|
|
140
|
+
internalRules = next;
|
|
141
|
+
onchange?.(next);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// 统计指标计算
|
|
145
|
+
const stats = $derived.by(() => {
|
|
146
|
+
let totalTargets = targetFields.length;
|
|
147
|
+
let mappedCount = 0;
|
|
148
|
+
let missingRequired = 0;
|
|
149
|
+
|
|
150
|
+
for (const tf of targetFields) {
|
|
151
|
+
const rule = internalRules.find((r) => r.targetField === tf.name);
|
|
152
|
+
const isMapped = Boolean(rule && (rule.sourceField || rule.fallbackValue));
|
|
153
|
+
if (isMapped) {
|
|
154
|
+
mappedCount += 1;
|
|
155
|
+
} else if (tf.required) {
|
|
156
|
+
missingRequired += 1;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const isValid = missingRequired === 0;
|
|
161
|
+
const percent = totalTargets > 0 ? Math.round((mappedCount / totalTargets) * 100) : 100;
|
|
162
|
+
|
|
163
|
+
return { totalTargets, mappedCount, missingRequired, isValid, percent };
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// 推演样本数据
|
|
167
|
+
const transformedSamples = $derived.by(() => {
|
|
168
|
+
if (sourceSampleRows.length === 0) return [];
|
|
169
|
+
return sourceSampleRows.slice(0, 3).map((row) => {
|
|
170
|
+
const result: Record<string, unknown> = {};
|
|
171
|
+
for (const tf of targetFields) {
|
|
172
|
+
const rule = internalRules.find((r) => r.targetField === tf.name);
|
|
173
|
+
let rawVal = rule && rule.sourceField ? row[rule.sourceField] : undefined;
|
|
174
|
+
|
|
175
|
+
if (rawVal === undefined || rawVal === null || rawVal === '') {
|
|
176
|
+
rawVal = rule?.fallbackValue ?? tf.defaultValue ?? '';
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (rule?.transform === 'uppercase' && typeof rawVal === 'string') {
|
|
180
|
+
rawVal = rawVal.toUpperCase();
|
|
181
|
+
} else if (rule?.transform === 'lowercase' && typeof rawVal === 'string') {
|
|
182
|
+
rawVal = rawVal.toLowerCase();
|
|
183
|
+
} else if (rule?.transform === 'trim' && typeof rawVal === 'string') {
|
|
184
|
+
rawVal = rawVal.trim();
|
|
185
|
+
} else if (rule?.transform === 'number') {
|
|
186
|
+
const num = Number(rawVal);
|
|
187
|
+
rawVal = isNaN(num) ? rawVal : num;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
result[tf.name] = rawVal;
|
|
191
|
+
}
|
|
192
|
+
return result;
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
</script>
|
|
196
|
+
|
|
197
|
+
<div
|
|
198
|
+
class={cn( 'rounded-xl border border-border/80 bg-card text-card-foreground shadow-sm transition-all',
|
|
199
|
+
className
|
|
200
|
+
)}
|
|
201
|
+
data-svadmin-component="FieldMappingBuilder"
|
|
202
|
+
>
|
|
203
|
+
<!-- 头部控制栏与状态摘要 -->
|
|
204
|
+
<div class="flex flex-wrap items-center justify-between gap-4 border-b border-border/60 p-4">
|
|
205
|
+
<div class="flex items-center gap-3">
|
|
206
|
+
<div class="flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 text-primary">
|
|
207
|
+
<Link2 class="h-5 w-5" />
|
|
208
|
+
</div>
|
|
209
|
+
<div>
|
|
210
|
+
<h3 class="text-sm font-semibold tracking-tight">字段映射与转换规则</h3>
|
|
211
|
+
<p class="text-xs text-muted-foreground">
|
|
212
|
+
将导入文件或三方源字段映射至本系统目标数据模型
|
|
213
|
+
</p>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<div class="flex items-center gap-2">
|
|
218
|
+
<!-- 映射完成度指示徽标 -->
|
|
219
|
+
<div
|
|
220
|
+
class={cn( 'flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium',
|
|
221
|
+
stats.isValid
|
|
222
|
+
? 'bg-success/10 text-success '
|
|
223
|
+
: 'bg-warning/10 text-warning '
|
|
224
|
+
)}
|
|
225
|
+
>
|
|
226
|
+
{#if stats.isValid}
|
|
227
|
+
<CheckCircle2 class="h-3.5 w-3.5" />
|
|
228
|
+
<span>必填字段均已映射 ({stats.mappedCount}/{stats.totalTargets})</span>
|
|
229
|
+
{:else}
|
|
230
|
+
<AlertCircle class="h-3.5 w-3.5" />
|
|
231
|
+
<span>尚有 {stats.missingRequired} 个必填项未映射</span>
|
|
232
|
+
{/if}
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
{#if sourceSampleRows.length > 0}
|
|
236
|
+
<button
|
|
237
|
+
type="button"
|
|
238
|
+
class="flex items-center gap-1 rounded-md border border-border bg-background px-2.5 py-1 text-xs text-foreground hover:bg-muted"
|
|
239
|
+
onclick={() => (showPreview = !showPreview)}
|
|
240
|
+
>
|
|
241
|
+
{#if showPreview}
|
|
242
|
+
<EyeOff class="h-3.5 w-3.5" />
|
|
243
|
+
<span>隐藏推演</span>
|
|
244
|
+
{:else}
|
|
245
|
+
<Eye class="h-3.5 w-3.5" />
|
|
246
|
+
<span>实时推演</span>
|
|
247
|
+
{/if}
|
|
248
|
+
</button>
|
|
249
|
+
{/if}
|
|
250
|
+
|
|
251
|
+
<button
|
|
252
|
+
type="button"
|
|
253
|
+
disabled={disabled}
|
|
254
|
+
class="flex items-center gap-1 rounded-md bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary hover:bg-primary/20 disabled:opacity-50"
|
|
255
|
+
onclick={handleAutoMatch}
|
|
256
|
+
>
|
|
257
|
+
<Sparkles class="h-3.5 w-3.5" />
|
|
258
|
+
<span>智能自动匹配</span>
|
|
259
|
+
</button>
|
|
260
|
+
|
|
261
|
+
<button
|
|
262
|
+
type="button"
|
|
263
|
+
disabled={disabled}
|
|
264
|
+
class="flex items-center gap-1 rounded-md border border-border bg-background px-2.5 py-1 text-xs text-muted-foreground hover:bg-muted disabled:opacity-50"
|
|
265
|
+
onclick={handleResetAll}
|
|
266
|
+
title="清空全部映射"
|
|
267
|
+
>
|
|
268
|
+
<RotateCcw class="h-3.5 w-3.5" />
|
|
269
|
+
<span>重置</span>
|
|
270
|
+
</button>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
<!-- 映射主列表 -->
|
|
275
|
+
<div class="divide-y divide-border/40">
|
|
276
|
+
<div class="grid grid-cols-12 gap-3 bg-muted/40 px-4 py-2 text-xs font-medium text-muted-foreground">
|
|
277
|
+
<div class="col-span-4">目标模型字段 (Target Schema)</div>
|
|
278
|
+
<div class="col-span-1 text-center">关联</div>
|
|
279
|
+
<div class="col-span-4">导入数据源字段 (Source Field)</div>
|
|
280
|
+
<div class="col-span-3">清洗与转换 (Transform)</div>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
{#each targetFields as target (target.name)}
|
|
284
|
+
{@const rule = internalRules.find((r) => r.targetField === target.name)}
|
|
285
|
+
{@const isMapped = Boolean(rule && (rule.sourceField || rule.fallbackValue))}
|
|
286
|
+
{@const isMissingRequired = target.required && !isMapped}
|
|
287
|
+
|
|
288
|
+
<div
|
|
289
|
+
class={cn( 'grid grid-cols-12 items-center gap-3 px-4 py-3 text-sm transition-colors hover:bg-muted/30',
|
|
290
|
+
isMissingRequired ? 'bg-warning/5' : ''
|
|
291
|
+
)}
|
|
292
|
+
>
|
|
293
|
+
<!-- 目标字段描述 -->
|
|
294
|
+
<div class="col-span-4 flex flex-col gap-0.5">
|
|
295
|
+
<div class="flex items-center gap-1.5">
|
|
296
|
+
<span class="font-medium text-foreground">{target.label}</span>
|
|
297
|
+
<code class="rounded bg-muted px-1 py-0.5 text-[11px] text-muted-foreground">{target.name}</code>
|
|
298
|
+
{#if target.required}
|
|
299
|
+
<span class="rounded bg-destructive/10 px-1 py-0.2 text-[10px] font-semibold text-destructive">必填</span>
|
|
300
|
+
{/if}
|
|
301
|
+
</div>
|
|
302
|
+
{#if target.description}
|
|
303
|
+
<span class="text-xs text-muted-foreground">{target.description}</span>
|
|
304
|
+
{/if}
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
<!-- 连线指示箭头 -->
|
|
308
|
+
<div class="col-span-1 flex justify-center text-muted-foreground">
|
|
309
|
+
<ArrowRight class={cn('h-4 w-4', isMapped ? 'text-primary' : 'opacity-40')} />
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
<!-- 选择源字段 -->
|
|
313
|
+
<div class="col-span-4 flex items-center gap-2">
|
|
314
|
+
<select
|
|
315
|
+
disabled={disabled}
|
|
316
|
+
value={rule?.sourceField ?? ''}
|
|
317
|
+
onchange={(e) => updateRule(target.name, { sourceField: e.currentTarget.value || undefined })}
|
|
318
|
+
class={cn( 'svadmin-select h-9 text-xs',
|
|
319
|
+
isMissingRequired ? 'border-warning ring-1 ring-warning/30' : ''
|
|
320
|
+
)}
|
|
321
|
+
>
|
|
322
|
+
<option value="">-- 未映射 (使用空值或回退值) --</option>
|
|
323
|
+
{#each sourceFields as source (source.name)}
|
|
324
|
+
<option value={source.name}>
|
|
325
|
+
{source.label ? `${source.label} (${source.name})` : source.name}
|
|
326
|
+
</option>
|
|
327
|
+
{/each}
|
|
328
|
+
</select>
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
<!-- 转换选项与回退默认值 -->
|
|
332
|
+
<div class="col-span-3 flex items-center gap-2">
|
|
333
|
+
<select
|
|
334
|
+
disabled={disabled}
|
|
335
|
+
value={rule?.transform ?? 'direct'}
|
|
336
|
+
onchange={(e) => updateRule(target.name, { transform: e.currentTarget.value as TransformType })}
|
|
337
|
+
class="svadmin-select svadmin-select--inline h-9 w-28 text-xs"
|
|
338
|
+
>
|
|
339
|
+
<option value="direct">直接映射</option>
|
|
340
|
+
<option value="trim">去除前后空格</option>
|
|
341
|
+
<option value="uppercase">全大写</option>
|
|
342
|
+
<option value="lowercase">全小写</option>
|
|
343
|
+
<option value="number">转为数值</option>
|
|
344
|
+
<option value="fallback">固定回退值</option>
|
|
345
|
+
</select>
|
|
346
|
+
|
|
347
|
+
{#if rule?.transform === 'fallback' || !rule?.sourceField}
|
|
348
|
+
<input
|
|
349
|
+
type="text"
|
|
350
|
+
disabled={disabled}
|
|
351
|
+
placeholder="默认回退值"
|
|
352
|
+
value={rule?.fallbackValue ?? ''}
|
|
353
|
+
oninput={(e) => updateRule(target.name, { fallbackValue: e.currentTarget.value })}
|
|
354
|
+
class="h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
355
|
+
/>
|
|
356
|
+
{/if}
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
{/each}
|
|
360
|
+
</div>
|
|
361
|
+
|
|
362
|
+
<!-- 样本实时推演对比抽屉 -->
|
|
363
|
+
{#if showPreview && transformedSamples.length > 0}
|
|
364
|
+
<div class="border-t border-border/80 bg-muted/20 p-4">
|
|
365
|
+
<div class="mb-2 flex items-center justify-between">
|
|
366
|
+
<span class="text-xs font-semibold text-foreground">目标数据样本推演结果 (前 3 条)</span>
|
|
367
|
+
<span class="text-[11px] text-muted-foreground">根据当前映射及清洗规则实时计算</span>
|
|
368
|
+
</div>
|
|
369
|
+
<div class="overflow-x-auto rounded-lg border border-border/60 bg-background">
|
|
370
|
+
<table class="w-full text-left text-xs">
|
|
371
|
+
<thead class="border-b border-border/60 bg-muted/40 font-medium text-muted-foreground">
|
|
372
|
+
<tr>
|
|
373
|
+
{#each targetFields as target (target.name)}
|
|
374
|
+
<th class="px-3 py-2 whitespace-nowrap">{target.label}</th>
|
|
375
|
+
{/each}
|
|
376
|
+
</tr>
|
|
377
|
+
</thead>
|
|
378
|
+
<tbody class="divide-y divide-border/40">
|
|
379
|
+
{#each transformedSamples as sampleRow, sampleIndex (sampleIndex)}
|
|
380
|
+
<tr class="hover:bg-muted/30">
|
|
381
|
+
{#each targetFields as target (target.name)}
|
|
382
|
+
<td class="px-3 py-1.5 text-foreground whitespace-nowrap font-mono text-[11px]">
|
|
383
|
+
{String(sampleRow[target.name] ?? '-')}
|
|
384
|
+
</td>
|
|
385
|
+
{/each}
|
|
386
|
+
</tr>
|
|
387
|
+
{/each}
|
|
388
|
+
</tbody>
|
|
389
|
+
</table>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
{/if}
|
|
393
|
+
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface SourceField {
|
|
2
|
+
name: string;
|
|
3
|
+
label?: string | undefined;
|
|
4
|
+
sample?: unknown | undefined;
|
|
5
|
+
type?: 'string' | 'number' | 'boolean' | 'date' | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface TargetField {
|
|
8
|
+
name: string;
|
|
9
|
+
label: string;
|
|
10
|
+
required?: boolean | undefined;
|
|
11
|
+
type?: 'string' | 'number' | 'boolean' | 'date' | undefined;
|
|
12
|
+
description?: string | undefined;
|
|
13
|
+
defaultValue?: unknown | undefined;
|
|
14
|
+
}
|
|
15
|
+
export type TransformType = 'direct' | 'uppercase' | 'lowercase' | 'trim' | 'number' | 'fallback';
|
|
16
|
+
export interface FieldMappingRule {
|
|
17
|
+
targetField: string;
|
|
18
|
+
sourceField?: string | undefined;
|
|
19
|
+
transform?: TransformType | undefined;
|
|
20
|
+
fallbackValue?: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
export interface FieldMappingBuilderProps {
|
|
23
|
+
/** 外部源字段列表(如来自 CSV 表头或三方接口) */
|
|
24
|
+
sourceFields: SourceField[];
|
|
25
|
+
/** 本系统目标字段要求规范 */
|
|
26
|
+
targetFields: TargetField[];
|
|
27
|
+
/** 当前映射规则列表 */
|
|
28
|
+
value?: FieldMappingRule[] | undefined;
|
|
29
|
+
/** 选填源数据样本行,用于实时推演目标值 */
|
|
30
|
+
sourceSampleRows?: Record<string, unknown>[] | undefined;
|
|
31
|
+
/** 映射变更事件 */
|
|
32
|
+
onchange?: ((rules: FieldMappingRule[]) => void) | undefined;
|
|
33
|
+
/** 是否只读禁用 */
|
|
34
|
+
disabled?: boolean | undefined;
|
|
35
|
+
class?: string | undefined;
|
|
36
|
+
}
|
|
37
|
+
declare const FieldMappingBuilder: import("svelte").Component<FieldMappingBuilderProps, {}, "">;
|
|
38
|
+
type FieldMappingBuilder = ReturnType<typeof FieldMappingBuilder>;
|
|
39
|
+
export default FieldMappingBuilder;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import type { CrudOperator, FieldDefinition, Filter } from '@svadmin/core';
|
|
10
10
|
import { isNumericFilterField as isNumericField } from '@svadmin/core';
|
|
11
11
|
import FilterCollectionInput from './FilterCollectionInput.svelte';
|
|
12
|
+
import { filterText, filterOperatorText } from './filter-i18n.js';
|
|
12
13
|
import { readFilterTree, compileFilterTree, filterOperators, parseFilterInput, isCollectionOperator, isListOperator, isRangeOperator, isNullOperator,
|
|
13
14
|
FILTER_EDITOR_LIMITS, type FilterGroupNode, type FilterNode, type FilterRuleNode, type FilterEditorIssue, type FilterIssueCode } from './enterprise/filter-tree.js';
|
|
14
15
|
|
|
@@ -25,6 +26,8 @@
|
|
|
25
26
|
logicalOperator?: 'and' | 'or';
|
|
26
27
|
/** 宿主服务端只支持部分操作符时,限制编辑器可选项;默认沿用字段全量操作符。 */
|
|
27
28
|
allowedOperators?: readonly CrudOperator[];
|
|
29
|
+
/** 按字段进一步限制操作符,与全局白名单取交集;未列出的字段沿用全局限制。 */
|
|
30
|
+
fieldOperators?: Readonly<Record<string, readonly CrudOperator[]>>;
|
|
28
31
|
/** 宿主只支持单一组合逻辑时(如扁平 AND 查询),限制逻辑选择;默认 AND/OR 都可用。 */
|
|
29
32
|
allowedLogicalOperators?: readonly ('and' | 'or')[];
|
|
30
33
|
/** 宿主不支持嵌套条件组时关闭新增入口;已保存的嵌套组仍会按白名单校验。 */
|
|
@@ -35,12 +38,11 @@
|
|
|
35
38
|
onReset?: () => void;
|
|
36
39
|
onInvalid?: (issues: FilterEditorIssue[]) => void;
|
|
37
40
|
}
|
|
38
|
-
let { fields = [], filters = $bindable([]), logicalOperator = $bindable('and'), allowedOperators = undefined,
|
|
41
|
+
let { fields = [], filters = $bindable([]), logicalOperator = $bindable('and'), allowedOperators = undefined, fieldOperators = undefined,
|
|
39
42
|
allowedLogicalOperators = ['and', 'or'], allowGroups = true, disabled = false,
|
|
40
43
|
class: className, onApply, onReset, onInvalid }: Props = $props();
|
|
41
44
|
const uid = $props.id();
|
|
42
45
|
const i18n = useTranslation();
|
|
43
|
-
const chinese = $derived(i18n.locale.startsWith('zh'));
|
|
44
46
|
const availableFields = $derived(fields.filter((field) => field.filterable !== false));
|
|
45
47
|
const logicalOperators = $derived<readonly ('and' | 'or')[]>(
|
|
46
48
|
allowedLogicalOperators.length > 0 ? allowedLogicalOperators : ['and'],
|
|
@@ -52,9 +54,10 @@
|
|
|
52
54
|
const editorFields = $derived(fields.map(field => isNumericField(field) ? { ...field, type: 'number' as const } : field));
|
|
53
55
|
function operatorsFor(field: FieldDefinition | undefined): CrudOperator[] {
|
|
54
56
|
const operators = filterOperators(field);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return operators.filter(
|
|
57
|
+
const perField = field && fieldOperators && Object.hasOwn(fieldOperators, field.key)
|
|
58
|
+
? fieldOperators[field.key] : undefined;
|
|
59
|
+
return operators.filter(operator => (!allowedOperators || allowedOperators.includes(operator))
|
|
60
|
+
&& (!perField || perField.includes(operator)));
|
|
58
61
|
}
|
|
59
62
|
function defaultOperator(field: FieldDefinition | undefined): CrudOperator | undefined {
|
|
60
63
|
const operators = operatorsFor(field);
|
|
@@ -67,7 +70,19 @@
|
|
|
67
70
|
let nextId = 0;
|
|
68
71
|
let lastInputFilters: Filter[] | undefined;
|
|
69
72
|
let preserved = $state.raw<ReadonlyMap<string, Filter>>(new Map());
|
|
70
|
-
const compilation = $derived(
|
|
73
|
+
const compilation = $derived.by(() => {
|
|
74
|
+
const compiled = compileFilterTree({ ...root, operator: activeLogicalOperator }, editorFields, preserved);
|
|
75
|
+
if (!compiled.ok) return compiled;
|
|
76
|
+
const issues: FilterEditorIssue[] = [];
|
|
77
|
+
function validate(node: FilterNode): void {
|
|
78
|
+
if (node.kind === 'group') node.children.forEach(validate);
|
|
79
|
+
else if (!node.readonly && !operatorsFor(editorFields.find(field => field.key === node.field)).includes(node.operator)) {
|
|
80
|
+
issues.push({ path: node.id, code: 'operator' });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
validate(root);
|
|
84
|
+
return issues.length ? { ok: false as const, issues } : compiled;
|
|
85
|
+
});
|
|
71
86
|
const issues = $derived(loadIssues.length ? loadIssues : attempted && !compilation.ok ? compilation.issues : []);
|
|
72
87
|
function countNodes(node: FilterNode): number { return 1 + (node.kind === 'group' ? node.children.reduce((sum, child) => sum + countNodes(child), 0) : 0); }
|
|
73
88
|
const nodeCount = $derived(countNodes(root));
|
|
@@ -139,17 +154,9 @@
|
|
|
139
154
|
});
|
|
140
155
|
|
|
141
156
|
function message(code: FilterIssueCode): string {
|
|
142
|
-
|
|
143
|
-
'invalid-filter': ['条件结构不受支持,原条件未被修改', 'Unsupported filter structure; the original query is unchanged'],
|
|
144
|
-
limit: ['条件数量或深度超过限制', 'Filter count or depth exceeds the limit'],
|
|
145
|
-
'unknown-field': ['字段不可用于筛选', 'Field is unavailable for filtering'],
|
|
146
|
-
operator: ['操作符不适用于此字段', 'Operator is not supported for this field'],
|
|
147
|
-
logic: ['组合逻辑不受支持,原条件未被修改', 'Unsupported group logic; the original query is unchanged'],
|
|
148
|
-
value: ['请输入有效的类型化值', 'Enter a valid typed value'],
|
|
149
|
-
'empty-group': ['条件组不能为空', 'A filter group cannot be empty'],
|
|
150
|
-
};
|
|
151
|
-
return labels[code][chinese ? 0 : 1];
|
|
157
|
+
return filterText(i18n, `filterBuilder.error.${code}`);
|
|
152
158
|
}
|
|
159
|
+
|
|
153
160
|
function appendRule(group: FilterGroupNode): void {
|
|
154
161
|
if (disabled || loadIssues.length || full) return;
|
|
155
162
|
const field = availableFields[0];
|
|
@@ -225,10 +232,13 @@
|
|
|
225
232
|
|
|
226
233
|
{#snippet groupEditor(group: FilterGroupNode, depth: number, top: boolean)}
|
|
227
234
|
<fieldset class="filter-group" data-testid={top ? 'filter-builder-root' : 'filter-builder-group'} data-filter-group={group.id} disabled={disabled}>
|
|
228
|
-
<legend>{
|
|
235
|
+
<legend>{filterText(i18n, top ? 'filterBuilder.filters' : 'filterBuilder.group')}</legend>
|
|
229
236
|
<div class="group-actions">
|
|
230
|
-
<label for={`${uid}-${group.id}-logic`}>{
|
|
231
|
-
|
|
237
|
+
<label for={`${uid}-${group.id}-logic`}>{filterText(i18n, 'filterBuilder.logic')}</label>
|
|
238
|
+
{#if logicalOperators.length === 1}
|
|
239
|
+
<output id={`${uid}-${group.id}-logic`} aria-label={filterText(i18n, 'filterBuilder.groupLogic')} class="fixed-choice">{filterText(i18n, `filter.${activeLogicalOperator}`)}</output>
|
|
240
|
+
{:else}
|
|
241
|
+
<Select id={`${uid}-${group.id}-logic`} aria-label={filterText(i18n, 'filterBuilder.groupLogic')}
|
|
232
242
|
value={top ? activeLogicalOperator : group.operator}
|
|
233
243
|
disabled={disabled || logicalOperators.length <= 1}
|
|
234
244
|
onchange={(event: Event) => {
|
|
@@ -238,22 +248,23 @@
|
|
|
238
248
|
if (!logicalOperators.includes(next)) return;
|
|
239
249
|
if (top) logicalOperator = next; else group.operator = next;
|
|
240
250
|
}}>
|
|
241
|
-
{#each logicalOperators as operator (operator)}<option value={operator}>{operator
|
|
251
|
+
{#each logicalOperators as operator (operator)}<option value={operator}>{filterText(i18n, `filter.${operator}`)}</option>{/each}
|
|
242
252
|
</Select>
|
|
253
|
+
{/if}
|
|
243
254
|
<Button type="button" size="sm" variant="outline" disabled={full || depth >= FILTER_EDITOR_LIMITS.depth || !availableFields.length}
|
|
244
255
|
data-testid={top ? 'filter-builder-add-rule' : 'filter-group-add-rule'} onclick={() => appendRule(group)}>
|
|
245
256
|
<Plus size={14} aria-hidden="true" />{i18n.t('common.addRule')}
|
|
246
257
|
</Button>
|
|
247
258
|
{#if allowGroups}
|
|
248
259
|
<Button type="button" size="sm" variant="ghost" disabled={full || depth >= FILTER_EDITOR_LIMITS.depth - 1}
|
|
249
|
-
data-testid="filter-builder-add-group" onclick={() => appendGroup(group)}>{
|
|
260
|
+
data-testid="filter-builder-add-group" onclick={() => appendGroup(group)}>{filterText(i18n, 'filterBuilder.addGroup')}</Button>
|
|
250
261
|
{/if}
|
|
251
262
|
</div>
|
|
252
263
|
{#each group.children as node (node.id)}
|
|
253
264
|
{#if node.kind === 'group'}
|
|
254
265
|
<div class="nested-group">
|
|
255
266
|
{@render groupEditor(node, depth + 1, false)}
|
|
256
|
-
<Button type="button" size="sm" variant="ghost" aria-label={
|
|
267
|
+
<Button type="button" size="sm" variant="ghost" aria-label={filterText(i18n, 'filterBuilder.removeGroup')} onclick={() => removeNode(group, node.id)}><Trash2 size={14} aria-hidden="true" /></Button>
|
|
257
268
|
</div>
|
|
258
269
|
{:else}
|
|
259
270
|
{@const field = availableFields.find((item) => item.key === node.field)}
|
|
@@ -263,30 +274,34 @@
|
|
|
263
274
|
{@const describedby = issues.flatMap((issue, index) => issue.path === node.id ? [`${uid}-issue-${index}`] : []).join(' ') || undefined}
|
|
264
275
|
<div class="filter-rule" data-testid="filter-builder-rule" data-filter-rule={node.id}>
|
|
265
276
|
{#if node.readonly}
|
|
266
|
-
<output aria-label={i18n.t('filter.readonly')}>{node.field} {node.operator} {JSON.stringify(node.value)}</output>
|
|
277
|
+
<output aria-label={i18n.t('filter.readonly')}>{field?.label || node.field} {filterOperatorText(i18n, node.operator)} {JSON.stringify(node.value)}</output>
|
|
267
278
|
{:else}
|
|
268
279
|
<div>
|
|
269
|
-
<label for={`${uid}-${node.id}-field`}>{
|
|
280
|
+
<label for={`${uid}-${node.id}-field`}>{filterText(i18n, 'filterBuilder.field')}</label>
|
|
270
281
|
<Select id={`${uid}-${node.id}-field`} value={node.field} onchange={(event: Event) => { if (event.currentTarget instanceof HTMLSelectElement) changeField(node, event.currentTarget.value); }}>
|
|
271
282
|
{#if !field}<option value={node.field} disabled>{node.field}</option>{/if}
|
|
272
283
|
{#each availableFields as option (option.key)}<option value={option.key}>{option.label || option.key}</option>{/each}
|
|
273
284
|
</Select>
|
|
274
285
|
</div>
|
|
275
286
|
<div>
|
|
276
|
-
<label for={`${uid}-${node.id}-operator`}>{
|
|
287
|
+
<label for={`${uid}-${node.id}-operator`}>{filterText(i18n, 'filterBuilder.operator')}</label>
|
|
288
|
+
{#if allowed.length === 1 && allowed.includes(node.operator)}
|
|
289
|
+
<output id={`${uid}-${node.id}-operator`} aria-label={filterText(i18n, 'filterBuilder.operator')} class="fixed-choice">{filterOperatorText(i18n, node.operator)}</output>
|
|
290
|
+
{:else}
|
|
277
291
|
<Select id={`${uid}-${node.id}-operator`} value={node.operator} onchange={(event: Event) => { if (event.currentTarget instanceof HTMLSelectElement) changeOperator(node, event.currentTarget.value as CrudOperator); }}>
|
|
278
|
-
{#if !allowed.includes(node.operator)}<option value={node.operator} disabled>{node.operator}</option>{/if}
|
|
279
|
-
{#each allowed as operator (operator)}<option value={operator}>{operator}</option>{/each}
|
|
292
|
+
{#if !allowed.includes(node.operator)}<option value={node.operator} disabled>{filterOperatorText(i18n, node.operator)}</option>{/if}
|
|
293
|
+
{#each allowed as operator (operator)}<option value={operator}>{filterOperatorText(i18n, operator)}</option>{/each}
|
|
280
294
|
</Select>
|
|
295
|
+
{/if}
|
|
281
296
|
</div>
|
|
282
297
|
<div>
|
|
283
298
|
{#if collection && field}
|
|
284
|
-
<span id={`${uid}-${node.id}-value-label`}>{
|
|
299
|
+
<span id={`${uid}-${node.id}-value-label`}>{filterText(i18n, 'filterBuilder.value')}</span>
|
|
285
300
|
{:else}
|
|
286
|
-
<label for={`${uid}-${node.id}-value`}>{
|
|
301
|
+
<label for={`${uid}-${node.id}-value`}>{filterText(i18n, collection ? 'filterBuilder.jsonValue' : 'filterBuilder.value')}</label>
|
|
287
302
|
{/if}
|
|
288
303
|
{#if isNullOperator(node.operator)}
|
|
289
|
-
<Input id={`${uid}-${node.id}-value`} value={
|
|
304
|
+
<Input id={`${uid}-${node.id}-value`} value={filterText(i18n, 'filterBuilder.noValue')} disabled />
|
|
290
305
|
{:else if collection && field}
|
|
291
306
|
<FilterCollectionInput {field} value={node.value}
|
|
292
307
|
{invalid} {describedby} labelledby={`${uid}-${node.id}-value-label`}
|
|
@@ -303,13 +318,13 @@
|
|
|
303
318
|
const option = field.options?.[Number(raw)];
|
|
304
319
|
if (option && !option.disabled) node.value = option.value;
|
|
305
320
|
}}>
|
|
306
|
-
<option value="">{
|
|
321
|
+
<option value="">{filterText(i18n, 'filterBuilder.choose')}</option>
|
|
307
322
|
{#each field.options as option, index (index)}<option value={String(index)} disabled={option.disabled}>{option.label}</option>{/each}
|
|
308
323
|
</Select>
|
|
309
324
|
{:else if !collection && field?.type === 'boolean'}
|
|
310
325
|
<Select id={`${uid}-${node.id}-value`} aria-invalid={invalid} aria-describedby={describedby} value={valueText(node.value)}
|
|
311
326
|
onchange={(event: Event) => { if (event.currentTarget instanceof HTMLSelectElement) changeValue(node, event.currentTarget.value); }}>
|
|
312
|
-
<option value="">{
|
|
327
|
+
<option value="">{filterText(i18n, 'filterBuilder.choose')}</option><option value="true">{i18n.t('common.yes')}</option><option value="false">{i18n.t('common.no')}</option>
|
|
313
328
|
</Select>
|
|
314
329
|
{:else if !collection && isNumericField(field)}
|
|
315
330
|
<Input id={`${uid}-${node.id}-value`} type="number" step="any" aria-invalid={invalid} aria-describedby={describedby} value={typeof node.value === 'number' ? node.value : undefined}
|
|
@@ -324,11 +339,11 @@
|
|
|
324
339
|
{/if}
|
|
325
340
|
</div>
|
|
326
341
|
{/if}
|
|
327
|
-
<Button type="button" size="sm" variant="ghost" aria-label={
|
|
342
|
+
<Button type="button" size="sm" variant="ghost" aria-label={filterText(i18n, 'filterBuilder.removeRule')} onclick={() => removeNode(group, node.id)}><Trash2 size={14} aria-hidden="true" /></Button>
|
|
328
343
|
</div>
|
|
329
344
|
{/if}
|
|
330
345
|
{:else}
|
|
331
|
-
<p class="empty">{
|
|
346
|
+
<p class="empty">{filterText(i18n, 'filterBuilder.empty')}</p>
|
|
332
347
|
{/each}
|
|
333
348
|
</fieldset>
|
|
334
349
|
{/snippet}
|
|
@@ -346,6 +361,7 @@
|
|
|
346
361
|
</div>
|
|
347
362
|
|
|
348
363
|
<style>
|
|
364
|
+
.fixed-choice { display: flex; align-items: center; min-height: 2.25rem; padding: .375rem .75rem; color: var(--muted-foreground); }
|
|
349
365
|
.svadmin-filter-builder { color: var(--foreground); background: var(--card, var(--background)); border: 1px solid var(--border); border-radius: var(--radius, .5rem); padding: .75rem; font-size: .875rem; }
|
|
350
366
|
.builder-header, .group-actions, .nested-group { display: flex; align-items: center; gap: .5rem; }
|
|
351
367
|
.builder-header { justify-content: space-between; flex-wrap: wrap; padding-block-end: .75rem; }
|
|
@@ -12,6 +12,8 @@ interface Props {
|
|
|
12
12
|
logicalOperator?: 'and' | 'or';
|
|
13
13
|
/** 宿主服务端只支持部分操作符时,限制编辑器可选项;默认沿用字段全量操作符。 */
|
|
14
14
|
allowedOperators?: readonly CrudOperator[];
|
|
15
|
+
/** 按字段进一步限制操作符,与全局白名单取交集;未列出的字段沿用全局限制。 */
|
|
16
|
+
fieldOperators?: Readonly<Record<string, readonly CrudOperator[]>>;
|
|
15
17
|
/** 宿主只支持单一组合逻辑时(如扁平 AND 查询),限制逻辑选择;默认 AND/OR 都可用。 */
|
|
16
18
|
allowedLogicalOperators?: readonly ('and' | 'or')[];
|
|
17
19
|
/** 宿主不支持嵌套条件组时关闭新增入口;已保存的嵌套组仍会按白名单校验。 */
|