From 7fa70b9a24444ab6245bce529125a843197de0e2 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 10 Jul 2026 11:03:56 +0800 Subject: [PATCH] fix: use urlwidget+PopupWindow instead of script/dspy for toolbar binds bricks.js only supports 5 actiontypes; dspy and script with fetch are not available. Use urlwidget with PopupWindow target instead. --- wwwroot/sub_distributors_list/index.ui | 17 +++++++++++++++-- wwwroot/suppliers_list/index.ui | 12 ++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/wwwroot/sub_distributors_list/index.ui b/wwwroot/sub_distributors_list/index.ui index 1a8be25..9ea0a37 100644 --- a/wwwroot/sub_distributors_list/index.ui +++ b/wwwroot/sub_distributors_list/index.ui @@ -321,8 +321,21 @@ { "wid": "self", "event": "distribution_agreements", - "actiontype": "script", - "script": "bricks_fetch('{{entire_url('../api/ensure_distribution_agreement.dspy')}}',{method:'POST',body:JSON.stringify({sub_reseller_id:data.id})}).then(r=>r.json()).then(r=>bricks.showMessage(r.options.title,r.options.message,r.options.type||'success'))" + "actiontype": "urlwidget", + "target": "PopupWindow", + "popup_options": { + "title": "分销协议", + "height": "200px", + "width": "400px" + }, + "params_mapping": { + "mapping": {"id": "sub_reseller_id"}, + "need_other": false + }, + "options": { + "method": "POST", + "url": "{{entire_url('../api/ensure_distribution_agreement.dspy')}}" + } } ] diff --git a/wwwroot/suppliers_list/index.ui b/wwwroot/suppliers_list/index.ui index 299d8a9..b3f940b 100644 --- a/wwwroot/suppliers_list/index.ui +++ b/wwwroot/suppliers_list/index.ui @@ -453,11 +453,15 @@ { "wid": "self", "event": "supply_contracts", - "actiontype": "dspy", + "actiontype": "urlwidget", + "target": "PopupWindow", + "popup_options": { + "title": "供销协议", + "height": "200px", + "width": "400px" + }, "params_mapping": { - "mapping": { - "id": "supplier_id" - }, + "mapping": {"id": "supplier_id"}, "need_other": false }, "options": {