{ "options": { "height": "100vh", "padding": "0" }, "subwidgets": [ { "widgettype": "VBox", "options": { "padding": "16px", "height": "100%" }, "subwidgets": [ { "widgettype": "Text", "options": { "text": "待办审批任务", "fontSize": "20px", "fontWeight": "bold", "marginBottom": "16px" } }, { "widgettype": "DataViewer", "options": { "title": "任务列表", "data_url": "/main/workflow_approval/api/task_list.dspy", "page_rows": 20, "row_options": { "fields": [ { "name": "instance_title", "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": [ { "label": "审批", "onclick": "openDialog('approveDialog'); setDialogField('approveDialog', 'task_id', '${id}'); setDialogField('approveDialog', 'task_title', '${instance_title}')", "condition": "status == 'pending'" }, { "label": "查看详情", "onclick": "openDialog('taskDetailDialog'); setDialogField('taskDetailDialog', 'task_id', '${id}'); setDialogField('taskDetailDialog', 'task_title', '${instance_title}'); setDialogField('taskDetailDialog', 'step_name', '${step_name}'); setDialogField('taskDetailDialog', 'assigned_at', '${assigned_at}'); setDialogField('taskDetailDialog', 'due_at', '${due_at}'); setDialogField('taskDetailDialog', 'approval_type', '${approval_type}')" } ] } }, { "widgettype": "Dialog", "id": "approveDialog", "options": { "title": "审批处理", "width": 500, "content": { "widgettype": "Form", "id": "approveForm", "fields": [ { "name": "task_id", "label": "任务ID", "uitype": "hidden" }, { "name": "task_title", "label": "审批事项", "uitype": "text", "readonly": true }, { "name": "decision", "label": "审批意见", "uitype": "textarea" } ], "actions": [ { "widgettype": "Button", "options": { "label": "取消", "onclick": "closeDialog('approveDialog')" } }, { "widgettype": "Button", "options": { "label": "拒绝", "onclick": "submitForm('approveForm', '/main/workflow_approval/api/task_reject.dspy', 'approveDialog', null)", "bgcolor": "#dc3545", "color": "#fff" } }, { "widgettype": "Button", "options": { "label": "批准", "onclick": "submitForm('approveForm', '/main/workflow_approval/api/task_approve.dspy', 'approveDialog', null)", "bgcolor": "#28a745", "color": "#fff" } } ] } } }, { "widgettype": "Dialog", "id": "taskDetailDialog", "options": { "title": "任务详情", "width": 500, "content": { "widgettype": "VBox", "options": { "gap": 8 }, "subwidgets": [ { "widgettype": "Text", "id": "detail_title", "options": { "text": "" } }, { "widgettype": "Divider", "options": {} }, { "widgettype": "HBox", "options": { "gap": 8 }, "subwidgets": [ { "widgettype": "Text", "options": { "text": "步骤: ", "fontWeight": "bold" } }, { "widgettype": "Text", "id": "detail_step", "options": { "text": "" } } ] }, { "widgettype": "HBox", "options": { "gap": 8 }, "subwidgets": [ { "widgettype": "Text", "options": { "text": "审批类型: ", "fontWeight": "bold" } }, { "widgettype": "Text", "id": "detail_type", "options": { "text": "" } } ] }, { "widgettype": "HBox", "options": { "gap": 8 }, "subwidgets": [ { "widgettype": "Text", "options": { "text": "分配时间: ", "fontWeight": "bold" } }, { "widgettype": "Text", "id": "detail_assigned", "options": { "text": "" } } ] }, { "widgettype": "HBox", "options": { "gap": 8 }, "subwidgets": [ { "widgettype": "Text", "options": { "text": "截止时间: ", "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": "去审批", "onclick": "closeDialog('taskDetailDialog'); openDialog('approveDialog'); setDialogField('approveDialog', 'task_id', getDialogField('taskDetailDialog', 'task_id')); setDialogField('approveDialog', 'task_title', getDialogField('taskDetailDialog', 'task_title'))", "bgcolor": "#007bff", "color": "#fff" } } ] } ] } } } ] } ] }