From fed36ff079feb2cbcbbc684a5295a46016a885d2 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 1 Jun 2026 13:35:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A8=A1=E5=9E=8B=E5=B9=BF=E5=9C=BA?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=89=BE=E4=B8=8D=E5=88=B0=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=20=E2=80=94=20=E5=86=85=E8=81=94=E5=B8=83=E5=B1=80=E6=9B=BF?= =?UTF-8?q?=E4=BB=A3=E5=B5=8C=E5=A5=97urlwidget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:TabPanel tab content通过urlwidget加载show_llms.ui时, urlwidget渲染后替换自身DOM,导致plaza_cards_panel的id丢失, getWidgetById()返回null。 修复:将左右分栏布局直接内联到model_plaza.ui的TabPanel tab content中, plaza_cards_panel改为VBox容器(保持id),初始内容通过子urlwidget加载, 点击导航按钮时用mode:replace替换VBox内容。 --- wwwroot/model_plaza.ui | 168 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 162 insertions(+), 6 deletions(-) diff --git a/wwwroot/model_plaza.ui b/wwwroot/model_plaza.ui index 7efe0ab..184b9b0 100644 --- a/wwwroot/model_plaza.ui +++ b/wwwroot/model_plaza.ui @@ -1,3 +1,5 @@ +{% set catelogs = get_llmcatelogs() %} +{% set providers = get_llms_sort_by_provider() %} { "widgettype": "VBox", "options": { @@ -42,20 +44,174 @@ "name": "by_catelog", "label": "按分类", "content": { - "widgettype": "urlwidget", + "widgettype": "HBox", "options": { - "url": "{{entire_url('show_llms.ui')}}" - } + "css": "filler", + "width": "100%", + "height": "100%" + }, + "subwidgets": [ + { + "widgettype": "VScrollPanel", + "options": { + "cwidth": 18, + "height": "100%", + "css": "plaza-sidebar" + }, + "subwidgets": [ + { + "widgettype": "Button", + "options": { + "label": "全部", + "css": "plaza-nav-btn", + "width": "100%" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "urlwidget", + "target": "app.plaza_cards_panel", + "mode": "replace", + "options": { + "url": "{{entire_url('show_llms_cards.ui')}}" + } + } + ] + }{% for cat in catelogs %}, + { + "widgettype": "Button", + "options": { + "label": "{{cat.name}}", + "css": "plaza-nav-btn", + "width": "100%" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "urlwidget", + "target": "app.plaza_cards_panel", + "mode": "replace", + "options": { + "url": "{{entire_url('show_llms_cards.ui')}}", + "params": { + "catelogid": "{{cat.id}}" + } + } + } + ] + }{% endfor %} + ] + }, + { + "widgettype": "VBox", + "id": "plaza_cards_panel", + "options": { + "css": "filler", + "cwidth": 82, + "height": "100%" + }, + "subwidgets": [ + { + "widgettype": "urlwidget", + "options": { + "css": "filler", + "width": "100%", + "height": "100%", + "url": "{{entire_url('show_llms_cards.ui')}}" + } + } + ] + } + ] } }, { "name": "by_provider", "label": "按供应商", "content": { - "widgettype": "urlwidget", + "widgettype": "HBox", "options": { - "url": "{{entire_url('show_llms_by_providers.ui')}}" - } + "css": "filler", + "width": "100%", + "height": "100%" + }, + "subwidgets": [ + { + "widgettype": "VScrollPanel", + "options": { + "cwidth": 18, + "height": "100%", + "css": "plaza-sidebar" + }, + "subwidgets": [ + { + "widgettype": "Button", + "options": { + "label": "全部", + "css": "plaza-nav-btn", + "width": "100%" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "urlwidget", + "target": "app.plaza_provider_panel", + "mode": "replace", + "options": { + "url": "{{entire_url('show_llms_cards_by_provider.ui')}}" + } + } + ] + }{% for p in providers %}, + { + "widgettype": "Button", + "options": { + "label": "{{p.orgname}}", + "css": "plaza-nav-btn", + "width": "100%" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "urlwidget", + "target": "app.plaza_provider_panel", + "mode": "replace", + "options": { + "url": "{{entire_url('show_llms_cards_by_provider.ui')}}", + "params": { + "providerid": "{{p.id}}" + } + } + } + ] + }{% endfor %} + ] + }, + { + "widgettype": "VBox", + "id": "plaza_provider_panel", + "options": { + "css": "filler", + "cwidth": 82, + "height": "100%" + }, + "subwidgets": [ + { + "widgettype": "urlwidget", + "options": { + "css": "filler", + "width": "100%", + "height": "100%", + "url": "{{entire_url('show_llms_cards_by_provider.ui')}}" + } + } + ] + } + ] } } ]