From ac7a5926189a492f6a7713e441f7647dc946ec7e Mon Sep 17 00:00:00 2001 From: WangLeo <690854599@qq.com> Date: Tue, 9 Jun 2026 14:39:54 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=20dimension.separato?= =?UTF-8?q?r=20=E5=AD=97=E6=AE=B5=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JSON 无法携带 JS 函数,dimension 类型需通过 separator 字段 让前端在运行时生成等价的 parse/format 逻辑。 --- docs/模型参数后端化方案.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/模型参数后端化方案.md b/docs/模型参数后端化方案.md index 82b6630..ff66fc9 100644 --- a/docs/模型参数后端化方案.md +++ b/docs/模型参数后端化方案.md @@ -128,6 +128,7 @@ GET /api/v1/models/:modelId/config "label": "尺寸", "default": "1024*1024", "dimension": { + "separator": "*", "width": { "min": 256, "max": 6197 }, "height": { "min": 256, "max": 4096 } } @@ -171,6 +172,8 @@ GET /api/v1/models/:modelId/config | `imageUpload` | `ImageUploader` | 参考图上传,`maxCount` 控制数量上限 | | `hidden` | 无 | 静默写入默认值,不渲染控件 | +> **关于 `dimension.separator`:** 当前前端 Painting 配置中 `parse/format` 为 JS 函数(`s.split('*')` / `` `${w}*${h}` ``),后端返回 JSON 无法携带函数。因此 `dimension` 类型的配置需包含 `separator` 字段,前端据此在运行时生成等价的 parse/format 逻辑,无需硬编码分隔符。拆分模式(`dimensionWidth` + `dimensionHeight`)无此字段。 + ### 3.4 条件显示 ```json