{ "widgettype": "VBox", "options": {"width": "100%", "height": "100%", "padding": "8px", "gap": "8px"}, "subwidgets": [ { "widgettype": "InlineForm", "id": "project_cost_filter", "options": { "css": "card", "padding": "8px", "submit_label": "查询", "fields": [ {"name": "date_from", "label": "开始日期", "uitype": "date", "cwidth": 12}, {"name": "date_to", "label": "结束日期", "uitype": "date", "cwidth": 12}, {"name": "status", "label": "状态", "uitype": "code", "cwidth": 10, "data": [ {"value": "", "text": "全部"}, {"value": "SUCCEEDED", "text": "成功"}, {"value": "FAILED", "text": "失败"} ]} ] }, "binds": [{ "wid": "self", "event": "submit", "actiontype": "script", "target": "project_cost_table", "script": "var tbl = bricks.getWidgetById('project_cost_table', bricks.app); if(tbl) await tbl.render(params);" }] }, { "widgettype": "Tabular", "id": "project_cost_table", "options": { "title": "按项目费用统计", "description": "按 llm_usage.project_id 分组汇总(成本=账号侧,应付=客户侧);project_id='0' 为非项目调用;缺省显示全部状态", "width": "100%", "css": "card", "data_url": "{{entire_url('../api/llm_project_cost_query.dspy')}}", "data_method": "GET", "page_rows": 50, "row_options": { "browserfields": { "exclouded": ["project_id"] }, "fields": [ {"name": "project_name", "title": "项目", "type": "str", "length": 100, "cwidth": 30}, {"name": "calls", "title": "调用次数", "type": "int", "cwidth": 10}, {"name": "cost", "title": "成本合计(元)", "type": "float", "cwidth": 12}, {"name": "charge", "title": "客户应付合计(元)", "type": "float", "cwidth": 14}, {"name": "req_tokens", "title": "输入token", "type": "int", "cwidth": 12}, {"name": "resp_tokens", "title": "输出token", "type": "int", "cwidth": 12} ] } } } ] }