From 6fe0cb49309e4e37933ba6e1b1950ee013181333 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 5 May 2026 19:28:22 +0800 Subject: [PATCH] fix: Text widgets use 'text' not 'label', Button widgets use 'label' not 'text' Per bricks-framework spec: - Text/Title: use 'text' for non-i18n, 'otext'+'i18n:true' for i18n - Button: use 'label' for button text --- wwwroot/base.ui | 224 +++++++++++++++++++-------------------- wwwroot/customer_list.ui | 160 ++++++++++++++++++++-------- wwwroot/index.ui | 38 +++---- 3 files changed, 249 insertions(+), 173 deletions(-) diff --git a/wwwroot/base.ui b/wwwroot/base.ui index ad3722f..3ad45c9 100644 --- a/wwwroot/base.ui +++ b/wwwroot/base.ui @@ -1,120 +1,120 @@ { - "id": "customer_management", - "widgettype": "VBox", - "options": { - "width": "100%", - "height": "100%", - "style": { - "padding": "16px" - } - }, - "subwidgets": [ - { - "widgettype": "HBox", - "options": { + "id": "customer_management", + "widgettype": "VBox", + "options": { + "width": "100%", + "height": "100%", "style": { - "marginBottom": "16px", - "gap": "8px" + "padding": "16px" } - }, - "subwidgets": [ - { - "widgettype": "Text", - "options": { - "label": "客户管理", - "style": { - "fontSize": "20px", - "fontWeight": "bold" - } - } - }, - { - "widgettype": "Filler", - "options": {} - }, - { - "widgettype": "Button", - "id": "btn_add_customer", - "options": { - "label": "新增客户", - "variant": "primary" - } - } - ] }, - { - "widgettype": "Tabular", - "id": "customer_grid", - "options": { - "data_url": "{{entire_url('api/customers_list.dspy')}}", - "data_method": "GET", - "row_options": { - "fields": [ - { - "name": "customer_code", - "title": "客户编码", - "uitype": "str", - "cwidth": 12 + "subwidgets": [ + { + "widgettype": "HBox", + "options": { + "style": { + "marginBottom": "16px", + "gap": "8px" + } }, - { - "name": "customer_name", - "title": "客户名称", - "uitype": "str", - "cwidth": 15 - }, - { - "name": "customer_type", - "title": "类型", - "uitype": "str", - "cwidth": 10 - }, - { - "name": "industry", - "title": "行业", - "uitype": "str", - "cwidth": 10 - }, - { - "name": "contact_person", - "title": "联系人", - "uitype": "str", - "cwidth": 10 - }, - { - "name": "phone", - "title": "电话", - "uitype": "str", - "cwidth": 12 - }, - { - "name": "status", - "title": "状态", - "uitype": "str", - "cwidth": 8 + "subwidgets": [ + { + "widgettype": "Text", + "options": { + "style": { + "fontSize": "20px", + "fontWeight": "bold" + }, + "text": "客户管理" + } + }, + { + "widgettype": "Filler", + "options": {} + }, + { + "widgettype": "Button", + "id": "btn_add_customer", + "options": { + "label": "新增客户", + "variant": "primary" + } + } + ] + }, + { + "widgettype": "Tabular", + "id": "customer_grid", + "options": { + "data_url": "{{entire_url('api/customers_list.dspy')}}", + "data_method": "GET", + "row_options": { + "fields": [ + { + "name": "customer_code", + "title": "客户编码", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "customer_name", + "title": "客户名称", + "uitype": "str", + "cwidth": 15 + }, + { + "name": "customer_type", + "title": "类型", + "uitype": "str", + "cwidth": 10 + }, + { + "name": "industry", + "title": "行业", + "uitype": "str", + "cwidth": 10 + }, + { + "name": "contact_person", + "title": "联系人", + "uitype": "str", + "cwidth": 10 + }, + { + "name": "phone", + "title": "电话", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "status", + "title": "状态", + "uitype": "str", + "cwidth": 8 + } + ], + "toolbar": [ + { + "type": "button", + "text": "新增", + "icon": "add", + "action": "navigate('customer_edit.ui')" + }, + { + "type": "button", + "text": "编辑", + "icon": "edit", + "action": "navigate('customer_edit.ui?id={{selectedRow.id}}')" + }, + { + "type": "button", + "text": "删除", + "icon": "delete", + "action": "doDelete('{{selectedRow.id}}')" + } + ] + } } - ], - "toolbar": [ - { - "type": "button", - "text": "新增", - "icon": "add", - "action": "navigate('customer_edit.ui')" - }, - { - "type": "button", - "text": "编辑", - "icon": "edit", - "action": "navigate('customer_edit.ui?id={{selectedRow.id}}')" - }, - { - "type": "button", - "text": "删除", - "icon": "delete", - "action": "doDelete('{{selectedRow.id}}')" - } - ] } - } - } - ] + ] } \ No newline at end of file diff --git a/wwwroot/customer_list.ui b/wwwroot/customer_list.ui index a8be893..7e47fb9 100644 --- a/wwwroot/customer_list.ui +++ b/wwwroot/customer_list.ui @@ -1,45 +1,121 @@ { - "widgettype": "Page", - "options": { - "title": "客户列表", - "style": {"height": "100vh", "padding": "0"} - }, - "subwidgets": [ - { - "widgettype": "VBox", - "options": {"style": {"padding": "16px", "flex": 1, "overflow": "hidden"}}, - "subwidgets": [ - { - "widgettype": "HBox", - "options": {"style": {"marginBottom": "16px", "gap": "8px"}}, - "subwidgets": [ - {"widgettype": "TextField", "id": "search_keyword", "options": {"label": "搜索", "placeholder": "客户名称/编码", "style": {"flex": 1}}}, - {"widgettype": "Button", "id": "btn_search", "options": {"text": "搜索", "variant": "primary"}} - ] - }, - { - "widgettype": "DataGrid", - "id": "customer_grid", - "options": { - "url": "{{entire_url('api/customers_list.dspy')}}", - "style": {"flex": 1}, - "columns": [ - {"field": "customer_code", "header": "客户编码", "width": 120}, - {"field": "customer_name", "header": "客户名称", "width": 200}, - {"field": "customer_type", "header": "类型", "width": 100}, - {"field": "industry", "header": "行业", "width": 120}, - {"field": "contact_person", "header": "联系人", "width": 100}, - {"field": "phone", "header": "电话", "width": 120}, - {"field": "status", "header": "状态", "width": 80} - ], - "toolbar": [ - {"type": "button", "text": "新增", "icon": "add", "action": "navigate('main/customer_management/customer_edit.ui')"}, - {"type": "button", "text": "编辑", "icon": "edit", "action": "navigate('main/customer_management/customer_edit.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')"}, - {"type": "button", "text": "删除", "icon": "delete", "action": "doDelete('{% raw %}{{selectedRow.id}}{% endraw %}')"} - ] - } + "widgettype": "Page", + "options": { + "title": "客户列表", + "style": { + "height": "100vh", + "padding": "0" } - ] - } - ] + }, + "subwidgets": [ + { + "widgettype": "VBox", + "options": { + "style": { + "padding": "16px", + "flex": 1, + "overflow": "hidden" + } + }, + "subwidgets": [ + { + "widgettype": "HBox", + "options": { + "style": { + "marginBottom": "16px", + "gap": "8px" + } + }, + "subwidgets": [ + { + "widgettype": "TextField", + "id": "search_keyword", + "options": { + "label": "搜索", + "placeholder": "客户名称/编码", + "style": { + "flex": 1 + } + } + }, + { + "widgettype": "Button", + "id": "btn_search", + "options": { + "variant": "primary", + "label": "搜索" + } + } + ] + }, + { + "widgettype": "DataGrid", + "id": "customer_grid", + "options": { + "url": "{{entire_url('api/customers_list.dspy')}}", + "style": { + "flex": 1 + }, + "columns": [ + { + "field": "customer_code", + "header": "客户编码", + "width": 120 + }, + { + "field": "customer_name", + "header": "客户名称", + "width": 200 + }, + { + "field": "customer_type", + "header": "类型", + "width": 100 + }, + { + "field": "industry", + "header": "行业", + "width": 120 + }, + { + "field": "contact_person", + "header": "联系人", + "width": 100 + }, + { + "field": "phone", + "header": "电话", + "width": 120 + }, + { + "field": "status", + "header": "状态", + "width": 80 + } + ], + "toolbar": [ + { + "type": "button", + "text": "新增", + "icon": "add", + "action": "navigate('main/customer_management/customer_edit.ui')" + }, + { + "type": "button", + "text": "编辑", + "icon": "edit", + "action": "navigate('main/customer_management/customer_edit.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')" + }, + { + "type": "button", + "text": "删除", + "icon": "delete", + "action": "doDelete('{% raw %}{{selectedRow.id}}{% endraw %}')" + } + ] + } + } + ] + } + ] } \ No newline at end of file diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 026d95e..6ea268e 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -10,11 +10,11 @@ { "widgettype": "Text", "options": { - "label": "客户管理", "fontSize": "24px", "fontWeight": "bold", "color": "#1E40AF", - "marginBottom": "20px" + "marginBottom": "20px", + "text": "客户管理" } }, { @@ -49,19 +49,19 @@ { "widgettype": "Text", "options": { - "label": "客户列表", "fontSize": "18px", "fontWeight": "bold", - "color": "#1E40AF" + "color": "#1E40AF", + "text": "客户列表" } }, { "widgettype": "Text", "options": { - "label": "查看所有客户信息,支持搜索和筛选", "fontSize": "14px", "color": "#6B7280", - "marginTop": "8px" + "marginTop": "8px", + "text": "查看所有客户信息,支持搜索和筛选" } } ] @@ -91,19 +91,19 @@ { "widgettype": "Text", "options": { - "label": "新建客户", "fontSize": "18px", "fontWeight": "bold", - "color": "#059669" + "color": "#059669", + "text": "新建客户" } }, { "widgettype": "Text", "options": { - "label": "创建新的客户档案", "fontSize": "14px", "color": "#6B7280", - "marginTop": "8px" + "marginTop": "8px", + "text": "创建新的客户档案" } } ] @@ -133,19 +133,19 @@ { "widgettype": "Text", "options": { - "label": "客户池", "fontSize": "18px", "fontWeight": "bold", - "color": "#D97706" + "color": "#D97706", + "text": "客户池" } }, { "widgettype": "Text", "options": { - "label": "公海客户池,领取和管理公共客户资源", "fontSize": "14px", "color": "#6B7280", - "marginTop": "8px" + "marginTop": "8px", + "text": "公海客户池,领取和管理公共客户资源" } } ] @@ -175,19 +175,19 @@ { "widgettype": "Text", "options": { - "label": "客户交接", "fontSize": "18px", "fontWeight": "bold", - "color": "#7C3AED" + "color": "#7C3AED", + "text": "客户交接" } }, { "widgettype": "Text", "options": { - "label": "管理客户交接流程和记录", "fontSize": "14px", "color": "#6B7280", - "marginTop": "8px" + "marginTop": "8px", + "text": "管理客户交接流程和记录" } } ] @@ -208,4 +208,4 @@ } } ] -} +} \ No newline at end of file