bugfix
This commit is contained in:
parent
a81dd8087a
commit
5ac011c96e
165
wwwroot/base.ui
165
wwwroot/base.ui
@ -1,67 +1,120 @@
|
|||||||
{
|
{
|
||||||
"type": "Page",
|
"id": "opportunity_management",
|
||||||
"title": "Opportunity Management",
|
"widgettype": "VBox",
|
||||||
"content": {
|
"options": {
|
||||||
"type": "VBox",
|
"width": "100%",
|
||||||
"style": {"padding": "16px", "height": "100%"},
|
"height": "100%",
|
||||||
"children": [
|
"style": {
|
||||||
|
"padding": "16px"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"subwidgets": [
|
||||||
{
|
{
|
||||||
"type": "HBox",
|
"widgettype": "HBox",
|
||||||
"justify": "space-between",
|
"options": {
|
||||||
"style": {"marginBottom": "16px"},
|
"style": {
|
||||||
"children": [
|
"marginBottom": "16px",
|
||||||
{"type": "Text", "content": "Opportunity List", "style": {"fontSize": "20px", "fontWeight": "bold"}},
|
"gap": "8px"
|
||||||
{"type": "Button", "text": "Add Opportunity", "variant": "primary", "leadingIcon": "add", "onclick": "openDialog('addOpportunityDialog')"}
|
}
|
||||||
|
},
|
||||||
|
"subwidgets": [
|
||||||
|
{
|
||||||
|
"widgettype": "Text",
|
||||||
|
"options": {
|
||||||
|
"label": "商机管理",
|
||||||
|
"style": {
|
||||||
|
"fontSize": "20px",
|
||||||
|
"fontWeight": "bold"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype": "Filler",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype": "Button",
|
||||||
|
"id": "btn_add_opportunity",
|
||||||
|
"options": {
|
||||||
|
"label": "新增商机",
|
||||||
|
"variant": "primary"
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "CRUD",
|
"widgettype": "Tabular",
|
||||||
"id": "opportunityCRUD",
|
"id": "opportunity_grid",
|
||||||
"api": {
|
"options": {
|
||||||
"list": "api/opportunities_list.dspy",
|
"data_url": "{{entire_url('api/opportunities_list.dspy')}}",
|
||||||
"create": "api/opportunities_create.dspy",
|
"data_method": "GET",
|
||||||
"update": "api/opportunities_update.dspy",
|
"row_options": {
|
||||||
"delete": "api/opportunities_delete.dspy"
|
|
||||||
},
|
|
||||||
"columns": [
|
|
||||||
{"field": "opportunity_name", "title": "Opportunity", "width": 200},
|
|
||||||
{"field": "customer_name", "title": "Customer", "width": 150},
|
|
||||||
{"field": "estimated_amount", "title": "Amount", "width": 120},
|
|
||||||
{"field": "current_stage", "title": "Stage", "width": 120},
|
|
||||||
{"field": "probability", "title": "Probability", "width": 100},
|
|
||||||
{"field": "expected_close_date", "title": "Close Date", "width": 120},
|
|
||||||
{"field": "owner_name", "title": "Owner", "width": 100},
|
|
||||||
{"field": "status", "title": "Status", "width": 80, "formatter": "code:opportunity_status"},
|
|
||||||
{"field": "created_at", "title": "Created", "width": 160}
|
|
||||||
],
|
|
||||||
"style": {"flex": 1}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Dialog",
|
|
||||||
"id": "addOpportunityDialog",
|
|
||||||
"title": "Add Opportunity",
|
|
||||||
"width": 600,
|
|
||||||
"content": {
|
|
||||||
"type": "Form",
|
|
||||||
"id": "addOpportunityForm",
|
|
||||||
"fields": [
|
"fields": [
|
||||||
{"field": "opportunity_name", "title": "Opportunity Name", "uitype": "TextField", "required": true},
|
{
|
||||||
{"field": "customer_id", "title": "Customer ID", "uitype": "TextField", "required": true},
|
"name": "opportunity_code",
|
||||||
{"field": "customer_name", "title": "Customer Name", "uitype": "TextField", "required": true},
|
"title": "商机编码",
|
||||||
{"field": "estimated_amount", "title": "Estimated Amount", "uitype": "TextField", "required": true},
|
"uitype": "str",
|
||||||
{"field": "current_stage", "title": "Stage", "uitype": "TextField", "required": true},
|
"cwidth": 12
|
||||||
{"field": "expected_close_date", "title": "Expected Close Date", "uitype": "DateField", "required": true},
|
},
|
||||||
{"field": "owner_id", "title": "Owner ID", "uitype": "TextField", "required": true},
|
{
|
||||||
{"field": "owner_name", "title": "Owner Name", "uitype": "TextField", "required": true},
|
"name": "opportunity_name",
|
||||||
{"field": "region", "title": "Region", "uitype": "TextField"},
|
"title": "商机名称",
|
||||||
{"field": "description", "title": "Description", "uitype": "TextField"}
|
"uitype": "str",
|
||||||
|
"cwidth": 15
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "customer_name",
|
||||||
|
"title": "客户",
|
||||||
|
"uitype": "str",
|
||||||
|
"cwidth": 12
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stage",
|
||||||
|
"title": "阶段",
|
||||||
|
"uitype": "str",
|
||||||
|
"cwidth": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "amount",
|
||||||
|
"title": "金额",
|
||||||
|
"uitype": "str",
|
||||||
|
"cwidth": 12
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "probability",
|
||||||
|
"title": "概率",
|
||||||
|
"uitype": "str",
|
||||||
|
"cwidth": 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "expected_close_date",
|
||||||
|
"title": "预计关闭日期",
|
||||||
|
"uitype": "str",
|
||||||
|
"cwidth": 12
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"actions": [
|
"toolbar": [
|
||||||
{"type": "Button", "text": "Cancel", "onclick": "closeDialog('addOpportunityDialog')"},
|
{
|
||||||
{"type": "Button", "text": "Submit", "variant": "primary", "onclick": "submitForm('addOpportunityForm', 'api/opportunities_create.dspy', 'addOpportunityDialog', 'opportunityCRUD')"}
|
"type": "button",
|
||||||
]
|
"text": "新增",
|
||||||
}
|
"icon": "add",
|
||||||
|
"action": "navigate('opportunity_edit.ui')"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"text": "编辑",
|
||||||
|
"icon": "edit",
|
||||||
|
"action": "navigate('opportunity_edit.ui?id={{selectedRow.id}}')"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"text": "删除",
|
||||||
|
"icon": "delete",
|
||||||
|
"action": "doDelete('{{selectedRow.id}}')"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user