From b560c0bafd4a10a13b9503b99fb00eadf636331a Mon Sep 17 00:00:00 2001 From: kuaifan Date: Mon, 14 Apr 2025 13:40:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/DialogController.php | 40 +++++++++++++++++ .../pages/manage/components/TaskOperation.vue | 45 ++++++++++++++++++- 2 files changed, 84 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/DialogController.php b/app/Http/Controllers/Api/DialogController.php index dde26c44d..6fa8944dd 100755 --- a/app/Http/Controllers/Api/DialogController.php +++ b/app/Http/Controllers/Api/DialogController.php @@ -19,6 +19,7 @@ use App\Module\TimeRange; use App\Module\MsgTool; use App\Module\Table\OnlineData; use App\Models\FileContent; +use App\Models\ProjectTask; use App\Models\AbstractModel; use App\Models\WebSocketDialog; use App\Models\WebSocketDialogMsg; @@ -1543,6 +1544,45 @@ class DialogController extends AbstractController return WebSocketDialogMsg::sendMsgBatch($user, $userids, $dialogids, $fileMsg); } + /** + * @api {get} api/dialog/msg/sendtaskid 29. 通过任务ID发送任务 + * + * @apiDescription 需要token身份 + * @apiVersion 1.0.0 + * @apiGroup dialog + * @apiName msg__sendtaskid + * + * @apiParam {Number} task_id 消息ID + * @apiParam {Array} dialogids 转发给的对话ID + * @apiParam {Array} userids 转发给的成员ID + * @apiParam {String} leave_message 转发留言 + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function msg__sendtaskid() + { + $user = User::auth(); + // + $task_id = intval(Request::input("task_id")); + $dialogids = Request::input('dialogids'); + $userids = Request::input('userids'); + $leave_message = Request::input('leave_message'); + // + if (empty($dialogids) && empty($userids)) { + return Base::retError("请选择对话或成员"); + } + // + $task = ProjectTask::userTask($task_id, null); + $taskMsg = "

#{$task->name}

"; + if ($leave_message) { + $taskMsg .= "

{$leave_message}

"; + } + // + return WebSocketDialogMsg::sendMsgBatch($user, $userids, $dialogids, $taskMsg); + } + /** * @api {post} api/dialog/msg/sendanon 30. 发送匿名消息 * diff --git a/resources/assets/js/pages/manage/components/TaskOperation.vue b/resources/assets/js/pages/manage/components/TaskOperation.vue index a6afba5a9..9ceaeb671 100644 --- a/resources/assets/js/pages/manage/components/TaskOperation.vue +++ b/resources/assets/js/pages/manage/components/TaskOperation.vue @@ -43,7 +43,12 @@