diff --git a/xls2ddl/__pycache__/tmpls.cpython-312.pyc b/xls2ddl/__pycache__/tmpls.cpython-312.pyc index 1a4c59a..c72c60b 100644 Binary files a/xls2ddl/__pycache__/tmpls.cpython-312.pyc and b/xls2ddl/__pycache__/tmpls.cpython-312.pyc differ diff --git a/xls2ddl/tmpls.py b/xls2ddl/tmpls.py index ade5126..7251921 100644 --- a/xls2ddl/tmpls.py +++ b/xls2ddl/tmpls.py @@ -3,35 +3,6 @@ data_browser_tmpl = """ "widgettype":"VBox", "options":{"height":"100%","width":"100%"}, "subwidgets":[ -{% if data_filter and data_filter.fields %} -{ - "widgettype":"InlineForm", - "id":"{{tblname}}_search", - "options":{ - "css":"card", - "padding":"8px", - "show_label":false, - "submit_label":"搜索", - "submit_css":"primary", - "fields":[ -{%- for f in data_filter.fields %} -{%- if f.uitype == 'code' %} - {{json.dumps(filter_fields[loop.index0], ensure_ascii=False)}}{% if not loop.last %},{% endif %} -{%- else %} - {"name":"{{f.field}}","uitype":"{{f.uitype}}","placeholder":"{{f.title}}","cwidth":15}{% if not loop.last %},{% endif %} -{%- endif %} -{%- endfor %} - ] - }, - "binds":[{ - "wid":"self", - "event":"submit", - "actiontype":"script", - "target":"app.{{tblname}}_tbl", - "script":"var tbl = bricks.getWidgetById('app.{{tblname}}_tbl'); if(tbl) await tbl.render(params);" - }] -}, -{% endif %} { "id":"{{tblname}}_tbl", "widgettype":"Tabular", @@ -104,6 +75,14 @@ data_browser_tmpl = """ {% endif %} {% if data_filter %} "data_filter":{{json.dumps(data_filter, indent=4, ensure_ascii=False)}}, + "search_form":{ + "css":"card", + "padding":"8px", + "show_label":false, + "submit_label":"搜索", + "submit_css":"primary", + "fields":{{json.dumps(filter_fields, indent=4, ensure_ascii=False)}} + }, {% endif %} {% if filter_labels %} "filter_labels":{{json.dumps(filter_labels, indent=4, ensure_ascii=False)}},