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:
yumoqing 2026-05-05 19:36:13 +08:00
parent 9e3734525c
commit b673139d73
6 changed files with 757 additions and 320 deletions

View File

@ -2,27 +2,42 @@
"widgettype": "Page", "widgettype": "Page",
"options": { "options": {
"title": "审批实例管理", "title": "审批实例管理",
"style": {"height": "100vh", "padding": "0"} "height": "100vh",
"padding": "0"
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "VBox", "widgettype": "VBox",
"options": {"style": {"padding": "16px", "height": "100%"}}, "options": {
"padding": "16px",
"height": "100%"
},
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "HBox", "widgettype": "HBox",
"options": {"style": {"marginBottom": "16px"}}, "options": {
"marginBottom": "16px"
},
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "Text", "widgettype": "Text",
"options": {"text": "审批实例管理", "style": {"fontSize": "20px", "fontWeight": "bold"}} "options": {
"text": "审批实例管理",
"fontSize": "20px",
"fontWeight": "bold"
}
}, },
{ {
"widgettype": "Button", "widgettype": "Button",
"options": { "options": {
"label": "发起审批", "label": "发起审批",
"style": {"backgroundColor": "#007bff", "color": "#fff", "border": "none", "padding": "8px 16px", "borderRadius": "4px", "marginLeft": "auto"}, "onclick": "openDialog('newInstanceDialog')",
"onclick": "openDialog('newInstanceDialog')" "backgroundColor": "#007bff",
"color": "#fff",
"border": "none",
"padding": "8px 16px",
"borderRadius": "4px",
"marginLeft": "auto"
} }
} }
] ]
@ -35,12 +50,36 @@
"page_rows": 20, "page_rows": 20,
"row_options": { "row_options": {
"fields": [ "fields": [
{"name": "title", "label": "审批标题", "uitype": "text"}, {
{"name": "workflow_name", "label": "工作流", "uitype": "text"}, "name": "title",
{"name": "module_type", "label": "模块类型", "uitype": "text"}, "label": "审批标题",
{"name": "status", "label": "状态", "uitype": "text"}, "uitype": "text"
{"name": "created_at", "label": "发起时间", "uitype": "text"}, },
{"name": "completed_at", "label": "完成时间", "uitype": "text"} {
"name": "workflow_name",
"label": "工作流",
"uitype": "text"
},
{
"name": "module_type",
"label": "模块类型",
"uitype": "text"
},
{
"name": "status",
"label": "状态",
"uitype": "text"
},
{
"name": "created_at",
"label": "发起时间",
"uitype": "text"
},
{
"name": "completed_at",
"label": "完成时间",
"uitype": "text"
}
] ]
} }
} }
@ -55,20 +94,74 @@
"widgettype": "Form", "widgettype": "Form",
"id": "newInstanceForm", "id": "newInstanceForm",
"fields": [ "fields": [
{"name": "workflow_id", "label": "选择工作流", "uitype": "code", "data_url": "/main/workflow_approval/api/workflow_list.dspy", "required": true}, {
{"name": "module_type", "label": "模块类型", "uitype": "code", "data": [ "name": "workflow_id",
{"value": "customer", "text": "客户管理"}, "label": "选择工作流",
{"value": "opportunity", "text": "商机管理"}, "uitype": "code",
{"value": "contract", "text": "合同管理"}, "data_url": "/main/workflow_approval/api/workflow_list.dspy",
{"value": "financial", "text": "财务管理"} "required": true
], "required": true}, },
{"name": "module_record_id", "label": "业务记录ID", "uitype": "text", "required": true}, {
{"name": "title", "label": "审批标题", "uitype": "text", "required": true}, "name": "module_type",
{"name": "description", "label": "审批描述", "uitype": "textarea"} "label": "模块类型",
"uitype": "code",
"data": [
{
"value": "customer",
"text": "客户管理"
},
{
"value": "opportunity",
"text": "商机管理"
},
{
"value": "contract",
"text": "合同管理"
},
{
"value": "financial",
"text": "财务管理"
}
],
"required": true
},
{
"name": "module_record_id",
"label": "业务记录ID",
"uitype": "text",
"required": true
},
{
"name": "title",
"label": "审批标题",
"uitype": "text",
"required": true
},
{
"name": "description",
"label": "审批描述",
"uitype": "textarea"
}
], ],
"actions": [ "actions": [
{"widgettype": "Button", "options": {"label": "取消", "onclick": "closeDialog('newInstanceDialog')"}}, {
{"widgettype": "Button", "options": {"label": "提交", "style": {"backgroundColor": "#007bff", "color": "#fff"}, "onclick": "submitForm('newInstanceForm', '/main/workflow_approval/api/instance_create.dspy', 'newInstanceDialog', null)"}} "widgettype": "Button",
"options": {
"label": "取消",
"onclick": "closeDialog('newInstanceDialog')"
}
},
{
"widgettype": "Button",
"options": {
"label": "提交",
"style": {
"backgroundColor": "#007bff",
"color": "#fff"
},
"onclick": "submitForm('newInstanceForm', '/main/workflow_approval/api/instance_create.dspy', 'newInstanceDialog', null)"
}
}
] ]
} }
} }

View File

@ -2,16 +2,25 @@
"widgettype": "Page", "widgettype": "Page",
"options": { "options": {
"title": "待办任务", "title": "待办任务",
"style": {"height": "100vh", "padding": "0"} "height": "100vh",
"padding": "0"
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "VBox", "widgettype": "VBox",
"options": {"style": {"padding": "16px", "height": "100%"}}, "options": {
"padding": "16px",
"height": "100%"
},
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "Text", "widgettype": "Text",
"options": {"text": "待办审批任务", "style": {"fontSize": "20px", "fontWeight": "bold", "marginBottom": "16px"}} "options": {
"text": "待办审批任务",
"fontSize": "20px",
"fontWeight": "bold",
"marginBottom": "16px"
}
}, },
{ {
"widgettype": "DataViewer", "widgettype": "DataViewer",
@ -21,12 +30,36 @@
"page_rows": 20, "page_rows": 20,
"row_options": { "row_options": {
"fields": [ "fields": [
{"name": "instance_title", "label": "审批事项", "uitype": "text"}, {
{"name": "step_name", "label": "审批步骤", "uitype": "text"}, "name": "instance_title",
{"name": "module_type", "label": "模块", "uitype": "text"}, "label": "审批事项",
{"name": "status", "label": "状态", "uitype": "text"}, "uitype": "text"
{"name": "assigned_at", "label": "分配时间", "uitype": "text"}, },
{"name": "due_at", "label": "截止时间", "uitype": "text"} {
"name": "step_name",
"label": "审批步骤",
"uitype": "text"
},
{
"name": "module_type",
"label": "模块",
"uitype": "text"
},
{
"name": "status",
"label": "状态",
"uitype": "text"
},
{
"name": "assigned_at",
"label": "分配时间",
"uitype": "text"
},
{
"name": "due_at",
"label": "截止时间",
"uitype": "text"
}
] ]
}, },
"row_actions": [ "row_actions": [
@ -52,14 +85,53 @@
"widgettype": "Form", "widgettype": "Form",
"id": "approveForm", "id": "approveForm",
"fields": [ "fields": [
{"name": "task_id", "label": "任务ID", "uitype": "hidden"}, {
{"name": "task_title", "label": "审批事项", "uitype": "text", "readonly": true}, "name": "task_id",
{"name": "decision", "label": "审批意见", "uitype": "textarea"} "label": "任务ID",
"uitype": "hidden"
},
{
"name": "task_title",
"label": "审批事项",
"uitype": "text",
"readonly": true
},
{
"name": "decision",
"label": "审批意见",
"uitype": "textarea"
}
], ],
"actions": [ "actions": [
{"widgettype": "Button", "options": {"label": "取消", "onclick": "closeDialog('approveDialog')"}}, {
{"widgettype": "Button", "options": {"label": "拒绝", "style": {"backgroundColor": "#dc3545", "color": "#fff"}, "onclick": "submitForm('approveForm', '/main/workflow_approval/api/task_reject.dspy', 'approveDialog', null)"}}, "widgettype": "Button",
{"widgettype": "Button", "options": {"label": "批准", "style": {"backgroundColor": "#28a745", "color": "#fff"}, "onclick": "submitForm('approveForm', '/main/workflow_approval/api/task_approve.dspy', 'approveDialog', null)"}} "options": {
"label": "取消",
"onclick": "closeDialog('approveDialog')"
}
},
{
"widgettype": "Button",
"options": {
"label": "拒绝",
"style": {
"backgroundColor": "#dc3545",
"color": "#fff"
},
"onclick": "submitForm('approveForm', '/main/workflow_approval/api/task_reject.dspy', 'approveDialog', null)"
}
},
{
"widgettype": "Button",
"options": {
"label": "批准",
"style": {
"backgroundColor": "#28a745",
"color": "#fff"
},
"onclick": "submitForm('approveForm', '/main/workflow_approval/api/task_approve.dspy', 'approveDialog', null)"
}
}
] ]
} }
} }
@ -72,31 +144,147 @@
"width": 500, "width": 500,
"content": { "content": {
"widgettype": "VBox", "widgettype": "VBox",
"options": {"gap": 8}, "options": {
"gap": 8
},
"subwidgets": [ "subwidgets": [
{"widgettype": "Text", "id": "detail_title", "options": {"text": ""}}, {
{"widgettype": "Divider", "options": {}}, "widgettype": "Text",
{"widgettype": "HBox", "options": {"gap": 8}, "subwidgets": [ "id": "detail_title",
{"widgettype": "Text", "options": {"text": "步骤: ", "style": {"fontWeight": "bold"}}}, "options": {
{"widgettype": "Text", "id": "detail_step", "options": {"text": ""}} "text": ""
]}, }
{"widgettype": "HBox", "options": {"gap": 8}, "subwidgets": [ },
{"widgettype": "Text", "options": {"text": "审批类型: ", "style": {"fontWeight": "bold"}}}, {
{"widgettype": "Text", "id": "detail_type", "options": {"text": ""}} "widgettype": "Divider",
]}, "options": {}
{"widgettype": "HBox", "options": {"gap": 8}, "subwidgets": [ },
{"widgettype": "Text", "options": {"text": "分配时间: ", "style": {"fontWeight": "bold"}}}, {
{"widgettype": "Text", "id": "detail_assigned", "options": {"text": ""}} "widgettype": "HBox",
]}, "options": {
{"widgettype": "HBox", "options": {"gap": 8}, "subwidgets": [ "gap": 8
{"widgettype": "Text", "options": {"text": "截止时间: ", "style": {"fontWeight": "bold"}}}, },
{"widgettype": "Text", "id": "detail_due", "options": {"text": ""}} "subwidgets": [
]}, {
{"widgettype": "Divider", "options": {}}, "widgettype": "Text",
{"widgettype": "HBox", "options": {"gap": 8}, "subwidgets": [ "options": {
{"widgettype": "Button", "options": {"label": "关闭", "onclick": "closeDialog('taskDetailDialog')"}}, "text": "步骤: ",
{"widgettype": "Button", "options": {"label": "去审批", "style": {"backgroundColor": "#007bff", "color": "#fff"}, "onclick": "closeDialog('taskDetailDialog'); openDialog('approveDialog'); setDialogField('approveDialog', 'task_id', getDialogField('taskDetailDialog', 'task_id')); setDialogField('approveDialog', 'task_title', getDialogField('taskDetailDialog', 'task_title'))"}} "style": {
]} "fontWeight": "bold"
}
}
},
{
"widgettype": "Text",
"id": "detail_step",
"options": {
"text": ""
}
}
]
},
{
"widgettype": "HBox",
"options": {
"gap": 8
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "审批类型: ",
"style": {
"fontWeight": "bold"
}
}
},
{
"widgettype": "Text",
"id": "detail_type",
"options": {
"text": ""
}
}
]
},
{
"widgettype": "HBox",
"options": {
"gap": 8
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "分配时间: ",
"style": {
"fontWeight": "bold"
}
}
},
{
"widgettype": "Text",
"id": "detail_assigned",
"options": {
"text": ""
}
}
]
},
{
"widgettype": "HBox",
"options": {
"gap": 8
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "截止时间: ",
"style": {
"fontWeight": "bold"
}
}
},
{
"widgettype": "Text",
"id": "detail_due",
"options": {
"text": ""
}
}
]
},
{
"widgettype": "Divider",
"options": {}
},
{
"widgettype": "HBox",
"options": {
"gap": 8
},
"subwidgets": [
{
"widgettype": "Button",
"options": {
"label": "关闭",
"onclick": "closeDialog('taskDetailDialog')"
}
},
{
"widgettype": "Button",
"options": {
"label": "去审批",
"style": {
"backgroundColor": "#007bff",
"color": "#fff"
},
"onclick": "closeDialog('taskDetailDialog'); openDialog('approveDialog'); setDialogField('approveDialog', 'task_id', getDialogField('taskDetailDialog', 'task_id')); setDialogField('approveDialog', 'task_title', getDialogField('taskDetailDialog', 'task_title'))"
}
}
]
}
] ]
} }
} }

View File

@ -46,24 +46,20 @@
"widgettype": "Button", "widgettype": "Button",
"options": { "options": {
"onClick": "approve_task", "onClick": "approve_task",
"style": { "label": "批准",
"backgroundColor": "#28a745", "backgroundColor": "#28a745",
"color": "white", "color": "white",
"flex": "1" "flex": "1"
},
"label": "批准"
} }
}, },
{ {
"widgettype": "Button", "widgettype": "Button",
"options": { "options": {
"onClick": "reject_task", "onClick": "reject_task",
"style": { "label": "拒绝",
"backgroundColor": "#dc3545", "backgroundColor": "#dc3545",
"color": "white", "color": "white",
"flex": "1" "flex": "1"
},
"label": "拒绝"
} }
} }
] ]

View File

@ -2,20 +2,30 @@
"widgettype": "Page", "widgettype": "Page",
"options": { "options": {
"title": "审批工作流管理", "title": "审批工作流管理",
"style": {"height": "100vh", "padding": "0"} "height": "100vh",
"padding": "0"
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "VBox", "widgettype": "VBox",
"options": {"style": {"padding": "16px", "height": "100%"}}, "options": {
"padding": "16px",
"height": "100%"
},
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "HBox", "widgettype": "HBox",
"options": {"style": {"marginBottom": "16px"}}, "options": {
"marginBottom": "16px"
},
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "Text", "widgettype": "Text",
"options": {"text": "审批工作流管理", "style": {"fontSize": "20px", "fontWeight": "bold"}} "options": {
"text": "审批工作流管理",
"fontSize": "20px",
"fontWeight": "bold"
}
} }
] ]
}, },
@ -31,39 +41,109 @@
"delete_data_url": "/main/workflow_approval/api/workflow_delete.dspy", "delete_data_url": "/main/workflow_approval/api/workflow_delete.dspy",
"form_cheight": 10, "form_cheight": 10,
"fields": [ "fields": [
{"name": "workflow_name", "label": "工作流名称", "uitype": "text", "required": true}, {
{"name": "module_type", "label": "模块类型", "uitype": "code", "data": [ "name": "workflow_name",
{"value": "customer", "text": "客户管理"}, "label": "工作流名称",
{"value": "opportunity", "text": "商机管理"}, "uitype": "text",
{"value": "contract", "text": "合同管理"}, "required": true
{"value": "financial", "text": "财务管理"} },
], "required": true}, {
{"name": "trigger_condition", "label": "触发条件", "uitype": "textarea"}, "name": "module_type",
{"name": "description", "label": "描述", "uitype": "textarea"}, "label": "模块类型",
{"name": "is_active", "label": "是否激活", "uitype": "code", "data": [ "uitype": "code",
{"value": "Y", "text": "是"}, "data": [
{"value": "N", "text": "否"} {
], "value": "Y"} "value": "customer",
"text": "客户管理"
},
{
"value": "opportunity",
"text": "商机管理"
},
{
"value": "contract",
"text": "合同管理"
},
{
"value": "financial",
"text": "财务管理"
}
],
"required": true
},
{
"name": "trigger_condition",
"label": "触发条件",
"uitype": "textarea"
},
{
"name": "description",
"label": "描述",
"uitype": "textarea"
},
{
"name": "is_active",
"label": "是否激活",
"uitype": "code",
"data": [
{
"value": "Y",
"text": "是"
},
{
"value": "N",
"text": "否"
}
],
"value": "Y"
}
] ]
}, },
"row_options": { "row_options": {
"fields": [ "fields": [
{"name": "workflow_name", "label": "工作流名称", "uitype": "text"}, {
{"name": "module_type", "label": "模块类型", "uitype": "text"}, "name": "workflow_name",
{"name": "description", "label": "描述", "uitype": "text"}, "label": "工作流名称",
{"name": "is_active", "label": "状态", "uitype": "text"}, "uitype": "text"
{"name": "created_at", "label": "创建时间", "uitype": "text"} },
{
"name": "module_type",
"label": "模块类型",
"uitype": "text"
},
{
"name": "description",
"label": "描述",
"uitype": "text"
},
{
"name": "is_active",
"label": "状态",
"uitype": "text"
},
{
"name": "created_at",
"label": "创建时间",
"uitype": "text"
}
] ]
} }
} }
}, },
{ {
"widgettype": "Divider", "widgettype": "Divider",
"options": {"style": {"margin": "20px 0"}} "options": {
"margin": "20px 0"
}
}, },
{ {
"widgettype": "Text", "widgettype": "Text",
"options": {"text": "审批步骤配置", "style": {"fontSize": "16px", "fontWeight": "bold", "marginBottom": "12px"}} "options": {
"text": "审批步骤配置",
"fontSize": "16px",
"fontWeight": "bold",
"marginBottom": "12px"
}
}, },
{ {
"widgettype": "DataViewer", "widgettype": "DataViewer",
@ -77,34 +157,122 @@
"delete_data_url": "/main/workflow_approval/api/step_delete.dspy", "delete_data_url": "/main/workflow_approval/api/step_delete.dspy",
"form_cheight": 10, "form_cheight": 10,
"fields": [ "fields": [
{"name": "workflow_id", "label": "所属工作流", "uitype": "code", "data_url": "/main/workflow_approval/api/workflow_list.dspy", "required": true}, {
{"name": "step_name", "label": "步骤名称", "uitype": "text", "required": true}, "name": "workflow_id",
{"name": "step_order", "label": "步骤顺序", "uitype": "number", "required": true}, "label": "所属工作流",
{"name": "approver_type", "label": "审批人类型", "uitype": "code", "data": [ "uitype": "code",
{"value": "role", "text": "角色"}, "data_url": "/main/workflow_approval/api/workflow_list.dspy",
{"value": "user", "text": "用户"}, "required": true
{"value": "department", "text": "部门"}, },
{"value": "dynamic", "text": "动态"} {
], "required": true}, "name": "step_name",
{"name": "approver_value", "label": "审批人值", "uitype": "text"}, "label": "步骤名称",
{"name": "approval_type", "label": "审批类型", "uitype": "code", "data": [ "uitype": "text",
{"value": "single", "text": "单人审批"}, "required": true
{"value": "multiple", "text": "多人审批"}, },
{"value": "sequential", "text": "顺序审批"}, {
{"value": "parallel", "text": "并行审批"} "name": "step_order",
], "required": true}, "label": "步骤顺序",
{"name": "timeout_hours", "label": "超时时间(小时)", "uitype": "number"}, "uitype": "number",
{"name": "description", "label": "描述", "uitype": "textarea"} "required": true
},
{
"name": "approver_type",
"label": "审批人类型",
"uitype": "code",
"data": [
{
"value": "role",
"text": "角色"
},
{
"value": "user",
"text": "用户"
},
{
"value": "department",
"text": "部门"
},
{
"value": "dynamic",
"text": "动态"
}
],
"required": true
},
{
"name": "approver_value",
"label": "审批人值",
"uitype": "text"
},
{
"name": "approval_type",
"label": "审批类型",
"uitype": "code",
"data": [
{
"value": "single",
"text": "单人审批"
},
{
"value": "multiple",
"text": "多人审批"
},
{
"value": "sequential",
"text": "顺序审批"
},
{
"value": "parallel",
"text": "并行审批"
}
],
"required": true
},
{
"name": "timeout_hours",
"label": "超时时间(小时)",
"uitype": "number"
},
{
"name": "description",
"label": "描述",
"uitype": "textarea"
}
] ]
}, },
"row_options": { "row_options": {
"fields": [ "fields": [
{"name": "workflow_id", "label": "工作流ID", "uitype": "text"}, {
{"name": "step_name", "label": "步骤名称", "uitype": "text"}, "name": "workflow_id",
{"name": "step_order", "label": "顺序", "uitype": "text"}, "label": "工作流ID",
{"name": "approver_type", "label": "审批人类型", "uitype": "text"}, "uitype": "text"
{"name": "approval_type", "label": "审批类型", "uitype": "text"}, },
{"name": "timeout_hours", "label": "超时(小时)", "uitype": "text"} {
"name": "step_name",
"label": "步骤名称",
"uitype": "text"
},
{
"name": "step_order",
"label": "顺序",
"uitype": "text"
},
{
"name": "approver_type",
"label": "审批人类型",
"uitype": "text"
},
{
"name": "approval_type",
"label": "审批类型",
"uitype": "text"
},
{
"name": "timeout_hours",
"label": "超时(小时)",
"uitype": "text"
}
] ]
} }
} }

View File

@ -4,28 +4,22 @@
"options": { "options": {
"width": "100%", "width": "100%",
"height": "100%", "height": "100%",
"style": {
"padding": "16px" "padding": "16px"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "HBox", "widgettype": "HBox",
"options": { "options": {
"style": {
"marginBottom": "16px", "marginBottom": "16px",
"gap": "8px" "gap": "8px"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"style": { "text": "审批管理",
"fontSize": "20px", "fontSize": "20px",
"fontWeight": "bold" "fontWeight": "bold"
},
"text": "审批管理"
} }
}, },
{ {

View File

@ -25,14 +25,12 @@
"widgettype": "Button", "widgettype": "Button",
"options": { "options": {
"onClick": "goto('workflow_approval/approval_instance/create.ui')", "onClick": "goto('workflow_approval/approval_instance/create.ui')",
"style": { "label": "发起审批",
"backgroundColor": "#007bff", "backgroundColor": "#007bff",
"color": "white", "color": "white",
"border": "none", "border": "none",
"padding": "8px 16px", "padding": "8px 16px",
"borderRadius": "4px" "borderRadius": "4px"
},
"label": "发起审批"
} }
} }
] ]