This commit is contained in:
yumoqing 2026-05-03 14:25:31 +08:00
parent 41636f0c91
commit 74d9c1e426

View File

@ -1,67 +1,120 @@
{ {
"type": "Page", "id": "customer_management",
"title": "Customer Management", "widgettype": "VBox",
"content": { "options": {
"type": "VBox", "width": "100%",
"style": {"padding": "16px", "height": "100%"}, "height": "100%",
"children": [ "style": {
{ "padding": "16px"
"type": "HBox", }
"justify": "space-between", },
"style": {"marginBottom": "16px"}, "subwidgets": [
"children": [ {
{"type": "Text", "content": "Customer List", "style": {"fontSize": "20px", "fontWeight": "bold"}}, "widgettype": "HBox",
{"type": "Button", "id": "addCustomerBtn", "text": "Add Customer", "variant": "primary", "leadingIcon": "add", "onclick": "openDialog('addCustomerDialog')"} "options": {
] "style": {
"marginBottom": "16px",
"gap": "8px"
}
}, },
{ "subwidgets": [
"type": "CRUD", {
"id": "customerCRUD", "widgettype": "Text",
"api": { "options": {
"list": "main/customer_management/api/customers_list.dspy", "label": "客户管理",
"create": "main/customer_management/api/customers_create.dspy", "style": {
"update": "main/customer_management/api/customers_update.dspy", "fontSize": "20px",
"delete": "main/customer_management/api/customers_delete.dspy" "fontWeight": "bold"
}
}
}, },
"columns": [ {
{"field": "customer_name", "title": "Customer Name", "width": 180}, "widgettype": "Filler",
{"field": "customer_type", "title": "Type", "width": 100, "formatter": "code:customer_type"}, "options": {}
{"field": "phone", "title": "Phone", "width": 130}, },
{"field": "email", "title": "Email", "width": 180}, {
{"field": "industry", "title": "Industry", "width": 120}, "widgettype": "Button",
{"field": "customer_level", "title": "Level", "width": 100, "formatter": "code:customer_level"}, "id": "btn_add_customer",
{"field": "region", "title": "Region", "width": 100}, "options": {
{"field": "status", "title": "Status", "width": 80, "formatter": "code:customer_status"}, "label": "新增客户",
{"field": "created_at", "title": "Created", "width": 160} "variant": "primary"
], }
"style": {"flex": 1} }
}, ]
{ },
"type": "Dialog", {
"id": "addCustomerDialog", "widgettype": "Tabular",
"title": "Add Customer", "id": "customer_grid",
"width": 600, "options": {
"content": { "data_url": "{{entire_url('api/customers_list.dspy')}}",
"type": "Form", "data_method": "GET",
"id": "addCustomerForm", "row_options": {
"fields": [ "fields": [
{"field": "customer_name", "title": "Customer Name", "uitype": "TextField", "required": true}, {
{"field": "customer_type", "title": "Type", "uitype": "SelectField", "required": true, "options": "code:customer_type"}, "name": "customer_code",
{"field": "phone", "title": "Phone", "uitype": "TextField"}, "title": "客户编码",
{"field": "email", "title": "Email", "uitype": "TextField"}, "uitype": "str",
{"field": "tax_id", "title": "Tax ID", "uitype": "TextField"}, "cwidth": 12
{"field": "industry", "title": "Industry", "uitype": "TextField"}, },
{"field": "customer_level", "title": "Level", "uitype": "SelectField", "options": "code:customer_level", "value": "potential"}, {
{"field": "address", "title": "Address", "uitype": "TextField"}, "name": "customer_name",
{"field": "region", "title": "Region", "uitype": "TextField"}, "title": "客户名称",
{"field": "owner_id", "title": "Owner ID", "uitype": "TextField", "required": true} "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
}
], ],
"actions": [ "toolbar": [
{"type": "Button", "text": "Cancel", "onclick": "closeDialog('addCustomerDialog')"}, {
{"type": "Button", "text": "Submit", "variant": "primary", "onclick": "submitForm('addCustomerForm', 'main/customer_management/api/customers_create.dspy', 'addCustomerDialog', 'customerCRUD')"} "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}}')"
}
] ]
} }
} }
] }
} ]
} }