From 2acf06e5e562e30f251a222cb307eaa9da1aba1c Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Mon, 22 Jun 2026 12:11:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20get=5Fcode.dspy=20supports=20prepend=5F?= =?UTF-8?q?all=3D1=20to=20add=20'=E5=85=A8=E9=83=A8'=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When prepend_all=1 is passed, insert {valueField:'', textField:'全部'} as the first item in the result array. Used by InlineForm search fields. --- wwwroot/get_code.dspy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wwwroot/get_code.dspy b/wwwroot/get_code.dspy index 0f5f998..b9e357e 100644 --- a/wwwroot/get_code.dspy +++ b/wwwroot/get_code.dspy @@ -23,5 +23,7 @@ debug(f'/appbase/get_code.dspy: {sql=}') async with db.sqlorContext(params_kw.dbname) as sor: rs = await sor.sqlExe(sql, ns) + if params_kw.get('prepend_all') == '1': + rs.insert(0, {params_kw.valueField: '', params_kw.textField: '全部'}) return rs return []