From d5a2e25e18a7eba980839224bf65ed8481901637 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Tue, 4 Aug 2026 17:40:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(editor):=20=E5=AE=8C=E5=96=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=AE=BE=E7=BD=AE=E5=99=A8=E5=AD=97=E6=AE=B5=20typeMa?= =?UTF-8?q?tch=20=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为 Background/Font/Position 补充类型校验提示。 字重字段支持字符串与数字,并复用 validateDataSourceFieldSelectValue。 getRules 过滤无 validator 的 typeMatch:false 规则,避免 number 被误校验。 --- .../src/fields/StyleSetter/pro/Background.vue | 7 ++ .../src/fields/StyleSetter/pro/Font.vue | 57 +++++++++++++++ .../src/fields/StyleSetter/pro/Position.vue | 31 ++++++++ packages/editor/src/utils/type-match-rules.ts | 41 ++++++++++- .../tests/unit/utils/typeMatchRules.spec.ts | 55 +++++++++++++- packages/form/src/utils/form.ts | 73 +++++++++++-------- .../form/tests/unit/utils/typeMatch.spec.ts | 27 +++++++ 7 files changed, 254 insertions(+), 37 deletions(-) diff --git a/packages/editor/src/fields/StyleSetter/pro/Background.vue b/packages/editor/src/fields/StyleSetter/pro/Background.vue index 01abdf1b..905e1cd1 100644 --- a/packages/editor/src/fields/StyleSetter/pro/Background.vue +++ b/packages/editor/src/fields/StyleSetter/pro/Background.vue @@ -17,6 +17,7 @@