From 9e3734525cf238c2f074bba2426be35f83f87d71 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 5 May 2026 19:28:25 +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/approval_task_detail.ui | 120 ++++++++------- wwwroot/base.ui | 260 ++++++++++++++++++++++---------- wwwroot/index.ui | 30 ++-- wwwroot/mobile_base.ui | 192 ++++++++++++----------- 4 files changed, 358 insertions(+), 244 deletions(-) diff --git a/wwwroot/approval_task_detail.ui b/wwwroot/approval_task_detail.ui index 8aa3c25..1c1c89e 100644 --- a/wwwroot/approval_task_detail.ui +++ b/wwwroot/approval_task_detail.ui @@ -1,66 +1,72 @@ { - "widgettype": "VBox", - "options": { - "maxWidth": "100%", - "padding": "15px" - }, - "subwidgets": [ - { - "widgettype": "Text", - "options": { - "text": "审批详情", - "fontSize": "18px", - "fontWeight": "bold", - "marginBottom": "20px" - } + "widgettype": "VBox", + "options": { + "maxWidth": "100%", + "padding": "15px" }, - { - "widgettype": "Form", - "options": { - "tblname": "approval_task", - "mode": "view", - "fields": ["title", "step_name", "description", "assigned_at", "due_at"], - "fieldLabels": { - "title": "审批事项", - "step_name": "审批步骤", - "description": "详细说明", - "assigned_at": "分配时间", - "due_at": "截止时间" - } - } - }, - { - "widgettype": "HBox", - "options": { - "marginTop": "30px", - "gap": "10px" - }, - "subwidgets": [ + "subwidgets": [ { - "widgettype": "Button", - "options": { - "text": "批准", - "onClick": "approve_task", - "style": { - "backgroundColor": "#28a745", - "color": "white", - "flex": "1" + "widgettype": "Text", + "options": { + "text": "审批详情", + "fontSize": "18px", + "fontWeight": "bold", + "marginBottom": "20px" } - } }, { - "widgettype": "Button", - "options": { - "text": "拒绝", - "onClick": "reject_task", - "style": { - "backgroundColor": "#dc3545", - "color": "white", - "flex": "1" + "widgettype": "Form", + "options": { + "tblname": "approval_task", + "mode": "view", + "fields": [ + "title", + "step_name", + "description", + "assigned_at", + "due_at" + ], + "fieldLabels": { + "title": "审批事项", + "step_name": "审批步骤", + "description": "详细说明", + "assigned_at": "分配时间", + "due_at": "截止时间" + } } - } + }, + { + "widgettype": "HBox", + "options": { + "marginTop": "30px", + "gap": "10px" + }, + "subwidgets": [ + { + "widgettype": "Button", + "options": { + "onClick": "approve_task", + "style": { + "backgroundColor": "#28a745", + "color": "white", + "flex": "1" + }, + "label": "批准" + } + }, + { + "widgettype": "Button", + "options": { + "onClick": "reject_task", + "style": { + "backgroundColor": "#dc3545", + "color": "white", + "flex": "1" + }, + "label": "拒绝" + } + } + ] } - ] - } - ] + ] } \ No newline at end of file diff --git a/wwwroot/base.ui b/wwwroot/base.ui index a83c5be..110223b 100644 --- a/wwwroot/base.ui +++ b/wwwroot/base.ui @@ -1,87 +1,185 @@ { - "id": "workflow_approval", - "widgettype": "VBox", - "options": {"width": "100%", "height": "100%", "style": {"padding": "16px"}}, - "subwidgets": [ - { - "widgettype": "HBox", - "options": {"style": {"marginBottom": "16px", "gap": "8px"}}, - "subwidgets": [ - {"widgettype": "Text", "options": {"label": "审批管理", "style": {"fontSize": "20px", "fontWeight": "bold"}}}, - {"widgettype": "Filler", "options": {}} - ] + "id": "workflow_approval", + "widgettype": "VBox", + "options": { + "width": "100%", + "height": "100%", + "style": { + "padding": "16px" + } }, - { - "widgettype": "TabPanel", - "id": "approval_tabs", - "options": { - "tab_pos": "top", - "items": [ - { - "name": "pending", - "label": "待审批", - "content": { - "widgettype": "Tabular", - "id": "pending_grid", - "options": { - "data_url": "{{entire_url('api/approvals_list.dspy?status=pending')}}", - "data_method": "GET", - "row_options": { - "fields": [ - {"name": "approval_code", "title": "审批编号", "uitype": "str", "cwidth": 12}, - {"name": "title", "title": "标题", "uitype": "str", "cwidth": 20}, - {"name": "applicant", "title": "申请人", "uitype": "str", "cwidth": 10}, - {"name": "apply_date", "title": "申请日期", "uitype": "str", "cwidth": 12}, - {"name": "status", "title": "状态", "uitype": "str", "cwidth": 8} - ] + "subwidgets": [ + { + "widgettype": "HBox", + "options": { + "style": { + "marginBottom": "16px", + "gap": "8px" } - } - } - }, - { - "name": "approved", - "label": "已审批", - "content": { - "widgettype": "Tabular", - "id": "approved_grid", - "options": { - "data_url": "{{entire_url('api/approvals_list.dspy?status=approved')}}", - "data_method": "GET", - "row_options": { - "fields": [ - {"name": "approval_code", "title": "审批编号", "uitype": "str", "cwidth": 12}, - {"name": "title", "title": "标题", "uitype": "str", "cwidth": 20}, - {"name": "applicant", "title": "申请人", "uitype": "str", "cwidth": 10}, - {"name": "apply_date", "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": "TabPanel", + "id": "approval_tabs", + "options": { + "tab_pos": "top", + "items": [ + { + "name": "pending", + "label": "待审批", + "content": { + "widgettype": "Tabular", + "id": "pending_grid", + "options": { + "data_url": "{{entire_url('api/approvals_list.dspy?status=pending')}}", + "data_method": "GET", + "row_options": { + "fields": [ + { + "name": "approval_code", + "title": "审批编号", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "title", + "title": "标题", + "uitype": "str", + "cwidth": 20 + }, + { + "name": "applicant", + "title": "申请人", + "uitype": "str", + "cwidth": 10 + }, + { + "name": "apply_date", + "title": "申请日期", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "status", + "title": "状态", + "uitype": "str", + "cwidth": 8 + } + ] + } + } + } + }, + { + "name": "approved", + "label": "已审批", + "content": { + "widgettype": "Tabular", + "id": "approved_grid", + "options": { + "data_url": "{{entire_url('api/approvals_list.dspy?status=approved')}}", + "data_method": "GET", + "row_options": { + "fields": [ + { + "name": "approval_code", + "title": "审批编号", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "title", + "title": "标题", + "uitype": "str", + "cwidth": 20 + }, + { + "name": "applicant", + "title": "申请人", + "uitype": "str", + "cwidth": 10 + }, + { + "name": "apply_date", + "title": "申请日期", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "status", + "title": "状态", + "uitype": "str", + "cwidth": 8 + } + ] + } + } + } + }, + { + "name": "rejected", + "label": "已拒绝", + "content": { + "widgettype": "Tabular", + "id": "rejected_grid", + "options": { + "data_url": "{{entire_url('api/approvals_list.dspy?status=rejected')}}", + "data_method": "GET", + "row_options": { + "fields": [ + { + "name": "approval_code", + "title": "审批编号", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "title", + "title": "标题", + "uitype": "str", + "cwidth": 20 + }, + { + "name": "applicant", + "title": "申请人", + "uitype": "str", + "cwidth": 10 + }, + { + "name": "apply_date", + "title": "申请日期", + "uitype": "str", + "cwidth": 12 + }, + { + "name": "status", + "title": "状态", + "uitype": "str", + "cwidth": 8 + } + ] + } + } + } + } + ] } - }, - { - "name": "rejected", - "label": "已拒绝", - "content": { - "widgettype": "Tabular", - "id": "rejected_grid", - "options": { - "data_url": "{{entire_url('api/approvals_list.dspy?status=rejected')}}", - "data_method": "GET", - "row_options": { - "fields": [ - {"name": "approval_code", "title": "审批编号", "uitype": "str", "cwidth": 12}, - {"name": "title", "title": "标题", "uitype": "str", "cwidth": 20}, - {"name": "applicant", "title": "申请人", "uitype": "str", "cwidth": 10}, - {"name": "apply_date", "title": "申请日期", "uitype": "str", "cwidth": 12}, - {"name": "status", "title": "状态", "uitype": "str", "cwidth": 8} - ] - } - } - } - } - ] - } - } - ] + } + ] } \ No newline at end of file diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 7d9ecfe..1b7ae06 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": "#D97706" + "color": "#D97706", + "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": "#7C3AED" + "color": "#7C3AED", + "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/mobile_base.ui b/wwwroot/mobile_base.ui index 5dd74b4..cff5975 100644 --- a/wwwroot/mobile_base.ui +++ b/wwwroot/mobile_base.ui @@ -1,98 +1,108 @@ { - "widgettype": "VBox", - "options": { - "maxWidth": "100%", - "padding": "10px" - }, - "subwidgets": [ - { - "widgettype": "HBox", - "options": { - "alignItems": "center", - "justifyContent": "space-between", - "marginBottom": "15px" - }, - "subwidgets": [ + "widgettype": "VBox", + "options": { + "maxWidth": "100%", + "padding": "10px" + }, + "subwidgets": [ { - "widgettype": "Text", - "options": { - "text": "审批中心", - "fontSize": "20px", - "fontWeight": "bold" - } + "widgettype": "HBox", + "options": { + "alignItems": "center", + "justifyContent": "space-between", + "marginBottom": "15px" + }, + "subwidgets": [ + { + "widgettype": "Text", + "options": { + "text": "审批中心", + "fontSize": "20px", + "fontWeight": "bold" + } + }, + { + "widgettype": "Button", + "options": { + "onClick": "goto('workflow_approval/approval_instance/create.ui')", + "style": { + "backgroundColor": "#007bff", + "color": "white", + "border": "none", + "padding": "8px 16px", + "borderRadius": "4px" + }, + "label": "发起审批" + } + } + ] }, { - "widgettype": "Button", - "options": { - "text": "发起审批", - "onClick": "goto('workflow_approval/approval_instance/create.ui')", - "style": { - "backgroundColor": "#007bff", - "color": "white", - "border": "none", - "padding": "8px 16px", - "borderRadius": "4px" + "widgettype": "TabPanel", + "options": { + "items": [ + { + "title": "待我审批", + "content": { + "widgettype": "DataGrid", + "options": { + "tblname": "approval_task", + "where": { + "approver_id": "${logined_userid}", + "status": "pending" + }, + "fields": [ + "title", + "step_name", + "assigned_at", + "due_at" + ], + "fieldLabels": { + "title": "审批事项", + "step_name": "步骤", + "assigned_at": "分配时间", + "due_at": "截止时间" + }, + "onRowClick": "goto('workflow_approval/approval_task/detail.ui?id=${id}')" + } + } + }, + { + "title": "我发起的", + "content": { + "widgettype": "DataGrid", + "options": { + "tblname": "approval_instance", + "where": { + "initiator_id": "${logined_userid}" + }, + "fields": [ + "title", + "status", + "created_at", + "completed_at" + ], + "fieldLabels": { + "title": "审批事项", + "status": "状态", + "created_at": "发起时间", + "completed_at": "完成时间" + }, + "onRowClick": "goto('workflow_approval/approval_instance/detail.ui?id=${id}')" + } + } + }, + { + "title": "工作流管理", + "content": { + "widgettype": "Frame", + "options": { + "src": "workflow_approval/approval_workflow/list.ui" + } + } + } + ] } - } } - ] - }, - { - "widgettype": "TabPanel", - "options": { - "items": [ - { - "title": "待我审批", - "content": { - "widgettype": "DataGrid", - "options": { - "tblname": "approval_task", - "where": { - "approver_id": "${logined_userid}", - "status": "pending" - }, - "fields": ["title", "step_name", "assigned_at", "due_at"], - "fieldLabels": { - "title": "审批事项", - "step_name": "步骤", - "assigned_at": "分配时间", - "due_at": "截止时间" - }, - "onRowClick": "goto('workflow_approval/approval_task/detail.ui?id=${id}')" - } - } - }, - { - "title": "我发起的", - "content": { - "widgettype": "DataGrid", - "options": { - "tblname": "approval_instance", - "where": { - "initiator_id": "${logined_userid}" - }, - "fields": ["title", "status", "created_at", "completed_at"], - "fieldLabels": { - "title": "审批事项", - "status": "状态", - "created_at": "发起时间", - "completed_at": "完成时间" - }, - "onRowClick": "goto('workflow_approval/approval_instance/detail.ui?id=${id}')" - } - } - }, - { - "title": "工作流管理", - "content": { - "widgettype": "Frame", - "options": { - "src": "workflow_approval/approval_workflow/list.ui" - } - } - } - ] - } - } - ] + ] } \ No newline at end of file