- Flatten nested style objects directly into options
- Text/Title use 'text', Button uses 'label'
- All paths use {{entire_url()}}
111 lines
4.2 KiB
XML
111 lines
4.2 KiB
XML
{
|
|
"widgettype": "Page",
|
|
"options": {
|
|
"title": "客户列表",
|
|
"height": "100vh",
|
|
"padding": "0"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"padding": "16px",
|
|
"flex": 1,
|
|
"overflow": "hidden"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {
|
|
"marginBottom": "16px",
|
|
"gap": "8px"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "TextField",
|
|
"id": "search_keyword",
|
|
"options": {
|
|
"label": "搜索",
|
|
"placeholder": "客户名称/编码",
|
|
"flex": 1
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Button",
|
|
"id": "btn_search",
|
|
"options": {
|
|
"variant": "primary",
|
|
"label": "搜索"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "DataGrid",
|
|
"id": "customer_grid",
|
|
"options": {
|
|
"url": "{{entire_url('api/customers_list.dspy')}}",
|
|
"columns": [
|
|
{
|
|
"field": "customer_code",
|
|
"header": "客户编码",
|
|
"width": 120
|
|
},
|
|
{
|
|
"field": "customer_name",
|
|
"header": "客户名称",
|
|
"width": 200
|
|
},
|
|
{
|
|
"field": "customer_type",
|
|
"header": "类型",
|
|
"width": 100
|
|
},
|
|
{
|
|
"field": "industry",
|
|
"header": "行业",
|
|
"width": 120
|
|
},
|
|
{
|
|
"field": "contact_person",
|
|
"header": "联系人",
|
|
"width": 100
|
|
},
|
|
{
|
|
"field": "phone",
|
|
"header": "电话",
|
|
"width": 120
|
|
},
|
|
{
|
|
"field": "status",
|
|
"header": "状态",
|
|
"width": 80
|
|
}
|
|
],
|
|
"toolbar": [
|
|
{
|
|
"type": "button",
|
|
"text": "新增",
|
|
"icon": "add",
|
|
"action": "navigate('main/customer_management/customer_edit.ui')"
|
|
},
|
|
{
|
|
"type": "button",
|
|
"text": "编辑",
|
|
"icon": "edit",
|
|
"action": "navigate('main/customer_management/customer_edit.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')"
|
|
},
|
|
{
|
|
"type": "button",
|
|
"text": "删除",
|
|
"icon": "delete",
|
|
"action": "doDelete('{% raw %}{{selectedRow.id}}{% endraw %}')"
|
|
}
|
|
],
|
|
"flex": 1
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |