sage_datamart/wwwroot/sect_currency.ui
yumoqing 990c35a953 fix: sect_currency urldata crash, switch to render_urldata method
The 4 period buttons used actiontype:urldata which calls
_buildDataHandler requiring desc.status_of[data.status] mapping.
Neither was provided, causing 'Cannot read properties of
undefined (reading undefined)' crash.

Fix: use actiontype:method with method:render_urldata (ChartBar's
inherited EchartsExt method). ChartBar's data_url now uses
data_params={'period':'all'} for default, buttons pass {period:x}
via render_urldata params.
2026-07-27 11:59:32 +08:00

34 lines
1.7 KiB
XML

{
"widgettype": "VBox",
"options": {"width": "100%", "gap": "8px"},
"subwidgets": [
{
"widgettype": "HBox",
"options": {"gap": "4px"},
"subwidgets": [
{"widgettype": "Button", "id": "btn_all", "options": {"label": "累计", "i18n": true}},
{"widgettype": "Button", "id": "btn_year", "options": {"label": "当年", "i18n": true}},
{"widgettype": "Button", "id": "btn_month", "options": {"label": "当月", "i18n": true}},
{"widgettype": "Button", "id": "btn_today", "options": {"label": "当天", "i18n": true}}
]
},
{
"widgettype": "ChartBar",
"id": "financial_chart",
"options": {
"height": "180px",
"data_url": "{{entire_url('/sage_datamart/api/financial_chart.dspy')}}",
"data_params": {"period": "all"},
"nameField": "metric",
"valueFields": ["value"]
}
}
],
"binds": [
{"wid": "btn_all", "event": "click", "actiontype": "method", "target": "financial_chart", "method": "render_urldata", "params": {"period": "all"}},
{"wid": "btn_year", "event": "click", "actiontype": "method", "target": "financial_chart", "method": "render_urldata", "params": {"period": "year"}},
{"wid": "btn_month", "event": "click", "actiontype": "method", "target": "financial_chart", "method": "render_urldata", "params": {"period": "month"}},
{"wid": "btn_today", "event": "click", "actiontype": "method", "target": "financial_chart", "method": "render_urldata", "params": {"period": "today"}}
]
}