From 8d39b4aa0da385d1374bc386728d23d42015a3b4 Mon Sep 17 00:00:00 2001 From: Pang Date: Wed, 17 Apr 2024 08:10:08 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AE=A1=E6=89=B9=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E8=BD=AC=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/ApproveController.php | 4 ++-- .../pages/manage/components/DialogWrapper.vue | 21 +++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Api/ApproveController.php b/app/Http/Controllers/Api/ApproveController.php index 72dfdba41..50d1a4c46 100755 --- a/app/Http/Controllers/Api/ApproveController.php +++ b/app/Http/Controllers/Api/ApproveController.php @@ -993,14 +993,14 @@ class ApproveController extends AbstractController if ($action == 'withdraw' || $action == 'pass' || $action == 'refuse') { // 任务完成,给发起人发送消息 if ($type == 'approve_submitter' && $action != 'withdraw') { - return WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true); + return WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text, 'approve_type' => $type], $botUser->userid, false, false, true); } // 查找最后一条消息msg_id $msg_action = 'change-' . $toUser['msg_id']; } // try { - $msg = WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true); + $msg = WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text, 'approve_type' => $type], $botUser->userid, false, false, true); // 关联信息 if ($action == 'start') { $proc_msg = new ApproveProcMsg(); diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 61d20019c..83c1e4e36 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -298,7 +298,7 @@ {{ $L(item.label) }} -
  • +
  • {{ $L('转发') }}
  • @@ -320,7 +320,7 @@ {{ $L(operateItem.tag ? '取消标注' : '标注') }} -
  • +
  • {{ $L('新任务') }}
  • @@ -3437,6 +3437,23 @@ export default { }) }, + actionPermission(item, permission) { + if (permission === 'forward') { + if (['word-chain', 'vote'].includes(item.type)) { + return false // 投票、接龙 不支持转发 + } + if (item.type === 'text') { + return typeof item.msg.approve_type === 'undefined' // 审批消息不支持转发 + } + } else if (permission === 'newTask') { + if (item.type === 'text') { + return typeof item.msg.approve_type === 'undefined' // 审批消息不支持新建任务 + } + return false + } + return true // 返回 true 允许操作 + }, + findOperateFile(msgId, link) { const file = this.fileLinks.find(item => item.link === link) if (file) {