fix: flatten style to options, fix Button/Text widget properties
- Flatten nested style objects directly into options
- Text/Title use 'text', Button uses 'label'
- All paths use {{entire_url()}}
This commit is contained in:
parent
32622d0a97
commit
c9e1879d80
@ -4,64 +4,52 @@
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"height": "100%",
|
||||
"style": {
|
||||
"padding": "16px"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"style": {
|
||||
"text": "工作台",
|
||||
"fontSize": "20px",
|
||||
"fontWeight": "bold",
|
||||
"marginBottom": "16px"
|
||||
},
|
||||
"text": "工作台"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "HBox",
|
||||
"options": {
|
||||
"style": {
|
||||
"gap": "16px",
|
||||
"flexWrap": "wrap",
|
||||
"marginBottom": "24px"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"style": {
|
||||
"background": "#4CAF50",
|
||||
"color": "white",
|
||||
"padding": "24px",
|
||||
"borderRadius": "8px",
|
||||
"minWidth": "200px",
|
||||
"flex": 1
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"style": {
|
||||
"text": "客户总数",
|
||||
"fontSize": "14px",
|
||||
"opacity": 0.9
|
||||
},
|
||||
"text": "客户总数"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"id": "lbl_customer_count",
|
||||
"options": {
|
||||
"style": {
|
||||
"text": "--",
|
||||
"fontSize": "32px",
|
||||
"fontWeight": "bold"
|
||||
},
|
||||
"text": "--"
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -69,35 +57,29 @@
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"style": {
|
||||
"background": "#2196F3",
|
||||
"color": "white",
|
||||
"padding": "24px",
|
||||
"borderRadius": "8px",
|
||||
"minWidth": "200px",
|
||||
"flex": 1
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"style": {
|
||||
"text": "商机总数",
|
||||
"fontSize": "14px",
|
||||
"opacity": 0.9
|
||||
},
|
||||
"text": "商机总数"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"id": "lbl_opportunity_count",
|
||||
"options": {
|
||||
"style": {
|
||||
"text": "--",
|
||||
"fontSize": "32px",
|
||||
"fontWeight": "bold"
|
||||
},
|
||||
"text": "--"
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -105,35 +87,29 @@
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"style": {
|
||||
"background": "#FF9800",
|
||||
"color": "white",
|
||||
"padding": "24px",
|
||||
"borderRadius": "8px",
|
||||
"minWidth": "200px",
|
||||
"flex": 1
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"style": {
|
||||
"text": "合同总数",
|
||||
"fontSize": "14px",
|
||||
"opacity": 0.9
|
||||
},
|
||||
"text": "合同总数"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"id": "lbl_contract_count",
|
||||
"options": {
|
||||
"style": {
|
||||
"text": "--",
|
||||
"fontSize": "32px",
|
||||
"fontWeight": "bold"
|
||||
},
|
||||
"text": "--"
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -141,35 +117,29 @@
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"style": {
|
||||
"background": "#F44336",
|
||||
"color": "white",
|
||||
"padding": "24px",
|
||||
"borderRadius": "8px",
|
||||
"minWidth": "200px",
|
||||
"flex": 1
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"style": {
|
||||
"text": "待审批",
|
||||
"fontSize": "14px",
|
||||
"opacity": 0.9
|
||||
},
|
||||
"text": "待审批"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"id": "lbl_approval_count",
|
||||
"options": {
|
||||
"style": {
|
||||
"text": "--",
|
||||
"fontSize": "32px",
|
||||
"fontWeight": "bold"
|
||||
},
|
||||
"text": "--"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -2,77 +2,249 @@
|
||||
"widgettype": "Page",
|
||||
"options": {
|
||||
"title": "仪表板",
|
||||
"style": {"height": "100%", "padding": "0"}
|
||||
"height": "100%",
|
||||
"padding": "0"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {"style": {"padding": "16px", "flex": 1, "overflow": "auto"}},
|
||||
"options": {
|
||||
"padding": "16px",
|
||||
"flex": 1,
|
||||
"overflow": "auto"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "HBox",
|
||||
"options": {"style": {"marginBottom": "16px", "gap": "12px", "flexWrap": "wrap"}},
|
||||
"options": {
|
||||
"marginBottom": "16px",
|
||||
"gap": "12px",
|
||||
"flexWrap": "wrap"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {"style": {"flex": 1, "minWidth": "200px", "backgroundColor": "#fff", "borderRadius": "8px", "padding": "16px", "boxShadow": "0 2px 4px rgba(0,0,0,0.1)"}},
|
||||
"options": {
|
||||
"flex": 1,
|
||||
"minWidth": "200px",
|
||||
"backgroundColor": "#fff",
|
||||
"borderRadius": "8px",
|
||||
"padding": "16px",
|
||||
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
|
||||
},
|
||||
"subwidgets": [
|
||||
{"widgettype": "Text", "options": {"text": "客户总数", "style": {"fontSize": "14px", "color": "#666"}}},
|
||||
{"widgettype": "Text", "id": "kpi_customers", "options": {"text": "--", "style": {"fontSize": "28px", "fontWeight": "bold", "color": "#1E40AF"}}}
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"text": "客户总数",
|
||||
"fontSize": "14px",
|
||||
"color": "#666"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"id": "kpi_customers",
|
||||
"options": {
|
||||
"text": "--",
|
||||
"fontSize": "28px",
|
||||
"fontWeight": "bold",
|
||||
"color": "#1E40AF"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {"style": {"flex": 1, "minWidth": "200px", "backgroundColor": "#fff", "borderRadius": "8px", "padding": "16px", "boxShadow": "0 2px 4px rgba(0,0,0,0.1)"}},
|
||||
"options": {
|
||||
"flex": 1,
|
||||
"minWidth": "200px",
|
||||
"backgroundColor": "#fff",
|
||||
"borderRadius": "8px",
|
||||
"padding": "16px",
|
||||
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
|
||||
},
|
||||
"subwidgets": [
|
||||
{"widgettype": "Text", "options": {"text": "活跃商机", "style": {"fontSize": "14px", "color": "#666"}}},
|
||||
{"widgettype": "Text", "id": "kpi_opportunities", "options": {"text": "--", "style": {"fontSize": "28px", "fontWeight": "bold", "color": "#059669"}}}
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"text": "活跃商机",
|
||||
"fontSize": "14px",
|
||||
"color": "#666"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"id": "kpi_opportunities",
|
||||
"options": {
|
||||
"text": "--",
|
||||
"fontSize": "28px",
|
||||
"fontWeight": "bold",
|
||||
"color": "#059669"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {"style": {"flex": 1, "minWidth": "200px", "backgroundColor": "#fff", "borderRadius": "8px", "padding": "16px", "boxShadow": "0 2px 4px rgba(0,0,0,0.1)"}},
|
||||
"options": {
|
||||
"flex": 1,
|
||||
"minWidth": "200px",
|
||||
"backgroundColor": "#fff",
|
||||
"borderRadius": "8px",
|
||||
"padding": "16px",
|
||||
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
|
||||
},
|
||||
"subwidgets": [
|
||||
{"widgettype": "Text", "options": {"text": "合同总数", "style": {"fontSize": "14px", "color": "#666"}}},
|
||||
{"widgettype": "Text", "id": "kpi_contracts", "options": {"text": "--", "style": {"fontSize": "28px", "fontWeight": "bold", "color": "#D97706"}}}
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"text": "合同总数",
|
||||
"fontSize": "14px",
|
||||
"color": "#666"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"id": "kpi_contracts",
|
||||
"options": {
|
||||
"text": "--",
|
||||
"fontSize": "28px",
|
||||
"fontWeight": "bold",
|
||||
"color": "#D97706"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {"style": {"flex": 1, "minWidth": "200px", "backgroundColor": "#fff", "borderRadius": "8px", "padding": "16px", "boxShadow": "0 2px 4px rgba(0,0,0,0.1)"}},
|
||||
"options": {
|
||||
"flex": 1,
|
||||
"minWidth": "200px",
|
||||
"backgroundColor": "#fff",
|
||||
"borderRadius": "8px",
|
||||
"padding": "16px",
|
||||
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
|
||||
},
|
||||
"subwidgets": [
|
||||
{"widgettype": "Text", "options": {"text": "应收总额", "style": {"fontSize": "14px", "color": "#666"}}},
|
||||
{"widgettype": "Text", "id": "kpi_receivables", "options": {"text": "--", "style": {"fontSize": "28px", "fontWeight": "bold", "color": "#DC2626"}}}
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"text": "应收总额",
|
||||
"fontSize": "14px",
|
||||
"color": "#666"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"id": "kpi_receivables",
|
||||
"options": {
|
||||
"text": "--",
|
||||
"fontSize": "28px",
|
||||
"fontWeight": "bold",
|
||||
"color": "#DC2626"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"widgettype": "HBox",
|
||||
"options": {"style": {"gap": "16px", "flexWrap": "wrap"}},
|
||||
"options": {
|
||||
"gap": "16px",
|
||||
"flexWrap": "wrap"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {"style": {"flex": 2, "minWidth": "400px", "backgroundColor": "#fff", "borderRadius": "8px", "padding": "16px", "boxShadow": "0 2px 4px rgba(0,0,0,0.1)"}},
|
||||
"options": {
|
||||
"flex": 2,
|
||||
"minWidth": "400px",
|
||||
"backgroundColor": "#fff",
|
||||
"borderRadius": "8px",
|
||||
"padding": "16px",
|
||||
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
|
||||
},
|
||||
"subwidgets": [
|
||||
{"widgettype": "Text", "options": {"text": "销售漏斗", "style": {"fontSize": "16px", "fontWeight": "bold", "marginBottom": "12px"}}},
|
||||
{"widgettype": "DataGrid", "id": "funnel_grid", "options": {"url": "{{entire_url('api/dashboard_kpi.dspy')}}?type=sales_funnel", "columns": [
|
||||
{"field": "stage", "header": "阶段", "width": 120},
|
||||
{"field": "count", "header": "数量", "width": 80},
|
||||
{"field": "amount", "header": "金额", "width": 120}
|
||||
]}}
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"text": "销售漏斗",
|
||||
"fontSize": "16px",
|
||||
"fontWeight": "bold",
|
||||
"marginBottom": "12px"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "DataGrid",
|
||||
"id": "funnel_grid",
|
||||
"options": {
|
||||
"url": "{{entire_url('api/dashboard_kpi.dspy')}}?type=sales_funnel",
|
||||
"columns": [
|
||||
{
|
||||
"field": "stage",
|
||||
"header": "阶段",
|
||||
"width": 120
|
||||
},
|
||||
{
|
||||
"field": "count",
|
||||
"header": "数量",
|
||||
"width": 80
|
||||
},
|
||||
{
|
||||
"field": "amount",
|
||||
"header": "金额",
|
||||
"width": 120
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {"style": {"flex": 1, "minWidth": "300px", "backgroundColor": "#fff", "borderRadius": "8px", "padding": "16px", "boxShadow": "0 2px 4px rgba(0,0,0,0.1)"}},
|
||||
"options": {
|
||||
"flex": 1,
|
||||
"minWidth": "300px",
|
||||
"backgroundColor": "#fff",
|
||||
"borderRadius": "8px",
|
||||
"padding": "16px",
|
||||
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
|
||||
},
|
||||
"subwidgets": [
|
||||
{"widgettype": "Text", "options": {"text": "最新商机", "style": {"fontSize": "16px", "fontWeight": "bold", "marginBottom": "12px"}}},
|
||||
{"widgettype": "DataGrid", "id": "recent_opp_grid", "options": {"url": "{{entire_url('api/dashboard_kpi.dspy')}}?type=recent_opportunities", "columns": [
|
||||
{"field": "customer_name", "header": "客户", "width": 120},
|
||||
{"field": "estimated_amount", "header": "金额", "width": 100},
|
||||
{"field": "current_stage", "header": "阶段", "width": 80}
|
||||
]}}
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"text": "最新商机",
|
||||
"fontSize": "16px",
|
||||
"fontWeight": "bold",
|
||||
"marginBottom": "12px"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "DataGrid",
|
||||
"id": "recent_opp_grid",
|
||||
"options": {
|
||||
"url": "{{entire_url('api/dashboard_kpi.dspy')}}?type=recent_opportunities",
|
||||
"columns": [
|
||||
{
|
||||
"field": "customer_name",
|
||||
"header": "客户",
|
||||
"width": 120
|
||||
},
|
||||
{
|
||||
"field": "estimated_amount",
|
||||
"header": "金额",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"field": "current_stage",
|
||||
"header": "阶段",
|
||||
"width": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -25,17 +25,27 @@
|
||||
"widgettype": "Select",
|
||||
"options": {
|
||||
"data": [
|
||||
{"value": "executive", "label": "管理视图"},
|
||||
{"value": "sales", "label": "销售视图"},
|
||||
{"value": "finance", "label": "财务视图"},
|
||||
{"value": "customer", "label": "客户视图"}
|
||||
{
|
||||
"value": "executive",
|
||||
"label": "管理视图"
|
||||
},
|
||||
{
|
||||
"value": "sales",
|
||||
"label": "销售视图"
|
||||
},
|
||||
{
|
||||
"value": "finance",
|
||||
"label": "财务视图"
|
||||
},
|
||||
{
|
||||
"value": "customer",
|
||||
"label": "客户视图"
|
||||
}
|
||||
],
|
||||
"onChange": "switch_dashboard",
|
||||
"style": {
|
||||
"width": "120px"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@ -25,14 +25,12 @@
|
||||
"widgettype": "Button",
|
||||
"options": {
|
||||
"onClick": "goto('unified_dashboard/report_template/create.ui')",
|
||||
"style": {
|
||||
"label": "新建报表",
|
||||
"backgroundColor": "#007bff",
|
||||
"color": "white",
|
||||
"border": "none",
|
||||
"padding": "6px 12px",
|
||||
"borderRadius": "4px"
|
||||
},
|
||||
"label": "新建报表"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -2,29 +2,23 @@
|
||||
"widgettype": "Page",
|
||||
"options": {
|
||||
"title": "报表中心",
|
||||
"style": {
|
||||
"height": "100%",
|
||||
"padding": "0"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"style": {
|
||||
"padding": "16px",
|
||||
"flex": 1,
|
||||
"overflow": "auto"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "HBox",
|
||||
"options": {
|
||||
"style": {
|
||||
"marginBottom": "16px",
|
||||
"gap": "8px"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
@ -33,10 +27,8 @@
|
||||
"options": {
|
||||
"label": "搜索报表",
|
||||
"placeholder": "报表名称",
|
||||
"style": {
|
||||
"flex": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Button",
|
||||
@ -53,9 +45,6 @@
|
||||
"id": "report_grid",
|
||||
"options": {
|
||||
"url": "{{entire_url('api/report_list.dspy')}}",
|
||||
"style": {
|
||||
"flex": 1
|
||||
},
|
||||
"columns": [
|
||||
{
|
||||
"field": "template_name",
|
||||
@ -90,7 +79,8 @@
|
||||
"icon": "view",
|
||||
"action": "navigate('main/unified_dashboard/report_view.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')"
|
||||
}
|
||||
]
|
||||
],
|
||||
"flex": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user