feat: 实现无感快速审批操作

问题:
- 用户点击飞书消息按钮需要跳转到web界面
- 需要登录才能操作,体验不流畅

解决方案:
1. 创建快速审批页面 (quick-action.tsx)
2. 用户点击按钮后自动执行审批操作
3. 操作成功后自动关闭页面或返回
4. 全流程无需用户手动跳转

工作流程:
1. 用户在飞书中点击"通过"/"拒绝"按钮
2. 打开快速审批页面
3. 自动执行审批操作(如果已登录)
4. 显示操作成功/失败
5. 自动关闭页面(飞书客户端)或返回列表

优势:
- 一步完成审批,无需跳转
- 已登录用户无感操作
- 未登录用户会引导登录后返回

相关文件:
- frontend/src/pages/approval/quick-action.tsx (新建)
- frontend/src/router/index.tsx
- backend/app/service/FeishuNotificationService.php

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-02-26 19:30:12 +08:00
parent e31cf88eab
commit 09a7220e76
3 changed files with 118 additions and 5 deletions
@@ -310,9 +310,9 @@ class FeishuNotificationService
// 操作按钮区域
$actions = [];
// 如果有审批单ID,添加审批操作按钮
// 如果有审批单ID,添加审批操作按钮(使用快速审批页面,无感操作)
if ($orderId) {
// 通过按钮(绿色)
// 通过按钮(绿色)- 快速审批页面
$actions[] = [
'tag' => 'button',
'text' => [
@@ -321,10 +321,10 @@ class FeishuNotificationService
],
'type' => 'primary',
'size' => 'medium',
'url' => "https://xsm.dev.hnxinyouhe.com/approval/detail/{$orderId}?action=approve",
'url' => "https://xsm.dev.hnxinyouhe.com/approval/quick-action?action=approve&order_id={$orderId}",
];
// 拒绝按钮(红色)
// 拒绝按钮(红色)- 快速审批页面
$actions[] = [
'tag' => 'button',
'text' => [
@@ -333,7 +333,7 @@ class FeishuNotificationService
],
'type' => 'danger',
'size' => 'medium',
'url' => "https://xsm.dev.hnxinyouhe.com/approval/detail/{$orderId}?action=reject",
'url' => "https://xsm.dev.hnxinyouhe.com/approval/quick-action?action=reject&order_id={$orderId}",
];
}