From e0f2942df33000e8d1da633dec96f54bc4735ec2 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 25 May 2026 18:30:59 +0800 Subject: [PATCH] feat: modernize platformbiz UI - add index.ui with RBAC-aware card navigation - Create index.ui with role-based visible cards (reseller.operator/sale) - Standardize card style: #1E293B bg, 12px radius, #334155 borders - Add page header with Title2 + description text - Simplify menu.ui to point to index.ui entry point - Use consistent SVG icon styling (36px, 1.5 stroke width) --- wwwroot/index.ui | 162 +++++++++++++++++++++++++++++++++++++++++++++++ wwwroot/menu.ui | 35 ++++------ 2 files changed, 173 insertions(+), 24 deletions(-) create mode 100644 wwwroot/index.ui diff --git a/wwwroot/index.ui b/wwwroot/index.ui new file mode 100644 index 0000000..cb9db06 --- /dev/null +++ b/wwwroot/index.ui @@ -0,0 +1,162 @@ +{% set roles = get_user_roles(get_user()) %} +{ + "widgettype": "VBox", + "options": { + "width": "100%", + "height": "100%", + "padding": "0" + }, + "subwidgets": [ + { + "widgettype": "HBox", + "options": { + "width": "100%", + "alignItems": "center", + "marginBottom": "24px" + }, + "subwidgets": [ + { + "widgettype": "Title2", + "options": { + "text": "平台业务", + "color": "#F1F5F9", + "fontWeight": "700" + } + }, + { + "widgettype": "Filler" + }, + { + "widgettype": "Text", + "options": { + "text": "供应商与分销商管理", + "fontSize": "14px", + "color": "#64748B" + } + } + ] + }, + { + "widgettype": "ResponsableBox", + "options": { + "gap": "16px", + "minWidth": "250px" + }, + "subwidgets": [ +{% if 'reseller.operator' in roles %} + { + "widgettype": "VBox", + "options": { + "bgcolor": "#1E293B", + "padding": "24px", + "borderRadius": "12px", + "border": "1px solid #334155", + "cursor": "pointer" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "urlwidget", + "target": "app.platformbiz_content", + "options": { + "url": "{{entire_url('/platformbiz/provider')}}" + }, + "mode": "replace" + } + ], + "subwidgets": [ + { + "widgettype": "Svg", + "options": { + "svg": "", + "width": "36px", + "height": "36px", + "marginBottom": "16px" + } + }, + { + "widgettype": "Title4", + "options": { + "text": "供应商管理", + "color": "#F1F5F9", + "fontWeight": "600", + "marginBottom": "8px" + } + }, + { + "widgettype": "Text", + "options": { + "text": "管理AI模型供应商信息与API配置", + "fontSize": "14px", + "color": "#94A3B8" + } + } + ] + }, +{% endif %} +{% if 'reseller.sale' in roles %} + { + "widgettype": "VBox", + "options": { + "bgcolor": "#1E293B", + "padding": "24px", + "borderRadius": "12px", + "border": "1px solid #334155", + "cursor": "pointer" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "urlwidget", + "target": "app.platformbiz_content", + "options": { + "url": "{{entire_url('/platformbiz/reseller')}}" + }, + "mode": "replace" + } + ], + "subwidgets": [ + { + "widgettype": "Svg", + "options": { + "svg": "", + "width": "36px", + "height": "36px", + "marginBottom": "16px" + } + }, + { + "widgettype": "Title4", + "options": { + "text": "分销商管理", + "color": "#F1F5F9", + "fontWeight": "600", + "marginBottom": "8px" + } + }, + { + "widgettype": "Text", + "options": { + "text": "管理分销商账户与渠道关系", + "fontSize": "14px", + "color": "#94A3B8" + } + } + ] + } +{% endif %} + ] + }, + { + "widgettype": "VBox", + "id": "platformbiz_content", + "options": { + "width": "100%", + "flex": "1", + "marginTop": "20px" + } + } + ] +} diff --git a/wwwroot/menu.ui b/wwwroot/menu.ui index 31a5224..121e46e 100644 --- a/wwwroot/menu.ui +++ b/wwwroot/menu.ui @@ -1,27 +1,14 @@ {% set roles = get_user_roles(get_user()) %} { - "widgettype":"Menu", - "options":{ - "target":"page_center", - "cwidth":10, - "items":[ -{% if 'reseller.operator' in roles %} - { - "name":"provider", - "label":"供应商管理" - "url":"{{entire_url('/platformbiz/provider')}}" - } -{% endif %} -{% if 'reseller.sale' in roles %} - { - "name":"reseller", - "label":"分销商管理", - "url":"{{entire_url('/platformbiz/reseller'}}" - } -{% endif %} -{% if 'reseller.accountant' in roles %} -{% endif %} - {} - ] - } + "widgettype": "Menu", + "id": "platformbiz_menu", + "options": { + "items": [ + { + "name": "dashboard", + "label": "平台业务", + "url": "{{entire_url('/platformbiz/index.ui')}}" + } + ] + } }