From a2cb5a8eec45e0f2ff01cb36df403270fdd43051 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 5 May 2026 19:28:23 +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/index.ui | 30 ++-- wwwroot/opportunity_management.ui | 171 +++++++++++++++++------ 3 files changed, 254 insertions(+), 171 deletions(-) diff --git a/wwwroot/base.ui b/wwwroot/base.ui index 9bbbd70..d06ada5 100644 --- a/wwwroot/base.ui +++ b/wwwroot/base.ui @@ -1,120 +1,120 @@ { - "id": "opportunity_management", - "widgettype": "VBox", - "options": { - "width": "100%", - "height": "100%", - "style": { - "padding": "16px" - } - }, - "subwidgets": [ - { - "widgettype": "HBox", - "options": { + "id": "opportunity_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_opportunity", - "options": { - "label": "新增商机", - "variant": "primary" - } - } - ] }, - { - "widgettype": "Tabular", - "id": "opportunity_grid", - "options": { - "data_url": "{{entire_url('api/opportunities_list.dspy')}}", - "data_method": "GET", - "row_options": { - "fields": [ - { - "name": "opportunity_code", - "title": "商机编码", - "uitype": "str", - "cwidth": 12 + "subwidgets": [ + { + "widgettype": "HBox", + "options": { + "style": { + "marginBottom": "16px", + "gap": "8px" + } }, - { - "name": "opportunity_name", - "title": "商机名称", - "uitype": "str", - "cwidth": 15 - }, - { - "name": "customer_name", - "title": "客户", - "uitype": "str", - "cwidth": 12 - }, - { - "name": "stage", - "title": "阶段", - "uitype": "str", - "cwidth": 10 - }, - { - "name": "amount", - "title": "金额", - "uitype": "str", - "cwidth": 12 - }, - { - "name": "probability", - "title": "概率", - "uitype": "str", - "cwidth": 8 - }, - { - "name": "expected_close_date", - "title": "预计关闭日期", - "uitype": "str", - "cwidth": 12 + "subwidgets": [ + { + "widgettype": "Text", + "options": { + "style": { + "fontSize": "20px", + "fontWeight": "bold" + }, + "text": "商机管理" + } + }, + { + "widgettype": "Filler", + "options": {} + }, + { + "widgettype": "Button", + "id": "btn_add_opportunity", + "options": { + "label": "新增商机", + "variant": "primary" + } + } + ] + }, + { + "widgettype": "Tabular", + "id": "opportunity_grid", + "options": { + "data_url": "{{entire_url('api/opportunities_list.dspy')}}", + "data_method": "GET", + "row_options": { + "fields": [ + { + "name": "opportunity_code", + "title": "商机编码", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "opportunity_name", + "title": "商机名称", + "uitype": "str", + "cwidth": 15 + }, + { + "name": "customer_name", + "title": "客户", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "stage", + "title": "阶段", + "uitype": "str", + "cwidth": 10 + }, + { + "name": "amount", + "title": "金额", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "probability", + "title": "概率", + "uitype": "str", + "cwidth": 8 + }, + { + "name": "expected_close_date", + "title": "预计关闭日期", + "uitype": "str", + "cwidth": 12 + } + ], + "toolbar": [ + { + "type": "button", + "text": "新增", + "icon": "add", + "action": "navigate('opportunity_edit.ui')" + }, + { + "type": "button", + "text": "编辑", + "icon": "edit", + "action": "navigate('opportunity_edit.ui?id={{selectedRow.id}}')" + }, + { + "type": "button", + "text": "删除", + "icon": "delete", + "action": "doDelete('{{selectedRow.id}}')" + } + ] + } } - ], - "toolbar": [ - { - "type": "button", - "text": "新增", - "icon": "add", - "action": "navigate('opportunity_edit.ui')" - }, - { - "type": "button", - "text": "编辑", - "icon": "edit", - "action": "navigate('opportunity_edit.ui?id={{selectedRow.id}}')" - }, - { - "type": "button", - "text": "删除", - "icon": "delete", - "action": "doDelete('{{selectedRow.id}}')" - } - ] } - } - } - ] + ] } \ No newline at end of file diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 94763c8..9922a2a 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": "管理销售阶段配置和转化率" } } ] @@ -166,4 +166,4 @@ } } ] -} +} \ No newline at end of file diff --git a/wwwroot/opportunity_management.ui b/wwwroot/opportunity_management.ui index f4b3e13..44107c8 100644 --- a/wwwroot/opportunity_management.ui +++ b/wwwroot/opportunity_management.ui @@ -1,46 +1,129 @@ { - "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": "Button", "id": "btn_add", "options": {"text": "新增", "variant": "primary", "action": "navigate('main/opportunity_management/opportunity_edit.ui')"}} - ] - }, - { - "widgettype": "DataGrid", - "id": "opportunity_grid", - "options": { - "url": "{{entire_url('api/opportunities_list.dspy')}}", - "style": {"flex": 1}, - "columns": [ - {"field": "opportunity_name", "header": "商机名称", "width": 200}, - {"field": "customer_name", "header": "客户", "width": 150}, - {"field": "estimated_amount", "header": "预估金额", "width": 120}, - {"field": "current_stage", "header": "阶段", "width": 120}, - {"field": "probability", "header": "概率", "width": 80}, - {"field": "expected_close_date", "header": "预计成交", "width": 120}, - {"field": "owner_name", "header": "负责人", "width": 100}, - {"field": "status", "header": "状态", "width": 80} - ], - "toolbar": [ - {"type": "button", "text": "编辑", "icon": "edit", "action": "navigate('main/opportunity_management/opportunity_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": "Button", + "id": "btn_add", + "options": { + "variant": "primary", + "action": "navigate('main/opportunity_management/opportunity_edit.ui')", + "label": "新增" + } + } + ] + }, + { + "widgettype": "DataGrid", + "id": "opportunity_grid", + "options": { + "url": "{{entire_url('api/opportunities_list.dspy')}}", + "style": { + "flex": 1 + }, + "columns": [ + { + "field": "opportunity_name", + "header": "商机名称", + "width": 200 + }, + { + "field": "customer_name", + "header": "客户", + "width": 150 + }, + { + "field": "estimated_amount", + "header": "预估金额", + "width": 120 + }, + { + "field": "current_stage", + "header": "阶段", + "width": 120 + }, + { + "field": "probability", + "header": "概率", + "width": 80 + }, + { + "field": "expected_close_date", + "header": "预计成交", + "width": 120 + }, + { + "field": "owner_name", + "header": "负责人", + "width": 100 + }, + { + "field": "status", + "header": "状态", + "width": 80 + } + ], + "toolbar": [ + { + "type": "button", + "text": "编辑", + "icon": "edit", + "action": "navigate('main/opportunity_management/opportunity_edit.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')" + }, + { + "type": "button", + "text": "删除", + "icon": "delete", + "action": "doDelete('{% raw %}{{selectedRow.id}}{% endraw %}')" + } + ] + } + } + ] + } + ] +} \ No newline at end of file