From a63b6ce42723b35bbc6a3e72c7b54f93261ff2bc Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 3 Jul 2026 16:46:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=99=84=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=94=B9=E7=94=A8=20UiFile=20changed=20+=20fetch=20FormData?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UiFile changed 事件 → script fetch POST multipart → 成功后 render Tabular 无需点击上传按钮,选择文件即自动上传 --- wwwroot/api/contract_attach.ui | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/wwwroot/api/contract_attach.ui b/wwwroot/api/contract_attach.ui index ca8f553..5b63600 100644 --- a/wwwroot/api/contract_attach.ui +++ b/wwwroot/api/contract_attach.ui @@ -23,19 +23,20 @@ } }, { - "widgettype": "Form", - "id": "upload_form", + "widgettype": "UiFile", + "id": "file_input", "options": { - "submit_url": "{{entire_url('/filemgr/upload_file.dspy')}}", - "fields": [ - {"name": "folderid", "uitype": "hide", "value": "{{folder}}"}, - {"name": "fiid", "uitype": "hide", "value": "{{fiid}}"}, - {"name": "upfile", "uitype": "file", "multiple": true, "label": "选择文件"} - ], - "buttons": [ - {"name": "submit", "label": "上传", "css": "primary"} - ] - } + "name": "upfile", + "multiple": true, + "label": "选择文件(支持多选及拖拽)", + "cwidth": 30 + }, + "binds": [{ + "wid": "self", + "event": "changed", + "actiontype": "script", + "script": "var files=this.get_files();if(!files||!files.length)return;var fd=new FormData();fd.append('folderid','{{folder}}');fd.append('fiid','{{fiid}}');for(var i=0;i