diff --git a/wwwroot/knowledge_bases_list/detail.ui b/wwwroot/knowledge_bases_list/detail.ui index 68c6702..3300eea 100644 --- a/wwwroot/knowledge_bases_list/detail.ui +++ b/wwwroot/knowledge_bases_list/detail.ui @@ -34,6 +34,7 @@ "widgettype": "Tree", "options": { "title": "目录", + "id": "dir_tree", "parentField": "parentid", "idField": "id", "textField": "label", @@ -47,7 +48,15 @@ "update_url": "{{entire_url('./update_tree_item.dspy')}}", "delete_url": "{{entire_url('./delete_tree_item.dspy')}}" } - } + }, + "binds": [ + { + "wid": "self", + "event": "selected", + "actiontype": "script", + "script": "window._rag_current_folder = event.params.id ? event.params.id : ''" + } + ] } ] }, @@ -57,18 +66,9 @@ "subwidgets": [ { "widgettype": "VBox", - "options": { - "width": "100%", - "cheight": 8, - "bgcolor": "#f8f9fa", - "padding": "16px", - "css": "card", - "border": "2px dashed #3b82f6", - "alignItems": "center", - "justifyContent": "center" - }, + "options": {"id": "drop_zone", "width": "100%", "cheight": 8, "bgcolor": "#f8f9fa", "padding": "16px", "css": "card", "border": "2px dashed #3b82f6", "alignItems": "center", "justifyContent": "center"}, "subwidgets": [ - {"widgettype": "Text", "options": {"text": "📂 点击或拖拽文件到此处上传", "cfontsize": 15, "color": "#888"}}, + {"widgettype": "Text", "options": {"text": "📂 点击选择文件上传", "cfontsize": 15, "color": "#888"}}, {"widgettype": "Text", "options": {"text": "支持 TXT/PDF/JPG/PNG/MP3/WAV/MP4", "cfontsize": 12, "color": "#aaa"}}, { "widgettype": "Button", @@ -76,12 +76,11 @@ "binds": [{ "wid": "self", "event": "click", - "actiontype": "urlwidget", - "target": "app.detail_content", - "mode": "replace", - "options": {"url": "{{entire_url('./upload.dspy')}}", "params": {"kb_id": "{{params_kw.kb_id}}"}} + "actiontype": "script", + "script": "var i=document.createElement('input');i.type='file';i.multiple=true;i.onchange=function(){var kb='{{params_kw.kb_id}}';var fd=window._rag_current_folder||'';for(var j=0;j