From 7792aa913e76452f4182ade40ad6a2a2b25a9d02 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 31 Jul 2026 16:14:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20search.ui=20-=20code=E2=86=92UiCode=20wi?= =?UTF-8?q?dgettype=20+=20bricks.app.root=E2=86=92this.parent=20for=20urlw?= =?UTF-8?q?idget=20sub-page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/knowledge_bases_list/search.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wwwroot/knowledge_bases_list/search.ui b/wwwroot/knowledge_bases_list/search.ui index 7ac698c..689a6a2 100644 --- a/wwwroot/knowledge_bases_list/search.ui +++ b/wwwroot/knowledge_bases_list/search.ui @@ -10,7 +10,7 @@ "subwidgets": [ {"widgettype": "Text", "options": {"text": "知识库:", "cfontsize": 13, "color": "#666"}}, { - "widgettype": "code", + "widgettype": "UiCode", "id": "kb_selector", "options": {"name": "kb_id", "dataurl": "{{entire_url('./kb_options.dspy')}}", "text": "全部", "cwidth": 18} }, @@ -47,7 +47,7 @@ "event": "changed", "actiontype": "script", "target": "search_file", - "script": "var f=this.value;if(!f)return;if(Array.isArray(f))f=f[0];if(!f)return;var kb=bricks.getWidgetById('kb_selector',bricks.app.root);var kb_id=kb?kb.getValue()||'':'all';var fd=new FormData();fd.append('file',f);var u='/rag/knowledge_bases_list/search_result.dspy?_webbricks_=1&kb_id='+encodeURIComponent(kb_id)+'&file_name='+encodeURIComponent(f.name);fetch(u,{method:'POST',body:fd}).then(function(r){return r.json()}).then(function(d){var fp=bricks.getWidgetById('search_results',bricks.app.root);if(fp){fp.clear_widgets();bricks.widgetBuild(d,fp).then(function(w){if(w)fp.add_widget(w)})}})" + "script": "var f=this.value;if(!f)return;if(Array.isArray(f))f=f[0];if(!f)return;var kb=bricks.getWidgetById('kb_selector',this.parent);var kb_id=kb?kb.getValue()||'':'all';var fd=new FormData();fd.append('file',f);var u='/rag/knowledge_bases_list/search_result.dspy?_webbricks_=1&kb_id='+encodeURIComponent(kb_id)+'&file_name='+encodeURIComponent(f.name);var pv=this.parent.parent;fetch(u,{method:'POST',body:fd}).then(function(r){return r.json()}).then(function(d){var fp=bricks.getWidgetById('search_results',pv);if(fp){fp.clear_widgets();bricks.widgetBuild(d,fp).then(function(w){if(w)fp.add_widget(w)})}})" } ] }