fix: wrap Tabular in VBox with cheight for proper scrolling

This commit is contained in:
yumoqing 2026-05-29 22:09:48 +08:00
parent 314b4763ae
commit 8f1b4d98ae

View File

@ -1,114 +1,123 @@
{ {
"id": "customer_management", "id": "customer_management",
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
"width": "100%", "width": "100%",
"height": "100%", "height": "100%",
"padding": "16px" "padding": "16px"
}, },
"subwidgets": [ "subwidgets": [
{
"widgettype": "HBox",
"options": {
"marginBottom": "16px",
"gap": "8px"
},
"subwidgets": [
{ {
"widgettype": "HBox", "widgettype": "Text",
"options": { "options": {
"marginBottom": "16px", "text": "客户管理",
"gap": "8px" "fontSize": "20px",
}, "fontWeight": "bold"
"subwidgets": [ }
{
"widgettype": "Text",
"options": {
"text": "客户管理",
"fontSize": "20px",
"fontWeight": "bold"
}
},
{
"widgettype": "Filler",
"options": {}
},
{
"widgettype": "Button",
"id": "btn_add_customer",
"options": {
"label": "新增客户",
"variant": "primary"
}
}
]
}, },
{ {
"widgettype": "Tabular", "widgettype": "Filler",
"id": "customer_grid", "options": {}
"options": { },
"data_url": "{{entire_url('api/customers_list.dspy')}}", {
"data_method": "GET", "widgettype": "Button",
"row_options": { "id": "btn_add_customer",
"fields": [ "options": {
{ "label": "新增客户",
"name": "customer_code", "variant": "primary"
"title": "客户编码", }
"uitype": "str",
"cwidth": 12
},
{
"name": "customer_name",
"title": "客户名称",
"uitype": "str",
"cwidth": 15
},
{
"name": "customer_type",
"title": "类型",
"uitype": "str",
"cwidth": 10
},
{
"name": "industry",
"title": "行业",
"uitype": "str",
"cwidth": 10
},
{
"name": "contact_person",
"title": "联系人",
"uitype": "str",
"cwidth": 10
},
{
"name": "phone",
"title": "电话",
"uitype": "str",
"cwidth": 12
},
{
"name": "status",
"title": "状态",
"uitype": "str",
"cwidth": 8
}
],
"toolbar": [
{
"type": "button",
"text": "新增",
"icon": "add",
"action": "navigate('customer_edit.ui')"
},
{
"type": "button",
"text": "编辑",
"icon": "edit",
"action": "navigate('customer_edit.ui?id={{selectedRow.id}}')"
},
{
"type": "button",
"text": "删除",
"icon": "delete",
"action": "doDelete('{{selectedRow.id}}')"
}
]
}
}
} }
] ]
},
{
"widgettype": "VBox",
"options": {
"cheight": 38,
"width": "100%"
},
"subwidgets": [
{
"widgettype": "Tabular",
"id": "customer_grid",
"options": {
"data_url": "{{entire_url('api/customers_list.dspy')}}",
"data_method": "GET",
"row_options": {
"fields": [
{
"name": "customer_code",
"title": "客户编码",
"uitype": "str",
"cwidth": 12
},
{
"name": "customer_name",
"title": "客户名称",
"uitype": "str",
"cwidth": 15
},
{
"name": "customer_type",
"title": "类型",
"uitype": "str",
"cwidth": 10
},
{
"name": "industry",
"title": "行业",
"uitype": "str",
"cwidth": 10
},
{
"name": "contact_person",
"title": "联系人",
"uitype": "str",
"cwidth": 10
},
{
"name": "phone",
"title": "电话",
"uitype": "str",
"cwidth": 12
},
{
"name": "status",
"title": "状态",
"uitype": "str",
"cwidth": 8
}
],
"toolbar": [
{
"type": "button",
"text": "新增",
"icon": "add",
"action": "navigate('customer_edit.ui')"
},
{
"type": "button",
"text": "编辑",
"icon": "edit",
"action": "navigate('customer_edit.ui?id={{selectedRow.id}}')"
},
{
"type": "button",
"text": "删除",
"icon": "delete",
"action": "doDelete('{{selectedRow.id}}')"
}
]
}
}
}
]
}
]
} }