From 49c99a5e74ed2ee466e34eb44b829a9917b43497 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 5 May 2026 19:36:13 +0800 Subject: [PATCH] fix: flatten style to options, fix Button/Text widget properties - Flatten nested style objects directly into options - Text/Title use 'text', Button uses 'label' - All paths use {{entire_url()}} --- wwwroot/receivable_edit.ui | 146 ++++++++++++++++++++++++++----------- wwwroot/receivables.ui | 30 +++----- 2 files changed, 115 insertions(+), 61 deletions(-) diff --git a/wwwroot/receivable_edit.ui b/wwwroot/receivable_edit.ui index 0248dc4..193a550 100644 --- a/wwwroot/receivable_edit.ui +++ b/wwwroot/receivable_edit.ui @@ -1,45 +1,109 @@ { - "widgettype": "Page", - "options": { - "title": "编辑应收账款", - "style": {"height": "100vh", "padding": "0"} - }, - "subwidgets": [ - { - "widgettype": "VBox", - "options": {"style": {"padding": "16px", "flex": 1, "overflow": "auto"}}, - "subwidgets": [ + "widgettype": "Page", + "options": { + "title": "编辑应收账款", + "height": "100vh", + "padding": "0" + }, + "subwidgets": [ { - "widgettype": "Form", - "id": "receivable_form", - "options": { - "submit_url": "{{entire_url('api/receivables_create.dspy')}}", - "method": "POST", - "layout": "vertical", - "style": {"maxWidth": "600px"}, - "fields": [ - {"name": "order_id", "label": "订单号", "uitype": "text"}, - {"name": "contract_id", "label": "合同ID", "uitype": "text"}, - {"name": "customer_id", "label": "客户ID", "uitype": "text"}, - {"name": "receivable_amount", "label": "应收金额", "uitype": "number", "required": true}, - {"name": "due_date", "label": "到期日", "uitype": "date", "required": true}, - {"name": "status", "label": "状态", "uitype": "code", "data": [ - {"value": "pending", "text": "待收"}, - {"value": "partial", "text": "部分收款"}, - {"value": "received", "text": "已收款"}, - {"value": "overdue", "text": "逾期"} - ]}, - {"name": "received_amount", "label": "已收金额", "uitype": "number"}, - {"name": "description", "label": "说明", "uitype": "textarea"}, - {"name": "org_id", "label": "组织ID", "uitype": "text"} - ], - "buttons": [ - {"type": "submit", "text": "保存", "variant": "primary"}, - {"type": "button", "text": "取消", "action": "navigate('main/financial_management/receivables.ui')"} + "widgettype": "VBox", + "options": { + "padding": "16px", + "flex": 1, + "overflow": "auto" + }, + "subwidgets": [ + { + "widgettype": "Form", + "id": "receivable_form", + "options": { + "submit_url": "{{entire_url('api/receivables_create.dspy')}}", + "method": "POST", + "layout": "vertical", + "fields": [ + { + "name": "order_id", + "label": "订单号", + "uitype": "text" + }, + { + "name": "contract_id", + "label": "合同ID", + "uitype": "text" + }, + { + "name": "customer_id", + "label": "客户ID", + "uitype": "text" + }, + { + "name": "receivable_amount", + "label": "应收金额", + "uitype": "number", + "required": true + }, + { + "name": "due_date", + "label": "到期日", + "uitype": "date", + "required": true + }, + { + "name": "status", + "label": "状态", + "uitype": "code", + "data": [ + { + "value": "pending", + "text": "待收" + }, + { + "value": "partial", + "text": "部分收款" + }, + { + "value": "received", + "text": "已收款" + }, + { + "value": "overdue", + "text": "逾期" + } + ] + }, + { + "name": "received_amount", + "label": "已收金额", + "uitype": "number" + }, + { + "name": "description", + "label": "说明", + "uitype": "textarea" + }, + { + "name": "org_id", + "label": "组织ID", + "uitype": "text" + } + ], + "buttons": [ + { + "type": "submit", + "text": "保存", + "variant": "primary" + }, + { + "type": "button", + "text": "取消", + "action": "navigate('main/financial_management/receivables.ui')" + } + ], + "maxWidth": "600px" + } + } ] - } } - ] - } - ] -} + ] +} \ No newline at end of file diff --git a/wwwroot/receivables.ui b/wwwroot/receivables.ui index 0cb23b2..84c4d39 100644 --- a/wwwroot/receivables.ui +++ b/wwwroot/receivables.ui @@ -2,29 +2,23 @@ "widgettype": "Page", "options": { "title": "应收账款", - "style": { - "height": "100vh", - "padding": "0" - } + "height": "100vh", + "padding": "0" }, "subwidgets": [ { "widgettype": "VBox", "options": { - "style": { - "padding": "16px", - "flex": 1, - "overflow": "hidden" - } + "padding": "16px", + "flex": 1, + "overflow": "hidden" }, "subwidgets": [ { "widgettype": "HBox", "options": { - "style": { - "marginBottom": "16px", - "gap": "8px" - } + "marginBottom": "16px", + "gap": "8px" }, "subwidgets": [ { @@ -33,9 +27,7 @@ "options": { "label": "搜索", "placeholder": "合同/客户", - "style": { - "flex": 1 - } + "flex": 1 } }, { @@ -62,9 +54,6 @@ "id": "receivables_grid", "options": { "url": "{{entire_url('api/receivables_list.dspy')}}", - "style": { - "flex": 1 - }, "columns": [ { "field": "id", @@ -120,7 +109,8 @@ "icon": "delete", "action": "doDelete('{% raw %}{{selectedRow.id}}{% endraw %}')" } - ] + ], + "flex": 1 } } ]